aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Marín Noguera <juan@mnpi.eu>2024-12-01 14:37:50 +0100
committerJuan Marín Noguera <juan@mnpi.eu>2024-12-01 14:37:50 +0100
commit8bbe7955e154bac1eeda33db9530b016725f7fdd (patch)
tree8c33d7c6bfb50f0c93f119f084c42a77ce51612a
Convert into git repository
-rw-r--r--.gitignore2
-rw-r--r--0.lyx172
-rw-r--r--1.1.lyx550
-rw-r--r--1.2.1.lyx1705
-rw-r--r--1.2.10.lyx1006
-rw-r--r--1.2.11.1.lyx556
-rw-r--r--1.2.11.2.lyx440
-rw-r--r--1.2.11.3.lyx241
-rw-r--r--1.2.2.lyx1329
-rw-r--r--1.2.3.lyx1732
-rw-r--r--1.2.4.lyx2433
-rw-r--r--1.2.5.lyx1097
-rw-r--r--1.2.6.lyx3599
-rw-r--r--1.2.7.lyx572
-rw-r--r--1.2.8.lyx1852
-rw-r--r--1.2.9.lyx846
-rw-r--r--1.3.1.lyx2356
-rw-r--r--1.3.2.lyx3414
-rw-r--r--1.3.3.lyx1630
-rw-r--r--1.4.1.lyx403
-rw-r--r--1.4.2.lyx465
-rw-r--r--1.4.3.1.lyx334
-rw-r--r--1.4.3.2.lyx294
-rw-r--r--1.4.4.lyx4213
-rw-r--r--2.1.lyx568
-rw-r--r--2.2.1.lyx910
-rw-r--r--2.2.2.lyx563
-rw-r--r--2.2.3.lyx1685
-rw-r--r--2.2.4.lyx644
-rw-r--r--2.2.5.lyx606
-rw-r--r--2.2.6.lyx577
-rw-r--r--2.3.1.lyx1075
-rw-r--r--2.3.2.lyx1316
-rw-r--r--2.3.3.lyx2031
-rw-r--r--2.3.4.1.lyx760
-rw-r--r--2.3.4.2.lyx859
-rw-r--r--2.3.4.3.lyx508
-rw-r--r--2.3.4.4.lyx796
-rw-r--r--2.3.4.5.lyx111
-rw-r--r--2.3.4.6.lyx109
-rw-r--r--2.3.5.lyx110
-rw-r--r--2.3.lyx884
-rw-r--r--defs.tex86
-rw-r--r--index.lyx1721
44 files changed, 47160 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..19c5622
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+\#*\#
+*~
diff --git a/0.lyx b/0.lyx
new file mode 100644
index 0000000..a56b5a7
--- /dev/null
+++ b/0.lyx
@@ -0,0 +1,172 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[00]
+\end_layout
+
+\end_inset
+
+What does the rating
+\begin_inset Quotes eld
+\end_inset
+
+
+\emph on
+M20
+\emph default
+
+\begin_inset Quotes erd
+\end_inset
+
+ mean?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+A mathematically oriented,
+ medium difficulty exercise.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+Of what value can the exercises in a textbook be to the reader?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It helps to internalize contents by applying them.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.1.lyx b/1.1.lyx
new file mode 100644
index 0000000..9644d3b
--- /dev/null
+++ b/1.1.lyx
@@ -0,0 +1,550 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[10]
+\end_layout
+
+\end_inset
+
+The text showed how to interchange the values of variables
+\begin_inset Formula $m$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+,
+ using the replacement notation,
+ by setting
+\begin_inset Formula $t\gets m$
+\end_inset
+
+,
+
+\begin_inset Formula $m\gets n$
+\end_inset
+
+,
+
+\begin_inset Formula $n\gets t$
+\end_inset
+
+.
+ Show how the values of the
+\emph on
+four
+\emph default
+ variables
+\begin_inset Formula $(a,b,c,d)$
+\end_inset
+
+ can be rearranged to
+\begin_inset Formula $(b,c,d,a)$
+\end_inset
+
+ by a sequence of replacements.
+ In other words,
+ the new value of
+\begin_inset Formula $a$
+\end_inset
+
+ is to be the original value of
+\begin_inset Formula $b$
+\end_inset
+
+,
+ etc.
+ Try to use the minimum number of replacements.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $t\gets a,a\gets b,b\gets c,c\gets d,d\gets t$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[12]
+\end_layout
+
+\end_inset
+
+Show that the
+\begin_inset Quotes eld
+\end_inset
+
+Procedure for Reading This Set of Books
+\begin_inset Quotes erd
+\end_inset
+
+ that appears in the preface actually fails to be a genuine algorithm on at least three of our five counts!
+ Also mention some differences in format between it and Algorithm E.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It fails on finiteness (it doesn't have an ending condition),
+ definiteness (the instructions are not unambiguous),
+ and effectiveness (solving the Fermat's theorem on the exercises is not
+\begin_inset Quotes eld
+\end_inset
+
+sufficiently basic that it can be done exactly and in a finite length of time
+\begin_inset Quotes erd
+\end_inset
+
+),
+ and it may have no output (although,
+ this time,
+ this is the output).
+ It also doesn't have a header,
+ an ending mark,
+ or a letter prefix on the steps.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[HM21]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $U_{m}$
+\end_inset
+
+ be the average number of times that step E1 is executed in Algorithm E,
+ if
+\begin_inset Formula $m$
+\end_inset
+
+ is known and
+\begin_inset Formula $n$
+\end_inset
+
+ is allowed to range over all positive integers.
+ Show that
+\begin_inset Formula $U_{m}$
+\end_inset
+
+ is well defined.
+ Is
+\begin_inset Formula $U_{m}$
+\end_inset
+
+ in any way related to
+\begin_inset Formula $T_{m}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+On average,
+ it will be the case that
+\begin_inset Formula $n>m$
+\end_inset
+
+,
+ so after one step,
+ the two numbers will exchange positions and,
+ after two steps,
+ we'll have the same value for
+\begin_inset Formula $m$
+\end_inset
+
+ but
+\begin_inset Formula $n$
+\end_inset
+
+ will be the remainder of the original values of
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $m$
+\end_inset
+
+,
+ which is uniformly distributed on the integers between
+\begin_inset Formula $0$
+\end_inset
+
+ and
+\begin_inset Formula $m-1$
+\end_inset
+
+.
+ This means
+\begin_inset Formula $U_{m}$
+\end_inset
+
+ is two plus the average number of times that E1 is executed if
+\begin_inset Formula $m$
+\end_inset
+
+ is known and
+\begin_inset Formula $0\leq n<m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Further,
+ since after one step,
+ the two numbers interchange,
+ it is clear that
+\begin_inset Formula $U_{m}=1+T_{m}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[M30]
+\end_layout
+
+\end_inset
+
+Suppose that
+\begin_inset Formula $C_{1}=(Q_{1},I_{1},\Omega_{1},f_{1})$
+\end_inset
+
+ and
+\begin_inset Formula $C_{2}=(Q_{2},I_{2},\Omega_{2},f_{2})$
+\end_inset
+
+ are computational methods.
+ For example,
+
+\begin_inset Formula $C_{1}$
+\end_inset
+
+ might stand for Algorithm E as in Eqs.
+ (2),
+ except that
+\begin_inset Formula $m$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ are restricted in magnitude,
+ and
+\begin_inset Formula $C_{2}$
+\end_inset
+
+ might stand for a computer program implementation of Algorithm E.
+ (This
+\begin_inset Formula $Q_{2}$
+\end_inset
+
+ might be the set of all states of the machine,
+ i.e.,
+ all possible configurations of its memory and registers;
+
+\begin_inset Formula $f_{2}$
+\end_inset
+
+ might be the definition of single machine actions;
+ and
+\begin_inset Formula $I_{2}$
+\end_inset
+
+ might be the set of initial states,
+ each including the program that determines the greatest common divisor as well as the particular values of
+\begin_inset Formula $m$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+Formulate a set-theoretic definition for the concept
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $C_{2}$
+\end_inset
+
+ is a representation of
+\begin_inset Formula $C_{1}$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ or
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $C_{2}$
+\end_inset
+
+ simulates
+\begin_inset Formula $C_{1}$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ This is to mean intuitively that any computation sequence of
+\begin_inset Formula $C_{1}$
+\end_inset
+
+ is mimicked by
+\begin_inset Formula $C_{2}$
+\end_inset
+
+,
+ except that
+\begin_inset Formula $C_{2}$
+\end_inset
+
+ might take more steps in which to do the computation and it might retain more information in its states.
+ (We thereby obtain a rigorous interpretation of the statement,
+
+\begin_inset Quotes eld
+\end_inset
+
+Program
+\begin_inset Formula $X$
+\end_inset
+
+ is an implementation of Algorithm
+\begin_inset Formula $Y$
+\end_inset
+
+.
+\begin_inset Quotes erd
+\end_inset
+
+)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We could state that
+\begin_inset Formula $C_{2}$
+\end_inset
+
+ is a representation of
+\begin_inset Formula $C_{1}$
+\end_inset
+
+ if there are functions
+\begin_inset Formula $h:Q_{2}\to Q_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $g:I_{1}\to I_{2}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $j:Q_{2}\to\mathbb{N}^{*}$
+\end_inset
+
+ such that
+\begin_inset Formula $h\circ g=\text{Id}_{I_{1}}$
+\end_inset
+
+,
+
+\begin_inset Formula $\Omega_{2}=h^{-1}(\Omega_{1})$
+\end_inset
+
+,
+ and for all
+\begin_inset Formula $q\in Q_{2}$
+\end_inset
+
+,
+
+\begin_inset Formula $f_{1}(h(q))=h(f_{2}^{j(q)}(q))$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.1.lyx b/1.2.1.lyx
new file mode 100644
index 0000000..f1058bf
--- /dev/null
+++ b/1.2.1.lyx
@@ -0,0 +1,1705 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[05]
+\end_layout
+
+\end_inset
+
+Explain how to modify the idea of proof by mathematical induction,
+ in case we want to prove some statement
+\begin_inset Formula $P(n)$
+\end_inset
+
+ for all
+\emph on
+nonnegative
+\emph default
+ integers—
+that is,
+ for
+\begin_inset Formula $n=0,1,2,\dots$
+\end_inset
+
+ instead of
+\begin_inset Formula $n=1,2,3,\dots$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We'd prove that
+\begin_inset Formula $P(0)$
+\end_inset
+
+ holds and that,
+ for all
+\begin_inset Formula $n\geq0$
+\end_inset
+
+,
+ if
+\begin_inset Formula $P(0),\dots,P(n)$
+\end_inset
+
+ hold,
+ then
+\begin_inset Formula $P(n+1)$
+\end_inset
+
+ holds.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[15]
+\end_layout
+
+\end_inset
+
+There must be something wrong with the following proof.
+ What is it?
+\end_layout
+
+\begin_layout Standard
+\begin_inset Quotes eld
+\end_inset
+
+
+\series bold
+Theorem:
+
+\series default
+ Let
+\begin_inset Formula $a$
+\end_inset
+
+ be any positive number.
+ For all positive integers
+\begin_inset Formula $n$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $a^{n-1}=1$
+\end_inset
+
+.
+
+\emph on
+Proof.
+
+\emph default
+ If
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+
+\begin_inset Formula $a^{n-1}=a^{1-1}=0$
+\end_inset
+
+.
+ And by induction,
+ assuming that the theorem is true for
+\begin_inset Formula $1,2,\dots,n$
+\end_inset
+
+,
+ we have
+\begin_inset Formula
+\[
+a^{(n+1)-1}=a^{n}=\frac{a^{n-1}\times a^{n-1}}{a^{(n-1)-1}}=\frac{1\times1}{1}=1;
+\]
+
+\end_inset
+
+so the theorem is true for
+\begin_inset Formula $n+1$
+\end_inset
+
+ as well.
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+
+\begin_inset Formula $a^{(n-1)-1}=a^{0-1}$
+\end_inset
+
+,
+ but we haven't proved the theorem for
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+ and indeed,
+
+\begin_inset Formula $a^{0-1}=a^{-1}=\frac{1}{a}\neq1$
+\end_inset
+
+ if
+\begin_inset Formula $a\neq1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[25]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Prove the following theorem of Nicomachus (A.D.
+ c.
+ 100) by induction:
+
+\begin_inset Formula $1^{3}=1$
+\end_inset
+
+,
+
+\begin_inset Formula $2^{3}=3+5$
+\end_inset
+
+,
+
+\begin_inset Formula $3^{3}=7+9+11$
+\end_inset
+
+,
+
+\begin_inset Formula $4^{3}=13+15+17+19$
+\end_inset
+
+,
+ etc.
+\end_layout
+
+\begin_layout Enumerate
+Use this result to prove the remarkable formula
+\begin_inset Formula $1^{3}+2^{3}+\dots+n^{3}=(1+2+\dots+n)^{2}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+For
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+
+\begin_inset Formula $1^{3}=1$
+\end_inset
+
+,
+ and the first number of the sequence is
+\begin_inset Formula $n(n-1)+1=1(1-1)+1=1$
+\end_inset
+
+.
+ If these two properties are proved up to a certain number
+\begin_inset Formula $n$
+\end_inset
+
+,
+ then the first number of the sequence for
+\begin_inset Formula $n+1$
+\end_inset
+
+ is 2 plus the last number of the sequence for
+\begin_inset Formula $n$
+\end_inset
+
+,
+ that is,
+ since the sequence for
+\begin_inset Formula $n$
+\end_inset
+
+ has
+\begin_inset Formula $n$
+\end_inset
+
+ numbers,
+ the first number of the sequence for
+\begin_inset Formula $n+1$
+\end_inset
+
+ is
+\begin_inset Formula $n(n-1)+1+2n=n(n-1+2)+1=(n+1)n+1=(n+1)((n-1)+1)+1$
+\end_inset
+
+.
+ Now,
+
+\begin_inset Formula $(n+1)^{3}=n^{3}+3n^{2}+3n+1=(n(n-1)+1)+(n(n-1)+3)+\dots+(n(n-1)+2n-1)+2n\cdot n+n^{2}+3n+1=(n(n-1)+2n+1)+\dots+(n(n-1)+2n+2n-1)+n^{2}+n+2n+1=(n(n+1)+1)+\dots+(n(n+1)+2n-1)+(n(n+1)+2n+1)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $1^{3}+2^{3}+\dots+n^{3}=1+3+\dots+((n+1)n+1-2)=1+3+\dots+((n+1)n-1)$
+\end_inset
+
+.
+ For each
+\begin_inset Formula $n$
+\end_inset
+
+,
+
+\begin_inset Formula $n^{2}-(n-1)^{2}=n^{2}-n^{2}+2n-1=2n-1$
+\end_inset
+
+,
+ so
+\begin_inset Formula $1^{3}+2^{3}+\dots+n^{3}=1+3+\dots+((n+1)n-1)=(1^{2}-0^{2})+(2^{2}-1^{2})+\dots+\left(\left(\frac{(n+1)n}{2}\right)^{2}-\left(\frac{(n+1)n}{2}-1\right)^{2}\right)=\left(\frac{(n+1)n}{2}\right)^{2}=(1+2+\dots+n)^{2}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc13[M23]
+\end_layout
+
+\end_inset
+
+Extend Algorithm E by adding a new variable
+\begin_inset Formula $T$
+\end_inset
+
+ and adding the operation
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $T\gets T+1$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ at the beginning of each step.
+ (Thus,
+
+\begin_inset Formula $T$
+\end_inset
+
+ is like a clock,
+ counting the number of steps executed.) Assume that
+\begin_inset Formula $T$
+\end_inset
+
+ is initially zero,
+ so that assertion
+\begin_inset Formula $A1$
+\end_inset
+
+ in Fig.
+ 4 becomes
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $m>0,n>0,T=0$
+\end_inset
+
+.
+\begin_inset Quotes erd
+\end_inset
+
+ The additional condition
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $T=1$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ should similarly be appended to
+\begin_inset Formula $A2$
+\end_inset
+
+.
+ Show how to append additional conditions to the assertions in such a way that any one of
+\begin_inset Formula $A1,A2,\dots,A6$
+\end_inset
+
+ implies
+\begin_inset Formula $T\leq3n$
+\end_inset
+
+,
+ and such that the inductive proof can still be carried out.
+ (Hence the computation must terminate in at most
+\begin_inset Formula $3n$
+\end_inset
+
+ steps.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+At
+\begin_inset Formula $A3$
+\end_inset
+
+,
+ we append
+\begin_inset Formula $T\leq3(n-r)-1$
+\end_inset
+
+.
+ From
+\begin_inset Formula $A2$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $T=2$
+\end_inset
+
+,
+ and since
+\begin_inset Formula $c=m>0$
+\end_inset
+
+ and
+\begin_inset Formula $d=n>0$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $r<n$
+\end_inset
+
+ and thus
+\begin_inset Formula $3(n-r)-1\geq3\cdot1-1=2$
+\end_inset
+
+.
+ We have yet to prove this when coming from
+\begin_inset Formula $A6$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+At
+\begin_inset Formula $A4$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $T\leq3n$
+\end_inset
+
+,
+ because,
+ coming from
+\begin_inset Formula $A3$
+\end_inset
+
+,
+
+\begin_inset Formula $T\leq3(n-r)-1+1=3n$
+\end_inset
+
+.
+ At
+\begin_inset Formula $A5$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $T\leq3(n-r)$
+\end_inset
+
+.
+ At
+\begin_inset Formula $A6$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $T\leq3(n-d)+1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Now,
+ at
+\begin_inset Formula $A3$
+\end_inset
+
+,
+ when coming from
+\begin_inset Formula $A6$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $T\leq3(n-d)+2$
+\end_inset
+
+,
+ but
+\begin_inset Formula $r<d$
+\end_inset
+
+,
+ so
+\begin_inset Formula $n-d>n-r$
+\end_inset
+
+ and
+\begin_inset Formula $T\leq3(n-d)+2\leq3(n-r)-3+2=3(n-r)-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc15[HM28]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Generalized induction.
+\emph default
+) The text shows how to prove statements
+\begin_inset Formula $P(n)$
+\end_inset
+
+ that depend on a single integer
+\begin_inset Formula $n$
+\end_inset
+
+,
+ but it does not describe how to prove statements
+\begin_inset Formula $P(m,n)$
+\end_inset
+
+ depending on two integers.
+ In these circumstances a proof is often given by some sort of
+\begin_inset Quotes eld
+\end_inset
+
+double induction,
+\begin_inset Quotes erd
+\end_inset
+
+ which frequently seems confusing.
+ Actually,
+ there is an important principle more general than simple induction that applies not only in this case but also to situations in which statements are to be proved about uncountable sets—
+for example,
+
+\begin_inset Formula $P(x)$
+\end_inset
+
+ for all real
+\begin_inset Formula $x$
+\end_inset
+
+.
+ This general principle is called
+\emph on
+well-ordering
+\emph default
+.
+\end_layout
+
+\begin_layout Standard
+Let
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $\prec$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ be a relation on a set
+\begin_inset Formula $S$
+\end_inset
+
+,
+ satisfying the following properties:
+\end_layout
+
+\begin_layout Enumerate
+Given
+\begin_inset Formula $x$
+\end_inset
+
+,
+
+\begin_inset Formula $y$
+\end_inset
+
+,
+ and
+\begin_inset Formula $z$
+\end_inset
+
+ in
+\begin_inset Formula $S$
+\end_inset
+
+,
+ if
+\begin_inset Formula $x\prec y$
+\end_inset
+
+ and
+\begin_inset Formula $y\prec z$
+\end_inset
+
+,
+ then
+\begin_inset Formula $x\prec z$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Given
+\begin_inset Formula $x$
+\end_inset
+
+ and
+\begin_inset Formula $y$
+\end_inset
+
+ in
+\begin_inset Formula $S$
+\end_inset
+
+,
+ exactly one of the following three possibilities is true:
+
+\begin_inset Formula $x\prec y$
+\end_inset
+
+,
+
+\begin_inset Formula $x=y$
+\end_inset
+
+,
+ or
+\begin_inset Formula $y\prec x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $A$
+\end_inset
+
+ is any nonempty subset of
+\begin_inset Formula $S$
+\end_inset
+
+,
+ there is an element
+\begin_inset Formula $x$
+\end_inset
+
+ in
+\begin_inset Formula $A$
+\end_inset
+
+ with
+\begin_inset Formula $x\preceq y$
+\end_inset
+
+ (that is,
+
+\begin_inset Formula $x\prec y$
+\end_inset
+
+ or
+\begin_inset Formula $x=y$
+\end_inset
+
+) for all
+\begin_inset Formula $y$
+\end_inset
+
+ in
+\begin_inset Formula $A$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+This relation is said to be a well-ordering of
+\begin_inset Formula $S$
+\end_inset
+
+.
+ For example,
+ it is clear that the positive integers are well-ordered by the ordinary
+\begin_inset Quotes eld
+\end_inset
+
+less than
+\begin_inset Quotes erd
+\end_inset
+
+ relation,
+
+\begin_inset Formula $<$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Show that the set of
+\emph on
+all
+\emph default
+ integers is not well-ordered by
+\begin_inset Formula $<$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Define a well-ordering relation on the set of all integers.
+\end_layout
+
+\begin_layout Enumerate
+Is the set of all nonnegative real numbers well-ordered by
+\begin_inset Formula $<$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:Lexicographic-order"
+
+\end_inset
+
+(
+\emph on
+Lexicographic order.
+\emph default
+) Let
+\begin_inset Formula $S$
+\end_inset
+
+ be well-ordered by
+\begin_inset Formula $\prec$
+\end_inset
+
+,
+ and for
+\begin_inset Formula $n>0$
+\end_inset
+
+,
+ let
+\begin_inset Formula $T_{n}$
+\end_inset
+
+ be the set of
+\begin_inset Formula $n$
+\end_inset
+
+-tuples
+\begin_inset Formula $(x_{1},x_{2},\dots,x_{n})$
+\end_inset
+
+ of elements
+\begin_inset Formula $x_{j}$
+\end_inset
+
+ in
+\begin_inset Formula $S$
+\end_inset
+
+.
+ Define
+\begin_inset Formula $(x_{1},x_{2},\dots,x_{n})\prec(y_{1},y_{2},\dots,y_{n})$
+\end_inset
+
+ if there is some
+\begin_inset Formula $k$
+\end_inset
+
+,
+
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+,
+ such that
+\begin_inset Formula $x_{j}=y_{j}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j<k$
+\end_inset
+
+,
+ but
+\begin_inset Formula $x_{k}\prec y_{k}$
+\end_inset
+
+ in
+\begin_inset Formula $S$
+\end_inset
+
+.
+ Is
+\begin_inset Formula $\prec$
+\end_inset
+
+ a well-ordering of
+\begin_inset Formula $T_{n}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Enumerate
+Continuing part
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:Lexicographic-order"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ let
+\begin_inset Formula $T=\bigcup_{n\geq1}T_{n}$
+\end_inset
+
+;
+ define
+\begin_inset Formula $(x_{1},\dots,x_{m})\prec(y_{1},\dots,y_{n})$
+\end_inset
+
+ if
+\begin_inset Formula $x_{j}=y_{j}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j<k$
+\end_inset
+
+ and
+\begin_inset Formula $x_{k}\prec y_{k}$
+\end_inset
+
+,
+ for some
+\begin_inset Formula $k\leq\min(m,n)$
+\end_inset
+
+,
+ or if
+\begin_inset Formula $m<n$
+\end_inset
+
+ and
+\begin_inset Formula $x_{j}=y_{j}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j\leq m$
+\end_inset
+
+.
+ Is
+\begin_inset Formula $\prec$
+\end_inset
+
+ a well-ordering of
+\begin_inset Formula $T_{n}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Enumerate
+Show that
+\begin_inset Formula $\prec$
+\end_inset
+
+ is a well-ordering of
+\begin_inset Formula $S$
+\end_inset
+
+ if and only if it satisfies (i) and (ii) above and there is no infinite sequence
+\begin_inset Formula $x_{1},x_{2},x_{3},\dots$
+\end_inset
+
+ with
+\begin_inset Formula $x_{j+1}\prec x_{j}$
+\end_inset
+
+ for all
+\begin_inset Formula $j\geq1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Let
+\begin_inset Formula $S$
+\end_inset
+
+ be well-ordered by
+\begin_inset Formula $\prec$
+\end_inset
+
+,
+ and let
+\begin_inset Formula $P(x)$
+\end_inset
+
+ be a statement about the element
+\begin_inset Formula $x$
+\end_inset
+
+ of
+\begin_inset Formula $S$
+\end_inset
+
+.
+ Show that if
+\begin_inset Formula $P(x)$
+\end_inset
+
+ can be proved under the assumption that
+\begin_inset Formula $P(y)$
+\end_inset
+
+ is true for all
+\begin_inset Formula $y\prec x$
+\end_inset
+
+,
+ then
+\begin_inset Formula $P(x)$
+\end_inset
+
+ is true for
+\emph on
+all
+\emph default
+
+\begin_inset Formula $x$
+\end_inset
+
+ in
+\begin_inset Formula $S$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\mathbb{Z}$
+\end_inset
+
+ is a non-empty subset of
+\begin_inset Formula $\mathbb{Z}$
+\end_inset
+
+ and it doesn't have a first element under
+\begin_inset Formula $<$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Let
+\begin_inset Formula $a,b\in\mathbb{Z}$
+\end_inset
+
+,
+ we could say that
+\begin_inset Formula $a\prec b$
+\end_inset
+
+ if and only if
+\begin_inset Formula $|a|<|b|$
+\end_inset
+
+,
+ or
+\begin_inset Formula $a=-b<0$
+\end_inset
+
+,
+ so the order would be
+\begin_inset Formula $0,1,-1,2,-2,\dots$
+\end_inset
+
+.
+ Now:
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+If
+\begin_inset Formula $a\prec b$
+\end_inset
+
+ and
+\begin_inset Formula $b\prec c$
+\end_inset
+
+,
+ then either
+\begin_inset Formula $a=-b<0$
+\end_inset
+
+ so it must be
+\begin_inset Formula $|a|=|b|\prec|c|$
+\end_inset
+
+ because it can't be
+\begin_inset Formula $b=-c<0$
+\end_inset
+
+ as
+\begin_inset Formula $b>0$
+\end_inset
+
+,
+ or
+\begin_inset Formula $|a|<|b|$
+\end_inset
+
+ so
+\begin_inset Formula $|a|<|b|\leq|c|$
+\end_inset
+
+.
+ In both cases,
+
+\begin_inset Formula $a\prec c$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $x\neq y$
+\end_inset
+
+,
+ then either
+\begin_inset Formula $|x|=|y|$
+\end_inset
+
+ so it must be
+\begin_inset Formula $x\prec y$
+\end_inset
+
+ if
+\begin_inset Formula $y<0$
+\end_inset
+
+ or
+\begin_inset Formula $y\prec x$
+\end_inset
+
+ if
+\begin_inset Formula $y>0$
+\end_inset
+
+,
+
+\begin_inset Formula $|x|<|y|$
+\end_inset
+
+ so that
+\begin_inset Formula $x\prec y$
+\end_inset
+
+,
+ or
+\begin_inset Formula $|y|>|x|$
+\end_inset
+
+ so that
+\begin_inset Formula $y\prec x$
+\end_inset
+
+.
+ It's clear that
+\begin_inset Formula $x\prec y$
+\end_inset
+
+ implies
+\begin_inset Formula $x\neq y$
+\end_inset
+
+ and
+\begin_inset Formula $y\nprec x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Let
+\begin_inset Formula $S\subseteq\mathbb{Z}$
+\end_inset
+
+ be nonempty,
+ then we can find the minimum element of
+\begin_inset Formula $S$
+\end_inset
+
+ by looking at the elements of
+\begin_inset Formula $S$
+\end_inset
+
+ with minimal absolute value,
+ which form a finite,
+ nonempty subset.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+No,
+ as the nonempty subset
+\begin_inset Formula $\{x\in\mathbb{R}:x>0\}$
+\end_inset
+
+ doesn't have a first element:
+ for each
+\begin_inset Formula $x>0$
+\end_inset
+
+,
+
+\begin_inset Formula $\frac{x}{2}<x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Yes:
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+If
+\begin_inset Formula $(a_{1},\dots,a_{n})\prec(b_{1},\dots,b_{n})\prec(c_{1},\dots,c_{n})$
+\end_inset
+
+,
+ let
+\begin_inset Formula $k_{1}$
+\end_inset
+
+ be the least integer with
+\begin_inset Formula $a_{k_{1}}\prec b_{k_{1}}$
+\end_inset
+
+,
+
+\begin_inset Formula $k_{2}$
+\end_inset
+
+ the least integer with
+\begin_inset Formula $b_{k_{2}}\prec c_{k_{2}}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $q:=\min\{k_{1},k_{2}\}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $a_{i}=b_{i}=c_{i}$
+\end_inset
+
+ for
+\begin_inset Formula $0\leq i<q$
+\end_inset
+
+ and
+\begin_inset Formula $a_{q}\prec c_{q}$
+\end_inset
+
+,
+ so
+\begin_inset Formula $(a_{1},\dots,a_{n})\prec(c_{1},\dots,c_{n})$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $(a_{1},\dots,a_{n})\neq(b_{1},\dots,b_{n})$
+\end_inset
+
+,
+ let
+\begin_inset Formula $k$
+\end_inset
+
+ be the least integer with
+\begin_inset Formula $a_{k}\neq b_{k}$
+\end_inset
+
+,
+ then either
+\begin_inset Formula $a_{k}\prec b_{k}$
+\end_inset
+
+ and so
+\begin_inset Formula $(a_{1},\dots,a_{n})\prec(b_{1},\dots,b_{n})$
+\end_inset
+
+,
+ or
+\begin_inset Formula $b_{k}\prec a_{k}$
+\end_inset
+
+ and so
+\begin_inset Formula $(b_{1},\dots,b_{n})\prec(a_{1},\dots,a_{n})$
+\end_inset
+
+,
+ and we can see that no two of the three possibilities can happen at once.
+\end_layout
+
+\begin_layout Enumerate
+Let
+\begin_inset Formula $A\subseteq S^{n}$
+\end_inset
+
+ be nonempty.
+ Let
+\begin_inset Formula $A_{1}$
+\end_inset
+
+ be the set of
+\begin_inset Formula $a\in A$
+\end_inset
+
+ with minimal
+\begin_inset Formula $a_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $A_{2}$
+\end_inset
+
+ the set of
+\begin_inset Formula $a\in A_{1}$
+\end_inset
+
+ with minimal
+\begin_inset Formula $a_{2}$
+\end_inset
+
+,
+ etc.
+ Then the elements of
+\begin_inset Formula $A_{1}$
+\end_inset
+
+ are lower than any
+\emph on
+other
+\emph default
+ element in
+\begin_inset Formula $A$
+\end_inset
+
+,
+ the ones in
+\begin_inset Formula $A_{2}$
+\end_inset
+
+ are lower than any other elements in
+\begin_inset Formula $A_{1}$
+\end_inset
+
+ and thus in
+\begin_inset Formula $A$
+\end_inset
+
+,
+ etc.
+ But then
+\begin_inset Formula $A_{n}$
+\end_inset
+
+ contains only one element,
+ which is the least element of
+\begin_inset Formula $A$
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+No:
+ if
+\begin_inset Formula $S$
+\end_inset
+
+ contains two elements
+\begin_inset Formula $a\prec b$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\{(b),(a,b),(a,a,b),\dots\}$
+\end_inset
+
+ doesn't have a first element.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+If there were such an infinite sequence
+\begin_inset Formula $(x_{n})_{n\geq1}$
+\end_inset
+
+,
+ then the set
+\begin_inset Formula $\{x_{n}\}_{n\geq1}$
+\end_inset
+
+ wouldn't have a first element.
+\begin_inset Formula $\#$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $A$
+\end_inset
+
+ be a nonempty subset of
+\begin_inset Formula $S$
+\end_inset
+
+,
+ and let
+\begin_inset Formula $x_{1}\in A$
+\end_inset
+
+.
+ Then we take
+\begin_inset Formula $x_{2}\in A$
+\end_inset
+
+ with
+\begin_inset Formula $x_{2}\prec x_{1}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $x_{3}\in A$
+\end_inset
+
+ with
+\begin_inset Formula $x_{3}\prec x_{2}$
+\end_inset
+
+,
+ etc.,
+ and since there's no infinite sequence of this kind in
+\begin_inset Formula $S$
+\end_inset
+
+,
+ then there must be an
+\begin_inset Formula $x_{n}$
+\end_inset
+
+ in the sequence with no candidate for
+\begin_inset Formula $x_{n+1}$
+\end_inset
+
+,
+ meaning that,
+ for all
+\begin_inset Formula $x\in A$
+\end_inset
+
+,
+
+\begin_inset Formula $x_{n}\preceq x$
+\end_inset
+
+.
+ Therefore,
+
+\begin_inset Formula $x_{n}$
+\end_inset
+
+ is the least element of
+\begin_inset Formula $A$
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Let
+\begin_inset Formula $P$
+\end_inset
+
+ be such a property that
+\begin_inset Formula $\forall x\in S,(\forall y\prec x,P(y)\implies P(x))$
+\end_inset
+
+.
+ Assume there's an
+\begin_inset Formula $x_{0}\in S$
+\end_inset
+
+ such that
+\begin_inset Formula $P(x_{0})$
+\end_inset
+
+ doesn't hold.
+ This means there's an
+\begin_inset Formula $x_{1}\prec x_{0}$
+\end_inset
+
+ such that
+\begin_inset Formula $P(x_{1})$
+\end_inset
+
+ doesn't hold,
+ which means there's an
+\begin_inset Formula $x_{2}\prec x_{1}$
+\end_inset
+
+ such that
+\begin_inset Formula $P(x_{2})$
+\end_inset
+
+ doesn't hold,
+ etc.
+ Then
+\begin_inset Formula $(x_{n})_{n}$
+\end_inset
+
+ is an infinite sequence of elements in
+\begin_inset Formula $S$
+\end_inset
+
+ with
+\begin_inset Formula $x_{j+1}\prec x_{j}$
+\end_inset
+
+ for all
+\begin_inset Formula $j\in\mathbb{N}$
+\end_inset
+
+,
+ but
+\begin_inset Formula $S$
+\end_inset
+
+ is well-ordered by
+\begin_inset Formula $\prec\#$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.10.lyx b/1.2.10.lyx
new file mode 100644
index 0000000..a0a6bbd
--- /dev/null
+++ b/1.2.10.lyx
@@ -0,0 +1,1006 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\use_default_options true
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[10]
+\end_layout
+
+\end_inset
+
+Determine the value of
+\begin_inset Formula $p_{n0}$
+\end_inset
+
+ from Eqs.
+ (4) and (5) and interpret this result from the standpoint of Algorithm M.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+
+\begin_inset Formula $p_{10}=1$
+\end_inset
+
+,
+ and for
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+
+\begin_inset Formula
+\[
+p_{n0}=\frac{1}{n}p_{(n-1)(-1)}+\frac{n-1}{n}p_{(n-1)0}=\frac{n-1}{n}p_{(n-1)0}=\dots=\frac{n-1}{n}\frac{n-2}{n-1}\cdots\frac{1}{2}p_{10}=\frac{1}{n},
+\]
+
+\end_inset
+
+so in general the probability that step M4 is never run (which happens when
+\begin_inset Formula $a_{n}$
+\end_inset
+
+ is already the maximum value) is
+\begin_inset Formula $p_{n0}=\frac{1}{n}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[M10]
+\end_layout
+
+\end_inset
+
+Give an explicit,
+ closed formula for the values of
+\begin_inset Formula $p_{nk}$
+\end_inset
+
+ in the coin-tossing experiment,
+ Eq.
+ (17).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $p_{nk}=\binom{n}{k}p^{k}q^{n-k}$
+\end_inset
+
+.
+ To show that this derives from Eq.
+ (17),
+ we see that,
+ when
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+
+\begin_inset Formula $p_{0k}=\delta_{k0}$
+\end_inset
+
+,
+ matching the formula,
+ and then,
+ by induction,
+\begin_inset Formula
+\[
+p_{nk}=pp_{n-1,k-1}+qp_{n-1,k}=\binom{n-1}{k-1}p^{k}q^{n-k}+\binom{n-1}{k}p^{k}q^{n-k}=\binom{n}{k}p^{k}q^{n-k}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[M20]
+\end_layout
+
+\end_inset
+
+Suppose that each
+\begin_inset Formula $X[k]$
+\end_inset
+
+ is taken at random from a set of
+\begin_inset Formula $M$
+\end_inset
+
+ distinct elements,
+ so that each of the
+\begin_inset Formula $M^{n}$
+\end_inset
+
+ possible choices for
+\begin_inset Formula $X[1],X[2],\dots,X[n]$
+\end_inset
+
+ is considered equally likely.
+ What is the probability that all the
+\begin_inset Formula $X[k]$
+\end_inset
+
+ will be distinct?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We need calculate the number of choices out of those
+\begin_inset Formula $M^{n}$
+\end_inset
+
+ that do not repeat numbers.
+ These choices can be considered as taking a subset of
+\begin_inset Formula $n$
+\end_inset
+
+ elements from those
+\begin_inset Formula $M$
+\end_inset
+
+ (if
+\begin_inset Formula $n>M$
+\end_inset
+
+ then we must necessarily repeat) and then ordering them somehow,
+ so the total number of choices is
+\begin_inset Formula $\binom{M}{n}n!$
+\end_inset
+
+,
+ and the probability is
+\begin_inset Formula
+\[
+\frac{\binom{M}{n}n!}{M^{n}}=\frac{M(M-1)\cdots(M-n+1)}{M^{n}}=\frac{M^{\underline{n}}}{M^{n}}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[M15]
+\end_layout
+
+\end_inset
+
+What happens to the semi-invariants of a distribution if we change
+\begin_inset Formula $G(z)$
+\end_inset
+
+ to
+\begin_inset Formula $F(z)=z^{n}G(z)$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $H(z)\coloneqq z^{n}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $h(t)\coloneqq\ln H(\text{e}^{t})=\ln\text{e}^{nt}=nt$
+\end_inset
+
+,
+ so
+\begin_inset Formula $\dot{h}(t)=n$
+\end_inset
+
+ and
+\begin_inset Formula $\ddot{h}(t)=\dddot{h}(t)=\dots=0$
+\end_inset
+
+.
+ Therefore
+\begin_inset Formula
+\begin{align*}
+\kappa_{1} & =\dot{h}(0)=n; & \kappa_{n} & =h^{(n)}(0)=0, & n & >1.
+\end{align*}
+
+\end_inset
+
+Thus,
+ by Theorem A,
+ the mean increases by
+\begin_inset Formula $n$
+\end_inset
+
+ and all the other semi-invariants stay the same.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc20[M22]
+\end_layout
+
+\end_inset
+
+Suppose we want to calculate
+\begin_inset Formula $\max\{|a_{1}-b_{1}|,|a_{2}-b_{2}|,\dots,|a_{n}-b_{n}|\}$
+\end_inset
+
+ when
+\begin_inset Formula $b_{1}\leq b_{2}\leq\dots\leq b_{n}$
+\end_inset
+
+.
+ Show that it is sufficient to calculate
+\begin_inset Formula $\max\{m_{\text{L}},m_{\text{R}}\}$
+\end_inset
+
+,
+ where
+\begin_inset Formula
+\begin{align*}
+m_{\text{L}} & =\max\{a_{k}-b_{k}\mid a_{k}\text{ is a left-to-right maximum of }a_{1}a_{2}\cdots a_{n}\},\\
+m_{\text{R}} & =\max\{b_{k}-a_{k}\mid a_{k}\text{ is a right-to-left minimum of }a_{1}a_{2}\cdots a_{n}\}.
+\end{align*}
+
+\end_inset
+
+(Thus,
+ if the
+\begin_inset Formula $a$
+\end_inset
+
+'s are in random order,
+ the number of
+\begin_inset Formula $k$
+\end_inset
+
+'s for which a subtraction must be performed is only about
+\begin_inset Formula $2\ln n$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We interpret the concepts of
+\begin_inset Quotes eld
+\end_inset
+
+directional
+\begin_inset Quotes erd
+\end_inset
+
+ maximum and minimum as meaning that
+\begin_inset Formula $a_{k}\geq a_{k-1},\dots,a_{1}$
+\end_inset
+
+ or that
+\begin_inset Formula $a_{k}\leq a_{k+1},\dots,a_{n}$
+\end_inset
+
+,
+ respectively.
+ Then,
+ if
+\begin_inset Formula $a_{j}$
+\end_inset
+
+ is not a left-to-right maximum,
+ there is a
+\begin_inset Formula $k<j$
+\end_inset
+
+ with
+\begin_inset Formula $a_{k}>a_{j}$
+\end_inset
+
+ and therefore
+\begin_inset Formula $a_{k}-b_{k}>a_{j}-b_{j}$
+\end_inset
+
+ (as
+\begin_inset Formula $b_{k}\leq b_{j}$
+\end_inset
+
+),
+ so
+\begin_inset Formula $a_{j}-b_{j}$
+\end_inset
+
+ is not a maximum of
+\begin_inset Formula $\{a_{k}-b_{k}\}$
+\end_inset
+
+.
+ Similarly,
+ if
+\begin_inset Formula $a_{j}$
+\end_inset
+
+ is not a right-to-left minimum,
+ there is a
+\begin_inset Formula $k>j$
+\end_inset
+
+ with
+\begin_inset Formula $a_{k}<a_{j}$
+\end_inset
+
+ and
+\begin_inset Formula $b_{k}-a_{k}>b_{j}-a_{j}$
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+Thus
+\begin_inset Formula $m_{\text{L}}=\max\{a_{k}-b_{k}\}$
+\end_inset
+
+ and
+\begin_inset Formula $m_{\text{R}}=\max\{b_{k}-a_{k}\}$
+\end_inset
+
+.
+ Since at least one of them is non-negative,
+
+\begin_inset Formula $\max\{m_{\text{L}},m_{\text{R}}\}$
+\end_inset
+
+ is also non-negative and it is therefore
+\begin_inset Formula $|a_{k}-b_{k}|$
+\end_inset
+
+ for some
+\begin_inset Formula $k$
+\end_inset
+
+,
+ and it is no lower than any
+\begin_inset Formula $|a_{j}-b_{j}|$
+\end_inset
+
+ as those are either
+\begin_inset Formula $a_{j}-b_{j}$
+\end_inset
+
+ or
+\begin_inset Formula $b_{j}-a_{j}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc21[HM21]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $X$
+\end_inset
+
+ be the number of heads that occur when a random coin is flipped
+\begin_inset Formula $n$
+\end_inset
+
+ times,
+ with generating function (18).
+ Use (25) to prove that
+\begin_inset Formula
+\[
+\text{Pr}(X\geq n(p+\epsilon))\leq\text{e}^{-\epsilon^{2}n/(2q)}
+\]
+
+\end_inset
+
+when
+\begin_inset Formula $\epsilon\geq0$
+\end_inset
+
+,
+ and obtain a similar estimate for
+\begin_inset Formula $\text{Pr}(X\leq n(p-\epsilon))$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First,
+ we tackle the edge cases.
+ If
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $X=0$
+\end_inset
+
+ and
+\begin_inset Formula $\text{Pr}(X\geq0)\leq1$
+\end_inset
+
+ trivially,
+ so we may consider
+\begin_inset Formula $n>0$
+\end_inset
+
+.
+ If
+\begin_inset Formula $p=0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\text{Pr}(X=0)=1$
+\end_inset
+
+ and
+\begin_inset Formula $\text{Pr}(X\geq n\epsilon)\leq\text{e}^{-\epsilon^{2}n/2}$
+\end_inset
+
+ trivially,
+ so we may consider
+\begin_inset Formula $p>0$
+\end_inset
+
+.
+ Finally,
+ if
+\begin_inset Formula $\epsilon>q$
+\end_inset
+
+ then
+\begin_inset Formula $\text{Pr}(X\geq n(p+\epsilon))=0\leq\text{e}^{-\epsilon^{2}n/(2q)}$
+\end_inset
+
+ and if
+\begin_inset Formula $\epsilon=q$
+\end_inset
+
+ then
+\begin_inset Formula $\text{Pr}(X\geq n)=p^{n}\leq(\text{e}^{-q})^{n}\leq\text{e}^{-qn/2}$
+\end_inset
+
+,
+ using the fact that
+\begin_inset Formula $t\leq\text{e}^{t-1}$
+\end_inset
+
+ for every
+\begin_inset Formula $t\in\mathbb{R}$
+\end_inset
+
+,
+ so we may consider
+\begin_inset Formula $\epsilon<q$
+\end_inset
+
+ and in particular
+\begin_inset Formula $q>0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Now let
+\begin_inset Formula $r=n(p+\epsilon)$
+\end_inset
+
+.
+ Then
+\begin_inset Formula $\text{Pr}(X\geq n(p+\epsilon))\leq x^{-n(p+\epsilon)}(q+px)^{n}$
+\end_inset
+
+,
+ and we just need to find
+\begin_inset Formula $x\geq1$
+\end_inset
+
+ such that
+\begin_inset Formula
+\[
+\ln(q+px)-(p+\epsilon)\ln x\leq-\frac{\epsilon^{2}}{2q}.
+\]
+
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(I had to look at the solution,
+ esp.
+ for the right value of
+\begin_inset Formula $x$
+\end_inset
+
+.)
+\end_layout
+
+\end_inset
+
+ If
+\begin_inset Formula $x\coloneqq\frac{p+\epsilon}{p}\frac{q}{q-\epsilon}$
+\end_inset
+
+,
+ we have
+\begin_inset Formula
+\begin{multline*}
+\ln(q+px)-(p+\epsilon)\ln x=\ln\left(q+(p+\epsilon)\frac{q}{q-\epsilon}\right)-(p+\epsilon)\ln\left(\frac{p+\epsilon}{p}\frac{q}{q-\epsilon}\right)=\\
+=\ln q-\ln(q-\epsilon)-(p+\epsilon)(\ln q-\ln(q-\epsilon)+\ln(p+\epsilon)-\ln p)=\\
+=(q-\epsilon)\ln\frac{q}{q-\epsilon}-(p+\epsilon)\ln\frac{p+\epsilon}{p},
+\end{multline*}
+
+\end_inset
+
+where we are assuming that
+\begin_inset Formula $\epsilon<q$
+\end_inset
+
+.
+ Now,
+ by Eq.
+ 1.2.9(24),
+ let
+\begin_inset Formula $v\coloneqq\frac{\epsilon}{q}$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+(q-\epsilon)\ln\frac{q}{q-\epsilon}=q(1-v)\ln\frac{1}{1-v}=q(v-1)\ln(1-v)=\\
+=q(v-1)\sum_{k\geq1}\frac{(-1)^{k+1}}{k}(-v)^{k}=q(1-v)\sum_{k\geq1}\frac{v^{k}}{k}=q\left(\sum_{k\geq1}\frac{v^{k}}{k}-\sum_{k\geq2}\frac{v^{k}}{k-1}\right)=\\
+=q\left(v-\sum_{k\geq2}\frac{v^{k}}{k(k-1)}\right)=\epsilon-\frac{\epsilon^{2}}{2q}-\frac{\epsilon^{3}}{6q^{2}}-\frac{\epsilon^{4}}{12q^{3}}-\dots\leq\epsilon-\frac{\epsilon^{2}}{2q}.
+\end{multline*}
+
+\end_inset
+
+In addition,
+\begin_inset Formula
+\[
+-(p+\epsilon)\ln\frac{p+\epsilon}{p}=(p+\epsilon)\ln\frac{p}{p+\epsilon}=(p+\epsilon)\ln\left(1-\frac{\epsilon}{p+\epsilon}\right)\leq-\epsilon,
+\]
+
+\end_inset
+
+so
+\begin_inset Formula $-(p+\epsilon)\ln\frac{p+\epsilon}{p}\leq\epsilon$
+\end_inset
+
+ and,
+ putting it all together,
+\begin_inset Formula
+\[
+\ln(q+px)-(p+\epsilon)\ln x\leq\cancel{\epsilon}-\frac{\epsilon^{2}}{2q}\cancel{-\epsilon}.
+\]
+
+\end_inset
+
+For the second part,
+ switching the roles of heads and tails,
+ let
+\begin_inset Formula $Y\coloneqq n-X$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\text{Pr}(X\leq n(p-\epsilon))=\text{Pr}(Y\geq n(q+\epsilon))\leq\text{e}^{-\epsilon^{2}n/(2p)}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[HM22]
+\end_layout
+
+\end_inset
+
+Suppose
+\begin_inset Formula $X$
+\end_inset
+
+ has the generating function
+\begin_inset Formula $(q_{1}+p_{1}z)(q_{2}+p_{2}z)\cdots(q_{n}+p_{n}z)$
+\end_inset
+
+,
+ where
+\begin_inset Formula $p_{k}+q_{k}=1$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+.
+ Let
+\begin_inset Formula $\mu=EX=p_{1}+p_{2}+\dots+p_{n}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Prove that
+\begin_inset Formula
+\begin{align*}
+\text{Pr}(X\leq\mu r) & \leq(r^{-r}\text{e}^{r-1})^{\mu}, & \text{when }0 & <r\leq1;\\
+\text{Pr}(X\geq\mu r) & \leq(r^{-r}\text{e}^{r-1})^{\mu}, & \text{when }r & \geq1.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Express the right-hand sides of these estimates in convenient form when
+\begin_inset Formula $r\approx1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Show that if
+\begin_inset Formula $r$
+\end_inset
+
+ is sufficiently large we have
+\begin_inset Formula $\text{Pr}(X\geq\mu r)\leq2^{-\mu r}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+For the first equation,
+ using Eq.
+ (24) with
+\begin_inset Formula $x=r$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+\text{Pr}(X\leq\mu r)\leq r^{-\mu r}(q_{1}+p_{1}r)\cdots(q_{n}+p_{n}r)=r^{-\mu r}\prod_{k}(q_{k}+p_{k}r)=\\
+=r^{-\mu r}\prod_{k}(1+p_{k}(r-1))\leq r^{-\mu r}\prod_{k}\text{e}^{p_{k}(r-1)}=r^{-\mu r}\text{e}^{\mu(r-1)}=(r^{-r}\text{e}^{r-1})^{\mu}.
+\end{multline*}
+
+\end_inset
+
+For the second equation,
+ repeat the same steps but using Eq.
+ (25).
+\end_layout
+
+\begin_layout Enumerate
+When
+\begin_inset Formula $r\approx1$
+\end_inset
+
+,
+
+\begin_inset Formula $r\approx\text{e}^{r-1}$
+\end_inset
+
+,
+ so
+\begin_inset Formula $(r^{-r}\text{e}^{r-1})^{\mu}\approx r^{\mu(1-r)}$
+\end_inset
+
+.
+ The inequality still holds for
+\begin_inset Formula $r<2$
+\end_inset
+
+ since,
+ in the previous proof,
+ we can see that
+\begin_inset Formula $1+p_{k}(r-1)\leq r^{p_{k}}$
+\end_inset
+
+ by taking the Taylor series of the logarithms:
+\begin_inset Formula
+\begin{multline*}
+\ln(1+p_{k}(r-1))=p_{k}(r-1)-\frac{p_{k}^{2}(r-1)^{2}}{2}+\frac{p_{k}^{3}(r-1)^{3}}{3}-\frac{p_{k}^{4}(r-1)^{4}}{4}+\dots\leq\\
+\leq p_{k}(r-1)-\frac{p_{k}(r-1)^{2}}{2}+\frac{p_{k}(r-1)^{3}}{3}-\frac{p_{k}(r-1)^{4}}{4}+\dots=p_{k}\ln r.
+\end{multline*}
+
+\end_inset
+
+Using this inequality instead of the one we used gives the proper result.
+\end_layout
+
+\begin_layout Enumerate
+Clearly
+\begin_inset Formula $1+p_{k}(r-1)\leq r$
+\end_inset
+
+,
+ so
+\begin_inset Formula $r^{-\mu r}\prod_{k}(1+p_{k}(r-1))\leq r^{-\mu r}r^{n}$
+\end_inset
+
+,
+ and we want to see that this in turn is less than
+\begin_inset Formula $2^{-\mu r}$
+\end_inset
+
+ for large enough
+\begin_inset Formula $r$
+\end_inset
+
+.
+ Now,
+\begin_inset Formula
+\[
+\frac{r^{n}r^{-\mu r}}{2^{-\mu r}}=r^{n}\left(\frac{2}{r}\right)^{\mu r},
+\]
+
+\end_inset
+
+and since
+\begin_inset Formula $\left(\frac{2}{r}\right)^{\mu r}$
+\end_inset
+
+ decreases faster than
+\begin_inset Formula $r^{n}$
+\end_inset
+
+ increases,
+ there exist
+\begin_inset Formula $r_{0}$
+\end_inset
+
+ such that,
+ for
+\begin_inset Formula $r>r_{0}$
+\end_inset
+
+,
+ this fraction is less than 1.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.11.1.lyx b/1.2.11.1.lyx
new file mode 100644
index 0000000..daa07e2
--- /dev/null
+++ b/1.2.11.1.lyx
@@ -0,0 +1,556 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\use_default_options true
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 1,
+ 2,
+ 4,
+ 6,
+ 11,
+ 13 (1 p.) (est.
+ 0:21:19)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[HM01]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $\lim_{n\to\infty}O(n^{-1/3})$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+0.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[M10]
+\end_layout
+
+\end_inset
+
+Mr.
+ B.
+ C.
+ Dull obtained astonishing results by using the
+\begin_inset Quotes eld
+\end_inset
+
+self-evident
+\begin_inset Quotes erd
+\end_inset
+
+ formula
+\begin_inset Formula $O(f(n))-O(f(n))=0$
+\end_inset
+
+.
+ What was his mistake,
+ and what should the right-hand side of his formula has been?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $O(f(n))$
+\end_inset
+
+ is a set of functions,
+ not a single function,
+ so the two
+\begin_inset Formula $O(f(n))$
+\end_inset
+
+ do not cancel out (for example,
+ the first
+\begin_inset Formula $O(f(n))$
+\end_inset
+
+ could represent
+\begin_inset Formula $f(n)$
+\end_inset
+
+ and the second one could be 0).
+ The right hand side should be another
+\begin_inset Formula $O(f(n))$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[M15]
+\end_layout
+
+\end_inset
+
+Give an asymptotic expansion of
+\begin_inset Formula $n(\sqrt[n]{a}-1)$
+\end_inset
+
+,
+ if
+\begin_inset Formula $a>0$
+\end_inset
+
+,
+ to terms
+\begin_inset Formula $O(1/n^{3})$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We can do this by considering the function in terms of
+\begin_inset Formula $x\coloneqq\frac{1}{n}$
+\end_inset
+
+,
+ which would be
+\begin_inset Formula $\frac{1}{x}(a^{x}-1)$
+\end_inset
+
+.
+ Then
+\begin_inset Formula $a^{x}=\text{e}^{x\ln a}=1+x\ln a+\frac{1}{2}x^{2}\ln^{2}a+\frac{1}{6}x^{3}\ln^{3}a+O(x^{4}\ln^{4}a)$
+\end_inset
+
+,
+ so
+\begin_inset Formula
+\[
+a^{x}-1=x\ln a+\frac{x^{2}\ln^{2}a}{2}+\frac{x^{3}\ln^{3}a}{6}+O(x^{4})=\frac{\ln a}{n}+\frac{\ln^{2}a}{2n^{2}}+\frac{\ln^{3}a}{6n^{3}}+O(n^{-4})
+\]
+
+\end_inset
+
+and finally
+\begin_inset Formula
+\[
+n(\sqrt[n]{a}-1)=\ln a+\frac{\ln^{2}a}{2n}+\frac{\ln^{3}a}{6n^{2}}+O(n^{-3}).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[M20]
+\end_layout
+
+\end_inset
+
+What is wrong with the following arguments?
+
+\begin_inset Quotes eld
+\end_inset
+
+Since
+\begin_inset Formula $n=O(n)$
+\end_inset
+
+,
+ and
+\begin_inset Formula $2n=O(n)$
+\end_inset
+
+,
+ ...,
+ we have
+\begin_inset Formula
+\[
+\sum_{k=1}^{n}kn=\sum_{k=1}^{n}O(n)=O(n^{2}).\text{''}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The second expression does not make sense.
+ It is a sum of
+\begin_inset Formula $n$
+\end_inset
+
+ functions each of which has
+\begin_inset Formula $n$
+\end_inset
+
+ as a parameter,
+ but if
+\begin_inset Formula $n$
+\end_inset
+
+ is a parameter,
+ it cannot be an
+\begin_inset Quotes eld
+\end_inset
+
+external
+\begin_inset Quotes erd
+\end_inset
+
+ parameter of the function represented by
+\begin_inset Formula $O(n)$
+\end_inset
+
+ as well.
+ In this case,
+ it is invalid to move the big O inside the sum as the range of the sum depends on
+\begin_inset Formula $n$
+\end_inset
+
+ and so does the domain of values
+\begin_inset Formula $k$
+\end_inset
+
+ can take,
+ so
+\begin_inset Formula $k$
+\end_inset
+
+,
+ which depends on
+\begin_inset Formula $n$
+\end_inset
+
+,
+ cannot be treated like a constant.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[M11]
+\end_layout
+
+\end_inset
+
+Explain why Eq.
+ (18) is true.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The first identity is because
+\begin_inset Formula $\sqrt[n]{n}=\text{e}^{\ln\sqrt[n]{n}}=\text{e}^{\ln n^{1/n}}=\text{e}^{\ln n/n}$
+\end_inset
+
+,
+ taking the power
+\begin_inset Formula $1/n$
+\end_inset
+
+ out of the logarithm.
+ The second identity is a direct application of Eq.
+ (12),
+ using that
+\begin_inset Formula $\ln n/n\to0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[M10]
+\end_layout
+
+\end_inset
+
+Prove or disprove:
+
+\begin_inset Formula $g(n)=\Omega(f(n))$
+\end_inset
+
+ if and only if
+\begin_inset Formula $f(n)=O(g(n))$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $g(n)=\Omega(f(n))$
+\end_inset
+
+ if and only if there exist
+\begin_inset Formula $n_{0}$
+\end_inset
+
+ and
+\begin_inset Formula $L$
+\end_inset
+
+ such that
+\begin_inset Formula $|g(n)|\geq L|f(n)|$
+\end_inset
+
+ for each
+\begin_inset Formula $n\geq n_{0}$
+\end_inset
+
+,
+ but this is the same as saying that,
+ for all such
+\begin_inset Formula $n$
+\end_inset
+
+,
+
+\begin_inset Formula $|f(n)|\leq\frac{1}{L}|g(n)|$
+\end_inset
+
+,
+ which is to say that
+\begin_inset Formula $f(n)=O(g(n))$
+\end_inset
+
+.
+ Since arguably this
+\begin_inset Formula $L$
+\end_inset
+
+ must be positive (otherwise the statement is trivial),
+ taking
+\begin_inset Formula $\frac{1}{L}$
+\end_inset
+
+ is valid,
+ and likewise,
+ if
+\begin_inset Formula $|f(n)|\leq M|g(n)|$
+\end_inset
+
+ for each
+\begin_inset Formula $n\geq n_{0}$
+\end_inset
+
+ and some
+\begin_inset Formula $M$
+\end_inset
+
+,
+ we can always make this
+\begin_inset Formula $M$
+\end_inset
+
+ positive to make the reverse argument.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.11.2.lyx b/1.2.11.2.lyx
new file mode 100644
index 0000000..cd12585
--- /dev/null
+++ b/1.2.11.2.lyx
@@ -0,0 +1,440 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\use_default_options true
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[HM20]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Sums of powers.
+\emph default
+) When
+\begin_inset Formula $f(x)=x^{m}$
+\end_inset
+
+,
+ the high-order derivatives of
+\begin_inset Formula $f$
+\end_inset
+
+ are all zero,
+ so Euler's summation formula gives an
+\emph on
+exact
+\emph default
+ value for the sum
+\begin_inset Formula
+\[
+S_{m}(n)=\sum_{0\leq k<n}k^{m}
+\]
+
+\end_inset
+
+in terms of Bernoulli numbers.
+ (It was the study of
+\begin_inset Formula $S_{m}(n)$
+\end_inset
+
+ for
+\begin_inset Formula $m=1,2,3,\dots$
+\end_inset
+
+ that led Bernoulli and Seki to discover those numbers in the first place.) Express
+\begin_inset Formula $S_{m}(n)$
+\end_inset
+
+ in terms of Bernoulli
+\emph on
+polynomials
+\emph default
+.
+ Check your answer for
+\begin_inset Formula $m=0$
+\end_inset
+
+,
+ 1,
+ and 2.
+ (Note that the desired sum is performed for
+\begin_inset Formula $0\leq k<n$
+\end_inset
+
+ instead of
+\begin_inset Formula $1\leq k<n$
+\end_inset
+
+;
+ Euler's summation formula may be applied with 0 replacing 1 throughout.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For
+\begin_inset Formula $k\geq0$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $f^{(k)}(x)=m^{\underline{k}}x^{m-k}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $k<m$
+\end_inset
+
+,
+ this is nonzero except that
+\begin_inset Formula $f^{(k)}(0)=0$
+\end_inset
+
+;
+ if
+\begin_inset Formula $k=m$
+\end_inset
+
+,
+
+\begin_inset Formula $f^{(m)}(x)\equiv1$
+\end_inset
+
+,
+ and if
+\begin_inset Formula $k>m$
+\end_inset
+
+,
+
+\begin_inset Formula $f^{(k)}(x)\equiv0$
+\end_inset
+
+.
+ Using Euler's summation formula,
+ when
+\begin_inset Formula $m\geq1$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+S_{m}(n)=\sum_{0\leq k<n}k^{m}=\int_{0}^{n}x^{m}\text{d}x+\sum_{k=1}^{m}\frac{B_{k}}{k!}m^{\underline{k-1}}n^{m-k+1}=\frac{n^{m+1}}{m+1}+\sum_{k=1}^{m}\frac{B_{k}}{m-k+1}\binom{m}{k}n^{m-k+1}.
+\]
+
+\end_inset
+
+Then,
+\begin_inset Formula
+\[
+S'_{m}(n)=n^{m}+\sum_{k=1}^{m}B_{k}\binom{m}{k}n^{m-k}=\sum_{k}B_{k}\binom{m}{k}n^{m-k}=B_{m}(x),
+\]
+
+\end_inset
+
+which means that
+\begin_inset Formula
+\[
+\int_{0}^{n}B_{m}=(S_{m}(n)-S_{m}(0))=S_{m}(n)
+\]
+
+\end_inset
+
+ and therefore,
+\begin_inset Formula
+\[
+S_{m}(n)=\int_{0}^{n}B_{m}.
+\]
+
+\end_inset
+
+Now we check the solution,
+ and in particular we check that this works for
+\begin_inset Formula $m=0$
+\end_inset
+
+ as well:
+\begin_inset Formula
+\begin{align*}
+\int_{0}^{n}B_{0} & =\int_{0}^{n}\text{d}x=n-0=n, & S_{0}(n) & =\sum_{0\leq k<n}1=n;\\
+\int_{0}^{n}B_{1} & =\int_{0}^{n}(x-\tfrac{1}{2})\text{d}x=\frac{n^{2}-n}{2}, & S_{1}(n) & =\sum_{0\leq k<n}k=\frac{n(n-1)}{2};\\
+\int_{0}^{n}B_{2} & =\int_{0}^{n}(x^{2}-x+\tfrac{1}{6})\text{d}x=\frac{2n^{3}-3n^{2}+n}{6},
+\end{align*}
+
+\end_inset
+
+and we check the last result we use induction.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+
+\begin_inset Formula $S_{2}(0)=0$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n\geq0$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{align*}
+S_{2}(n) & =\frac{1}{6}\left(2(n-1)^{3}-3(n-1)^{2}+(n-1)\right)+(n-1)^{2}\\
+ & =\frac{1}{6}\left(2n^{3}\cancel{-6n^{2}}\cancel{+6n}\cancel{-2}-3n^{2}\cancel{+6n}\cancel{-3}+n\cancel{-1}\cancel{+6n^{2}}\cancel{-12n}\cancel{+6}\right)=\int_{0}^{n}B_{2}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[M25]
+\end_layout
+
+\end_inset
+
+Find the asymptotic value of
+\begin_inset Formula $\binom{2n}{n}$
+\end_inset
+
+ with a relative error of
+\begin_inset Formula $O(n^{-3})$
+\end_inset
+
+,
+ in two ways:
+\end_layout
+
+\begin_layout Enumerate
+via Stirling's approximation;
+\end_layout
+
+\begin_layout Enumerate
+via exercise 1.2.6–47 and Eq.
+ 1.2.11.1–(16).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+We have,
+\begin_inset Formula
+\[
+\binom{2n}{n}=\frac{(2n)!}{n!^{2}},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{multline*}
+\ln\binom{2n}{n}=\ln(2n)!-2\ln(n!)=\\
+=(2n+\tfrac{1}{2})\ln(2n)-2n+\sigma+\frac{1}{24n}-(2n+1)\ln n+2n-2\sigma-\frac{1}{6n}+O(n^{-3})=\\
+=(2n+\tfrac{1}{2})(\ln n+\ln2)-(2n+1)\ln n-\sigma-\frac{1}{8n}+O(n^{-3})=\\
+=(2n+\tfrac{1}{2})\ln2-\frac{\ln n}{2}-\sigma-\frac{1}{8n}+O(n^{-3}),
+\end{multline*}
+
+\end_inset
+
+and therefore
+\begin_inset Formula
+\[
+\binom{2n}{n}=\exp(\cdots)=\frac{2^{2n}}{\sqrt{\pi n}}\left(1-\frac{1}{8n}+\frac{1}{128n^{2}}+O(n^{3})\right).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(I had to look up the solution.)
+\end_layout
+
+\end_inset
+
+Exercise 1.2.6–47,
+ when
+\begin_inset Formula $r=-1/2$
+\end_inset
+
+,
+ the first identity simplifies to
+\begin_inset Formula
+\[
+(-1)^{k}\binom{-\frac{1}{2}}{k}=(-1)^{k}\binom{-k-1}{k}\Bigg/4^{k}=\binom{2k}{k}\Bigg/4^{k}.
+\]
+
+\end_inset
+
+Thus,
+ using Eq.
+ 1.2.6–(21),
+\begin_inset Formula
+\begin{multline*}
+\binom{2n}{n}=4^{n}(-1)^{n}\binom{-\frac{1}{2}}{n}=4^{n}\binom{n-\frac{1}{2}}{n}=4^{n}\frac{\Gamma(n+\frac{1}{2})}{\Gamma(n+1)\Gamma(\frac{1}{2})}=4^{k}\frac{\Gamma(n+\frac{1}{2})}{n\Gamma(n)\sqrt{\pi}}=\\
+=\frac{4^{n}n^{\overline{1/2}}}{n\sqrt{\pi}}=\frac{2^{2n}}{n\sqrt{\pi}}\left(\stirla{1/2}{1/2}n^{1/2}+\stirla{1/2}{-1/2}n^{-1/2}+\stirla{1/2}{-3/2}n^{-3/2}+O(n^{-5/2})\right).
+\end{multline*}
+
+\end_inset
+
+Using Eqs.
+ 1.2.6–(48),
+ (49),
+ and (57),
+\begin_inset Formula
+\begin{align*}
+\stirla{1/2}{1/2} & =1,\\
+\stirla{1/2}{-1/2} & =\binom{1/2}{2}=\frac{\frac{1}{2}(-\frac{1}{2})}{2}=-\frac{1}{8},\\
+\stirla{1/2}{-3/2} & =\binom{1/2}{4}+2\binom{3/2}{4}=\frac{-\frac{15}{16}}{24}+2\frac{\frac{9}{16}}{24}=\frac{3}{16\cdot24}=\frac{1}{128},
+\end{align*}
+
+\end_inset
+
+so in the end,
+\begin_inset Formula
+\[
+\binom{2n}{n}=\frac{2^{2n}}{\sqrt{\pi n}}\left(1-\frac{1}{8n}+\frac{1}{128n^{2}}+O(n^{-3})\right).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.11.3.lyx b/1.2.11.3.lyx
new file mode 100644
index 0000000..637512e
--- /dev/null
+++ b/1.2.11.3.lyx
@@ -0,0 +1,241 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\use_default_options true
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 4,
+ 6 (1 p.) (est.
+ 0:13:30)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[HM10]
+\end_layout
+
+\end_inset
+
+Prove Eq.
+ (13).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Since
+\begin_inset Formula $u\geq0$
+\end_inset
+
+,
+
+\begin_inset Formula $\ln(1+u)\geq0$
+\end_inset
+
+ and
+\begin_inset Formula $u=v+\ln(1+u)\geq v$
+\end_inset
+
+.
+ On the other hand,
+
+\begin_inset Formula $x$
+\end_inset
+
+ is fixed with respect to
+\begin_inset Formula $v$
+\end_inset
+
+,
+ so by monotonicity of the integral,
+ if
+\begin_inset Formula $v\geq1$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+0\leq\int_{r}^{\infty}x\text{e}^{-xv}\left(1+\frac{1}{u}\right)\text{d}v\leq\int_{r}^{\infty}x\text{e}^{-xv}\left(1+\frac{1}{v}\right)\text{d}v\leq\int_{r}^{\infty}2x\text{e}^{-xv}=\\
+=\left.-2\text{e}^{-xv}\right|_{v=r}^{\infty}=2\text{e}^{-rx}.
+\end{multline*}
+
+\end_inset
+
+This means
+\begin_inset Formula $\int_{r}^{\infty}x\text{e}^{-xv}\left(1+\frac{1}{u}\right)\text{d}v=O(\text{e}^{-rx})$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[HM20]
+\end_layout
+
+\end_inset
+
+Prove Eq.
+ (23).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+(n+\alpha)^{n+\beta}=n^{n+\beta}\left(1+\frac{\alpha}{n}\right)^{n+\beta}.
+\]
+
+\end_inset
+
+For the second factor,
+\begin_inset Formula
+\begin{multline*}
+\ln\left(1+\frac{\alpha}{n}\right)^{n+\beta}=(n+\beta)\ln\left(1+\frac{\alpha}{n}\right)=(n+\beta)\left(\frac{\alpha}{n}-\frac{\alpha^{2}}{2n^{2}}+O(n^{-3})\right)=\\
+=\alpha+\frac{1}{n}\left(\alpha\beta-\frac{\alpha^{2}}{2}\right)+O(n^{-2}),
+\end{multline*}
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{multline*}
+n^{n+\beta}\left(1+\frac{\alpha}{n}\right)^{n+\beta}=n^{n+\beta}\text{e}^{\alpha}\exp\left(\frac{1}{n}\left(\alpha\beta-\frac{\alpha^{2}}{2}\right)+O(n^{-2})\right)=\\
+n^{n+\beta}\text{e}^{\alpha}\left(1+\frac{\alpha}{n}\left(\beta-\frac{\alpha}{2}\right)+O(n^{-2})\right).
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.2.lyx b/1.2.2.lyx
new file mode 100644
index 0000000..e964905
--- /dev/null
+++ b/1.2.2.lyx
@@ -0,0 +1,1329 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+What is the smallest positive rational number?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+There isn't.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[00]
+\end_layout
+
+\end_inset
+
+Is
+\begin_inset Formula $1+0.239999999\dots$
+\end_inset
+
+ a decimal expansion?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes,
+ as long as it means a number
+\begin_inset Formula $x$
+\end_inset
+
+ with
+\begin_inset Formula $1.239999999\leq x<1.24$
+\end_inset
+
+,
+ that is,
+ as long as it doesn't end with an infinite number of nines.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[02]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $(-3)^{-3}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $(-3)^{-3}=\frac{1}{(-3)^{3}}=\frac{1}{-27}=-\frac{1}{27}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[05]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $(0.125)^{-2/3}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $(0.125)^{-2/3}=(\frac{1}{8})^{-2/3}=\sqrt[3]{(\frac{1}{8})^{-2}}=\sqrt[3]{8^{2}}=\sqrt[3]{64}=4$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc5[05]
+\end_layout
+
+\end_inset
+
+We defined real numbers in terms of a decimal expansion.
+ Discuss how we could have defined them in terms of a binary expansion instead,
+ and give a definition to replace Eq.
+ (2).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+A decimal expansion would have the form
+\begin_inset Formula $x=n+0.b_{1}b_{2}b_{3}\dots$
+\end_inset
+
+,
+ where each
+\begin_inset Formula $b_{i}$
+\end_inset
+
+ would be a binary digit,
+ 0 or 1,
+ and this would mean that
+\begin_inset Formula
+\[
+n+\frac{b_{1}}{2}+\frac{b_{2}}{4}+\dots+\frac{b_{k}}{2^{k}}\leq x<n+\frac{b_{1}}{2}+\frac{b_{2}}{4}+\dots+\frac{b_{k}}{2^{k}}+\frac{1}{10^{k}}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc6[10]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $x=m+0.d_{1}d_{2}\dots$
+\end_inset
+
+ and
+\begin_inset Formula $y=n+0.e_{1}e_{2}\dots$
+\end_inset
+
+ be real numbers,
+ Give a rule for determining whether
+\begin_inset Formula $x=y$
+\end_inset
+
+,
+
+\begin_inset Formula $x<y$
+\end_inset
+
+,
+ or
+\begin_inset Formula $x>y$
+\end_inset
+
+,
+ based on the decimal representation.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We say that
+\begin_inset Formula $x=y$
+\end_inset
+
+ if
+\begin_inset Formula $m=n$
+\end_inset
+
+ and
+\begin_inset Formula $d_{k}=e_{k}$
+\end_inset
+
+ for all
+\begin_inset Formula $k$
+\end_inset
+
+,
+ and that
+\begin_inset Formula $x<y$
+\end_inset
+
+ if
+\begin_inset Formula $m<n$
+\end_inset
+
+ or if
+\begin_inset Formula $m=n$
+\end_inset
+
+ and there's a
+\begin_inset Formula $k$
+\end_inset
+
+ such that
+\begin_inset Formula $d_{j}=e_{j}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j<k$
+\end_inset
+
+ and
+\begin_inset Formula $d_{k}<e_{k}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[10]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $b=10$
+\end_inset
+
+ and
+\begin_inset Formula $x\approx\log_{10}2$
+\end_inset
+
+,
+ to how many decimal places of accuracy will we need to know the value of
+\begin_inset Formula $x$
+\end_inset
+
+ in order to determine the first three decimal places of the decimal expansion of
+\begin_inset Formula $b^{x}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Potentially infinite.
+ Because
+\begin_inset Formula $10^{\log_{10}2}=2$
+\end_inset
+
+,
+
+\begin_inset Formula $10^{x}=2.0\dots$
+\end_inset
+
+ if
+\begin_inset Formula $x\geq\log_{10}2$
+\end_inset
+
+ or
+\begin_inset Formula $10^{x}=1.9\dots$
+\end_inset
+
+ if
+\begin_inset Formula $x\leq\log_{10}2$
+\end_inset
+
+,
+ but since
+\begin_inset Formula $\log_{10}2$
+\end_inset
+
+ is irrational,
+ its decimal expansion is infinite and,
+ in the worst case that
+\begin_inset Formula $x=\log_{10}2$
+\end_inset
+
+,
+ we can't determine by an algorithm that
+\begin_inset Formula $x\geq\log_{10}2$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc12[02]
+\end_layout
+
+\end_inset
+
+Explain why Eq.
+ (10) follows from Eqs.
+ (8).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Because logarithms are strictly increasing,
+ continuous functions,
+ and we have that
+\begin_inset Formula $10^{0.30102999}<2<10^{0.30103000}$
+\end_inset
+
+,
+ we can take logarithms on the expression to get
+\begin_inset Formula $0.30102999<\log_{10}2<0.30103000$
+\end_inset
+
+,
+ and so
+\begin_inset Formula $\log_{10}2=0.30102999$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[M23]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Given that
+\begin_inset Formula $x$
+\end_inset
+
+ is a positive real number and
+\begin_inset Formula $n$
+\end_inset
+
+ is a positive integer,
+ prove the inequality
+\begin_inset Formula $\sqrt[n]{1+x}-1\leq x/n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Use this fact to justify the remarks following (7).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Let
+\begin_inset Formula $f(x):=\sqrt[n]{1+x}-1-\frac{x}{n}$
+\end_inset
+
+,
+ we have to prove that,
+ if
+\begin_inset Formula $n$
+\end_inset
+
+ is a positive integer and
+\begin_inset Formula $x>0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $f(x)\leq0$
+\end_inset
+
+.
+ We have
+\begin_inset Formula
+\[
+f'(x)=\frac{1}{n\sqrt[n]{1+x}}-\frac{1}{n}=\frac{1}{n}\left(\frac{1}{\sqrt[n]{1+x}-1}\right),
+\]
+
+\end_inset
+
+but since
+\begin_inset Formula $\sqrt[n]{1+x}>1$
+\end_inset
+
+ for
+\begin_inset Formula $x>0$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $f'(x)<0$
+\end_inset
+
+ and
+\begin_inset Formula $f$
+\end_inset
+
+ is strictly decreasing on
+\begin_inset Formula $(0,+\infty)$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $f(0)=0$
+\end_inset
+
+,
+ this proves the result.
+\end_layout
+
+\begin_layout Enumerate
+It's clear that
+\begin_inset Formula $b^{n+d_{1}/10+\dots+d_{k}/10^{k}}\leq b^{n+1}$
+\end_inset
+
+,
+ and then,
+ taken
+\begin_inset Formula $x=b-1>0$
+\end_inset
+
+ and
+\begin_inset Formula $n=10^{k}$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $\sqrt[10^{k}]{1+b-1}=b^{1/10^{k}}\leq(b-1)/10^{k}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc15[10]
+\end_layout
+
+\end_inset
+
+Prove or disprove:
+\begin_inset Formula
+\begin{align*}
+\log_{b}x/y & =\log_{b}x-\log_{b}y, & \text{if }x,y & >0.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $\alpha:=\log_{b}x$
+\end_inset
+
+ and
+\begin_inset Formula $\beta:=\log_{b}y$
+\end_inset
+
+,
+ we have
+\begin_inset Formula
+\[
+\frac{b^{\alpha}}{b^{\beta}}=b^{\alpha}b^{-\beta}=b^{\alpha-\beta},
+\]
+
+\end_inset
+
+and taking logarithms,
+ we get
+\begin_inset Formula $\log_{b}\frac{b^{\alpha}}{b^{\beta}}=\log_{b}\frac{x}{y}=\log_{b}b^{\alpha-\beta}=\alpha-\beta=\log_{b}x-\log_{b}y.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc16[00]
+\end_layout
+
+\end_inset
+
+How can
+\begin_inset Formula $\log_{10}x$
+\end_inset
+
+ be expressed in terms of
+\begin_inset Formula $\ln x$
+\end_inset
+
+ and
+\begin_inset Formula $\ln10$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\log_{10}x=\frac{\log_{e}x}{\log_{e}10}=\frac{\ln x}{\ln10}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[05]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $\lg32$
+\end_inset
+
+?
+
+\begin_inset Formula $\log_{\pi}\pi$
+\end_inset
+
+?
+
+\begin_inset Formula $\ln e$
+\end_inset
+
+?
+
+\begin_inset Formula $\log_{b}1$
+\end_inset
+
+?
+
+\begin_inset Formula $\log_{b}(-1)$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\lg32=5$
+\end_inset
+
+,
+
+\begin_inset Formula $\log_{\pi}\pi=1$
+\end_inset
+
+,
+
+\begin_inset Formula $\ln e=1$
+\end_inset
+
+,
+
+\begin_inset Formula $\log_{b}1=0$
+\end_inset
+
+.
+ As for
+\begin_inset Formula $\log_{b}(-1)$
+\end_inset
+
+,
+ it would be an
+\begin_inset Formula $x$
+\end_inset
+
+ such that
+\begin_inset Formula $b^{x}=-1$
+\end_inset
+
+,
+ which is not a real number most of the time.
+ As a complex number,
+ it would be
+\begin_inset Formula $\log_{b}(-1)=\frac{\ln(-1)}{\ln b}=\frac{i\pi}{\ln b}$
+\end_inset
+
+,
+ since
+\begin_inset Formula $e^{i\pi}=-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc18[10]
+\end_layout
+
+\end_inset
+
+Prove or disprove:
+
+\begin_inset Formula $\log_{8}x=\frac{1}{2}\lg x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\log_{8}x=\frac{\lg x}{\lg8}$
+\end_inset
+
+,
+ but
+\begin_inset Formula $\lg8=3\neq2$
+\end_inset
+
+,
+ so this is false in the general case (this is only true when
+\begin_inset Formula $x=1$
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc19[20]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $n$
+\end_inset
+
+ is an integer whose decimal representation is 14 digits long,
+ will the value of
+\begin_inset Formula $n$
+\end_inset
+
+ fit in a computer word with a capacity of 47 bits and a sign bit?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The number of possibilities for a number with up to 14 digits is
+\begin_inset Formula $10^{14}$
+\end_inset
+
+,
+ and the number for 47 bits is
+\begin_inset Formula $2^{47}\approx1.3\cdot2^{14}$
+\end_inset
+
+,
+ so it would fit.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc20[10]
+\end_layout
+
+\end_inset
+
+Is there any simple relation between
+\begin_inset Formula $\log_{10}2$
+\end_inset
+
+ and
+\begin_inset Formula $\log_{2}10$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\log_{10}2=\frac{\log_{2}2}{\log_{2}10}=\frac{1}{\log_{2}10}$
+\end_inset
+
+,
+ so
+\begin_inset Formula $\log_{10}2\log_{2}10=1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[20]
+\end_layout
+
+\end_inset
+
+(R.
+ W.
+ Hamming.) Prove that
+\begin_inset Formula
+\[
+\lg x\approx\ln x+\log_{10}x,
+\]
+
+\end_inset
+
+with less than
+\begin_inset Formula $\unit[1]{\%}$
+\end_inset
+
+ error!
+ (Thus a table of natural logarithms and of common logarithms can be used to get approximate values of binary logarithms as well.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\ln x+\log_{10}x=\frac{\lg x}{\lg e}+\frac{\lg x}{\lg10}=\lg x\left(\frac{1}{\lg e}+\frac{1}{\lg10}\right)\cong0.994\lg x\approx\lg x,
+\]
+
+\end_inset
+
+and this gives us about
+\begin_inset Formula $\unit[0.6]{\%}$
+\end_inset
+
+ error.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc27[M25]
+\end_layout
+
+\end_inset
+
+Consider the method for calculating
+\begin_inset Formula $\log_{10}x$
+\end_inset
+
+ discussed in the text.
+ Let
+\begin_inset Formula $x'_{k}$
+\end_inset
+
+ denote the computed approximation to
+\begin_inset Formula $x_{k}$
+\end_inset
+
+,
+ determined as follows:
+
+\begin_inset Formula $x(1-\delta)\leq10^{n}x'_{0}\leq x(1+\epsilon)$
+\end_inset
+
+;
+ and in the determination of
+\begin_inset Formula $x'_{k}$
+\end_inset
+
+ by Eqs.
+ (18),
+ the quantity
+\begin_inset Formula $y_{k}$
+\end_inset
+
+ is used in place of
+\begin_inset Formula $(x'_{k-1})^{2}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $(x'_{k-1})^{2}(1-\delta)\leq y_{k}\leq(x'_{k-1})^{2}(1+\epsilon)$
+\end_inset
+
+ and
+\begin_inset Formula $1\leq y_{k}<100$
+\end_inset
+
+.
+ Here
+\begin_inset Formula $\delta$
+\end_inset
+
+ and
+\begin_inset Formula $\epsilon$
+\end_inset
+
+ are small constants that reflect the upper and lower errors due to rounding or truncation.
+ If
+\begin_inset Formula $\log^{\prime}x$
+\end_inset
+
+ denotes the result of the calculations,
+ show that after
+\begin_inset Formula $k$
+\end_inset
+
+ steps we have
+\begin_inset Formula
+\[
+\log_{10}x+2\log_{10}(1-\delta)-1/2^{k}<\log^{\prime}x\leq\log_{10}x+2\log_{10}(1+\epsilon).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We first prove by induction that
+\begin_inset Formula
+\[
+x^{2^{k}}(1-\delta)^{2^{k+1}-1}\leq10^{2^{k}(n+b_{1}/2+\dots+b_{k}/2^{k})}x'_{k}\leq x^{2^{k}}(1+\epsilon)^{2^{k+1}-1}.
+\]
+
+\end_inset
+
+For
+\begin_inset Formula $k=0$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $x(1-\delta)\leq10^{n}x'_{0}\leq x(1+\epsilon)$
+\end_inset
+
+,
+ which is given.
+ If this holds up to a certain
+\begin_inset Formula $k$
+\end_inset
+
+,
+ then if
+\begin_inset Formula $(x'_{k})^{2}<10$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $b_{k+1}=0$
+\end_inset
+
+,
+
+\begin_inset Formula $(1-\delta)(x'_{k})^{2}\leq x'_{k+1}\leq(1+\epsilon)(x'_{k})^{2}$
+\end_inset
+
+ and
+\begin_inset Formula
+\begin{eqnarray*}
+x^{2^{k+1}}(1-\delta)^{2^{k+2}-1} & = & (x^{2^{k+1}}(1-\delta)^{2^{k+1}-1})^{2}(1-\delta)\\
+ & \leq & (10^{2^{k}(n+b_{1}/2+\dots+b_{k}/2^{k})}x'_{k})^{2}(1-\delta)\\
+ & \leq & 10^{2^{k+1}(n+b_{1}/2+\dots+b_{k}/2^{k}+b_{k+1}/2^{k+1})}x'_{k+1}\\
+ & \leq & (10^{2^{k}(n+b_{1}/2+\dots+b_{k}/2^{k})}x'_{k})^{2}(1+\epsilon)\\
+ & \leq & (x^{2^{k}}(1+\epsilon)^{2^{k+1}-1})^{2}(1+\epsilon)=x^{2^{k+1}}(1+\epsilon)^{2^{k+2}-1}.
+\end{eqnarray*}
+
+\end_inset
+
+If
+\begin_inset Formula $(x'_{k})^{2}\geq10$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $b_{k+1}=1$
+\end_inset
+
+,
+
+\begin_inset Formula $(1-\delta)(x'_{k})^{2}\leq10x'_{k+1}\leq(1+\epsilon)(x'_{k})^{2}$
+\end_inset
+
+ and
+\begin_inset Formula
+\begin{eqnarray*}
+x^{2^{k+1}}(1-\delta)^{2^{k+2}-1} & \leq & (10^{2^{k}(n+b_{1}/2+\dots+b_{k}/2^{k})}x'_{k})^{2}(1-\delta)\\
+ & \leq & 10^{2^{k+1}(n+b_{1}/2+\dots+b_{k}/2^{k})}10x'_{k+1}\\
+ & = & 10^{2^{k+1}(n+b_{1}/2+\dots+b_{k}/2^{k}+b_{k+1}/2^{k+1})}x'_{k+1}\\
+ & \leq & (10^{2^{k}(n+b_{1}/2+\dots+b_{k}/2^{k})}x'_{k})^{2}(1+\epsilon)\\
+ & \leq & x^{2^{k+1}}(1+\epsilon)^{2^{k+2}-1}.
+\end{eqnarray*}
+
+\end_inset
+
+Then,
+ by taking logarithms on the expression,
+ we get
+\begin_inset Formula
+\[
+2^{k}\log x+(2^{k+1}-1)\log(1-\delta)\leq2^{k}\log^{\prime}x+\log x'_{k}\leq2^{k}\log x+(2^{k+1}-1)\log(1+\epsilon).
+\]
+
+\end_inset
+
+Finally,
+ subtracting
+\begin_inset Formula $\log x'_{k}$
+\end_inset
+
+ from all sides,
+ using that
+\begin_inset Formula $-1<-\log(1-\delta)-\log x'_{k}=-\log(x'_{k}(1-\delta))$
+\end_inset
+
+,
+ because
+\begin_inset Formula $x'_{k}(1-\delta)<10$
+\end_inset
+
+,
+ using that
+\begin_inset Formula $-\log(1+\epsilon)-\log x'_{k}=-\log(x'_{k}(1+\epsilon))\leq0$
+\end_inset
+
+,
+ because
+\begin_inset Formula $x'_{k}(1+\epsilon)\geq1$
+\end_inset
+
+,
+ and dividing everything by
+\begin_inset Formula $2^{k}$
+\end_inset
+
+,
+ we get
+\begin_inset Formula
+\[
+\log x+2\log(1-\delta)-\frac{1}{2^{k}}<\log^{\prime}x\leq\log x+2\log(1+\epsilon),
+\]
+
+\end_inset
+
+which is precisely what we wanted to prove.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.3.lyx b/1.2.3.lyx
new file mode 100644
index 0000000..0648fc2
--- /dev/null
+++ b/1.2.3.lyx
@@ -0,0 +1,1732 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[10]
+\end_layout
+
+\end_inset
+
+The text says that
+\begin_inset Formula $a_{1}+a_{2}+\dots+a_{0}=0$
+\end_inset
+
+.
+ What then,
+ is
+\begin_inset Formula $a_{2}+\dots+a_{0}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We could set that to be
+\begin_inset Formula $-a_{1}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[01]
+\end_layout
+
+\end_inset
+
+What does the notation
+\begin_inset Formula $\sum_{1\leq j\leq n}a_{j}$
+\end_inset
+
+ mean,
+ if
+\begin_inset Formula $n=3.14$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $a_{1}+a_{2}+a_{3}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[13]
+\end_layout
+
+\end_inset
+
+Without using the
+\begin_inset Formula $\sum$
+\end_inset
+
+-notation,
+ write out the equivalent of
+\begin_inset Formula
+\[
+\sum_{0\leq n\leq5}\frac{1}{2n+1},
+\]
+
+\end_inset
+
+and also the equivalent of
+\begin_inset Formula
+\[
+\sum_{0\leq n^{2}\leq5}\frac{1}{2n^{2}+1}.
+\]
+
+\end_inset
+
+Explain why the two results are different,
+ in spite of rule (b).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{eqnarray*}
+\sum_{0\leq n\leq5}\frac{1}{2n+1} & = & \frac{1}{1}+\frac{1}{3}+\frac{1}{5}+\frac{1}{7}+\frac{1}{9}+\frac{1}{11},\\
+\sum_{0\leq n^{2}\leq5}\frac{1}{2n^{2}+1} & = & \frac{1}{9}+\frac{1}{3}+\frac{1}{1}+\frac{1}{3}+\frac{1}{9},
+\end{eqnarray*}
+
+\end_inset
+
+as the integers with
+\begin_inset Formula $0\leq n^{2}\leq5$
+\end_inset
+
+ are
+\begin_inset Formula $\{-2,-1,0,1,2\}$
+\end_inset
+
+.
+ Rule (b) states that a permutation of the integers satisfying the condition doesn't alter the result,
+ but because
+\begin_inset Formula $n\mapsto n^{2}$
+\end_inset
+
+ is not a permutation of such
+\emph on
+integers
+\emph default
+,
+ the rule doesn't apply.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[10]
+\end_layout
+
+\end_inset
+
+Without using the
+\begin_inset Formula $\sum$
+\end_inset
+
+-notation,
+ write out the equivalent of each side of Eq.
+ (10) as a sum of sums for the case
+\begin_inset Formula $n=3$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $a_{11}+a_{21}+a_{22}+a_{31}+a_{32}+a_{33}=a_{11}+a_{21}+a_{31}+a_{22}+a_{32}+a_{33}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[HM20]
+\end_layout
+
+\end_inset
+
+Prove that rule (a) is valid for arbitrary infinite series,
+ provided that the series converge.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Since infinite series are defined for cases where the total number of nonzero elements is at most countable,
+ we might assume that the series are indexed by positive integers.
+ Thus,
+ we'd have to prove that
+\begin_inset Formula
+\[
+\left(\sum_{i=1}^{\infty}a_{i}\right)\left(\sum_{j=1}^{\infty}b_{j}\right)=\sum_{i=1}^{\infty}\sum_{j=1}^{\infty}a_{i}b_{j},
+\]
+
+\end_inset
+
+assuming that the relevant series converge.
+ We have
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\[
+\left(\sum_{i=0}^{\infty}a_{i}\right)\left(\sum_{j=0}^{\infty}b_{j}\right)=\sum_{i=0}^{\infty}\left(a_{i}\sum_{j=0}^{\infty}b_{j}\right)=\sum_{i=0}^{\infty}\sum_{j=0}^{\infty}b_{j},
+\]
+
+\end_inset
+
+by entering the second series as a constant into the first series (because it converges) and then entering the element of the first series,
+ considered as a constant,
+ into the inner series.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[05]
+\end_layout
+
+\end_inset
+
+Is the derivation of Eq.
+ (14) valid even if
+\begin_inset Formula $n=-1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The result is
+\begin_inset Formula
+\[
+\sum_{0\leq j\leq-1}ax^{j}=0=a\left(\frac{1-x^{0}}{1-x}\right),
+\]
+
+\end_inset
+
+which is correct.
+ However,
+ the derivation is not correct as the rule (d) cannot be applied,
+ because the applications in the derivation assume
+\begin_inset Formula $n\geq0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc10[05]
+\end_layout
+
+\end_inset
+
+Is the derivation of Eq.
+ (14) valid even if
+\begin_inset Formula $n=-2$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+No (see previous exercise).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc11[03]
+\end_layout
+
+\end_inset
+
+What should the right-hand side of Eq.
+ (14) be if
+\begin_inset Formula $x=1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Mere substitution in the original formula yields an undefined result,
+ but it's clear that
+\begin_inset Formula
+\[
+\sum_{0\leq j\leq n}a\cdot1^{j}=\sum_{0\leq j\leq n}a=(n+1)a.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc12[10]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $1+\frac{1}{7}+\frac{1}{49}+\frac{1}{343}+\dots+\left(\frac{1}{7}\right)^{n}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+By Eq.
+ (14),
+ this is
+\begin_inset Formula
+\[
+\sum_{k=0}^{n}\left(\frac{1}{7}\right)^{k}=\left(\frac{1-\left(\frac{1}{7}\right)^{n+1}}{1-\frac{1}{7}}\right)=\frac{1-\left(\frac{1}{7}\right)^{n+1}}{\frac{6}{7}}=\frac{7}{6}\left(1-\frac{1}{7^{n+1}}\right).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc13[10]
+\end_layout
+
+\end_inset
+
+Using Eq.
+ (15) and assuming that
+\begin_inset Formula $m\leq n$
+\end_inset
+
+,
+ evaluate
+\begin_inset Formula $\sum_{j=m}^{n}j$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{multline*}
+\sum_{m\leq j\leq n}j=\sum_{m\leq j+m\leq n}(j+m)=\sum_{0\leq j\leq n-m}(m+j)=\\
+=m(n-m+1)+\frac{1}{2}(n-m)(n-m+1)=\frac{1}{2}(n(n+1)-m(m-1)).
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc14[11]
+\end_layout
+
+\end_inset
+
+Using the result of the previous exercise,
+ evaluate
+\begin_inset Formula $\sum_{j=m}^{n}\sum_{k=r}^{s}jk$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{multline*}
+\sum_{j=m}^{n}\sum_{k=r}^{s}jk=\left(\sum_{j=m}^{n}j\right)\left(\sum_{k=r}^{s}k\right)=\\
+=\frac{1}{4}(n(n+1)-m(m-1))(s(s+1)-r(r-1)).
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc15[M22]
+\end_layout
+
+\end_inset
+
+Compute the sum
+\begin_inset Formula $1\times2+2\times2^{2}+3\times2^{3}+\dots+n\times2^{n}$
+\end_inset
+
+ for small values of
+\begin_inset Formula $n$
+\end_inset
+
+.
+ Do you see the pattern developing in these numbers?
+ If not,
+ discover it by manipulations similar to those leading up to Eq.
+ (14).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $\tau(n)$
+\end_inset
+
+ be such a such sum
+\begin_inset Formula
+\begin{align*}
+\tau(1) & =2, & \tau(2) & =2+8=10, & \tau(3) & =10+24=34,\\
+\tau(4) & =34+64=98, & \tau(5) & =98+160=258, & & \dots
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Now,
+\begin_inset Formula
+\begin{align*}
+\tau(n) & =\sum_{1\leq k\leq n}k2^{k} & & \text{by definition}\\
+ & =\sum_{0\leq k\leq n-1}(k+1)2^{k+1} & & \text{by rule (b)}\\
+ & =2\sum_{0\leq k\leq n-1}(k+1)2^{k} & & \text{by a special case of (a)}\\
+ & =2\left(\sum_{0\leq k\leq n-1}k2^{k}+\sum_{0\leq k\leq n-1}2^{k}\right) & & \text{by rule (c)}\\
+ & =2\left(\sum_{0\leq k\leq n}k2^{k}-n2^{n}+(2^{n}-1)\right) & & \text{by rule (d) and Eq. (14)}\\
+ & =2\left(\sum_{1\leq k\leq n}k2^{k}-n2^{n}+(2^{n}-1)\right) & & \text{by rule (d)}
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+This means
+\begin_inset Formula $\tau(n)=2(\tau(n)-n2^{n}+2^{n}-1)=2\tau(n)-n2^{n+1}+2^{n+1}-2$
+\end_inset
+
+,
+ so
+\begin_inset Formula
+\[
+\tau(n)=n2^{n+1}-2^{n+1}+2=(n-1)2^{n+1}+2.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[M00]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $S$
+\end_inset
+
+ be a set of integers.
+ What is
+\begin_inset Formula $\sum_{j\in S}1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $|S|$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc20[25]
+\end_layout
+
+\end_inset
+
+Dr.
+ I.
+ J.
+ Matrix has observed a remarkable sequence of formulas:
+\begin_inset Formula
+\begin{align*}
+9\times1+2 & =11, & 9\times12+3 & =111,\\
+9\times123+4 & =1111, & 9\times1234+5 & =11111.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Write the good doctor's great discovery in terms of the
+\begin_inset Formula $\sum$
+\end_inset
+
+-notation.
+\end_layout
+
+\begin_layout Enumerate
+Your answer to part (a) undoubtedly involves the number 10 as base of the decimal system;
+ generalize this formula so that you get a formula that will perhaps work in any base
+\begin_inset Formula $b$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Prove your formula from part (b) by using formulas derived in the text or in exercise 16 above.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+For
+\begin_inset Formula $n\geq1$
+\end_inset
+
+,
+
+\begin_inset Formula
+\[
+9\sum_{j=0}^{n-1}10^{j}(n-j)+n+1=\sum_{j=0}^{n}10^{j}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula
+\[
+(b-1)\sum_{j=0}^{n-1}b^{j}(n-j)+n+1=\sum_{j=0}^{n}b^{j}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+We have
+\begin_inset Formula
+\begin{eqnarray*}
+\sum_{j=0}^{n-1}b^{j}(n-j) & = & n\sum_{j=0}^{n-1}b^{j}-\sum_{j=0}^{n-1}jb^{j}\\
+ & = & n\frac{1-b^{n}}{1-b}-\frac{(n-1)b^{n+1}-nb^{n}+b}{(b-1)^{2}}\\
+ & = & n\frac{b^{n}-1}{b-1}-\frac{(n-1)b^{n+1}-nb^{n}+b}{(b-1)^{2}},
+\end{eqnarray*}
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{align*}
+ & (b-1)\sum_{j=0}^{n-1}b^{j}(n-j)+n+1\\
+ & =n(b^{n}-1)-\frac{(n-1)b^{n+1}-nb^{n}+b}{b-1}+n+1\\
+ & =\frac{n(b^{n}-1)(b-1)-(n-1)b^{n+1}+nb^{n}-b+n(b-1)+b-1}{b-1}\\
+ & =\frac{nb^{n+1}-nb^{n}-nb+n-nb^{n+1}+b^{n+1}+nb^{n}-b+nb-n+b-1}{b-1}\\
+ & =\frac{b^{n+1}-1}{b-1}=\frac{1-b^{n+1}}{b-1}=\sum_{j=0}^{n}b^{j}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc21[M25]
+\end_layout
+
+\end_inset
+
+Derive rule (d) from (8) and (17).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{multline*}
+\sum_{R(j)}a_{j}+\sum_{S(j)}a_{j}=\sum_{j}a_{j}[R(j)]+\sum_{j}a_{j}[S(j)]=\sum_{j}a_{j}([R(j)]+[S(j)])=\\
+\sum_{j}a_{j}([R(j)\lor S(j)]+[R(j)\land S(j)])=\sum_{R(j)\lor S(j)}a_{j}+\sum_{R(j)\land S(j)}a_{j}.
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[20]
+\end_layout
+
+\end_inset
+
+State the appropriate analogs of Eqs.
+ (5),
+ (7),
+ (8),
+ and (11) for
+\emph on
+products
+\emph default
+ instead of sums.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{align*}
+\prod_{R(i)}a_{i} & =\prod_{R(j)}a_{j}=\prod_{R(p(j))}a_{p(j)}, & \prod_{R(i)}\prod_{S(j)}a_{ij} & =\prod_{S(j)}\prod_{R(i)}a_{ij},\\
+\prod_{R(i)}b_{i}c_{i} & =\prod_{R(i)}b_{i}+\prod_{R(i)}c_{i}, & \prod_{R(j)}a_{j}\prod_{S(j)}a_{j} & =\prod_{R(j)\lor S(j)}a_{j}\prod_{R(j)\land S(j)}a_{j}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc23[10]
+\end_layout
+
+\end_inset
+
+Explain why it is a good idea to define
+\begin_inset Formula $\sum_{R(j)}a_{j}$
+\end_inset
+
+ and
+\begin_inset Formula $\prod_{R(j)}a_{j}$
+\end_inset
+
+ as zero and one,
+ respectively,
+ when no integers satisfy
+\begin_inset Formula $R(j)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Zero and one are the neutral terms for sum and product,
+ respectively,
+ so by defining it this way,
+ rule (d) (among others) applies independently of whether there are integers satisfying the properties or not.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc25[15]
+\end_layout
+
+\end_inset
+
+Consider the following derivation;
+ is anything amiss?
+\begin_inset Formula
+\[
+\left(\sum_{i=1}^{n}a_{i}\right)\left(\sum_{j=1}^{n}\frac{1}{a_{j}}\right)=\sum_{1\leq i\leq n}\sum_{1\leq j\leq n}\frac{a_{i}}{a_{j}}=\sum_{1\leq i\leq n}\sum_{1\leq i\leq n}\frac{a_{i}}{a_{i}}=\sum_{i=1}^{n}1=n.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First,
+ the change of variable on the second equality is invalid since it changes to a bound variable,
+ not to a free variable.
+ Second,
+ it then converts the double summation into a single summation,
+ which is invalid too.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc29[M30]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Express
+\begin_inset Formula $\sum_{i=0}^{n}\sum_{j=0}^{i}\sum_{k=0}^{j}a_{i}a_{j}a_{k}$
+\end_inset
+
+ in terms of the multiple-sum notation explained at the end of the section.
+\end_layout
+
+\begin_layout Enumerate
+Express the same sum in terms of
+\begin_inset Formula $\sum_{i=0}^{n}a_{i}$
+\end_inset
+
+,
+
+\begin_inset Formula $\sum_{i=0}^{n}a_{i}^{2}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\sum_{i=0}^{n}a_{i}^{3}$
+\end_inset
+
+ [see Eq.
+ (13)].
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula
+\[
+\sum_{0\leq k\leq j\leq i\leq n}a_{i}a_{j}a_{k}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+\noindent
+We have
+\begin_inset Formula
+\begin{align*}
+S & :=\sum_{i=0}^{n}\sum_{j=0}^{i}\sum_{k=0}^{j}a_{i}a_{j}a_{k}=\sum_{i=0}^{n}\sum_{j=0}^{i}\sum_{k=j}^{i}a_{i}a_{j}a_{k}\\
+ & =\sum_{i=0}^{n}\sum_{j=i}^{n}\sum_{k=0}^{i}a_{i}a_{j}a_{k}=\sum_{i=0}^{n}\sum_{j=0}^{i}\sum_{k=i}^{n}a_{i}a_{j}a_{k}\\
+ & =\sum_{i=0}^{n}\sum_{j=i}^{n}\sum_{k=i}^{j}a_{i}a_{j}a_{k}=\sum_{i=0}^{n}\sum_{j=i}^{n}\sum_{k=j}^{n}a_{i}a_{j}a_{k}.
+\end{align*}
+
+\end_inset
+
+Thus,
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bgroup
+\backslash
+small
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{eqnarray*}
+6S & = & \sum_{i=0}^{n}\sum_{j=0}^{i}\left(\sum_{k=0}^{j}a_{i}a_{j}a_{k}+\sum_{k=j}^{i}a_{i}a_{j}a_{k}+\sum_{k=i}^{n}a_{i}a_{j}a_{k}\right)\\
+ & & +\sum_{i=0}^{n}\sum_{j=i}^{n}\left(\sum_{k=0}^{i}a_{i}a_{j}a_{k}+\sum_{k=i}^{j}a_{i}a_{j}a_{k}+\sum_{i=j}^{n}a_{i}a_{j}a_{k}\right)\\
+ & = & \sum_{i=0}^{n}\left(\sum_{j=0}^{i}\left(\sum_{k=0}^{n}a_{i}a_{j}a_{k}+a_{i}a_{j}^{2}+a_{i}^{2}a_{j}\right)+\sum_{j=i}^{n}\left(\sum_{k=0}^{n}a_{i}a_{j}a_{k}+a_{i}a_{j}^{2}+a_{j}^{2}a_{i}\right)\right)\\
+ & = & \sum_{i=0}^{n}\left(\sum_{j=0}^{n}\left(\sum_{k=0}^{n}a_{i}a_{j}a_{k}+a_{i}a_{j}^{2}+a_{i}^{2}a_{j}\right)+\sum_{k=0}^{n}a_{i}^{2}a_{k}+a_{i}^{3}+a_{i}^{3}\right)\\
+ & = & \sum_{i=0}^{n}\sum_{j=0}^{n}\sum_{k=0}^{n}a_{i}a_{j}a_{k}+\sum_{i=0}^{n}\sum_{j=0}^{n}a_{i}a_{j}^{2}+\sum_{i=0}^{n}\sum_{j=0}^{n}a_{i}^{2}a_{j}+\sum_{i=0}^{n}\sum_{k=0}^{n}a_{i}^{2}a_{k}+2\sum_{i=0}^{n}a_{i}^{3}\\
+ & = & \left(\sum_{i=0}^{n}a_{i}\right)^{3}+\left(\sum_{i=0}^{n}a_{i}\right)\left(\sum_{i=0}^{n}a_{i}^{2}\right)+\left(\sum_{i=0}^{n}a_{i}^{2}\right)\left(\sum_{i=0}^{n}a_{i}\right)\\
+ & & +\left(\sum_{i=0}^{n}a_{i}^{2}\right)\left(\sum_{i=0}^{n}a_{i}\right)+2\sum_{i=0}^{n}a_{i}^{3}\\
+ & = & \left(\sum_{i=0}^{n}a_{i}\right)^{3}+3\left(\sum_{i=0}^{n}a_{i}\right)\left(\sum_{i=0}^{n}a_{i}^{2}\right)+2\left(\sum_{i=0}^{n}a_{i}^{3}\right).
+\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+egroup
+\end_layout
+
+\end_inset
+
+This means
+\begin_inset Formula
+\[
+S=\frac{1}{6}\left(\sum_{i=0}^{n}a_{i}\right)^{3}+\frac{1}{2}\left(\sum_{i=0}^{n}a_{i}\right)\left(\sum_{i=0}^{n}a_{i}^{2}\right)+\frac{1}{3}\left(\sum_{i=0}^{n}a_{i}^{3}\right).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc30[M23]
+\end_layout
+
+\end_inset
+
+(J.
+ Binet,
+ 1812.) Without using induction,
+ prove the identity
+\begin_inset Formula
+\[
+\left(\sum_{j=1}^{n}a_{j}x_{j}\right)\left(\sum_{j=1}^{n}b_{j}y_{j}\right)=\left(\sum_{j=1}^{n}a_{j}y_{j}\right)\left(\sum_{j=1}^{n}b_{j}x_{j}\right)+\sum_{1\leq j<k\leq n}(a_{j}b_{k}-a_{k}b_{j})(x_{j}y_{k}-x_{k}y_{j}).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{eqnarray*}
+\left(\sum_{j=1}^{n}a_{j}x_{j}\right)\left(\sum_{j=1}^{n}b_{j}y_{j}\right) & = & \sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}x_{i}y_{j}\\
+ & = & \sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}(x_{j}y_{i}-x_{j}y_{i}+x_{i}y_{j})\\
+ & = & \sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}x_{j}y_{i}+\sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i})\\
+ & = & \left(\sum_{j=1}^{n}a_{j}y_{j}\right)\left(\sum_{j=1}^{n}b_{j}x_{j}\right)+\sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i}),
+\end{eqnarray*}
+
+\end_inset
+
+but
+\begin_inset Formula
+\begin{eqnarray*}
+\sum_{i=1}^{n}\sum_{j=1}^{n}a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i}) & = & \sum_{1\leq j<i\leq n}a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i})+\sum_{1\leq i<j\leq n}a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i})\\
+ & = & \sum_{1\leq i<j\leq n}(a_{j}b_{i}(x_{j}y_{i}-x_{i}y_{j})+a_{i}b_{j}(x_{i}y_{j}-x_{j}y_{i}))\\
+ & = & \sum_{1\leq j<k\leq n}(a_{j}b_{k}-a_{k}b_{j})(x_{j}y_{k}-x_{k}y_{j}).
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc33[M30]
+\end_layout
+
+\end_inset
+
+One evening Dr.
+ Matrix discovered some formulas that might even be classed as more remarkable than those of exercise 20:
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Formula
+\begin{align*}
+\frac{1}{(a-b)(a-c)}+\frac{1}{(b-a)(b-c)}+\frac{1}{(c-a)(c-b)} & =0,\\
+\frac{a}{(a-b)(a-c)}+\frac{b}{(b-a)(b-c)}+\frac{c}{(c-a)(c-b)} & =0,\\
+\frac{a^{2}}{(a-b)(a-c)}+\frac{b^{2}}{(b-a)(b-c)}+\frac{c^{2}}{(c-a)(c-b)} & =1,\\
+\frac{a^{3}}{(a-b)(a-c)}+\frac{b^{3}}{(b-a)(b-c)}+\frac{c^{3}}{(c-a)(c-b)} & =a+b+c.
+\end{align*}
+
+\end_inset
+
+Prove that these formulas are a special case of a general law;
+ let
+\begin_inset Formula $x_{1},x_{2},\dots,x_{n}$
+\end_inset
+
+ be distinct numbers,
+ and show that
+\begin_inset Formula
+\[
+\sum_{j=1}^{n}\Bigg(x_{j}^{r}\Bigg/\prod_{\begin{subarray}{c}
+1\leq k\leq n\\
+k\neq j
+\end{subarray}}(x_{j}-x_{k})\Bigg)=\begin{cases}
+0, & \text{if }0\leq r<n-1;\\
+1, & \text{if }r=n-1;\\
+{\textstyle \sum_{j=1}^{n}x_{j}}, & \text{if }r=n.
+\end{cases}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc37[M24]
+\end_layout
+
+\end_inset
+
+Show that the determinant of Vandermonde's matrix is
+\begin_inset Formula
+\[
+\prod_{1\leq j\leq n}x_{j}\prod_{1\leq i<j\leq n}(x_{j}-x_{i}).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We show this by induction.
+ For
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+ this is obvious.
+ For
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+ assuming this holds for
+\begin_inset Formula $n-1$
+\end_inset
+
+,
+ subtracting from each row the previous one multiplied by
+\begin_inset Formula $x_{1}$
+\end_inset
+
+,
+ expanding by cofactors,
+ factoring out,
+ and applying the induction hypothesis,
+ we have
+\begin_inset Formula
+\begin{eqnarray*}
+\left|\begin{array}{cccc}
+x_{1} & x_{2} & \cdots & x_{n}\\
+x_{1}^{2} & x_{2}^{2} & \cdots & x_{n}^{2}\\
+\vdots & \vdots & & \vdots\\
+x_{1}^{n} & x_{2}^{n} & \cdots & x_{n}^{n}
+\end{array}\right| & = & \left|\begin{array}{cccc}
+x_{1} & x_{2} & \cdots & x_{n}\\
+0 & x_{2}(x_{2}-x_{1}) & \cdots & x_{n}(x_{n}-x_{1})\\
+\vdots & \vdots & & \vdots\\
+0 & x_{2}^{n-1}(x_{2}-x_{1}) & \cdots & x_{n}^{n-1}(x_{n}-x_{1})
+\end{array}\right|\\
+ & = & x_{1}\left|\begin{array}{ccc}
+x_{2}(x_{2}-x_{1}) & \cdots & x_{n}(x_{n}-x_{1})\\
+\vdots & & \vdots\\
+x_{2}^{n-1}(x_{2}-x_{1}) & \cdots & x_{n}^{n-1}(x_{n}-x_{1})
+\end{array}\right|\\
+ & = & x_{1}(x_{2}-x_{1})\cdots(x_{n}-x_{1})\left|\begin{array}{ccc}
+x_{2} & \cdots & x_{n}\\
+\vdots & & \vdots\\
+x_{2}^{n-1} & \cdots & x_{n}^{n-1}
+\end{array}\right|\\
+ & = & x_{1}\prod_{2\leq j\leq n}(x_{j}-x_{1})\prod_{2\leq j\leq n}x_{j}\prod_{2\leq i<j\leq n}(x_{j}-x_{i})\\
+ & = & \prod_{1\leq j\leq n}x_{j}\prod_{1\leq i<j\leq n}(x_{j}-x_{i}).
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc38[M25]
+\end_layout
+
+\end_inset
+
+Show that the determinant of Cauchy's matrix is
+\begin_inset Formula
+\[
+\prod_{1\leq i<j\leq n}(x_{j}-x_{i})(y_{j}-y_{i})\Bigg/\prod_{1\leq i,j\leq n}(x_{i}+y_{j}).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove it by induction.
+ For
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+ this is obvious.
+ Now assume
+\begin_inset Formula $n>1$
+\end_inset
+
+ and that the hypothesis holds for
+\begin_inset Formula $n-1$
+\end_inset
+
+.
+ Multiplying each row
+\begin_inset Formula $i$
+\end_inset
+
+ by
+\begin_inset Formula $\frac{x_{1}+y_{1}}{x_{i}+y_{1}}$
+\end_inset
+
+ times the first row,
+ we get
+\begin_inset Formula
+\begin{multline*}
+\left|\begin{array}{cccc}
+\frac{1}{x_{1}+y_{1}} & \frac{1}{x_{1}+y_{2}} & \cdots & \frac{1}{x_{1}+y_{n}}\\
+\frac{1}{x_{2}+y_{1}} & \frac{1}{x_{2}+y_{2}} & \cdots & \frac{1}{x_{2}+y_{n}}\\
+\vdots & \vdots & & \vdots\\
+\frac{1}{x_{n}+y_{1}} & \frac{1}{x_{n}+y_{2}} & \cdots & \frac{1}{x_{n}+y_{n}}
+\end{array}\right|=\\
+=\left|\begin{array}{cccc}
+\frac{1}{x_{1}+y_{1}} & \frac{1}{x_{1}+y_{2}} & \cdots & \frac{1}{x_{1}+y_{n}}\\
+0 & \frac{1}{x_{2}+y_{2}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{2})(x_{2}+y_{1})} & \cdots & \frac{1}{x_{2}+y_{n}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{n})(x_{2}+y_{1})}\\
+\vdots & \vdots & & \vdots\\
+0 & \frac{1}{x_{n}+y_{2}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{2})(x_{n}+y_{1})} & \cdots & \frac{1}{x_{n}+y_{n}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{n})(x_{n}+y_{1})}
+\end{array}\right|=\\
+=\frac{1}{x_{1}+y_{1}}\left|\begin{array}{ccc}
+\frac{1}{x_{2}+y_{2}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{2})(x_{2}+y_{1})} & \cdots & \frac{1}{x_{2}+y_{n}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{n})(x_{2}+y_{1})}\\
+\vdots & & \vdots\\
+\frac{1}{x_{n}+y_{2}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{2})(x_{n}+y_{1})} & \cdots & \frac{1}{x_{n}+y_{n}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{n})(x_{n}+y_{1})}
+\end{array}\right|.
+\end{multline*}
+
+\end_inset
+
+Now,
+\begin_inset Formula
+\begin{multline*}
+\frac{1}{x_{i}+y_{j}}-\frac{x_{1}+y_{1}}{(x_{1}+y_{j})(x_{i}+y_{1})}=\frac{(x_{1}+y_{j})(x_{i}+y_{1})-(x_{1}+y_{1})(x_{i}+y_{j})}{(x_{i}+y_{j})(x_{1}+y_{j})(x_{i}+y_{1})}=\\
+=\frac{1}{x_{i}+y_{j}}\frac{x_{1}y_{1}+x_{i}y_{j}-x_{1}y_{j}-x_{i}y_{1}}{(x_{1}+y_{j})(x_{i}+y_{1})}=\frac{1}{x_{i}+y_{j}}\frac{(x_{i}-x_{1})(y_{j}-y_{1})}{(x_{1}+y_{j})(x_{i}+y_{1})},
+\end{multline*}
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{multline*}
+\left|\begin{array}{cccc}
+\frac{1}{x_{1}+y_{1}} & \frac{1}{x_{1}+y_{2}} & \cdots & \frac{1}{x_{1}+y_{n}}\\
+\frac{1}{x_{2}+y_{1}} & \frac{1}{x_{2}+y_{2}} & \cdots & \frac{1}{x_{2}+y_{n}}\\
+\vdots & \vdots & & \vdots\\
+\frac{1}{x_{n}+y_{1}} & \frac{1}{x_{n}+y_{2}} & \cdots & \frac{1}{x_{n}+y_{n}}
+\end{array}\right|=\\
+=\frac{1}{x_{1}+y_{1}}\left|\begin{array}{ccc}
+\frac{1}{x_{2}+y_{2}}\frac{(x_{2}-x_{1})(y_{2}-y_{1})}{(x_{1}+y_{2})(x_{2}+y_{1})} & \cdots & \frac{1}{x_{2}+y_{n}}\frac{(x_{2}-x_{1})(y_{n}-y_{1})}{(x_{1}+y_{n})(x_{2}+y_{1})}\\
+\vdots & & \vdots\\
+\frac{1}{x_{n}+y_{2}}\frac{(x_{n}-x_{1})(y_{2}-y_{1})}{(x_{1}+y_{2})(x_{n}+y_{1})} & \cdots & \frac{1}{x_{n}+y_{n}}\frac{(x_{n}-x_{1})(y_{n}-y_{1})}{(x_{1}+y_{n})(x_{n}+y_{1})}
+\end{array}\right|=\\
+=\frac{1}{x_{1}+y_{1}}\prod_{i=2}^{n}\frac{x_{i}-x_{1}}{x_{i}+y_{1}}\prod_{j=2}^{n}\frac{y_{j}-y_{1}}{x_{1}+y_{j}}\left|\begin{array}{ccc}
+\frac{1}{x_{2}+y_{2}} & \cdots & \frac{1}{x_{2}+y_{n}}\\
+\vdots & & \vdots\\
+\frac{1}{x_{n}+y_{2}} & \cdots & \frac{1}{x_{n}+y_{n}}
+\end{array}\right|=\\
+=\frac{\prod_{j=2}^{n}(x_{j}-x_{1})(y_{j}-y_{1})}{(x_{1}+y_{1})\prod_{i=2}^{n}(x_{j}+y_{1})\prod_{j=2}^{n}(x_{1}+y_{j})}\frac{\prod_{2\leq i<j\leq n}(x_{j}-x_{i})(y_{j}-y_{i})}{\prod_{2\leq i,j\leq n}(x_{i}+y_{j})}=\\
+=\prod_{1\leq i<j\leq n}(x_{j}-x_{i})(y_{j}-y_{i})\Bigg/\prod_{1\leq i,j\leq n}(x_{i}+y_{j}).
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc45[M25]
+\end_layout
+
+\end_inset
+
+A
+\emph on
+Hilbert matrix
+\emph default
+,
+ sometimes called an
+\begin_inset Formula $n\times n$
+\end_inset
+
+ segment of
+\emph on
+the
+\emph default
+ (infinite) Hilbert matrix,
+ is a matrix for which
+\begin_inset Formula $a_{ij}=1/(i+j-1)$
+\end_inset
+
+.
+ Show that this is a special case of Cauchy's matrix,
+ find its inverse,
+ show that each element of the inverse is an integer and show that the sum of all elements of the inverse is
+\begin_inset Formula $n^{2}$
+\end_inset
+
+.
+ The solution to this problem requires an elementary knowledge of factorial and binomial coefficients,
+ which are discussed in sections 1.2.5 and 1.2.6.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Clearly this is the Cauchy's matrix
+\begin_inset Formula $a_{ij}=1/(x_{i}+y_{j})$
+\end_inset
+
+ where
+\begin_inset Formula $x_{i}=i$
+\end_inset
+
+ and
+\begin_inset Formula $y_{j}=j-1$
+\end_inset
+
+.
+ Then the elements of the inverse,
+ by exercise 41,
+ are given by
+\begin_inset Formula
+\begin{align*}
+b_{ij} & =\left(\prod_{1\leq k\leq n}(x_{j}+y_{k})(x_{k}+y_{i})\right)\Bigg/(x_{j}+y_{i})\Bigg(\prod_{\begin{subarray}{c}
+1\leq k\leq n\\
+k\neq j
+\end{subarray}}(x_{j}-x_{k})\Bigg)\Bigg(\prod_{\begin{subarray}{c}
+1\leq k\leq n\\
+k\neq i
+\end{subarray}}(y_{i}-y_{k})\Bigg)\\
+ & =\left(\prod_{k}(j+k-1)(i+k-1)\right)\Bigg/(i+j-1)\Bigg(\prod_{k\neq j}(j-k)\Bigg)\Bigg(\prod_{k\neq i}(i-k)\Bigg)\\
+ & =\frac{(j+n-1)!(i+n-1)!}{(j-1)!(i-1)!}\bigg/(i+j-1)(-1)^{i+j}(n-j)!(j-1)!(n-i)!(i-1)!\\
+ & =(-1)^{i+j}\frac{(j+n-1)!(i+n-1)!}{(i+j-1)(n-j)!(n-i)!(j-1)!^{2}(i-1)!^{2}}.
+\end{align*}
+
+\end_inset
+
+We have used that
+\begin_inset Formula
+\begin{multline*}
+\prod_{k\neq j}(j-k)=(-1)^{n}\prod_{k\neq j}(k-j)=(-1)^{n}\prod_{j<k\leq n}(k-j)\prod_{1\leq k<j}(k-j)=\\
+=(-1)^{n+j}(n-j)!(j-1)!,
+\end{multline*}
+
+\end_inset
+
+and the same happens to
+\begin_inset Formula $i$
+\end_inset
+
+.
+ Then,
+\begin_inset Formula
+\begin{align*}
+b_{ij} & =\frac{(-1)^{i+j}ij}{i+j-1}\frac{(i+n-1)!(j+n-1)!}{i!(i-1)!(n-i)!j!(j-1)!(n-j)!}\\
+ & =\frac{(-1)^{i+j}ij}{i+j-1}\binom{n}{i}\frac{(i+n-1)!}{n!(i-1)!}\binom{n}{j}\frac{(j+n-1)!}{n!}\\
+ & =\frac{(-1)^{i+j}ij}{i+j-1}\binom{n}{i}\binom{i+n-1}{n}\binom{n}{j}\binom{j+n-1}{n}\\
+ & =\frac{(-1)^{i+j}ij}{i+j-1}\binom{n}{i}\binom{-i}{n}\binom{n}{j}\binom{-j}{n}\\
+ & =\frac{(-1)^{i+j}ij}{i+j-1}\binom{-j}{i}\binom{-j-i}{n-i}\binom{-i}{n}\binom{n}{j}\\
+ & =\frac{(-1)^{i+j}ij}{i+j-1}\binom{i+j-1}{i}\binom{n+j-1}{n-i}\binom{n+i-1}{n}\binom{n}{j}\\
+ & =(-1)^{i+j}\binom{i+j-2}{i-1}\binom{i+n-1}{i-1}\binom{j+n-1}{n-1}\binom{n}{j}\in\mathbb{Z}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Finally,
+ from exercise 44,
+\begin_inset Formula
+\[
+\sum_{i,j}b_{ij}=\sum_{i=1}^{n}i+\sum_{j=1}^{n}(j-1)=\frac{n(n+1)}{2}+\frac{n(n-1)}{2}=n^{2}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.4.lyx b/1.2.4.lyx
new file mode 100644
index 0000000..ed3730a
--- /dev/null
+++ b/1.2.4.lyx
@@ -0,0 +1,2433 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+What are
+\begin_inset Formula $\lfloor1.1\rfloor$
+\end_inset
+
+,
+
+\begin_inset Formula $\lfloor-1.1\rfloor$
+\end_inset
+
+,
+
+\begin_inset Formula $\lceil-1.1\rceil$
+\end_inset
+
+,
+
+\begin_inset Formula $\lfloor0.99999\rfloor$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\lfloor\lg35\rfloor$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\lfloor1.1\rfloor=1$
+\end_inset
+
+,
+
+\begin_inset Formula $\lfloor-1.1\rfloor=-2$
+\end_inset
+
+,
+
+\begin_inset Formula $\lceil-1.1\rceil=-1$
+\end_inset
+
+,
+
+\begin_inset Formula $\lfloor0.99999\rfloor=0$
+\end_inset
+
+,
+
+\begin_inset Formula $\lfloor\lg35\rfloor=5$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[01]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $\lceil\lfloor x\rfloor\rceil$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The same as
+\begin_inset Formula $\lfloor x\rfloor$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[10]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $n$
+\end_inset
+
+ be an integer,
+ and let
+\begin_inset Formula $x$
+\end_inset
+
+ be a real number.
+ Prove that
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\lfloor x\rfloor<n$
+\end_inset
+
+ if and only if
+\begin_inset Formula $x<n$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $n\leq\lfloor x\rfloor$
+\end_inset
+
+ if and only if
+\begin_inset Formula $n\leq x$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\lceil x\rceil\leq n$
+\end_inset
+
+ if and only if
+\begin_inset Formula $x\leq n$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $n<\lceil x\rceil$
+\end_inset
+
+ if and only if
+\begin_inset Formula $n<x$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\lfloor x\rfloor=n$
+\end_inset
+
+ if and only if
+\begin_inset Formula $x-1<n\leq x$
+\end_inset
+
+,
+ and if and only if
+\begin_inset Formula $n\leq x<n+1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\lceil x\rceil=n$
+\end_inset
+
+ if and only if
+\begin_inset Formula $x\leq n<x+1$
+\end_inset
+
+,
+ and if and only if
+\begin_inset Formula $n-1<x\leq n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+By contraposition,
+ if
+\begin_inset Formula $x\geq n$
+\end_inset
+
+,
+ then
+\begin_inset Formula $n$
+\end_inset
+
+ is an integer less than or equal to
+\begin_inset Formula $x$
+\end_inset
+
+ and so
+\begin_inset Formula $\lfloor x\rfloor\geq n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\lfloor x\rfloor\leq x<n$
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+It's the contrapositive of the previous statement.
+\end_layout
+
+\begin_layout Enumerate
+Derived from the previous statement replacing
+\begin_inset Formula $x$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ with
+\begin_inset Formula $-x$
+\end_inset
+
+ and
+\begin_inset Formula $-n$
+\end_inset
+
+ and using that
+\begin_inset Formula $\lfloor-x\rfloor=-\lceil x\rceil$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+It's the contrapositive of the previous statement.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Description
+\begin_inset Formula $1\implies2]$
+\end_inset
+
+ Obviously
+\begin_inset Formula $n=\lfloor x\rfloor\leq x$
+\end_inset
+
+,
+ and if
+\begin_inset Formula $x-1\geq n$
+\end_inset
+
+ then it would be
+\begin_inset Formula $x\geq n+1\in\mathbb{Z}$
+\end_inset
+
+ and
+\begin_inset Formula $\lfloor x\rfloor\geq n+1>n\#$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+\begin_inset Formula $2\implies3]$
+\end_inset
+
+ Multiply the inequality by
+\begin_inset Formula $-1$
+\end_inset
+
+ and add
+\begin_inset Formula $x+n$
+\end_inset
+
+ to each member.
+\end_layout
+
+\begin_layout Description
+\begin_inset Formula $3\implies1]$
+\end_inset
+
+
+\begin_inset Formula $n\leq x$
+\end_inset
+
+ and any
+\begin_inset Formula $m\in\mathbb{Z}$
+\end_inset
+
+ with
+\begin_inset Formula $m\leq x$
+\end_inset
+
+ has
+\begin_inset Formula $m<n+1$
+\end_inset
+
+ and therefore
+\begin_inset Formula $m\leq n$
+\end_inset
+
+,
+ so
+\begin_inset Formula $n=\max\{m\in\mathbb{Z}\mid m\leq x\}=\lfloor x\rfloor$
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Derived from the previous statement by replacing
+\begin_inset Formula $x$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ with
+\begin_inset Formula $-x$
+\end_inset
+
+ and
+\begin_inset Formula $-n$
+\end_inset
+
+ and using that
+\begin_inset Formula $-\lceil x\rceil=\lfloor-x\rfloor$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[M10]
+\end_layout
+
+\end_inset
+
+Using the previous exercise,
+ prove that
+\begin_inset Formula $\lfloor-x\rfloor=-\lceil x\rceil$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Since that would be circular reasoning (I did the previous exercise before reading the statement of this one),
+ we'll prove it directly.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{align*}
+\lfloor-x\rfloor=n & \iff\forall m\in\mathbb{Z},(m\leq-x\implies m\leq n)\\
+ & \iff\forall m\in\mathbb{Z},(-m\geq x\implies-m\geq-n)\\
+ & \iff\forall m\in\mathbb{Z},(m\geq x\implies m\geq-n)\iff-n=\lceil x\rceil\iff n=-\lceil x\rceil.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[20]
+\end_layout
+
+\end_inset
+
+Which of the following equations are true for all positive real numbers
+\begin_inset Formula $x$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\left\lfloor \sqrt{\lfloor x\rfloor}\right\rfloor =\lfloor\sqrt{x}\rfloor$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\left\lceil \sqrt{\lceil x\rceil}\right\rceil =\lceil\sqrt{x}\rceil$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\left\lceil \sqrt{\lfloor x\rfloor}\right\rceil =\lceil\sqrt{x}\rceil$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+True,
+ if
+\begin_inset Formula $n=\lfloor\sqrt{x}\rfloor$
+\end_inset
+
+,
+ then
+\begin_inset Formula $n\leq\sqrt{x}<n+1$
+\end_inset
+
+,
+ so
+\begin_inset Formula $n^{2}\leq\lfloor x\rfloor\leq x<(n+1)^{2}$
+\end_inset
+
+ and so
+\begin_inset Formula $n\leq\sqrt{\lfloor x\rfloor}<n+1$
+\end_inset
+
+ and
+\begin_inset Formula $n=\left\lfloor \sqrt{\lfloor x\rfloor}\right\rfloor $
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+True,
+ if
+\begin_inset Formula $n=\lceil\sqrt{x}\rceil$
+\end_inset
+
+,
+ then
+\begin_inset Formula $n-1<\sqrt{x}\leq n$
+\end_inset
+
+ and
+\begin_inset Formula $(n-1)^{2}<x\leq\lceil x\rceil\leq n$
+\end_inset
+
+,
+ so
+\begin_inset Formula $n-1<\sqrt{\lceil x\rceil}\leq n$
+\end_inset
+
+ and therefore
+\begin_inset Formula $\left\lceil \sqrt{\lceil x\rceil}\right\rceil =n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+False,
+ for example
+\begin_inset Formula $\left\lceil \sqrt{\lfloor\frac{9}{2}\rfloor}\right\rceil =\lceil\sqrt{4}\rceil=2$
+\end_inset
+
+ but
+\begin_inset Formula $\lceil\sqrt{\frac{9}{2}}\rceil=3$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc8[00]
+\end_layout
+
+\end_inset
+
+What are
+\begin_inset Formula $100\bmod3$
+\end_inset
+
+,
+
+\begin_inset Formula $100\bmod7$
+\end_inset
+
+,
+
+\begin_inset Formula $-100\bmod7$
+\end_inset
+
+,
+
+\begin_inset Formula $-100\bmod0$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $100\bmod3=1$
+\end_inset
+
+,
+
+\begin_inset Formula $100\bmod7=2$
+\end_inset
+
+,
+
+\begin_inset Formula $-100\bmod7=-2\bmod7=5$
+\end_inset
+
+,
+
+\begin_inset Formula $-100\bmod0=-100$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc9[05]
+\end_layout
+
+\end_inset
+
+What are
+\begin_inset Formula $5\bmod-3$
+\end_inset
+
+,
+
+\begin_inset Formula $18\bmod-3$
+\end_inset
+
+,
+
+\begin_inset Formula $-2\bmod-3$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $5\bmod-3=5-(-3)\lfloor\frac{5}{-3}\rfloor=5+3(-2)=5-6=-1$
+\end_inset
+
+,
+
+\begin_inset Formula $18\bmod-3=18-(-3)(-6)=0$
+\end_inset
+
+,
+
+\begin_inset Formula $-2\bmod-3=-2-(-3)\lfloor\frac{-2}{-3}\rfloor=-2$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[10]
+\end_layout
+
+\end_inset
+
+What are
+\begin_inset Formula $1.1\bmod1$
+\end_inset
+
+,
+
+\begin_inset Formula $0.11\bmod.1$
+\end_inset
+
+,
+
+\begin_inset Formula $0.11\bmod-.1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{eqnarray*}
+1.1\bmod1 & = & 1.1-\lfloor1.1\rfloor=.1,\\
+0.11\bmod.1 & = & .11-.1\lfloor1.1\rfloor=.01,\\
+0.11\bmod-.1 & = & .11-(-.1)\lfloor-1.1\rfloor=-.09.
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc11[00]
+\end_layout
+
+\end_inset
+
+What does
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $x\equiv y\bmod0$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ mean by our conventions?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It means
+\begin_inset Formula $x=x\bmod0=y\bmod0=y$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc12[00]
+\end_layout
+
+\end_inset
+
+What integers are relatively prime to 1?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+All of them,
+ since
+\begin_inset Formula $\gcd\{a,1\}=1$
+\end_inset
+
+ for any
+\begin_inset Formula $a\in\mathbb{Z}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc13[M00]
+\end_layout
+
+\end_inset
+
+By convention,
+ we say that the greatest common divisor of 0 and
+\begin_inset Formula $n$
+\end_inset
+
+ is
+\begin_inset Formula $|n|$
+\end_inset
+
+.
+ What integers are relatively prime to 0?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Only 1 and
+\begin_inset Formula $-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc14[12]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $x\bmod3=2$
+\end_inset
+
+ and
+\begin_inset Formula $x\bmod5=3$
+\end_inset
+
+,
+ what is
+\begin_inset Formula $x\bmod15$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+This is a simple Diophantine equation,
+ there exist
+\begin_inset Formula $n,m\in\mathbb{Z}$
+\end_inset
+
+ such that
+\begin_inset Formula
+\[
+x=3n+2=5m+3,
+\]
+
+\end_inset
+
+so
+\begin_inset Formula $3n-5m=1$
+\end_inset
+
+ and one solution is
+\begin_inset Formula $n=2$
+\end_inset
+
+ and
+\begin_inset Formula $m=1$
+\end_inset
+
+.
+ In this case
+\begin_inset Formula $x\bmod15=(3n+2)\bmod15=8$
+\end_inset
+
+,
+ and the Chinese remainder theorem tells us that this is the only possibility.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc15[10]
+\end_layout
+
+\end_inset
+
+Prove that
+\begin_inset Formula $z(x\bmod y)=(zx)\bmod(zy)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $z=0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $z(x\bmod y)=0=0\bmod0=(zx)\bmod(zy)$
+\end_inset
+
+.
+ If
+\begin_inset Formula $y=0$
+\end_inset
+
+,
+
+\begin_inset Formula $z(x\bmod y)=zx=(zx)\bmod(zy)$
+\end_inset
+
+.
+ If
+\begin_inset Formula $y,z\neq0$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+(zx)\bmod(zy)=zx-zy\left\lfloor \frac{zx}{zy}\right\rfloor =zx-zy\left\lfloor \frac{x}{y}\right\rfloor =z\left(x-y\left\lfloor \frac{x}{y}\right\rfloor \right)=z(x\bmod y).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc16[M10]
+\end_layout
+
+\end_inset
+
+Assume that
+\begin_inset Formula $y>0$
+\end_inset
+
+.
+ Show that if
+\begin_inset Formula $(x-z)/y$
+\end_inset
+
+ is an integer and if
+\begin_inset Formula $0\leq z<y$
+\end_inset
+
+,
+ then
+\begin_inset Formula $z=x\bmod y$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+In this case,
+ there exists an integer
+\begin_inset Formula $k$
+\end_inset
+
+ such that
+\begin_inset Formula $x-z=ky$
+\end_inset
+
+,
+ so
+\begin_inset Formula $z=x-ky$
+\end_inset
+
+ and we just have to show that
+\begin_inset Formula $k=\lfloor\frac{x}{y}\rfloor$
+\end_inset
+
+.
+ But since
+\begin_inset Formula $0\leq z<y$
+\end_inset
+
+,
+
+\begin_inset Formula $0\leq\frac{z}{y}<1$
+\end_inset
+
+ and,
+ multiplying this formula by
+\begin_inset Formula $-1$
+\end_inset
+
+ and adding
+\begin_inset Formula $\frac{x}{y}$
+\end_inset
+
+,
+
+\begin_inset Formula $\frac{x}{y}-1<\frac{x}{y}-\frac{z}{y}=k\leq\frac{x}{y}$
+\end_inset
+
+,
+ which means that
+\begin_inset Formula $k=\lfloor\frac{x}{y}\rfloor$
+\end_inset
+
+ by Exercise 3.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc19[M10]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Law of inverses.
+\emph default
+) If
+\begin_inset Formula $n\bot m$
+\end_inset
+
+,
+ there is an integer
+\begin_inset Formula $n'$
+\end_inset
+
+ such that
+\begin_inset Formula $nn'\equiv1$
+\end_inset
+
+ (modulo
+\begin_inset Formula $m$
+\end_inset
+
+).
+ Prove this,
+ using the extension of Euclid's algorithm (Algorithm 1.2.1E).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We already know that the algorithm terminates and that returns
+\begin_inset Formula $a,b\in\mathbb{Z}$
+\end_inset
+
+ such that
+\begin_inset Formula $am+bn=d\coloneqq\gcd\{n,m\}$
+\end_inset
+
+.
+ But in this case
+\begin_inset Formula $d=1$
+\end_inset
+
+,
+ so
+\begin_inset Formula $bn=d-am=1-am=1$
+\end_inset
+
+ (modulo
+\begin_inset Formula $m$
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[M10]
+\end_layout
+
+\end_inset
+
+Give an example to show that Law B is not always true if
+\begin_inset Formula $a$
+\end_inset
+
+ is not relatively prime to
+\begin_inset Formula $m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $a=b=3$
+\end_inset
+
+,
+
+\begin_inset Formula $x=2$
+\end_inset
+
+,
+
+\begin_inset Formula $y=4$
+\end_inset
+
+,
+ and
+\begin_inset Formula $m=6$
+\end_inset
+
+ in Law B,
+ then
+\begin_inset Formula $ax=6\equiv12=by$
+\end_inset
+
+ and
+\begin_inset Formula $a=3=b$
+\end_inset
+
+ but
+\begin_inset Formula $x=2\not\equiv4=y$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc23[M10]
+\end_layout
+
+\end_inset
+
+Give an example to show that Law D is not always true if
+\begin_inset Formula $r$
+\end_inset
+
+ is not relatively prime to
+\begin_inset Formula $s$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $a=6$
+\end_inset
+
+,
+
+\begin_inset Formula $b=12$
+\end_inset
+
+,
+
+\begin_inset Formula $r=3$
+\end_inset
+
+,
+ and
+\begin_inset Formula $s=6$
+\end_inset
+
+,
+ in Law D,
+ then
+\begin_inset Formula $a=6\equiv12=b$
+\end_inset
+
+ modulo
+\begin_inset Formula $r=3$
+\end_inset
+
+ and modulo
+\begin_inset Formula $s=6$
+\end_inset
+
+ but not modulo
+\begin_inset Formula $rs=18$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc24[M20]
+\end_layout
+
+\end_inset
+
+To what extent can Laws A,
+ B,
+ C,
+ and D be generalized to apply to arbitrary real numbers instead of integers?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let's check the laws one by one.
+\end_layout
+
+\begin_layout Description
+Law
+\begin_inset space ~
+\end_inset
+
+A If
+\begin_inset Formula $a,b,x,y,m\in\mathbb{R}$
+\end_inset
+
+,
+ if
+\begin_inset Formula $m=0$
+\end_inset
+
+ the law is trivial.
+ If not,
+ we have
+\begin_inset Formula $a-m\lfloor\frac{a}{m}\rfloor=b-m\lfloor\frac{b}{m}\rfloor$
+\end_inset
+
+ and
+\begin_inset Formula $x-m\lfloor\frac{x}{m}\rfloor=y-m\lfloor\frac{y}{m}\rfloor$
+\end_inset
+
+,
+ and for addition
+\begin_inset Formula
+\begin{multline*}
+a+x-m\left\lfloor \frac{a+x}{m}\right\rfloor =b+y-m\left\lfloor \frac{b+y}{m}\right\rfloor \iff\\
+\iff m\left(\left\lfloor \frac{a+x}{m}\right\rfloor -\left\lfloor \frac{b+y}{m}\right\rfloor \right)=\\
+=a+x-b-y=m\left(\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor -\left\lfloor \frac{b}{m}\right\rfloor -\left\lfloor \frac{y}{m}\right\rfloor \right)\iff\\
+\iff\left\lfloor \frac{a+x}{m}\right\rfloor -\left\lfloor \frac{a}{m}\right\rfloor -\left\lfloor \frac{x}{m}\right\rfloor =\left\lfloor \frac{b+y}{m}\right\rfloor -\left\lfloor \frac{b}{m}\right\rfloor -\left\lfloor \frac{y}{m}\right\rfloor .
+\end{multline*}
+
+\end_inset
+
+Now,
+\begin_inset Formula
+\[
+\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor \leq\frac{a+x}{m}<\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor +2,
+\]
+
+\end_inset
+
+so
+\begin_inset Formula $\left\lfloor \frac{a+x}{m}\right\rfloor $
+\end_inset
+
+ is either
+\begin_inset Formula $\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor $
+\end_inset
+
+ or
+\begin_inset Formula $\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor +1$
+\end_inset
+
+,
+ and similarly for
+\begin_inset Formula $b$
+\end_inset
+
+ and
+\begin_inset Formula $y$
+\end_inset
+
+.
+ But
+\begin_inset Formula
+\begin{multline*}
+\left\lfloor \frac{a+x}{m}\right\rfloor =\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor \iff\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor \leq\frac{a+x}{m}<\left\lfloor \frac{a}{m}\right\rfloor +\left\lfloor \frac{x}{m}\right\rfloor +1\iff\\
+\iff a+x<m\left\lfloor \frac{a}{m}\right\rfloor +m\left\lfloor \frac{x}{m}\right\rfloor +m\iff\\
+\iff(a\bmod m)+(x\bmod m)=(b\bmod m)+(x\bmod m)<m\iff\\
+\iff\left\lfloor \frac{b+y}{m}\right\rfloor =\left\lfloor \frac{b}{m}\right\rfloor +\left\lfloor \frac{y}{m}\right\rfloor ,
+\end{multline*}
+
+\end_inset
+
+which proves the equality in the last line of the first formula.
+ For subtraction,
+ we have to see that
+\begin_inset Formula $-x\equiv-y\bmod m$
+\end_inset
+
+ and so
+\begin_inset Formula $a-x=a+(-x)\equiv a+(-y)=a-y\pmod m$
+\end_inset
+
+.
+ If
+\begin_inset Formula $x\bmod m=0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\frac{x}{m}\in\mathbb{Z}$
+\end_inset
+
+,
+ so
+\begin_inset Formula $-\frac{x}{m}\in\mathbb{Z}$
+\end_inset
+
+ and
+\begin_inset Formula $-x\bmod m=0$
+\end_inset
+
+,
+ and similarly
+\begin_inset Formula $y\bmod m=0$
+\end_inset
+
+ and so
+\begin_inset Formula $-y\bmod m=0$
+\end_inset
+
+.
+ Otherwise
+\begin_inset Formula $\frac{x}{m}\notin\mathbb{Z}$
+\end_inset
+
+,
+ so
+\begin_inset Formula $\lceil\frac{x}{m}\rceil=\lfloor\frac{x}{m}\rfloor+1$
+\end_inset
+
+,
+ but by Exercise 4,
+
+\begin_inset Formula
+\begin{align*}
+-x\bmod m & =-x-m\left\lfloor \frac{-x}{m}\right\rfloor =-x+m\left\lceil \frac{x}{m}\right\rceil =-x+m\left\lfloor \frac{x}{m}\right\rfloor +m=\\
+ & =m-(x\bmod m)=m-(y\bmod m)=-y\bmod m.
+\end{align*}
+
+\end_inset
+
+For multiplication this doesn't hold;
+ for example,
+ if
+\begin_inset Formula $m=2.5$
+\end_inset
+
+,
+
+\begin_inset Formula $a=0.5$
+\end_inset
+
+,
+
+\begin_inset Formula $b=-2$
+\end_inset
+
+,
+ and
+\begin_inset Formula $x=y=2.2$
+\end_inset
+
+,
+ then
+\begin_inset Formula $ax\bmod m=1.1\bmod2.5=1.1$
+\end_inset
+
+ but
+\begin_inset Formula $by\bmod m=-4.4\bmod2.5=0.6$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+Law
+\begin_inset space ~
+\end_inset
+
+B Obviously
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $m$
+\end_inset
+
+ must be integers,
+ otherwise the statement wouldn't make sense.
+ Even then,
+ however,
+ if
+\begin_inset Formula $a=1$
+\end_inset
+
+,
+
+\begin_inset Formula $b=-2$
+\end_inset
+
+,
+
+\begin_inset Formula $x=\frac{4}{3}$
+\end_inset
+
+,
+
+\begin_inset Formula $y=\frac{7}{3}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $m=3$
+\end_inset
+
+,
+ then
+\begin_inset Formula $ax=\frac{4}{3}\equiv-\frac{14}{3}=by$
+\end_inset
+
+ and
+\begin_inset Formula $a=1\equiv-2=b$
+\end_inset
+
+,
+ but
+\begin_inset Formula $\frac{4}{3}\not\equiv\frac{7}{3}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+Law
+\begin_inset space ~
+\end_inset
+
+C Using Exercise 15,
+ for
+\begin_inset Formula $a,b,m,n\in\mathbb{R}$
+\end_inset
+
+ with
+\begin_inset Formula $n\neq0$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+a\equiv b\bmod m\iff a\bmod m=b\bmod m\iff\\
+\iff an\bmod mn=n(a\bmod m)=n(b\bmod m)=bn\bmod mn\iff\\
+\iff an\equiv bn\bmod mn.
+\end{multline*}
+
+\end_inset
+
+Note that the second double implication would not hold in the left direction for
+\begin_inset Formula $n=0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+Law
+\begin_inset space ~
+\end_inset
+
+D Here
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+ must be integers.
+ Then,
+ if
+\begin_inset Formula $a,b\in\mathbb{R}$
+\end_inset
+
+ with
+\begin_inset Formula $a\equiv b$
+\end_inset
+
+ modulo
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+,
+ if
+\begin_inset Formula $r=0$
+\end_inset
+
+ or
+\begin_inset Formula $s=0$
+\end_inset
+
+,
+ the statement is obvious,
+ and otherwise
+\begin_inset Formula $a-r\lfloor\frac{a}{r}\rfloor=b-r\lfloor\frac{b}{r}\rfloor$
+\end_inset
+
+ and so
+\begin_inset Formula $a-b=r(\lfloor\frac{a}{r}\rfloor-\lfloor\frac{b}{r}\rfloor)\eqqcolon d\in\mathbb{Z}$
+\end_inset
+
+.
+ By Law A,
+ since
+\begin_inset Formula $a\equiv b$
+\end_inset
+
+ and
+\begin_inset Formula $b\equiv b$
+\end_inset
+
+,
+
+\begin_inset Formula $d=a-b\equiv b-b=0$
+\end_inset
+
+ modulo both
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+,
+ so from Law D for integers we have
+\begin_inset Formula $a-b\equiv0$
+\end_inset
+
+ modulo
+\begin_inset Formula $rs$
+\end_inset
+
+ (assuming
+\begin_inset Formula $r\bot s$
+\end_inset
+
+) and so
+\begin_inset Formula $a\equiv b$
+\end_inset
+
+ modulo
+\begin_inset Formula $rs$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Thus,
+ Law A holds for addition and subtraction,
+ Law C always holds,
+ and Law D holds if we still maintain
+\begin_inset Formula $r,s\in\mathbb{Z}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc25[M02]
+\end_layout
+
+\end_inset
+
+Show that,
+ according to Theorem F,
+
+\begin_inset Formula $a^{p-1}\bmod p=[a\text{ is not a multiple of }p]$
+\end_inset
+
+,
+ whenever
+\begin_inset Formula $p$
+\end_inset
+
+ is a prime number.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $a$
+\end_inset
+
+ is a multiple of
+\begin_inset Formula $p$
+\end_inset
+
+,
+ then so is
+\begin_inset Formula $a^{p-1}$
+\end_inset
+
+ and
+\begin_inset Formula $a^{p-1}\bmod p=0$
+\end_inset
+
+.
+ Otherwise
+\begin_inset Formula $a\bot p$
+\end_inset
+
+,
+ so we can cancel out in
+\begin_inset Formula $a^{p}\equiv a\pmod p$
+\end_inset
+
+ to get
+\begin_inset Formula $a^{p-1}\equiv1\pmod p$
+\end_inset
+
+ and so
+\begin_inset Formula $a^{p-1}\bmod p=1\bmod p=1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc28[M25]
+\end_layout
+
+\end_inset
+
+Show that the method used to prove Theorem F can be used to prove the following extension,
+ called
+\emph on
+Euler's theorem
+\emph default
+:
+
+\begin_inset Formula $a^{\varphi(m)}\equiv1\pmod m$
+\end_inset
+
+,
+ for
+\emph on
+any
+\emph default
+ positive integer
+\begin_inset Formula $m$
+\end_inset
+
+,
+ when
+\begin_inset Formula $a\bot m$
+\end_inset
+
+.
+ (In particular,
+ the number
+\begin_inset Formula $n'$
+\end_inset
+
+ in exercise 19 may be taken to be
+\begin_inset Formula $n^{\varphi(m)-1}\bmod m$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First,
+
+\begin_inset Formula $\gcd\{x,y\}\equiv\gcd\{x+ky,y\}$
+\end_inset
+
+ for any
+\begin_inset Formula $x,y,k\in\mathbb{Z}$
+\end_inset
+
+,
+ because if
+\begin_inset Formula $z\mid x$
+\end_inset
+
+ and
+\begin_inset Formula $z\mid y$
+\end_inset
+
+ then obviously
+\begin_inset Formula $z\mid x+ky$
+\end_inset
+
+ and if
+\begin_inset Formula $z\mid x+ky$
+\end_inset
+
+ and
+\begin_inset Formula $z\mid y$
+\end_inset
+
+ then
+\begin_inset Formula $z\mid x$
+\end_inset
+
+,
+ so the set of common divisors is the same.
+ It's also clear that if
+\begin_inset Formula $x\bot z$
+\end_inset
+
+ and
+\begin_inset Formula $y\bot z$
+\end_inset
+
+ then
+\begin_inset Formula $xy\bot z$
+\end_inset
+
+,
+ since neither
+\begin_inset Formula $x$
+\end_inset
+
+ nor
+\begin_inset Formula $y$
+\end_inset
+
+ has common divisors with
+\begin_inset Formula $z$
+\end_inset
+
+ and so neither does
+\begin_inset Formula $xy$
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+With these lemmas,
+ we are ready to prove the statement.
+ Let
+\begin_inset Formula
+\[
+\{x_{1},\dots,x_{\varphi(m)}\}\coloneqq\{x\in\{0,\dots,m-1\}\mid x\bot m\},
+\]
+
+\end_inset
+
+ then the
+\begin_inset Formula $x_{i}a\bmod m$
+\end_inset
+
+ are all distinct,
+ for if
+\begin_inset Formula $x_{i}a\bmod m=x_{j}a\bmod m$
+\end_inset
+
+,
+ since
+\begin_inset Formula $a\bot m$
+\end_inset
+
+,
+ then
+\begin_inset Formula $x_{i}=x_{i}\bmod m=x_{j}\bmod m=x_{j}$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $x_{i},a\bot m$
+\end_inset
+
+,
+
+\begin_inset Formula $x_{i}a\bot m$
+\end_inset
+
+ and also
+\begin_inset Formula $(x_{i}a\bmod m)\bot m$
+\end_inset
+
+,
+ so all the
+\begin_inset Formula $x_{i}a\bmod m$
+\end_inset
+
+ are different and relatively prime to
+\begin_inset Formula $m$
+\end_inset
+
+ and therefore
+\begin_inset Formula $\{x_{i}a\bmod m\}_{i}=\{x_{i}\}_{i}$
+\end_inset
+
+.
+ Thus
+\begin_inset Formula
+\[
+\prod_{i}x_{i}\equiv\prod_{i}(x_{i}a\bmod m)\equiv\prod_{i}x_{i}a\equiv a^{\varphi(m)}\prod_{i}x_{i}\pmod m,
+\]
+
+\end_inset
+
+and therefore using Law B with the fact that
+\begin_inset Formula $\prod_{i}x_{i}\bot m$
+\end_inset
+
+ gives us the result.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc34[M21]
+\end_layout
+
+\end_inset
+
+What conditions on the real number
+\begin_inset Formula $b>1$
+\end_inset
+
+ are necessary and sufficient to guarantee that
+\begin_inset Formula $\lfloor\log_{b}x\rfloor=\left\lfloor \log_{b}\lfloor x\rfloor\right\rfloor $
+\end_inset
+
+ for all real
+\begin_inset Formula $x\geq1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It happens if and only if
+\begin_inset Formula $b\in\mathbb{Z}$
+\end_inset
+
+.
+ To prove this,
+ observe that,
+ since the logarithm in base
+\begin_inset Formula $b>1$
+\end_inset
+
+ is strictly increasing,
+
+\begin_inset Formula $\log_{b}\lfloor x\rfloor<\log_{b}x$
+\end_inset
+
+,
+ so
+\begin_inset Formula $\lfloor\log_{b}x\rfloor\neq\left\lfloor \log_{b}\lfloor x\rfloor\right\rfloor $
+\end_inset
+
+ if and only if
+\begin_inset Formula $\left\lfloor \log_{b}\lfloor x\rfloor\right\rfloor <\lfloor\log_{b}x\rfloor$
+\end_inset
+
+,
+ that is,
+ if there exists an integer
+\begin_inset Formula $k$
+\end_inset
+
+ (namely
+\begin_inset Formula $\lfloor\log_{b}x\rfloor$
+\end_inset
+
+) such that
+\begin_inset Formula $\log_{b}\lfloor x\rfloor<k\leq\log_{b}x$
+\end_inset
+
+,
+ if and only if
+\begin_inset Formula $\lfloor x\rfloor<b^{k}\leq x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $b\in\mathbb{Z}$
+\end_inset
+
+,
+
+\begin_inset Formula $b^{k}\in\mathbb{Z}$
+\end_inset
+
+ as well,
+ so that would mean that
+\begin_inset Formula $\lfloor x\rfloor+1\leq b^{k}\leq x\#$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $b\notin\mathbb{Z}$
+\end_inset
+
+,
+ we just have to set
+\begin_inset Formula $x=b$
+\end_inset
+
+ and
+\begin_inset Formula $k=1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc35[M20]
+\end_layout
+
+\end_inset
+
+Given that
+\begin_inset Formula $m$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ are integers and
+\begin_inset Formula $n>0$
+\end_inset
+
+,
+ prove that
+\begin_inset Formula
+\[
+\lfloor(x+m)/n\rfloor=\left\lfloor (\lfloor x\rfloor+m)/n\right\rfloor
+\]
+
+\end_inset
+
+for all real
+\begin_inset Formula $x$
+\end_inset
+
+.
+ (When
+\begin_inset Formula $m=0$
+\end_inset
+
+,
+ we have an important special case.) Does an analogous result hold for the ceiling function?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Clearly
+\begin_inset Formula $\left\lfloor \frac{\lfloor x\rfloor+m}{n}\right\rfloor \leq\left\lfloor \frac{x+m}{n}\right\rfloor $
+\end_inset
+
+.
+ If this inequality were strict,
+ however,
+ there would be an integer
+\begin_inset Formula $k$
+\end_inset
+
+ such that
+\begin_inset Formula $\frac{\lfloor x\rfloor+m}{n}<k\leq\frac{x+m}{n}$
+\end_inset
+
+,
+ and so
+\begin_inset Formula $\lfloor x\rfloor<nk-m\leq x$
+\end_inset
+
+,
+ but this is impossible because
+\begin_inset Formula $nk-m\in\mathbb{Z}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+For the ceiling,
+ clearly
+\begin_inset Formula $\left\lceil \frac{\lceil x\rceil+m}{n}\right\rceil \geq\left\lceil \frac{x+m}{n}\right\rceil $
+\end_inset
+
+,
+ but if this inequality were strict,
+ there would be an integer
+\begin_inset Formula $k$
+\end_inset
+
+ (namely
+\begin_inset Formula $\left\lceil \frac{x+m}{n}\right\rceil $
+\end_inset
+
+) such that
+\begin_inset Formula $\frac{x+m}{n}\leq k<\frac{\lceil x\rceil+m}{n}$
+\end_inset
+
+,
+ and so
+\begin_inset Formula $x\leq nk-m<\lceil x\rceil$
+\end_inset
+
+,
+ an absurdity because
+\begin_inset Formula $nk-m\in\mathbb{Z}$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.5.lyx b/1.2.5.lyx
new file mode 100644
index 0000000..d379269
--- /dev/null
+++ b/1.2.5.lyx
@@ -0,0 +1,1097 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+How many ways are there to shuffle a 52-card deck?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $52!=80658175170943878571660636856403766975289505440883277824000000000000$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+In the notation of Eq.
+ (2),
+ show that
+\begin_inset Formula $p_{n(n-1)}=p_{nn}$
+\end_inset
+
+,
+ and explain why this happens.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $p_{n(n-1)}=n(n-1)\cdots(n-(n-1)+1)=n(n-1)\cdots2=n(n-1)\cdots1=p_{nn}$
+\end_inset
+
+.
+ This is because
+\begin_inset Formula $p_{n(n-1)}$
+\end_inset
+
+ is the number of ways to take and arrange
+\begin_inset Formula $n-1$
+\end_inset
+
+ objects out
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $p_{nn}$
+\end_inset
+
+ is the number of ways to take and arrange the
+\begin_inset Formula $n$
+\end_inset
+
+ objects,
+ which consists of first arranging
+\begin_inset Formula $n-1$
+\end_inset
+
+ objects out of the
+\begin_inset Formula $n$
+\end_inset
+
+ objects and then adding the one remaining.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[10]
+\end_layout
+
+\end_inset
+
+What permutations of
+\begin_inset Formula $\{1,2,3,4,5\}$
+\end_inset
+
+ would be constructed from the permutation
+\begin_inset Formula $3\,1\,2\,4$
+\end_inset
+
+ using Methods 1 and 2,
+ respectively?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+
+\series bold
+Method 1:
+
+\series default
+
+\begin_inset Formula $5\,3\,1\,2\,4$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,5\,1\,2\,4$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,1\,5\,2\,4$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,1\,2\,5\,4$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,1\,2\,4\,5$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+
+\series bold
+Method 2:
+
+\series default
+
+\begin_inset Formula $4\,2\,3\,5\,1$
+\end_inset
+
+,
+
+\begin_inset Formula $4\,1\,3\,5\,2$
+\end_inset
+
+,
+
+\begin_inset Formula $4\,1\,2\,5\,3$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,1\,2\,5\,4$
+\end_inset
+
+,
+
+\begin_inset Formula $3\,1\,2\,4\,5$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[13]
+\end_layout
+
+\end_inset
+
+Given the fact that
+\begin_inset Formula $\log_{10}1000!=2567.60464...$
+\end_inset
+
+,
+ determine exactly how many decimal digits are present in the number
+\begin_inset Formula $1000!$
+\end_inset
+
+.
+ What is the
+\emph on
+most significant
+\emph default
+ digit?
+ What is the
+\emph on
+least significant
+\emph default
+ digit?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Given a number
+\begin_inset Formula $x$
+\end_inset
+
+ with
+\begin_inset Formula $n+1$
+\end_inset
+
+ digits
+\begin_inset Formula $x_{n}x_{n-1}\cdots x_{1}x_{0}$
+\end_inset
+
+,
+ we have
+\begin_inset Formula $x_{n}10^{n}\leq x<(x_{n}+1)10^{n}$
+\end_inset
+
+ and therefore
+\begin_inset Formula $n+\log_{10}x_{n}\leq\log x<n+\log_{10}(x_{n}+1)$
+\end_inset
+
+,
+ with
+\begin_inset Formula $0\leq\log_{10}X_{n}<\log_{10}(x_{n}+1)\leq1$
+\end_inset
+
+.
+ Thus,
+
+\begin_inset Formula $1000!$
+\end_inset
+
+ has 2568 digits and the most significant digit is 4,
+ since
+\begin_inset Formula $\log_{10}4=0.60205...$
+\end_inset
+
+ and
+\begin_inset Formula $\log_{10}5=0.69897...$
+\end_inset
+
+.
+ Furthermore,
+ since
+\begin_inset Formula $10\mid1000!$
+\end_inset
+
+,
+ the least significant digit is 0.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[17]
+\end_layout
+
+\end_inset
+
+Using Eq.
+ (8),
+ write
+\begin_inset Formula $20!$
+\end_inset
+
+ as a product of prime factors.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Numbers up to 20 have prime factors up to 20,
+ so the prime factors are 2,
+ 3,
+ 5,
+ 7,
+ 11,
+ 13,
+ 17,
+ and 19.
+ For the multiplicities,
+\begin_inset Formula
+\begin{align*}
+\mu_{2} & =\sum_{k\geq1}\left\lfloor \frac{20}{2^{k}}\right\rfloor =10+5+2+1=18, & \mu_{11} & =\sum_{k\geq1}\left\lfloor \frac{20}{11^{k}}\right\rfloor =1,\\
+\mu_{3} & =\sum_{k\geq1}\left\lfloor \frac{20}{3^{k}}\right\rfloor =6+2=8, & \mu_{13} & =\sum_{k\geq1}\left\lfloor \frac{20}{13^{k}}\right\rfloor =1,\\
+\mu_{5} & =\sum_{k\geq1}\left\lfloor \frac{20}{5^{k}}\right\rfloor =4, & \mu_{17} & =\sum_{k\geq1}\left\lfloor \frac{20}{17^{k}}\right\rfloor =1,\\
+\mu_{7} & =\sum_{k\geq1}\left\lfloor \frac{20}{7^{k}}\right\rfloor =2, & \mu_{19} & =\sum_{k\geq1}\left\lfloor \frac{20}{19^{k}}\right\rfloor =1,
+\end{align*}
+
+\end_inset
+
+so
+\begin_inset Formula $20!=2^{18}3^{8}5^{4}7^{2}\cdot11\cdot13\cdot17\cdot19$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc7[M10]
+\end_layout
+
+\end_inset
+
+Show that the
+\begin_inset Quotes eld
+\end_inset
+
+generalized termial
+\begin_inset Quotes erd
+\end_inset
+
+ function in Eq.
+ (10) satisfies the identity
+\begin_inset Formula $x?=x+(x-1)?$
+\end_inset
+
+ for all real numbers
+\begin_inset Formula $x$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $x+(x-1)?=x+\frac{1}{2}(x-1)x=\frac{1}{2}2x+\frac{1}{2}(x-1)x=\frac{1}{2}(x+1)x=x?$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc9[M10]
+\end_layout
+
+\end_inset
+
+Determine the values of
+\begin_inset Formula $\Gamma(\frac{1}{2})$
+\end_inset
+
+ and
+\begin_inset Formula $\Gamma(-\frac{1}{2})$
+\end_inset
+
+,
+ given that
+\begin_inset Formula $(\frac{1}{2})!=\sqrt{\pi}/2$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{align*}
+(\tfrac{1}{2})!=\tfrac{1}{2}\Gamma(\tfrac{1}{2}) & \implies\Gamma(\tfrac{1}{2})=2(\tfrac{1}{2})!=\sqrt{\pi},\\
+-\tfrac{1}{2}\Gamma(-\tfrac{1}{2})=\Gamma(\tfrac{1}{2}) & \implies\Gamma(-\tfrac{1}{2})=-2\Gamma(\tfrac{1}{2})=-2\sqrt{\pi}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[HM20]
+\end_layout
+
+\end_inset
+
+Does the identity
+\begin_inset Formula $\Gamma(x+1)=x\Gamma(x)$
+\end_inset
+
+ hold for all real numbers
+\begin_inset Formula $x$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+No,
+ as it doesn't hold when
+\begin_inset Formula $\Gamma(x)$
+\end_inset
+
+ or
+\begin_inset Formula $\Gamma(x+1)$
+\end_inset
+
+ are not defined.
+ However,
+ when they are defined,
+\begin_inset Formula
+\begin{align*}
+x\Gamma(x) & =x\lim_{m}\frac{m^{x}m!}{\prod_{i=0}^{m}(x+i)}=\lim_{m}\frac{m^{x}m!}{\prod_{i=1}^{m}(x+i)}=\lim_{m}\frac{(m+1)^{x}(m+1)!}{\prod_{i=1}^{m+1}(x+i)}=\\
+ & =\lim_{m}\frac{(m+1)^{x+1}m!}{\prod_{i=0}^{m}(x+1+i)}=\lim_{m}\left(\frac{m^{x+1}m!}{\prod_{i=0}^{m}((x+1)+i)}\left(\frac{m+1}{m}\right)^{x+1}\right)=\Gamma(x+1)\cdot1.
+\end{align*}
+
+\end_inset
+
+Note that,
+ if
+\begin_inset Formula $x\in\mathbb{Z}^{-}$
+\end_inset
+
+,
+ then the terms from
+\begin_inset Formula $m=-x$
+\end_inset
+
+ onward are not defined,
+ so this is not the scenario we are dealing with.
+ For ant other value,
+ this holds.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc11[M15]
+\end_layout
+
+\end_inset
+
+Let the representation of
+\begin_inset Formula $n$
+\end_inset
+
+ in the binary system be
+\begin_inset Formula $n=2^{e_{1}}+2^{e_{2}}+\dots+2^{e_{r}}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $e_{1}>e_{2}>\dots>e_{r}\geq0$
+\end_inset
+
+.
+ Show that
+\begin_inset Formula $n!$
+\end_inset
+
+ is divisible by
+\begin_inset Formula $2^{n-r}$
+\end_inset
+
+ but not by
+\begin_inset Formula $2^{n-r+1}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+This is exactly to say that,
+ for
+\begin_inset Formula $p=2$
+\end_inset
+
+,
+
+\begin_inset Formula $\mu=n-r$
+\end_inset
+
+.
+ But
+\begin_inset Formula $r$
+\end_inset
+
+ is the sum of all bits of
+\begin_inset Formula $n$
+\end_inset
+
+ in base 2,
+ so by Exercise 12,
+
+\begin_inset Formula $\mu=\frac{1}{2-1}(n-r)=n-r$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc12[M22]
+\end_layout
+
+\end_inset
+
+(A.
+ Legendre,
+ 1808.) Generalizing the result of the previous exercise,
+ let
+\begin_inset Formula $p$
+\end_inset
+
+ be a prime number,
+ and let the representation of
+\begin_inset Formula $n$
+\end_inset
+
+ in the
+\begin_inset Formula $p$
+\end_inset
+
+-ary number system be
+\begin_inset Formula $n=a_{k}p^{k}+a_{k-1}p^{k-1}+\dots+a_{1}p+a_{0}$
+\end_inset
+
+.
+ Express the number
+\begin_inset Formula $\mu$
+\end_inset
+
+ of Eq.
+ (8) in a simple formula involving
+\begin_inset Formula $n$
+\end_inset
+
+,
+
+\begin_inset Formula $p$
+\end_inset
+
+,
+ and
+\begin_inset Formula $a$
+\end_inset
+
+'s.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The question makes sense for
+\begin_inset Formula $n\in\mathbb{N}^{*}$
+\end_inset
+
+.
+ Then,
+ given that the previous exercise showed that,
+ for
+\begin_inset Formula $p=2$
+\end_inset
+
+,
+
+\begin_inset Formula $\mu=n-r$
+\end_inset
+
+,
+ where
+\begin_inset Formula $r\coloneqq|\{k\in\mathbb{N}\mid a_{k}\neq0\}|=\sum_{k}a_{k}$
+\end_inset
+
+,
+ a guess is that
+\begin_inset Formula $\mu=n-\sum_{k}a_{k}$
+\end_inset
+
+ for any other positive prime integer
+\begin_inset Formula $p$
+\end_inset
+
+ as well,
+ that is,
+
+\begin_inset Formula $n-\mu=\sum_{k}a_{k}$
+\end_inset
+
+.
+ To prove this,
+\begin_inset Formula
+\[
+\mu=\sum_{j\geq1}\left\lfloor \frac{n}{p^{j}}\right\rfloor =\sum_{j=1}^{k}\sum_{i=j}^{k}a_{i}p^{i-j}=\sum_{1\leq j\leq i\leq k}a_{i}p^{i-j}=\sum_{i=1}^{k}a_{i}\left(\sum_{j=0}^{i-1}p^{j}\right)=\sum_{i=1}^{k}\frac{a_{i}(p^{i}-1)}{p-1},
+\]
+
+\end_inset
+
+where the latter identity is because of the cyclotomic formula.
+ Then,
+\begin_inset Formula
+\begin{align*}
+\sum_{i=1}^{k}\frac{a_{i}(p^{i}-1)}{p-1} & =\frac{1}{p-1}\left(\sum_{i=1}^{k}a_{i}p^{i}-\sum_{i=1}^{k}a_{i}\right)=\frac{1}{p-1}\left((n-a_{0})-\sum_{i\geq1}a_{i}\right)\\
+ & =\frac{1}{p-1}\left(n-\sum_{i\geq0}a_{i}\right).
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[HM20]
+\end_layout
+
+\end_inset
+
+Try to put yourself in Euler's place,
+ looking for a way to generalize
+\begin_inset Formula $n!$
+\end_inset
+
+ to noninteger values of
+\begin_inset Formula $n$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $(n+\frac{1}{2})!/n!$
+\end_inset
+
+ times
+\begin_inset Formula $((n+\frac{1}{2})+\frac{1}{2})!/(n+\frac{1}{2})!$
+\end_inset
+
+ equals
+\begin_inset Formula $(n+1)!/n!=n+1$
+\end_inset
+
+,
+ it seems natural that
+\begin_inset Formula $(n+\frac{1}{2})!/n!$
+\end_inset
+
+ should be approximately
+\begin_inset Formula $\sqrt{n}$
+\end_inset
+
+.
+ Similarly,
+
+\begin_inset Formula $(n+\frac{1}{3})!/n!$
+\end_inset
+
+ should be
+\begin_inset Formula $\approx\sqrt[3]{n}$
+\end_inset
+
+.
+ Invent a hypothesis about the ratio
+\begin_inset Formula $(n+x)!/n!$
+\end_inset
+
+ as
+\begin_inset Formula $n$
+\end_inset
+
+ approaches infinity.
+ Is your hypothesis correct when
+\begin_inset Formula $x$
+\end_inset
+
+ is an integer?
+ Does it tell anything about the appropriate value of
+\begin_inset Formula $x!$
+\end_inset
+
+ when
+\begin_inset Formula $x$
+\end_inset
+
+ is not an integer?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The previous examples show
+\begin_inset Formula $\frac{(n+\frac{1}{m})!}{n!}\approx\sqrt[m]{n}=n^{\frac{1}{m}}$
+\end_inset
+
+,
+ which is to say that
+\begin_inset Formula $\frac{(n+x)!}{n!}\approx n^{x}$
+\end_inset
+
+ for
+\begin_inset Formula $x=\frac{1}{m}$
+\end_inset
+
+.
+ As
+\begin_inset Formula $n$
+\end_inset
+
+ gets bigger,
+ the approximation should probably be more accurate for the same value of
+\begin_inset Formula $x$
+\end_inset
+
+,
+ so we could see that
+\begin_inset Formula $(n+x)!\approx n^{x}n!$
+\end_inset
+
+.
+ For a non-negative integer
+\begin_inset Formula $x$
+\end_inset
+
+,
+
+\begin_inset Formula $(n+x)!=(n+1)\cdots(n+x)\cdot n!$
+\end_inset
+
+,
+ so as
+\begin_inset Formula $n$
+\end_inset
+
+ gets bigger the approximation is more and more precise,
+ and in fact,
+\begin_inset Formula
+\[
+\lim_{n}\frac{n^{x}n!}{(n+x)!}=\lim_{n}\frac{n^{x}}{(n+1)\cdots(n+x)}=\lim_{n}\prod_{k=1}^{x}\frac{n}{n+k}=1.
+\]
+
+\end_inset
+
+Multiplying by
+\begin_inset Formula $x!$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+x!=\lim_{n}\frac{n^{x}x!n!}{(n+x)!}=\lim_{n}(n^{x}n!)\frac{x!}{(n+x)!}=\lim_{n}\frac{n^{x}n!}{(x+1)\cdots(x+n)},
+\]
+
+\end_inset
+
+which is Euler's factorial formula.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc24[HM21]
+\end_layout
+
+\end_inset
+
+Prove the handy inequalities
+\begin_inset Formula
+\begin{align*}
+\frac{n^{n}}{\text{e}^{n-1}} & \leq n!\leq\frac{n^{n+1}}{\text{e}^{n-1}}, & \text{integer }n & \geq1.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(Looking at the answers.)
+\end_layout
+
+\end_inset
+
+We have
+\begin_inset Formula
+\begin{align*}
+\frac{n^{n}}{n!} & =\prod_{k=1}^{n}\frac{n}{k}=\prod_{k=1}^{n-1}\frac{n}{k}=\prod_{k=1}^{n-1}\prod_{j=k}^{n-1}\frac{j+1}{j}=\prod_{1\leq k\leq j<n}\frac{j+1}{j}=\prod_{j=1}^{n-1}\left(\frac{j+1}{j}\right)^{j}=\\
+ & =\prod_{j=1}^{n-1}\left(1+\frac{1}{j}\right)^{j}\leq\prod_{j=1}^{n-1}\left(\text{e}^{1/j}\right)^{j}=\text{e}^{n-1},
+\end{align*}
+
+\end_inset
+
+where for the inequality we use that
+\begin_inset Formula $1+x\leq\text{e}^{x}$
+\end_inset
+
+ for all real
+\begin_inset Formula $x$
+\end_inset
+
+.
+ Likewise,
+\begin_inset Formula
+\begin{align*}
+\frac{n^{n+1}}{n!} & =n\frac{n^{n}}{n!}=n\prod_{j=1}^{n-1}\left(\frac{j+1}{j}\right)^{j}=\prod_{j=1}^{n-1}\frac{j+1}{j}\prod_{j=1}^{n-1}\left(\frac{j+1}{j}\right)^{j}=\prod_{j=1}^{n-1}\left(\frac{j+1}{j}\right)^{j+1}=\\
+ & =\prod_{j=2}^{n}\left(\frac{j}{j-1}\right)^{j}=\prod_{j=2}^{n}\left(1-\frac{1}{j}\right)^{-j}\geq\prod_{j=2}^{n}\left(\text{e}^{-1/j}\right)^{-j}=\text{e}^{n-1}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.6.lyx b/1.2.6.lyx
new file mode 100644
index 0000000..047325d
--- /dev/null
+++ b/1.2.6.lyx
@@ -0,0 +1,3599 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\usepackage{amsmath}
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset FormulaMacro
+\newcommand{\stirla}[2]{\genfrac[]{0pt}{}{#1}{#2}}
+{\begin{bmatrix}{\textstyle #1}\\
+{\textstyle #2}
+\end{bmatrix}}
+\end_inset
+
+
+\begin_inset FormulaMacro
+\newcommand{\stirlb}[2]{\genfrac\{\}{0pt}{}{#1}{#2}}
+{\begin{Bmatrix}{\textstyle #1}\\
+{\textstyle #2}
+\end{Bmatrix}}
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+How many combinations of
+\begin_inset Formula $n$
+\end_inset
+
+ things taken
+\begin_inset Formula $n-1$
+\end_inset
+
+ at a time are possible?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\binom{n}{n-1}=\frac{n!}{1!(n-1)!}=n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[00]
+\end_layout
+
+\end_inset
+
+What is
+\begin_inset Formula $\binom{0}{0}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\binom{0}{0}=\frac{1!}{1!1!}=1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[00]
+\end_layout
+
+\end_inset
+
+How many bridge hands (13 cards out of a 52-card deck) are possible?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\binom{52}{13}=635013559600$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[10]
+\end_layout
+
+\end_inset
+
+Give the answer to exercise 3 as a product of prime numbers.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We have
+\begin_inset Formula $\binom{52}{13}=\frac{52!}{13!39!}$
+\end_inset
+
+.
+ Using Equation 1.2.5.8:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{align*}
+52! & =2^{49}3^{23}5^{12}7^{8}11^{4}13^{4}17^{3}19^{2}23^{2}\cdot29\cdot31\cdot37\cdot41\cdot43\cdot47,\\
+39! & =2^{35}3^{18}5^{8}7^{5}11^{3}13^{3}17^{2}19^{2}\cdot23\cdot29\cdot31\cdot37\\
+13! & =2^{10}3^{5}5^{2}\cdot7\cdot11\cdot13\\
+\hline \binom{52}{13} & =2^{4}5^{2}7^{2}\cdot17\cdot23\cdot41\cdot43\cdot47.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[05]
+\end_layout
+
+\end_inset
+
+Use Pascal's triangle to explain the fact that
+\begin_inset Formula $11^{4}=14641$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $11^{4}=(10+1)^{4}=\binom{4}{0}10^{4}1^{0}+\binom{4}{1}10^{3}1^{1}+\binom{4}{2}10^{2}1^{2}+\binom{4}{3}10^{1}1^{3}+\binom{4}{4}10^{0}1^{4}=14641$
+\end_inset
+
+.
+ The pattern works for the number 11 in any given base until the number 10 or higher appears,
+ which in this case happens in the next row.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[10]
+\end_layout
+
+\end_inset
+
+Pascal's triangle (Table 1) can be extended in all directions by use of the addition formula,
+ Eq.
+ (9).
+ Find the three rows that go on
+\emph on
+top
+\emph default
+ of Table 1 (i.e.
+ for
+\begin_inset Formula $r=-1$
+\end_inset
+
+,
+
+\begin_inset Formula $-2$
+\end_inset
+
+,
+ and
+\begin_inset Formula $-3$
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The table is based on the properties that
+\begin_inset Formula $\binom{r}{k}=\binom{r-1}{k}+\binom{r-1}{k-1}$
+\end_inset
+
+ and that
+\begin_inset Formula $\binom{r}{k}=0$
+\end_inset
+
+ for
+\begin_inset Formula $k<0$
+\end_inset
+
+.
+ This implies that
+\begin_inset Formula $\binom{r}{0}=1$
+\end_inset
+
+ for any
+\begin_inset Formula $r\in\mathbb{Z}$
+\end_inset
+
+ (really for any
+\begin_inset Formula $r\in\mathbb{R}$
+\end_inset
+
+) and that
+\begin_inset Formula $\binom{r-1}{k}=\binom{r}{k}-\binom{r-1}{k-1}$
+\end_inset
+
+ (the one below in the table minus the one on the left).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="11">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $r$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{0}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{1}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{2}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{3}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{4}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{5}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{6}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{7}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{8}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{r}{9}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-3$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-3$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $6$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-10$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $15$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-21$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $28$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-36$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $45$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-55$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-2$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-2$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $3$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-4$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $5$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-6$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $7$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-8$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $9$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-10$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-1$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc8[00]
+\end_layout
+
+\end_inset
+
+What property of Pascal's triangle is reflected in the
+\begin_inset Quotes eld
+\end_inset
+
+symmetry condition,
+\begin_inset Quotes erd
+\end_inset
+
+ Eq.
+ (6)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The symmetry of each row
+\begin_inset Formula $r$
+\end_inset
+
+ with center in
+\begin_inset Formula $k=\frac{r}{2}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc9[01]
+\end_layout
+
+\end_inset
+
+What is the value of
+\begin_inset Formula $\binom{n}{n}$
+\end_inset
+
+?
+ (Consider all integers
+\begin_inset Formula $n$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For
+\begin_inset Formula $n\geq0$
+\end_inset
+
+,
+
+\begin_inset Formula $\binom{n}{n}=\frac{n!}{n!1!}=1$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n<0$
+\end_inset
+
+,
+ by definition
+\begin_inset Formula $\binom{n}{n}=0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[M25]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $p$
+\end_inset
+
+ is prime,
+ show that:
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\binom{n}{p}\equiv\left\lfloor \frac{n}{p}\right\rfloor \pmod p$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\binom{p}{k}\equiv0\pmod p$
+\end_inset
+
+,
+ for
+\begin_inset Formula $1\leq k\leq p-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\binom{p-1}{k}\equiv(-1)^{k}\pmod p$
+\end_inset
+
+,
+ for
+\begin_inset Formula $0\leq k\leq p-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\binom{p+1}{k}\equiv0\pmod p$
+\end_inset
+
+,
+ for
+\begin_inset Formula $2\leq k\leq p-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+(É.
+ Lucas,
+ 1877.)
+\begin_inset Formula
+\[
+\binom{n}{k}\equiv\binom{\lfloor n/p\rfloor}{\lfloor k/p\rfloor}\binom{n\bmod p}{k\bmod p}\pmod p.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+If the representations of
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $k$
+\end_inset
+
+ in the
+\begin_inset Formula $p$
+\end_inset
+
+-ary number system are
+\begin_inset Formula
+\begin{eqnarray*}
+\begin{array}{rlc}
+n & = & a_{r}p^{r}+\dots+a_{1}p+a_{0},\\
+k & = & b_{r}p^{r}+\dots+b_{1}p+b_{0},
+\end{array} & \text{then} & \binom{n}{k}\equiv\binom{a_{r}}{b_{r}}\cdots\binom{a_{1}}{b_{1}}\binom{a_{0}}{b_{0}}\pmod p.
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We assume
+\begin_inset Formula $n\in\mathbb{Z}$
+\end_inset
+
+ and
+\begin_inset Formula $k\in\mathbb{N}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Using part 5,
+\begin_inset Formula
+\[
+\binom{n}{p}\equiv\binom{\lfloor n/p\rfloor}{\lfloor p/p\rfloor}\binom{n\bmod p}{p\bmod p}=\binom{\lfloor n/p\rfloor}{1}\binom{n\bmod p}{0}=\left\lfloor \frac{n}{p}\right\rfloor \cdot1.
+\]
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+\begin_inset Note Comment
+status open
+
+\begin_layout Plain Layout
+Since we know
+\begin_inset Formula $\binom{n}{p}=\frac{n(n-1)\cdots(n-p+1)}{1\cdot2\cdot\cdots\cdot p}\in\mathbb{Z}$
+\end_inset
+
+ (because of the addition formula),
+ and since
+\begin_inset Formula $p$
+\end_inset
+
+ appears once in the denominator,
+ there must be a
+\begin_inset Formula $k\in\{0,\dots,p-1\}$
+\end_inset
+
+ such that
+\begin_inset Formula $p\mid n-k$
+\end_inset
+
+,
+ and it obviously must be unique.
+ It's then easy to see that
+\begin_inset Formula $\lfloor\frac{n}{p}\rfloor=\frac{n-k}{p}$
+\end_inset
+
+,
+ and so
+\begin_inset Formula
+\[
+\binom{n}{p}\equiv\left\lfloor \frac{n}{p}\right\rfloor \frac{n(n-1)\cdots(n-k+1)(n-k-1)\cdots(n-p+1)}{1\cdot2\cdots(p-1)}\pmod p.
+\]
+
+\end_inset
+
+Let us call
+\begin_inset Formula $b$
+\end_inset
+
+ the numerator in the fraction of the above formula,
+ we just need to prove that
+\begin_inset Formula $\frac{b}{(p-1)!}\equiv1\pmod p$
+\end_inset
+
+,
+ which by rule 1.2.4–C is equivalent to
+\begin_inset Formula $b\equiv(p-1)!\bmod p!$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $b$
+\end_inset
+
+ is a multiple of
+\begin_inset Formula $(p-1)!$
+\end_inset
+
+ (otherwise
+\begin_inset Formula $\binom{n}{p}$
+\end_inset
+
+ would be an integer),
+
+\begin_inset Formula $b\equiv0\equiv(p-1)!\bmod(p-1)!$
+\end_inset
+
+,
+ and since
+\begin_inset Formula $\{(n-j)\bmod p\}_{0\leq j<p}^{j\neq k}=\{1,\dots,p-1\}$
+\end_inset
+
+,
+ we have
+\begin_inset Formula
+\[
+b=\prod_{\begin{subarray}{c}
+0\leq j<p\\
+j\neq k
+\end{subarray}}(n-j)\equiv\prod_{j=1}^{p-1}j=(p-1)!\pmod p.
+\]
+
+\end_inset
+
+Therefore,
+ since
+\begin_inset Formula $(p-1)!\bot p$
+\end_inset
+
+,
+ rule 1.2.4–D gives us the result.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\binom{p}{k}=\frac{p!}{k!(p-k)!}$
+\end_inset
+
+,
+ but neither
+\begin_inset Formula $k!$
+\end_inset
+
+ nor
+\begin_inset Formula $(p-k)!$
+\end_inset
+
+ divide
+\begin_inset Formula $p$
+\end_inset
+
+ while
+\begin_inset Formula $p!$
+\end_inset
+
+ does,
+ so
+\begin_inset Formula $p\mid\binom{p}{k}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+We prove it by induction on
+\begin_inset Formula $k$
+\end_inset
+
+.
+ For
+\begin_inset Formula $k=0$
+\end_inset
+
+,
+
+\begin_inset Formula $\binom{p-1}{0}=1=(-1)^{0}$
+\end_inset
+
+,
+ so the equation holds.
+ For
+\begin_inset Formula $1\leq k\leq p-1$
+\end_inset
+
+,
+
+\begin_inset Formula
+\[
+\binom{p-1}{k}=\binom{p}{k}-\binom{p-1}{k-1}\equiv0-(-1)^{k-1}=(-1)^{k}\pmod p,
+\]
+
+\end_inset
+
+ where for the equivalence we use the previous part of the exercise and the induction hypothesis.
+\end_layout
+
+\begin_layout Enumerate
+Using part 2,
+\begin_inset Formula
+\[
+\binom{p+1}{k}=\binom{p}{k}+\binom{p}{k-1}\equiv0-0=0\pmod k.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $k<0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\binom{n}{k}=0$
+\end_inset
+
+ and
+\begin_inset Formula $\binom{\lfloor n/p\rfloor}{\lfloor k/p\rfloor}=0$
+\end_inset
+
+.
+ Now let's prove this for
+\begin_inset Formula $k\geq0$
+\end_inset
+
+.
+ First,
+ note that,
+ if
+\begin_inset Formula $a,b,c,d\in\mathbb{Z}$
+\end_inset
+
+,
+
+\begin_inset Formula $\frac{a}{b},\frac{c}{d}\in\mathbb{Z}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $a\equiv c$
+\end_inset
+
+ and
+\begin_inset Formula $0\not\equiv b\equiv d\pmod p$
+\end_inset
+
+,
+ then
+\begin_inset Formula
+\[
+\frac{a}{b}\equiv\frac{c}{d}\pmod p.
+\]
+
+\end_inset
+
+Effectively,
+ let
+\begin_inset Formula $a=jp+b$
+\end_inset
+
+
+\begin_inset Formula $c=kp+d$
+\end_inset
+
+ for some integers
+\begin_inset Formula $j$
+\end_inset
+
+ and
+\begin_inset Formula $k$
+\end_inset
+
+,
+ then
+\begin_inset Formula
+\[
+\frac{a}{b}-\frac{c}{d}=\frac{ad-bc}{bd}=\frac{(jd-bk)p}{bd},
+\]
+
+\end_inset
+
+which is a multiple of
+\begin_inset Formula $p$
+\end_inset
+
+ because it's an integer and,
+ since
+\begin_inset Formula $bd\nmid p$
+\end_inset
+
+,
+ it follows that
+\begin_inset Formula $bd\mid jd-bk$
+\end_inset
+
+.
+ Now,
+ let
+\begin_inset Formula $n\eqqcolon n'p+n_{0}$
+\end_inset
+
+ and
+\begin_inset Formula $k\eqqcolon k'p+k_{0}$
+\end_inset
+
+ with
+\begin_inset Formula $n',n_{0},k',k_{0}\in\mathbb{Z}$
+\end_inset
+
+ and
+\begin_inset Formula $0\leq n_{0},k_{0}<p$
+\end_inset
+
+.
+ Clearly
+\begin_inset Formula $n_{0}\equiv n$
+\end_inset
+
+ and
+\begin_inset Formula $k_{0}\equiv k$
+\end_inset
+
+ (modulo
+\begin_inset Formula $p$
+\end_inset
+
+),
+ and then
+\begin_inset Formula
+\begin{align*}
+\binom{n}{k} & =\prod_{j=1}^{k}\frac{n+1-j}{j}=\left(\prod_{j=1}^{pk'}\frac{n+1-j}{j}\right)\left(\prod_{j=1}^{k_{0}}\frac{pn'+n_{0}+1-pk'-j}{j+pk'}\right)\\
+ & \equiv\left(\prod_{j=1}^{pk'}\frac{n+1-j}{j}\right)\left(\prod_{j=1}^{k_{0}}\frac{n_{0}+1-j}{j}\right)=\binom{n}{pk'}\binom{n_{0}}{k_{0}}\pmod p,
+\end{align*}
+
+\end_inset
+
+where for the equivalence we used that both
+\begin_inset Formula $\binom{n}{k}$
+\end_inset
+
+ and
+\begin_inset Formula $\binom{n}{pk'}\binom{n_{0}}{k_{0}}$
+\end_inset
+
+ are integers.
+ Now we have to prove that
+\begin_inset Formula $\binom{n}{pk'}\equiv\binom{n'}{k'}$
+\end_inset
+
+.
+ This coefficient can be factored as
+\begin_inset Formula
+\[
+\binom{n}{pk'}=\prod_{j=0}^{k'-1}\left(\prod_{i=1}^{p}\frac{n+1-jp-i}{jp+i}\right)=\prod_{j=0}^{k'-1}\prod_{i=1}^{p}\frac{(n'-j)p+n_{0}+1-i}{jp+i}.
+\]
+
+\end_inset
+
+Each of the
+\begin_inset Formula $k'$
+\end_inset
+
+ groups of factors has exactly one factor whose numerator is a multiple of
+\begin_inset Formula $p$
+\end_inset
+
+ (when
+\begin_inset Formula $i=s\coloneqq(n_{0}+1)\bmod p$
+\end_inset
+
+),
+ and one whose denominator is.
+ Canceling the
+\begin_inset Formula $p$
+\end_inset
+
+ in them and taking congruences on the other factors,
+ we get
+\begin_inset Formula
+\begin{align*}
+\binom{n}{pk'} & \equiv\prod_{j=0}^{k'-1}\left(\frac{n'-j}{j+1}\frac{\prod_{\begin{subarray}{c}
+1\leq i\leq p\\
+i\neq s
+\end{subarray}}(n_{0}+1-i)}{(p-1)!}\right)=\prod_{j=0}^{k'-1}\left(\frac{n'-j}{j+1}\frac{(p-1)!}{(p-1)!}\right)=\\
+ & =\prod_{j=1}^{k'}\frac{n'+1+j}{j}=\binom{n'}{k'}\pmod p.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+From part 5 by induction on
+\begin_inset Formula $r$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[M20]
+\end_layout
+
+\end_inset
+
+(E.
+ Kummer,
+ 1852.) Let
+\begin_inset Formula $p$
+\end_inset
+
+ be prime.
+ Show that if
+\begin_inset Formula $p^{n}$
+\end_inset
+
+ divides
+\begin_inset Formula
+\[
+\binom{a+b}{a}
+\]
+
+\end_inset
+
+but
+\begin_inset Formula $p^{n+1}$
+\end_inset
+
+ does not,
+ then
+\begin_inset Formula $n$
+\end_inset
+
+ is equal to the number of
+\emph on
+carries
+\emph default
+ that occur when
+\begin_inset Formula $a$
+\end_inset
+
+ is added to
+\begin_inset Formula $b$
+\end_inset
+
+ in the
+\begin_inset Formula $p$
+\end_inset
+
+-ary number system.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Because of the way the exercise is written,
+ we may assume that both
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $b$
+\end_inset
+
+ are natural numbers (non-negative integers),
+ and therefore
+\begin_inset Formula $\binom{a+b}{a}=\frac{(a+b)!}{a!b!}$
+\end_inset
+
+.
+ Let
+\begin_inset Formula $s_{a}$
+\end_inset
+
+ be the sum of the digits of
+\begin_inset Formula $a$
+\end_inset
+
+ in base
+\begin_inset Formula $p$
+\end_inset
+
+ and let
+\begin_inset Formula $\mu_{a}=\frac{a-s_{a}}{p-1}$
+\end_inset
+
+ be the number of times
+\begin_inset Formula $p$
+\end_inset
+
+ appears in the prime factorization of
+\begin_inset Formula $a$
+\end_inset
+
+,
+ by Exercise 1.2.5–12.
+ Define
+\begin_inset Formula $s_{b}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mu_{b}$
+\end_inset
+
+,
+
+\begin_inset Formula $s_{c}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mu_{c}$
+\end_inset
+
+ in a similar manner,
+ with
+\begin_inset Formula $c\coloneqq a+b$
+\end_inset
+
+.
+ Then the number of times
+\begin_inset Formula $p$
+\end_inset
+
+ appears in the prime factorization of
+\begin_inset Formula $\binom{a+b}{a}$
+\end_inset
+
+ is precisely
+\begin_inset Formula
+\[
+\mu_{c}-\mu_{a}-\mu_{b}=\frac{\cancel{c-a-b}-s_{c}+s_{a}+s_{b}}{p-1},
+\]
+
+\end_inset
+
+but
+\begin_inset Formula $s_{c}$
+\end_inset
+
+ is precisely the sum of
+\begin_inset Formula $s_{a}$
+\end_inset
+
+ plus
+\begin_inset Formula $s_{b}$
+\end_inset
+
+ except that,
+ every time we do a carry in the sum in base
+\begin_inset Formula $p$
+\end_inset
+
+,
+ we have to subtract
+\begin_inset Formula $p$
+\end_inset
+
+ and add 1,
+ that is,
+ we subtract
+\begin_inset Formula $p-1$
+\end_inset
+
+,
+ so
+\begin_inset Formula $s_{a}+s_{b}-s_{c}$
+\end_inset
+
+ is precisely
+\begin_inset Formula $p-1$
+\end_inset
+
+ times the number of carries and this proves the result.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[M18]
+\end_layout
+
+\end_inset
+
+Prove the Chu-Vandermonde formula (21) from Eq.
+ (15),
+ using that
+\begin_inset Formula $(1+x)^{r+s}=(1+x)^{r}(1+x)^{s}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $n$
+\end_inset
+
+ is negative,
+ either
+\begin_inset Formula $k$
+\end_inset
+
+ or
+\begin_inset Formula $n-k$
+\end_inset
+
+ is negative for any
+\begin_inset Formula $k$
+\end_inset
+
+ so both sides of the equation are 0.
+ Otherwise,
+ for
+\begin_inset Formula $x\in(-1,1)$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+\sum_{n}\binom{r+s}{n}x^{n}=(1+x)^{r+s}=(1+x)^{r}(1+x)^{s}=\sum_{k}\binom{r}{k}x^{k}\sum_{m}\binom{s}{m}x^{m}=\\
+=\sum_{k}\binom{r}{k}x^{k}\sum_{n}\binom{s}{n-k}x^{n-k}=\sum_{n}\left(\sum_{k}\binom{r}{k}\binom{s}{n-k}\right)x^{n}.
+\end{multline*}
+
+\end_inset
+
+If
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+ are integers,
+ the sums are finite and therefore we have polynomials in
+\begin_inset Formula $x$
+\end_inset
+
+ in both side,
+ but since they are both equal in a nonempty open interval,
+ the coefficients are all equal and we have proved the result.
+ If
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+ are not integers,
+ since
+\begin_inset Formula
+\[
+\binom{r+s}{n}-\sum_{k}\binom{r}{k}\binom{s}{n-k}=0
+\]
+
+\end_inset
+
+for all
+\begin_inset Formula $r,s\in\mathbb{Z}$
+\end_inset
+
+,
+ and the left hand side is a polynomial on
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+,
+ it follows that the polynomial is 0 everywhere.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc21[05]
+\end_layout
+
+\end_inset
+
+Both sides of Eq.
+ (25) are polynomials in
+\begin_inset Formula $s$
+\end_inset
+
+;
+ why isn't that equation an identity in
+\begin_inset Formula $s$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We know the equation to be valid for
+\begin_inset Formula $n+1$
+\end_inset
+
+ values of
+\begin_inset Formula $s$
+\end_inset
+
+,
+ namely
+\begin_inset Formula $0,1,\dots,n$
+\end_inset
+
+,
+ but while the polynomial on the left has degree
+\begin_inset Formula $n$
+\end_inset
+
+,
+ the one on the right has degree
+\begin_inset Formula $m+n+1\geq n+1$
+\end_inset
+
+,
+ so we cannot apply the reasoning below Eq.
+ (8).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc30[M24]
+\end_layout
+
+\end_inset
+
+Show that there is a better way to solve Example 3 than the way used in the text,
+ by manipulating the sum so that Eq.
+ (26) applies.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First,
+ we note that the terms are nonzero when
+\begin_inset Formula $k\geq0$
+\end_inset
+
+ and
+\begin_inset Formula $m+2k\leq n+k$
+\end_inset
+
+,
+ which happens precisely when
+\begin_inset Formula $0\leq k\leq n-m$
+\end_inset
+
+,
+ and in particular we may assume
+\begin_inset Formula $n\geq m$
+\end_inset
+
+ since otherwise the sum is 0.
+\end_layout
+
+\begin_layout Standard
+We start by negating the upper index (rule G) in the second factor and using symmetry (rule B) on the first,
+ and noting that all factors with negative
+\begin_inset Formula $k$
+\end_inset
+
+ are 0:
+\begin_inset Formula
+\[
+\sum_{k}\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^{k}}{k+1}=\sum_{k\geq0}\binom{n+k}{n-m-k}\binom{-k-1}{k}\frac{1}{k+1}.
+\]
+
+\end_inset
+
+We have the left hand side of Eq.
+ (26) with
+\begin_inset Formula $t\mapsto1$
+\end_inset
+
+,
+
+\begin_inset Formula $r\mapsto-1$
+\end_inset
+
+,
+
+\begin_inset Formula $n\mapsto n-m$
+\end_inset
+
+,
+ and
+\begin_inset Formula $s\mapsto2n-m$
+\end_inset
+
+,
+ so this is equal to
+\begin_inset Formula
+\[
+\binom{-1+2n-m-n+m}{n-m}=\binom{n-1}{n-m}=\binom{n-1}{m-1}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc31[M20]
+\end_layout
+
+\end_inset
+
+Evaluate
+\begin_inset Formula
+\[
+\sum_{k}\binom{m-r+s}{k}\binom{n+r-s}{n-k}\binom{r+k}{m+n}
+\]
+
+\end_inset
+
+in terms of
+\begin_inset Formula $r$
+\end_inset
+
+,
+
+\begin_inset Formula $s$
+\end_inset
+
+,
+
+\begin_inset Formula $m$
+\end_inset
+
+,
+ and
+\begin_inset Formula $n$
+\end_inset
+
+,
+ given that
+\begin_inset Formula $m$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ are integers.
+ Begin by replacing
+\begin_inset Formula
+\begin{eqnarray*}
+\binom{r+k}{m+n} & \text{ by } & \sum_{j}\binom{r}{m+n-j}\binom{k}{j}.
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We start assuming that
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+ are also integers.
+ The replacement suggested is given directly by Equation 21,
+ and we get
+\begin_inset Formula
+\begin{align*}
+S & \coloneqq\sum_{k}\binom{m-r+s}{k}\binom{n+r-s}{n-k}\binom{r+k}{m+n}\\
+ & =\sum_{k}\sum_{j}\binom{m-r+s}{k}\binom{n+r-s}{n-k}\binom{r}{m+n-j}\binom{k}{j} & \text{Eq. (21)}\\
+ & =\sum_{j}\binom{r}{m+n-j}\binom{m-r+s}{j}\sum_{k}\binom{n+r-s}{n-k}\binom{m-r+s-j}{k-j} & \text{Eq. (20)}\\
+ & =\sum_{j}\binom{r}{m+n-j}\binom{m-r+s}{j}\sum_{k}\binom{n+r-s}{k+r-s}\binom{m-r+s-j}{k-j} & \text{Eq. (6)*}\\
+ & =\sum_{j}\binom{r}{m+n-j}\binom{m-r+s}{j}\binom{m+n-j}{n-j} & \text{Eq. (22)*}\\
+ & =\sum_{j}\binom{r}{m+n-j}\binom{m-r+s}{j}\binom{m+n-j}{m} & \text{Eq. (6)**}\\
+ & =\binom{r}{m}\sum_{j}\binom{m-r+s}{j}\binom{r-m}{n-j} & \text{Eq. (20)}\\
+ & =\binom{r}{m}\binom{s}{n}.
+\end{align*}
+
+\end_inset
+
+ In (**),
+ we use that,
+ for nonzero addends,
+
+\begin_inset Formula $m+n-j\geq0$
+\end_inset
+
+ and therefore we can apply Equation 6.
+ In (*),
+ we assume
+\begin_inset Formula $s\leq m-r$
+\end_inset
+
+.
+ This is not important,
+ since,
+ by the reasoning about polynomials,
+ this has been proved for infinite values of
+\begin_inset Formula $r$
+\end_inset
+
+ and infinite values of
+\begin_inset Formula $s$
+\end_inset
+
+ and therefore applies to all
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $s$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc36[M10]
+\end_layout
+
+\end_inset
+
+What is the sum
+\begin_inset Formula $\sum_{k}\binom{n}{k}$
+\end_inset
+
+ of the numbers in each row of Pascal's triangle?
+ What is the sum of these numbers with alternating signs,
+
+\begin_inset Formula $\sum_{k}\binom{n}{k}(-1)^{k}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $n\geq0$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{align*}
+\sum_{k}\binom{n}{k}=\sum_{k}\binom{n}{k}1^{k}1^{n-k} & =(1+1)^{n}=2^{n},\\
+\sum_{k}\binom{n}{k}(-1)^{k}=\sum_{k}\binom{n}{k}(-1)^{k}1^{n-k} & =(1-1)^{n}=0^{n}=\delta_{n0}.
+\end{align*}
+
+\end_inset
+
+If
+\begin_inset Formula $n<0$
+\end_inset
+
+ the value is generally undefined,
+ as evidenced by Exercise 6.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc37[M10]
+\end_layout
+
+\end_inset
+
+From the answers to the preceding exercise,
+ deduce the value of the sum of every other entry in a row,
+
+\begin_inset Formula $\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\dots$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\sum_{k}\binom{n}{2k}=\sum_{k}\binom{n}{k}[k\text{ even}]=\sum_{k}\binom{n}{k}\frac{1+(-1)^{k}}{2}=\frac{2^{n}+\delta_{n0}}{2}=\left\{ \begin{array}{rl}
+1, & n=0;\\
+2^{n-1}, & n>0.
+\end{array}\right.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc39[M10]
+\end_layout
+
+\end_inset
+
+What is the sum
+\begin_inset Formula $\sum_{k}\stirla nk$
+\end_inset
+
+ of the numbers in each row of Stirling's first triangle?
+ What is the sum of these numbers with alternating signs?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We can use Equation 44:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{multline*}
+\sum_{k}\stirla nk=(-1)^{-n}\sum_{k}(-1)^{n-k}\stirla nk(-1)^{k}=(-1)^{n}(-1)^{\underline{n}}=\\
+=(-1)^{n}(-1)(-2)\cdots(-n)=n!,
+\end{multline*}
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\sum_{k}\stirla nk(-1)^{k}=\sum_{k}\stirla nk(-1)^{-k}=(-1)^{-n}\sum_{k}(-1)^{n-k}\stirla nk1^{k}=(-1)^{n}1^{\underline{n}}=\delta_{n0}-\delta_{n1}.
+\]
+
+\end_inset
+
+The first equation makes sense,
+ as it is the number of permutations of
+\begin_inset Formula $n$
+\end_inset
+
+ symbols irrespective of the number
+\begin_inset Formula $k$
+\end_inset
+
+ of cycles.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc42[HM10]
+\end_layout
+
+\end_inset
+
+Express the binomial coefficient
+\begin_inset Formula $\binom{r}{k}$
+\end_inset
+
+ in terms of the beta function defined above.
+ (This gives us a way to extend the definition to all real values of
+\begin_inset Formula $k$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For integers
+\begin_inset Formula $r\geq0$
+\end_inset
+
+ and
+\begin_inset Formula $k\neq0$
+\end_inset
+
+,
+
+\begin_inset Formula
+\[
+\binom{r}{k}=\frac{r!}{k!(r-k)!}=\frac{\Gamma(r+1)}{\Gamma(k+1)\Gamma(r-k)}=\frac{\Gamma(r+1)}{k\Gamma(k)\Gamma(r-k+1)}=(kB(k,r-k+1))^{-1}.
+\]
+
+\end_inset
+
+We can extend this function to the points where it is not defined by taking limits.
+\end_layout
+
+\begin_layout Standard
+We are not required to evaluate the domain of this function,
+ but we have to see that it matches our definition for
+\begin_inset Formula $r\in\mathbb{R}$
+\end_inset
+
+ and
+\begin_inset Formula $k\in\mathbb{Z}$
+\end_inset
+
+.
+ For
+\begin_inset Formula $k\in\mathbb{N}$
+\end_inset
+
+,
+ we first see that
+\begin_inset Formula
+\begin{multline*}
+\lim_{(x,y)\to(r,k)}\frac{\Gamma(x-y+1)}{\Gamma(x-k+1)}=\lim_{(x,y)\to(r,k)}\frac{\lim_{m}\frac{m^{x-y}m!}{(x-y+1)\cdots(x-y+m)}}{\lim_{m}\frac{m^{x-k}m!}{(x-k+1)\cdots(x-k+m)}}=\\
+=\lim_{(x,y)\to(r,k)}\lim_{m}m^{k-y}\prod_{i=1}^{m}\frac{x+m-y}{x+m-k}=1,
+\end{multline*}
+
+\end_inset
+
+where I don't remember enough of my calculus lessons to know why the last step is correct but it has to do with exchanging limits.
+ With this,
+ if we successively apply the fact that
+\begin_inset Formula $\Gamma(x+1)=x\Gamma(x)$
+\end_inset
+
+,
+
+\begin_inset Formula
+\begin{multline*}
+\lim_{(x,y)\to(r,k)}\frac{\Gamma(x+1)}{y\Gamma(y)\Gamma(x-y+1)}=\lim_{(x,y)\to(r,k)}\frac{x(x-1)\cdots(x-k+1)}{y\Gamma(y)\frac{\Gamma(x-y+1)}{\Gamma(x-k+1)}}=\\
+=\frac{r(r-1)\cdots(r-k+1)}{k!}.
+\end{multline*}
+
+\end_inset
+
+If
+\begin_inset Formula $k\in\mathbb{Z}^{-}$
+\end_inset
+
+,
+ for
+\begin_inset Formula $r\notin\mathbb{Z}^{-}$
+\end_inset
+
+,
+
+\begin_inset Formula $\Gamma(r+1)$
+\end_inset
+
+ is bounded in an open set around
+\begin_inset Formula $(r,k)$
+\end_inset
+
+,
+ and since
+\begin_inset Formula $\Gamma$
+\end_inset
+
+ is continuous and has no zeros,
+ the denominator tends to infinity,
+ so the corresponding limit correctly evaluates to 0.
+ If
+\begin_inset Formula $k,r\in\mathbb{Z}^{-}$
+\end_inset
+
+ I can't find if the value is defined,
+ but if it is then its value is 0.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc44[HM20]
+\end_layout
+
+\end_inset
+
+Using the generalized binomial coefficient suggested in exercise 42,
+ show that
+\begin_inset Formula
+\[
+\binom{r}{1/2}=2^{2r+1}\bigg/\binom{2r}{r}\pi.
+\]
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+From the definition,
+\begin_inset Formula
+\[
+\binom{r}{\frac{1}{2}}=\frac{1}{\frac{1}{2}B(\frac{1}{2},r+\frac{1}{2})}=\frac{2\Gamma(r+1)}{\Gamma(\frac{1}{2})\Gamma(r+\frac{1}{2})}.
+\]
+
+\end_inset
+
+Now,
+ we know
+\begin_inset Formula $\frac{\sqrt{\pi}}{2}=(\frac{1}{2})!=\frac{1}{2}\Gamma(\frac{1}{2})$
+\end_inset
+
+,
+ so
+\begin_inset Formula $\Gamma(\frac{1}{2})=\sqrt{\pi}$
+\end_inset
+
+ and
+\begin_inset Formula
+\[
+\binom{r}{\frac{1}{2}}=\frac{2r!}{\sqrt{\pi}(r-\frac{1}{2})(r-\frac{3}{2})\cdots(\frac{1}{2})\sqrt{\pi}}=\frac{2r!2^{r}}{\pi(2r-1)(2r-3)\cdots1}.
+\]
+
+\end_inset
+
+We see that
+\begin_inset Formula $(2r)!=((2r)(2r-2)\cdots2)((2r-1)(2r-3)\cdots1)$
+\end_inset
+
+.
+ We already have the second factor,
+ and the first one is precisely
+\begin_inset Formula $2^{r}r!$
+\end_inset
+
+,
+ so we multiply both numerator and denominator by this factor to get that
+\begin_inset Formula
+\[
+\binom{r}{\frac{1}{2}}=\frac{2r!2^{r}2^{r}r!}{\pi(2r)!}=\frac{2^{2r+1}}{\binom{2r}{r}\pi}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc46[M21]
+\end_layout
+
+\end_inset
+
+Using Stirling's approximation,
+ Eq.
+ 1.2.5–(7),
+ find an approximate value of
+\begin_inset Formula $\binom{x+y}{y}$
+\end_inset
+
+,
+ assuming that both
+\begin_inset Formula $x$
+\end_inset
+
+ and
+\begin_inset Formula $y$
+\end_inset
+
+ are large.
+ In particular,
+ find the approximate size of
+\begin_inset Formula $\binom{2n}{n}$
+\end_inset
+
+ when
+\begin_inset Formula $n$
+\end_inset
+
+ is large.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For large
+\begin_inset Formula $x$
+\end_inset
+
+ and
+\begin_inset Formula $y$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+\binom{x+y}{y}=\frac{(x+y)!}{x!y!}\approx\frac{\sqrt{2\pi(x+y)}\left(\frac{x+y}{\text{e}}\right)^{x+y}}{\sqrt{2\pi x}\sqrt{2\pi y}\left(\frac{x}{\text{e}}\right)^{x}\left(\frac{y}{\text{e}}\right)^{y}}=\sqrt{\frac{x+y}{2\pi xy}}\left(\frac{(x+y)^{x+y}}{x^{x}y^{y}}\right)=\\
+=\frac{(x+y)^{x+y+\nicefrac{1}{2}}}{\sqrt{2\pi}x^{x+\nicefrac{1}{2}}y^{y+\nicefrac{1}{2}}}=\sqrt{\frac{1}{2\pi}\left(\frac{1}{x}+\frac{1}{y}\right)}\left(1+\frac{y}{x}\right)^{x}\left(1+\frac{x}{y}\right)^{y}.
+\end{multline*}
+
+\end_inset
+
+Then,
+ for large
+\begin_inset Formula $n$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\binom{2n}{n}=\frac{(2n)^{2n+\nicefrac{1}{2}}}{\sqrt{2\pi}n^{2n+1}}=\frac{2^{2n}\sqrt{2}n^{2n}\sqrt{n}}{\sqrt{2\pi}n^{2n}n}=\frac{4^{n}}{\sqrt{\pi n}}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc48[M25]
+\end_layout
+
+\end_inset
+
+Show that
+\begin_inset Formula
+\[
+\sum_{k\geq0}\binom{n}{k}\frac{(-1)^{k}}{k+x}=\frac{n!}{x(x+1)\cdots(x+n)}=\frac{1}{x\binom{n+x}{n}},
+\]
+
+\end_inset
+
+if the denominators are not zero.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The second equality is obvious.
+ For the first one,
+ since the way the formula is written assumes
+\begin_inset Formula $n\in\mathbb{N}$
+\end_inset
+
+,
+ we can prove this by induction.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\sum_{k\geq0}\binom{0}{k}\frac{(-1)^{k}}{k+x}=\frac{1}{x}=\frac{0!}{x}.
+\]
+
+\end_inset
+
+For
+\begin_inset Formula $n>0$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+\sum_{k\geq0}\binom{n}{k}\frac{(-1)^{k}}{k+x}=\sum_{k\geq0}\binom{n-1}{k}\frac{(-1)^{k}}{k+x}+\sum_{k\geq0}\binom{n-1}{k-1}\frac{(-1)^{k}}{k+x}=\\
+=\sum_{k\geq0}\binom{n-1}{k}\frac{(-1)^{k}}{k+x}+\sum_{k\geq0}\binom{n-1}{k}\frac{(-1)^{k+1}}{k+1+x}=\frac{1}{x\binom{n-1+x}{n-1}}-\frac{1}{(x+1)\binom{n+x}{n-1}}=\\
+=\frac{(n-1)!}{x(x+1)\cdots(x+n-1)}-\frac{(n-1)!}{(x+1)(x+2)\cdots(x+n)}=\frac{(n-1)!((\cancel{x+}n)\cancel{-x})}{x(x+1)\cdots(x+n)}.
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc57[M22]
+\end_layout
+
+\end_inset
+
+Show that the coefficient
+\begin_inset Formula $a_{m}$
+\end_inset
+
+ in Stirling's attempt at generalizing the factorial function,
+ Eq.
+ 1.2.5–(12),
+ is
+\begin_inset Formula
+\[
+\frac{(-1)^{m}}{m!}\sum_{k\geq1}(-1)^{k}\binom{m-1}{k-1}\ln k.
+\]
+
+\end_inset
+
+Also find
+\begin_inset Formula $q$
+\end_inset
+
+-nomial generalizations of the fundamental identities (17) and (21).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The sum in Stirling's attempt is
+\begin_inset Formula
+\begin{eqnarray*}
+S_{n} & = & \sum_{k\geq0}a_{k+1}\prod_{j=0}^{k}(n-j)=\sum_{m\geq1}a_{m}\prod_{j=0}^{m-1}(n-j)\\
+ & = & \sum_{m\geq1}\frac{(-1)^{m}}{m!}\left(\sum_{k\geq1}(-1)^{k}\binom{m-1}{k-1}\ln k\right)\prod_{j=0}^{m-1}(n-j)\\
+ & = & \sum_{k\geq1}\left(\sum_{m\geq1}(-1)^{m+k}\binom{n}{m}\binom{m-1}{k-1}\right)\ln k.
+\end{eqnarray*}
+
+\end_inset
+
+There are several things happening in the last line.
+ First,
+ note that both sums are bounded,
+ for
+\begin_inset Formula $m$
+\end_inset
+
+ must be at most
+\begin_inset Formula $n$
+\end_inset
+
+ because otherwise the product would contain a factor
+\begin_inset Formula $n-n=0$
+\end_inset
+
+,
+ and
+\begin_inset Formula $k$
+\end_inset
+
+ must be lower than
+\begin_inset Formula $m$
+\end_inset
+
+,
+ and therefore lower than
+\begin_inset Formula $n$
+\end_inset
+
+,
+ because otherwise the factor
+\begin_inset Formula $\binom{m-1}{k-1}$
+\end_inset
+
+ would be 0.
+ This allows us to swap the sums and extract a factor that only depends on
+\begin_inset Formula $k$
+\end_inset
+
+.
+ Moreover,
+\begin_inset Formula
+\[
+\frac{\prod_{j=0}^{m-1}(n-j)}{m!}=\frac{\prod_{j=1}^{m}(n-j+1)}{\prod_{j=1}^{m}j}=\binom{n}{m}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Let
+\begin_inset Formula $A_{k}$
+\end_inset
+
+ be the value of the inner sum for a given
+\begin_inset Formula $k$
+\end_inset
+
+,
+ we know that
+\begin_inset Formula $A_{k}=0$
+\end_inset
+
+ for
+\begin_inset Formula $k>n$
+\end_inset
+
+,
+ and if we prove that
+\begin_inset Formula $A_{k}=1$
+\end_inset
+
+ for
+\begin_inset Formula $k\leq n$
+\end_inset
+
+,
+ we would have
+\begin_inset Formula
+\[
+S_{n}=\sum_{k=1}^{n}\ln k=\ln\prod_{k=1}^{n}k=\ln n!
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Now,
+ we have
+\begin_inset Formula
+\begin{align*}
+A_{k} & =\sum_{m\geq1}(-1)^{m+k}\binom{n}{m}\binom{m-1}{k-1}\\
+ & =\sum_{m}(-1)^{m+k}\binom{n}{m}\binom{m-1}{k-1}-(-1)^{k}\binom{-1}{k-1} & (*)\\
+ & =\sum_{m}(-1)^{n-m-k}\binom{n}{n-m}\binom{n-m-1}{k-1}+1 & (**)\\
+ & =-\sum_{m}(-1)^{n-m}\binom{n}{m}\binom{k-1-n+m}{k-1}+1 & \text{Rules B, G}\\
+ & =-\binom{k-1-n}{k-1-n}+1=1, & \text{Eq. (23)}
+\end{align*}
+
+\end_inset
+
+where in
+\begin_inset Formula $(*)$
+\end_inset
+
+ we expand the domain of
+\begin_inset Formula $m$
+\end_inset
+
+ to all integers and subtract the case when
+\begin_inset Formula $m=0$
+\end_inset
+
+ to compensate for that (this is the only nonzero term that wasn't considered already) and in
+\begin_inset Formula $(**)$
+\end_inset
+
+ we change
+\begin_inset Formula $m$
+\end_inset
+
+ to
+\begin_inset Formula $n-m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+For the second part of the exercise,
+ we start by writing the identities (17) and (21) in
+\begin_inset Formula $q$
+\end_inset
+
+-nomial notation.
+ For (17),
+ this would be
+\begin_inset Formula
+\begin{eqnarray*}
+\binom{r}{k,r-k}=(-1)^{k}\binom{k-r-1}{k,-r-1}, & \text{ or } & \binom{a+b}{a,b}=(-1)^{a}\binom{-b-1}{a,-(a+b)-1}.
+\end{eqnarray*}
+
+\end_inset
+
+That is,
+ this allows us to change the sum on top to something resembling just one of the numbers that were on the bottom part.
+ To generalize this,
+\begin_inset Formula
+\begin{align*}
+\binom{k_{1}+\dots+k_{m}}{k_{1},\dots,k_{m}} & =\binom{k_{1}+k_{2}}{k_{1}}\cdots\binom{k_{1}+\dots+k_{m}}{k_{1}+\dots+k_{m-1}}\\
+ & =(-1)^{k_{1}+\dots+k_{m-1}}\binom{k_{1}+k_{2}}{k_{1}}\cdots\binom{k_{1}+\dots+k_{m-1}}{k_{1}+\dots+k_{m-2}}\binom{-k_{m}-1}{k_{1}+\dots+k_{m-1}}\\
+ & =(-1)^{k_{1}+\dots+k_{m-1}}\binom{-k_{m}-1}{k_{1},\dots,k_{m-1},-(k_{1}+\dots+k_{m})-1}.
+\end{align*}
+
+\end_inset
+
+We are abusing notation here,
+ since the book only defines multinomial coefficients for
+\begin_inset Formula $k_{i}\geq0$
+\end_inset
+
+,
+ but we can define them for any
+\begin_inset Formula $k_{i}\in\mathbb{Z}$
+\end_inset
+
+ by using the property that relates them to binomial coefficients,
+ at the cost of symmetry with respect to the order of the
+\begin_inset Formula $k_{i}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+For (21),
+ this would be
+\begin_inset Formula
+\[
+\sum_{k}\binom{r}{k,r-k}\binom{s}{n-k,s-n+k}=\binom{r+s}{n,r+s-n}.
+\]
+
+\end_inset
+
+That is,
+ in this case we would add up all the numbers on each component.
+ This clearly holds if we place
+\begin_inset Formula $k,r-k$
+\end_inset
+
+ and
+\begin_inset Formula $n-k,s-n+k$
+\end_inset
+
+ as the two last components of the multinomial coefficient.
+ There must be a better (less silly) generalization but I've already spent way too much time in this exercise.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc60[M23]
+\end_layout
+
+\end_inset
+
+We have seen that
+\begin_inset Formula $\binom{n}{k}$
+\end_inset
+
+ is the number of combinations of
+\begin_inset Formula $n$
+\end_inset
+
+ things,
+
+\begin_inset Formula $k$
+\end_inset
+
+ at a time,
+ namely the number of ways to choose
+\begin_inset Formula $k$
+\end_inset
+
+ different things out of a set of
+\begin_inset Formula $n$
+\end_inset
+
+.
+ The
+\emph on
+combinations with repetitions
+\emph default
+ are similar to ordinary combinations,
+ except that we may choose each object any number of times.
+ Thus,
+ the list (1) would be extended to include also
+\begin_inset Formula $aaa$
+\end_inset
+
+,
+
+\begin_inset Formula $aab$
+\end_inset
+
+,
+
+\begin_inset Formula $aac$
+\end_inset
+
+,
+
+\begin_inset Formula $aad$
+\end_inset
+
+,
+
+\begin_inset Formula $aae$
+\end_inset
+
+,
+
+\begin_inset Formula $abb$
+\end_inset
+
+,
+ etc.,
+ if we were considering combinations with repetition.
+ How many
+\begin_inset Formula $k$
+\end_inset
+
+-combinations of
+\begin_inset Formula $n$
+\end_inset
+
+ objects are there,
+ if repetition is allowed?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We can draw a bijection between
+\begin_inset Formula $k$
+\end_inset
+
+-combinations of
+\begin_inset Formula $\{1,\dots,n\}$
+\end_inset
+
+ with repetition and
+\begin_inset Formula $k$
+\end_inset
+
+-combinations of
+\begin_inset Formula $\{1,\dots,n+k-1\}$
+\end_inset
+
+ without repetition by the following assignment:
+\begin_inset Formula
+\begin{eqnarray*}
+1\leq a_{1}\leq a_{2}\leq\dots\leq a_{k}\leq n & \mapsto & 1\leq a_{1}<a_{2}+1<\dots<a_{k}+k-1\leq n+k-1\\
+1\leq b_{1}\leq b_{2}-1\leq\dots\leq b_{k}-k+1\leq n & \mapsfrom & 1\leq b_{1}<b_{2}<\dots<b_{k}\leq n+k-1
+\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Thus the answer is
+\begin_inset Formula
+\[
+\binom{n+k-1}{k}=(-1)^{k}\binom{-n}{k}=\frac{n^{\overline{k}}}{k!}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc62[M23]
+\end_layout
+
+\end_inset
+
+The text gives formulas for sums involving a product of two binomial coefficients.
+ Of the sums involving a product of three binomial coefficients,
+ the following one and the identity of exercise 31 seem to be the most useful:
+\begin_inset Formula
+\begin{align*}
+\sum_{k}(-1)^{k}\binom{l+m}{l+k}\binom{m+n}{m+k}\binom{n+l}{n+k} & =\frac{(l+m+n)!}{l!m!n!}, & \text{integer }l,m,n & \geq0.
+\end{align*}
+
+\end_inset
+
+(The sum includes both positive and negative values of
+\begin_inset Formula $k$
+\end_inset
+
+.) Prove this identity.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(Looking at the solution.)
+\end_layout
+
+\end_inset
+
+We may assume that
+\begin_inset Formula $l\leq m,n$
+\end_inset
+
+,
+ since we can always rename coefficients to make it this way.
+ Then the application of the identity in exercise 31 is actually from right to left:
+ we add a new variable
+\begin_inset Formula $j$
+\end_inset
+
+,
+ change the last factor
+\begin_inset Formula $\binom{n+l}{n+k}$
+\end_inset
+
+ to
+\begin_inset Formula $\binom{n+k}{l-k}$
+\end_inset
+
+ by symmetry,
+ and apply the aforementioned exercise to the last two factors to get that
+\begin_inset Formula
+\[
+S\coloneqq\sum_{k}(-1)^{k}\binom{l+m}{l+k}\binom{m+n}{m+k}\binom{n+l}{n+k}=\sum_{j,k}(-1)^{k}\binom{l+m}{k+l}\binom{k+l}{j}\binom{m-k}{l-k-j}\binom{m+n+j}{m+l}.
+\]
+
+\end_inset
+
+Using that in general
+\begin_inset Formula $\binom{n}{k}=0$
+\end_inset
+
+ for
+\begin_inset Formula $n\geq0$
+\end_inset
+
+ and
+\begin_inset Formula $k\notin\{0,\dots,n\}$
+\end_inset
+
+,
+ nonzero addends here must follow
+\begin_inset Formula
+\begin{align*}
+-l & \leq k\leq m, & -m & \leq k\leq n, & -n & \leq k\leq l, & 0 & \leq j\leq l+k, & l-m & \leq j\leq l-k;
+\end{align*}
+
+\end_inset
+
+that is,
+
+\begin_inset Formula $\vert k\vert\leq\min\{m,n,l\}$
+\end_inset
+
+ and
+\begin_inset Formula $\max\{l-m,0\}\leq j\leq l-\vert k\vert$
+\end_inset
+
+,
+ which simplifies to
+\begin_inset Formula $\vert k\vert\leq l$
+\end_inset
+
+ and
+\begin_inset Formula $0\leq j\leq l-\vert k\vert$
+\end_inset
+
+ using the conditions at the beginning and then to only
+\begin_inset Formula $0\leq j\leq l-\vert k\vert$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+This means that,
+ in all the binomial coefficients in the right hand side of the above equation,
+ the upper and lower parts are non-negative,
+ so we can substitute them to fractions of coefficients and,
+ after canceling out,
+ we get
+\begin_inset Formula
+\begin{align*}
+S & =\sum_{0\leq j\leq l-\vert k\vert}(-1)^{k}\frac{(m+n+j)!}{j!(l+k-j)!(l-k-j)!(m-l+j)!(n-l+j)!}\\
+ & =\sum_{0\leq j\leq l}\sum_{\vert k\vert\leq l-j}(-1)^{k}\binom{2l-2j}{l+k-j}\frac{(m+n+j)!}{(2l-2j)!j!(m-l+j)!(n-l+j)!},
+\end{align*}
+
+\end_inset
+
+but then the sum of
+\begin_inset Formula $(-1)^{k}\binom{2l-2j}{l+k-j}$
+\end_inset
+
+ across all
+\begin_inset Formula $k$
+\end_inset
+
+ is 0 unless
+\begin_inset Formula $j=l$
+\end_inset
+
+,
+ so we just take the term with
+\begin_inset Formula $j=l$
+\end_inset
+
+ and
+\begin_inset Formula $k=0$
+\end_inset
+
+ to get
+\begin_inset Formula
+\[
+S=(-1)^{0}\binom{2l-2l}{l+0-l}\frac{(m+n+l)!}{(2l-2l)!l!(m-l+l)!(n-l+l)!}=\frac{(l+m+n)!}{l!m!n!}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc64[M20]
+\end_layout
+
+\end_inset
+
+Show that
+\begin_inset Formula $\stirlb nm$
+\end_inset
+
+ is the number of ways to partition a set of
+\begin_inset Formula $n$
+\end_inset
+
+ elements into
+\begin_inset Formula $m$
+\end_inset
+
+ nonempty disjoint subsets.
+ For example,
+ the set
+\begin_inset Formula $\{1,2,3,4\}$
+\end_inset
+
+ can be partitioned into two subsets in
+\begin_inset Formula $\stirlb 42=7$
+\end_inset
+
+ ways:
+
+\begin_inset Formula $\{1,2,3\}\{4\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{1,2,4\}\{3\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{1,3,4\}\{2\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{2,3,4\}\{1\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{1,2\}\{3,4\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{1,3\}\{2,4\}$
+\end_inset
+
+;
+
+\begin_inset Formula $\{1,4\}\{2,3\}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $n,m\in\mathbb{N}$
+\end_inset
+
+,
+ we prove this by induction in
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $m$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+ there is
+\begin_inset Formula $1=\stirlb 00$
+\end_inset
+
+ way to partition
+\begin_inset Formula $\emptyset$
+\end_inset
+
+ into 0 nonempty disjoint subsets and
+\begin_inset Formula $0=\stirlb 0m$
+\end_inset
+
+ ways to partition it into
+\begin_inset Formula $m\geq1$
+\end_inset
+
+ nonempty subsets,
+ which matches Equation 48.
+ For
+\begin_inset Formula $m=0$
+\end_inset
+
+ and
+\begin_inset Formula $n\geq1$
+\end_inset
+
+,
+ there are
+\begin_inset Formula $0=\stirlb n0$
+\end_inset
+
+ ways to divide a set of
+\begin_inset Formula $n$
+\end_inset
+
+ elements into 0 nonempty subsets.
+
+\end_layout
+
+\begin_layout Standard
+Now,
+ for the induction step,
+ if
+\begin_inset Formula $n\geq1$
+\end_inset
+
+ and
+\begin_inset Formula $m\geq1$
+\end_inset
+
+,
+ a partition of a set like
+\begin_inset Formula $\{1,\dots,n\}$
+\end_inset
+
+ into nonempty subsets can be thought of as a partition of
+\begin_inset Formula $\{1,\dots,n-1\}$
+\end_inset
+
+ to which
+\begin_inset Formula $n$
+\end_inset
+
+ has been added either to one of the elements of a partition or in a separate singleton set.
+ If the partition of
+\begin_inset Formula $\{1,\dots,n\}$
+\end_inset
+
+ has
+\begin_inset Formula $m$
+\end_inset
+
+ nonempty subsets,
+ for the first option we might add
+\begin_inset Formula $n$
+\end_inset
+
+ to any of the subsets of a partition of
+\begin_inset Formula $\{1,\dots,n-1\}$
+\end_inset
+
+ with
+\begin_inset Formula $m$
+\end_inset
+
+ subsets,
+ and for the second one,
+ we would need a partition of
+\begin_inset Formula $\{1,\dots,n-1\}$
+\end_inset
+
+ with
+\begin_inset Formula $m-1$
+\end_inset
+
+ subsets.
+ Thus we would need
+\begin_inset Formula
+\[
+\stirlb nm=m\stirlb{n-1}m+\stirlb{n-1}{m-1},
+\]
+
+\end_inset
+
+but this is precisely Equation 46.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc67[M20]
+\end_layout
+
+\end_inset
+
+We often need to know that binomial coefficients aren't too large.
+ Prove the easy-to-remember upper bound
+\begin_inset Formula
+\begin{align*}
+\binom{n}{k} & \leq\left(\frac{n\text{e}}{k}\right)^{k}, & \text{when }n\geq k & \geq0.
+\end{align*}
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+From Exercise 1.2.5–21,
+ if
+\begin_inset Formula $k\geq1$
+\end_inset
+
+,
+ then
+\begin_inset Formula $k!\geq\frac{k^{k}}{\text{e}^{k-1}}$
+\end_inset
+
+,
+ so
+\begin_inset Formula
+\[
+\binom{n}{k}=\frac{n(n-1)\cdots(n-k+1)}{k!}\leq\frac{n(n-1)\cdots(n-k+1)}{\frac{k^{k}}{\text{e}^{k-1}}}\leq\frac{n^{k}\text{e}^{k-1}}{k^{k}}\leq\left(\frac{n\text{e}}{k}\right)^{k}.
+\]
+
+\end_inset
+
+For
+\begin_inset Formula $k=0$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\lim_{k\to0}\left(\frac{n\text{e}}{k}\right)^{k}=\lim_{k\to\infty}\sqrt[k]{n\text{e}k}=1=\binom{n}{0}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.7.lyx b/1.2.7.lyx
new file mode 100644
index 0000000..f110304
--- /dev/null
+++ b/1.2.7.lyx
@@ -0,0 +1,572 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\usepackage{amsmath}
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[01]
+\end_layout
+
+\end_inset
+
+What are
+\begin_inset Formula $H_{0}$
+\end_inset
+
+,
+
+\begin_inset Formula $H_{1}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $H_{2}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $H_{0}=0$
+\end_inset
+
+,
+
+\begin_inset Formula $H_{1}=1$
+\end_inset
+
+,
+
+\begin_inset Formula $H_{2}=\frac{3}{2}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[10]
+\end_layout
+
+\end_inset
+
+Decide which of the following statements are true for all positive integers
+\begin_inset Formula $n$
+\end_inset
+
+:
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $H_{n}<\ln n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $H_{n}>\ln n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $H_{n}>\ln n+\gamma$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+False,
+ since
+\begin_inset Formula $H_{2}=\frac{3}{2}>1>\ln2$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+True,
+ because the next one is true.
+\end_layout
+
+\begin_layout Enumerate
+True.
+ If this wasn't true for some number
+\begin_inset Formula $n$
+\end_inset
+
+,
+ then it would be
+\begin_inset Formula
+\[
+0\geq H_{n}-(\ln n+\gamma)>\frac{1}{2n}-\frac{1}{12n^{2}}+\frac{1}{12n^{4}}-\frac{1}{252n^{6}},
+\]
+
+\end_inset
+
+but
+\begin_inset Formula $\frac{1}{2n}>\frac{1}{12n^{2}}$
+\end_inset
+
+ and
+\begin_inset Formula $\frac{1}{12n^{4}}>\frac{1}{252n^{6}}$
+\end_inset
+
+ for any
+\begin_inset Formula $n\geq1\#$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[M18]
+\end_layout
+
+\end_inset
+
+Theorem A applies only when
+\begin_inset Formula $x>0$
+\end_inset
+
+;
+ what is the value of the sum considered when
+\begin_inset Formula $x=-1$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Using Equation 1.2.6(18) in
+\begin_inset Formula $(*)$
+\end_inset
+
+ and Exercise 1.2.6–48 in
+\begin_inset Formula $(**)$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{multline*}
+\sum_{k=1}^{n}\binom{n}{k}(-1)^{k}H_{k}=\sum_{1\leq j\leq k\leq n}\binom{n}{k}(-1)^{k}\frac{1}{j}=\sum_{j=1}^{n}\frac{1}{j}\sum_{k=j}^{n}\binom{n}{k}(-1)^{k}=\\
+=(-1)^{n}\sum_{j=1}^{n}\frac{1}{j}\sum_{k=0}^{n-j}\binom{n}{k}(-1)^{k}\overset{(*)}{=}(-1)^{\cancel{n}}\sum_{j=1}^{n}\frac{1}{j}(-1)^{\cancel{n}-j}\binom{n-1}{n-j}=\\
+=\sum_{j=0}^{n}\frac{1}{j+1}(-1)^{-j-1}\binom{n-1}{n-j-1}=-\sum_{j=0}^{n-1}\frac{(-1)^{j}}{j+1}\binom{n-1}{j}\overset{(**)}{=}\frac{1}{\binom{n}{n-1}}=-\frac{1}{n}.
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[M21]
+\end_layout
+
+\end_inset
+
+Using summation by parts,
+ evaluate
+\begin_inset Formula
+\[
+\sum_{1<k\leq n}\frac{1}{k(k-1)}H_{k}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We have
+\begin_inset Formula
+\[
+\frac{1}{k(k-1)}H_{k}=\left(\frac{1}{k-1}-\frac{1}{k}\right)H_{k}=\frac{1}{k-1}\left(H_{k-1}+\frac{1}{k}\right)-\frac{1}{k}H_{k},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{multline*}
+\sum_{k=2}^{n}\frac{H_{k}}{k(k-1)}=\sum_{k=2}^{n}\left(\frac{1}{k-1}\left(H_{k-1}+\frac{1}{k}\right)-\frac{1}{k}H_{k}\right)=1-\frac{1}{n}H_{n}+\sum_{k=2}^{n}\frac{1}{k(k-1)}=\\
+=1-\frac{H_{n}}{n}+\sum_{k=2}^{n}\left(\frac{1}{k-1}-\frac{1}{k}\right)=1-\frac{H_{n}}{n}+H_{n-1}-H_{n}+1=\\
+=1-\frac{1}{n}H_{n}\cancel{+H_{n}}-\frac{1}{n}\cancel{-H_{n}}+1=2-\frac{1}{n}(1+H_{n}).
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc12[M10]
+\end_layout
+
+\end_inset
+
+Evaluate
+\begin_inset Formula $H_{\infty}^{(1000)}$
+\end_inset
+
+ correct to at least 100 decimal places.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+H_{\infty}^{(1000)}=\sum_{k\geq1}\frac{1}{k^{1000}}=1\pm0.5\cdot10^{-100},
+\]
+
+\end_inset
+
+since
+\begin_inset Formula $2^{1000}$
+\end_inset
+
+ has way more than 100 digits.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc15[M23]
+\end_layout
+
+\end_inset
+
+Express
+\begin_inset Formula $\sum_{k=1}^{n}H_{k}^{2}$
+\end_inset
+
+ in terms of
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $H_{n}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{align*}
+\sum_{k=1}^{n}H_{k}^{2} & =\sum_{1\leq j\leq k\leq n}\frac{1}{j}H_{k}=\sum_{j=1}^{n}\frac{1}{j}\sum_{k=j}^{n}H_{k}=\sum_{j=1}^{n}\frac{1}{j}\left(\sum_{k=1}^{n}H_{k}-\sum_{k=1}^{j-1}H_{k}\right)\\
+ & =\sum_{j=1}^{n}\frac{1}{j}\left((n+1)H_{n}-n-jH_{j-1}+j-1\right)\\
+ & =\sum_{j=1}^{n}\left(\frac{1}{j}\left((n+1)H_{n}-n-1\right)-H_{j-1}+1\right)\\
+ & =\left((n+1)H_{n}-n-1\right)H_{n}-(nH_{n-1}-n+1)+n\\
+ & =(n+1)H_{n}^{2}-(n+1)H_{n}-nH_{n}+n+n\\
+ & =(n+1)H_{n}^{2}-(2n+1)H_{n}+2n.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc23[HM20]
+\end_layout
+
+\end_inset
+
+By considering the function
+\begin_inset Formula $\Gamma'(x)/\Gamma(x)$
+\end_inset
+
+,
+ generalize
+\begin_inset Formula $H_{n}$
+\end_inset
+
+ to noninteger values of
+\begin_inset Formula $n$
+\end_inset
+
+.
+ You may use the fact that
+\begin_inset Formula $\Gamma'(1)=-\gamma$
+\end_inset
+
+,
+ anticipating the next exercise.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We have
+\begin_inset Formula
+\begin{multline*}
+\Gamma'(x)=\lim_{m}\left(\frac{\ln m\cdot m^{x}m!}{x(x+1)\cdots(x+m)}-\frac{m^{x}m!\sum_{k=0}^{m}\frac{x(x+1)\cdots(x+m)}{(x+k)}}{(x(x+1)\cdots(x+m))^{2}}\right)=\\
+=\Gamma(x)\lim_{m}\left(\ln m-\sum_{k=0}^{m}\frac{1}{x+k}\right)=\Gamma(x)(\ln m-H_{k+m}+H_{k-1}).
+\end{multline*}
+
+\end_inset
+
+The fact given in the exercise tells us that
+\begin_inset Formula
+\[
+-\gamma=\Gamma'(1)=\Gamma(1)\lim_{m}(\ln m-H_{m+1}),
+\]
+
+\end_inset
+
+so for
+\begin_inset Formula $n\in\mathbb{Z}^{>0}$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\frac{\Gamma'(n)}{\Gamma(n)}=\lim_{m}(\ln m-H_{n+m}+H_{n-1})=H_{n-1}-\gamma,
+\]
+
+\end_inset
+
+and we can define
+\begin_inset Formula
+\[
+H_{x}\coloneqq\frac{\Gamma'(x+1)}{\Gamma(x+1)}+\gamma
+\]
+
+\end_inset
+
+for any
+\begin_inset Formula $x\in\mathbb{C}$
+\end_inset
+
+ where this expression is defined or can be extended by continuity.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.8.lyx b/1.2.8.lyx
new file mode 100644
index 0000000..23e44dc
--- /dev/null
+++ b/1.2.8.lyx
@@ -0,0 +1,1852 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\usepackage{amsmath}
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[10]
+\end_layout
+
+\end_inset
+
+What is the answer to Leonardo Fibonacci's original problem:
+ How many pairs of rabbits are present after a year?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+After one month there are
+\begin_inset Formula $F_{3}=2$
+\end_inset
+
+ pairs of rabbits,
+ after two months there are
+\begin_inset Formula $F_{4}=3$
+\end_inset
+
+,
+ etc.,
+ therefore after a year there are
+\begin_inset Formula $F_{14}=377$
+\end_inset
+
+ pairs of rabbits.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[20]
+\end_layout
+
+\end_inset
+
+In view of Eq.
+ (15),
+ what is the approximate value of
+\begin_inset Formula $F_{1000}$
+\end_inset
+
+?
+ (Use logarithms found in Appendix A.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{align*}
+F_{1000} & \approx\frac{\phi^{1000}}{\sqrt{5}}=\frac{10^{\log\phi^{1000}}}{\sqrt{5}}=\frac{10^{1000(\ln\phi/\ln10)}}{\sqrt{5}}\cong\frac{10^{1000\cdot0.48121...\cdot0.43429...}}{2.23606...}\cong\frac{10^{208.9876..}}{2.23606...}\\
+ & \cong\frac{10^{0.9876}}{2.23606}\cdot10^{208}\cong4.3\cdot10^{208}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[14]
+\end_layout
+
+\end_inset
+
+Find all
+\begin_inset Formula $n$
+\end_inset
+
+ for which
+\begin_inset Formula $F_{n}=n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $F_{0}=0$
+\end_inset
+
+,
+
+\begin_inset Formula $F_{1}=1$
+\end_inset
+
+.
+ Then
+\begin_inset Formula $F_{2}=1$
+\end_inset
+
+,
+
+\begin_inset Formula $F_{3}=2$
+\end_inset
+
+,
+
+\begin_inset Formula $F_{4}=3$
+\end_inset
+
+,
+
+\begin_inset Formula $F_{5}=5$
+\end_inset
+
+,
+ and from here
+\begin_inset Formula $F_{n}$
+\end_inset
+
+ grows strictly faster than
+\begin_inset Formula $n$
+\end_inset
+
+ so there are no more such numbers.
+ Thus only 0,
+ 1,
+ and 5 meet this condition.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[15]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $n$
+\end_inset
+
+ is not a prime number,
+
+\begin_inset Formula $F_{n}$
+\end_inset
+
+ is not a prime number (with one exception).
+ Prove this and find the exception.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The exception is
+\begin_inset Formula $F_{4}=3$
+\end_inset
+
+.
+ For the general rule,
+ let
+\begin_inset Formula $r,s\in\mathbb{Z}$
+\end_inset
+
+ with
+\begin_inset Formula $r\geq3$
+\end_inset
+
+ and
+\begin_inset Formula $s\geq2$
+\end_inset
+
+,
+ by Eq.
+ (6),
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{align*}
+F_{rs} & =F_{r+r(s-1)}=F_{r(s-1)}F_{r+1}+F_{r(s-1)-1}F_{r}=F_{r}(F_{r(s-1)}+F_{r(s-1)-1})+F_{r-1}F_{r(s-1)}\\
+ & =F_{r}\left(F_{r(s-1)+1}+F_{r-1}{\textstyle \frac{F_{r(s-1)}}{F_{r}}}\right),
+\end{align*}
+
+\end_inset
+
+where the fraction in the last part is an integer.
+ If
+\begin_inset Formula $r>2$
+\end_inset
+
+,
+ then
+\begin_inset Formula $F_{r}>1$
+\end_inset
+
+ and,
+ since
+\begin_inset Formula $F_{r(s-1)+1}>1$
+\end_inset
+
+,
+ we have a decomposition of
+\begin_inset Formula $F_{rs}$
+\end_inset
+
+ as a compound number.
+ Every compound number other than 4 can be expressed as a product of integers
+\begin_inset Formula $rs$
+\end_inset
+
+ with
+\begin_inset Formula $r\geq3$
+\end_inset
+
+ and
+\begin_inset Formula $s\geq2$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[M22]
+\end_layout
+
+\end_inset
+
+Express the following sequences in terms of the Fibonacci numbers,
+ when
+\begin_inset Formula $r$
+\end_inset
+
+,
+
+\begin_inset Formula $s$
+\end_inset
+
+,
+ and
+\begin_inset Formula $c$
+\end_inset
+
+ are given constants:
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $a_{0}=r$
+\end_inset
+
+,
+
+\begin_inset Formula $a_{1}=s$
+\end_inset
+
+;
+
+\begin_inset Formula $a_{n+2}=a_{n+1}+a_{n}$
+\end_inset
+
+,
+ for
+\begin_inset Formula $n\geq0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $b_{0}=0$
+\end_inset
+
+,
+
+\begin_inset Formula $b_{1}=1$
+\end_inset
+
+;
+
+\begin_inset Formula $b_{n+2}=b_{n+1}+b_{n}+c$
+\end_inset
+
+,
+ for
+\begin_inset Formula $n\geq0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+We have
+\begin_inset Formula
+\[
+\binom{a_{n+1}}{a_{n}}=\begin{pmatrix}1 & 1\\
+1 & 0
+\end{pmatrix}\begin{pmatrix}a_{n}\\
+a_{n-1}
+\end{pmatrix}=\dots=\begin{pmatrix}1 & 1\\
+1 & 0
+\end{pmatrix}^{n}\begin{pmatrix}s\\
+r
+\end{pmatrix}=\begin{pmatrix}F_{n+1}s+F_{n}r\\
+F_{n}s+F_{n-1}r
+\end{pmatrix},
+\]
+
+\end_inset
+
+so in general
+\begin_inset Formula $a_{n}=F_{n-1}r+F_{n}s$
+\end_inset
+
+,
+ using the convention that
+\begin_inset Formula $F_{-1}=1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+We have
+\begin_inset Formula
+\[
+\begin{pmatrix}b_{n+1}\\
+b_{n}\\
+1
+\end{pmatrix}=\begin{pmatrix}1 & 1 & c\\
+1 & 0 & 0\\
+0 & 0 & 1
+\end{pmatrix}\begin{pmatrix}b_{n}\\
+b_{n-1}\\
+1
+\end{pmatrix}=\dots=\begin{pmatrix}1 & 1 & c\\
+1 & 0 & 0\\
+0 & 0 & 1
+\end{pmatrix}^{n}\begin{pmatrix}1\\
+0\\
+1
+\end{pmatrix}.
+\]
+
+\end_inset
+
+By playing a bit with this matrix,
+ we come to the conclusion that
+\begin_inset Formula
+\[
+\begin{pmatrix}1 & 1 & c\\
+1\\
+ & & 1
+\end{pmatrix}^{n}=\begin{pmatrix}F_{n+1} & F_{n} & (F_{n+2}-1)c\\
+F_{n} & F_{n-1} & (F_{n+1}-1)c\\
+ & & 1
+\end{pmatrix}
+\]
+
+\end_inset
+
+and therefore
+\begin_inset Formula
+\[
+b_{n}=F_{n}+(F_{n+1}-1)c.
+\]
+
+\end_inset
+
+For
+\begin_inset Formula $n=0$
+\end_inset
+
+ and
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+ this is easy to check.
+ For
+\begin_inset Formula $n\geq2$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+b_{n}=b_{n-1}+b_{n-2}+c=F_{n-1}+(F_{n}-1)c+F_{n-2}+(F_{n-1}-1)c+c=F_{n}+(F_{n+1}-1)c.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc16[M20]
+\end_layout
+
+\end_inset
+
+Fibonacci numbers appear implicitly in Pascal's triangle if it is viewed from the right angle.
+ Show that the following sum of binomial coefficients is a Fibonacci number:
+\begin_inset Formula
+\[
+\sum_{k=0}^{n}\binom{n-k}{k}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove by induction that this sum is precisely
+\begin_inset Formula $F_{n+1}$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+ and
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+ this is a simple check.
+ For
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{align*}
+\sum_{k=0}^{n}\binom{n-k}{k} & =\sum_{k=0}^{n}\binom{n-k-1}{k}+\sum_{k=0}^{n}\binom{n-k-1}{k-1}\\
+ & =\sum_{k=0}^{n}\binom{n-k-1}{k}+\sum_{k=-1}^{n-1}\binom{n-k-2}{k}\\
+ & =\sum_{k=0}^{n-1}\binom{(n-1)-k}{k}+\sum_{k=0}^{n-2}\binom{(n-2)-k}{k}=F_{n}+F_{n-1}=F_{n+1}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[M20]
+\end_layout
+
+\end_inset
+
+Show that
+\begin_inset Formula $\sum_{k}\binom{n}{k}F_{m+k}$
+\end_inset
+
+ is a Fibonacci number.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove by induction on
+\begin_inset Formula $n$
+\end_inset
+
+ that this sum is
+\begin_inset Formula $F_{m+2n}$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+ and
+\begin_inset Formula $n=1$
+\end_inset
+
+,
+ this is a simple check.
+ For
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{align*}
+\sum_{k}\binom{n}{k}F_{m+k} & =\sum_{k}\binom{n-1}{k}F_{m+k}+\sum_{k}\binom{n-1}{k-1}F_{m+k}\\
+ & =F_{m+2(n-1)}+\sum_{k}\binom{n-1}{k}F_{m+1+k}\\
+ & =F_{m+2(n-1)}+F_{m+1+2(n-1)}=F_{m+2+2(n-1)}=F_{m+2n}.
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc26[M20]
+\end_layout
+
+\end_inset
+
+Using the previous exercise,
+ show that
+\begin_inset Formula $F_{p}=5^{(p-1)/2}\pmod p$
+\end_inset
+
+ if
+\begin_inset Formula $p$
+\end_inset
+
+ is an odd prime.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The previous exercise tells us that
+\begin_inset Formula
+\[
+2^{n}F_{n}=2\sum_{k\text{ odd}}\binom{n}{k}5^{(k-1)/2}.
+\]
+
+\end_inset
+
+Now,
+ if
+\begin_inset Formula $n=p$
+\end_inset
+
+ is prime,
+
+\begin_inset Formula $\binom{p}{k}=\frac{p(p-1)\cdots(p-k+1)}{1\cdots k}$
+\end_inset
+
+ is a multiple of
+\begin_inset Formula $p$
+\end_inset
+
+ for
+\begin_inset Formula $k\in\{1,\dots,p-1\}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $k=0$
+\end_inset
+
+ is not odd,
+ so
+\begin_inset Formula
+\[
+2^{p-1}F_{p}=\sum_{k\text{ odd}}\binom{p}{k}5^{(k-1)/2}\equiv\binom{p}{p}5^{(p-1)/2}=5^{(p-1)/2}\pmod p,
+\]
+
+\end_inset
+
+but by Fermat's theorem,
+
+\begin_inset Formula $2^{p-1}\equiv1\pmod p$
+\end_inset
+
+,
+ so this simplifies to the desired result.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc29[M23]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Fibonomial coefficients.
+\emph default
+) Édouard Lucas defined the quantities
+\begin_inset Formula
+\[
+\binom{n}{k}_{{\cal F}}=\frac{F_{n}F_{n-1}\cdots F_{n-k+1}}{F_{k}F_{k-1}\cdots F_{1}}=\prod_{j=1}^{k}\left(\frac{F_{n-k+j}}{F_{j}}\right)
+\]
+
+\end_inset
+
+in a manner analogous to binomial coefficients.
+\end_layout
+
+\begin_layout Enumerate
+Make a table of
+\begin_inset Formula $\binom{n}{k}_{{\cal F}}$
+\end_inset
+
+ for
+\begin_inset Formula $0\leq k\leq n\leq6$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Show that
+\begin_inset Formula $\binom{n}{k}_{{\cal F}}$
+\end_inset
+
+ is always an integer because we have
+\begin_inset Formula
+\[
+\binom{n}{k}_{{\cal F}}=F_{k-1}\binom{n-1}{k}_{{\cal F}}+F_{n-k+1}\binom{n-1}{k-1}_{{\cal F}}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="8" columns="8">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" bottomline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $n$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{0}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{1}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{2}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{3}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{4}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{5}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\binom{n}{6}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+15
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+15
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+40
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+60
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+40
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+We have
+\begin_inset Formula
+\begin{multline*}
+F_{k-1}\binom{n-1}{k}_{{\cal F}}+F_{n-k+1}\binom{n-1}{k-1}_{{\cal F}}=\\
+=F_{k-1}\prod_{j=1}^{k}\frac{F_{n-k+j-1}}{F_{j}}+F_{n-k+1}\prod_{j=1}^{k-1}\frac{F_{n-k+j}}{F_{j}}=\\
+=\frac{1}{F_{k}}\left(\prod_{j=1}^{k-1}\frac{F_{n-k+j}}{F_{j}}\right)(F_{k-1}F_{n-k}+F_{n-k+1}F_{k}),
+\end{multline*}
+
+\end_inset
+
+where the last identity is better read backwards,
+ and by Eq.
+ (6),
+\begin_inset Formula
+\[
+F_{n}=F_{(n-k)+k}=F_{k}F_{n-k+1}+F_{k-1}F_{n-k},
+\]
+
+\end_inset
+
+so the above simplifies precisely to
+\begin_inset Formula $\binom{n}{k}_{{\cal F}}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc34[M24]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+The Fibonacci number system.
+\emph default
+) Let the notation
+\begin_inset Formula $k\gg m$
+\end_inset
+
+ mean that
+\begin_inset Formula $k\geq m+2$
+\end_inset
+
+.
+ Show that every positive integer
+\begin_inset Formula $n$
+\end_inset
+
+ has a
+\emph on
+unique
+\emph default
+ representation
+\begin_inset Formula $n=F_{k_{1}}+F_{k_{2}}+\dots+F_{k_{r}}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $k_{1}\gg k_{2}\gg\cdots\gg k_{r}\gg0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $n\leq3$
+\end_inset
+
+,
+ this is easy to check.
+ Otherwise,
+ let
+\begin_inset Formula $k$
+\end_inset
+
+ be the greatest number such that
+\begin_inset Formula $n\geq F_{k}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $n=F_{k}$
+\end_inset
+
+,
+ we're done.
+ Otherwise
+\begin_inset Formula $n>3$
+\end_inset
+
+ and
+\begin_inset Formula $k\geq4$
+\end_inset
+
+,
+ and
+\begin_inset Formula $n-F_{k}<F_{k-1}$
+\end_inset
+
+ (otherwise
+\begin_inset Formula $F_{k+1}\leq n\#$
+\end_inset
+
+),
+ and it can be expressed this way by induction.
+
+\end_layout
+
+\begin_layout Standard
+To see that this representation is unique,
+ let
+\begin_inset Formula $n=F_{k_{1}}+\dots+F_{k_{r}}=F_{j_{1}}+\dots+F_{j_{s}}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $n\leq3$
+\end_inset
+
+,
+ this is easy to check.
+ Otherwise,
+ if
+\begin_inset Formula $F_{k_{1}}=F_{j_{1}}$
+\end_inset
+
+ we use induction;
+ otherwise assume
+\begin_inset Formula $F_{k_{1}}>F_{j_{1}}\geq2$
+\end_inset
+
+,
+ and we want to prove that
+\begin_inset Formula
+\[
+F_{j_{2}}+\dots+F_{j_{s}}\leq F_{j_{1}-2}+\dots+F_{\lfloor j_{1}\bmod2\rfloor+2}\leq F_{j_{1}-1}\leq F_{k_{1}}-F_{j_{1}}.
+\]
+
+\end_inset
+
+The first inequality comes from the highest value that
+\begin_inset Formula $F_{j_{2}}+\dots+F_{j_{s}}$
+\end_inset
+
+ could possibly have,
+ and the last one from the highest value that
+\begin_inset Formula $F_{j_{1}}+F_{j_{1}-1}$
+\end_inset
+
+ could.
+ For the middle one we use induction.
+ For
+\begin_inset Formula $j_{1}\in\{2,3\}$
+\end_inset
+
+,
+ the left hand side is 0.
+ Otherwise
+\begin_inset Formula
+\[
+F_{j_{1}-2}+F_{j_{1}-4}+\dots+F_{\lfloor j_{1}\bmod2\rfloor+2}\leq F_{j_{1}-2}+F_{j_{1}-3}=F_{j_{1}-1}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc41[M25]
+\end_layout
+
+\end_inset
+
+(Yuri Matiyasevich,
+ 1990.) Let
+\begin_inset Formula $f(x)=\lfloor x+\phi^{-1}\rfloor$
+\end_inset
+
+.
+ Prove that if
+\begin_inset Formula $n=F_{k_{1}}+\dots+F_{k_{r}}$
+\end_inset
+
+ is the representation of
+\begin_inset Formula $n$
+\end_inset
+
+ in the Fibonacci number system of exercise 34,
+ then
+\begin_inset Formula $F_{k_{1}+1}+\dots+F_{k_{r}+1}=f(\phi n)$
+\end_inset
+
+.
+ Find a similar formula for
+\begin_inset Formula $F_{k_{1}-1}+\dots+F_{k_{r}-1}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Using that each
+\begin_inset Formula $F_{k_{i}}=\frac{1}{\sqrt{5}}(\phi^{k_{i}}+\hat{\phi}^{k_{i}})$
+\end_inset
+
+,
+ let
+\begin_inset Formula $m\coloneqq F_{k_{1}+1}+\dots+F_{k_{r}+1}$
+\end_inset
+
+,
+ since
+\begin_inset Formula $m\in\mathbb{Z}$
+\end_inset
+
+,
+\begin_inset Formula
+\begin{align*}
+f(\phi n)-m & =\left\lfloor \frac{1}{\sqrt{5}}\left(\sum_{i}\phi^{k_{i}+1}+\sum_{i}\hat{\phi}^{k_{i}-1}\right)-\hat{\phi}\right\rfloor -\frac{1}{\sqrt{5}}\left(\sum_{i}\phi^{k_{i}+1}-\sum_{i}\hat{\phi}^{k_{i}+1}\right)\\
+ & =\left\lfloor \frac{1}{\sqrt{5}}\sum_{i}(\hat{\phi}^{k_{i}-1}+\hat{\phi}^{k_{i}+1})-\hat{\phi}\right\rfloor =\left\lfloor \frac{1+\hat{\phi}^{2}}{\sqrt{5}}\sum_{i}\hat{\phi}^{k_{i}-1}-\hat{\phi}\right\rfloor .
+\end{align*}
+
+\end_inset
+
+Here,
+ when
+\begin_inset Formula $k_{i}$
+\end_inset
+
+ is even,
+
+\begin_inset Formula $\hat{\phi}^{k_{i}-1}$
+\end_inset
+
+ is negative,
+ and when it's odd,
+
+\begin_inset Formula $\hat{\phi}^{k_{i}-1}$
+\end_inset
+
+ is positive,
+ so the value of this sum is strictly lower than
+\begin_inset Formula $\sum_{k\geq1}\hat{\phi}^{2k}=\frac{\hat{\phi}^{2}}{1-\hat{\phi}^{2}}$
+\end_inset
+
+,
+ and strictly greater than
+\begin_inset Formula $\sum_{k\geq1}\hat{\phi}^{2k-1}=\frac{\hat{\phi}}{1-\hat{\phi}^{2}}$
+\end_inset
+
+.
+ Now,
+
+\begin_inset Formula $\hat{\phi}^{2}=\frac{1}{4}(1-\sqrt{5})^{2}=\frac{1}{4}(6-2\sqrt{5})=\frac{1}{2}(3-\sqrt{5})$
+\end_inset
+
+,
+ so
+\begin_inset Formula $1-\hat{\phi}^{2}=\frac{1}{2}(2-3+\sqrt{5})=-\frac{1}{2}(1-\sqrt{5})=-\hat{\phi}$
+\end_inset
+
+ and therefore the lower bound of what is inside the brackets above is
+\begin_inset Formula
+\[
+\frac{1+\hat{\phi}^{2}}{\sqrt{5}}\frac{\hat{\phi}}{1-\hat{\phi}^{2}}-\hat{\phi}=-\frac{1+\hat{\phi}^{2}}{\sqrt{5}}-\hat{\phi}=-\frac{5-\sqrt{5}}{2\sqrt{5}}-\frac{1-\sqrt{5}}{2}=-\frac{5-\sqrt{5}+\sqrt{5}-5}{2\sqrt{5}}=0,
+\]
+
+\end_inset
+
+and the upper bound is
+\begin_inset Formula
+\[
+-\hat{\phi}\frac{1+\hat{\phi}^{2}}{\sqrt{5}}-\hat{\phi}=-\hat{\phi}\left(\frac{5-\sqrt{5}}{2\sqrt{5}}+1\right)=-\hat{\phi}\left(\frac{5+\sqrt{5}}{2\sqrt{5}}\right)=-\hat{\phi}\phi=1,
+\]
+
+\end_inset
+
+and since these bounds are never reached,
+ the property has been proven.
+ A similar argument can be made to prove that
+\begin_inset Formula $F_{k_{1}-1}+\dots+F_{k_{r}-1}=f(n/\phi)$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.2.9.lyx b/1.2.9.lyx
new file mode 100644
index 0000000..6bc6c57
--- /dev/null
+++ b/1.2.9.lyx
@@ -0,0 +1,846 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\use_default_options true
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[M13]
+\end_layout
+
+\end_inset
+
+Prove Eq.
+ (11).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\left(\sum_{n\geq0}\frac{a_{n}}{n!}z^{n}\right)\left(\sum_{m\geq0}\frac{b_{m}}{m!}z^{m}\right)=\sum_{n\geq0}\left(\sum_{k}\frac{a_{k}b_{n-k}}{k!(n-k)!}\right)z^{n}=\sum_{n\geq0}\frac{1}{n!}\left(\sum_{k}\binom{n}{k}a_{k}b_{n-k}\right)z^{n}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[M01]
+\end_layout
+
+\end_inset
+
+Explain why Eq.
+ (19) is a special case of Eq.
+ (21).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Just set
+\begin_inset Formula $t=0$
+\end_inset
+
+,
+ then
+\begin_inset Formula $x=1+z$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[HM15]
+\end_layout
+
+\end_inset
+
+Find the generating function for
+\begin_inset Formula
+\[
+\left\langle \sum_{0<k<n}\frac{1}{k(n-k)}\right\rangle ;
+\]
+
+\end_inset
+
+differentiate it and express the coefficients in terms of harmonic numbers.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The generating function is
+\begin_inset Formula
+\begin{align*}
+G(z) & \coloneqq\sum_{n\geq0}\sum_{0<k<n}\frac{1}{k(n-k)}z^{n}=\sum_{n,m\geq1}\frac{z^{n+m}}{nm}=\left(\sum_{n\geq1}\frac{z^{n}}{n}\right)\left(\sum_{m\geq1}\frac{z^{m}}{m}\right)=\left(\sum_{n\geq1}\frac{z^{n}}{n}\right)^{2}\\
+ & =\left(-\sum_{n\geq1}\frac{(-1)^{n+1}}{n}(-z)^{n}\right)^{2}=(-\ln(1+(-z)))^{2}=\ln(1-z)^{2},
+\end{align*}
+
+\end_inset
+
+by Eq.
+ (24).
+ Its derivative is
+\begin_inset Formula
+\[
+\dot{G}(z)=-\frac{2}{1-z}\ln(1-z)=\frac{2}{1-z}\ln\left(\frac{1}{1-z}\right),
+\]
+
+\end_inset
+
+so by Eq.
+ (25) with
+\begin_inset Formula $m=0$
+\end_inset
+
+ the coefficients are
+\begin_inset Formula $[z^{n}]\dot{G}(z)=2(H_{n}-H_{0})\binom{n}{n}=2H_{n}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[M25]
+\end_layout
+
+\end_inset
+
+An
+\emph on
+elementary symmetric function
+\emph default
+ is defined by the formula
+\begin_inset Formula
+\[
+e_{m}=\sum_{1\leq j_{1}<\dots<j_{m}\leq n}x_{j_{1}}\cdots x_{j_{m}}.
+\]
+
+\end_inset
+
+(This is the same as
+\begin_inset Formula $h_{m}$
+\end_inset
+
+ of Eq.
+ (33),
+ except that equal subscripts are not allowed.) Find the generating function for
+\begin_inset Formula $e_{m}$
+\end_inset
+
+,
+ and express
+\begin_inset Formula $e_{m}$
+\end_inset
+
+ in terms of the
+\begin_inset Formula $S_{j}$
+\end_inset
+
+ in Eq.
+ (34).
+ Write out the formulas for
+\begin_inset Formula $e_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $e_{2}$
+\end_inset
+
+,
+
+\begin_inset Formula $e_{3}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $e_{4}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Here
+\begin_inset Formula $m\leq n$
+\end_inset
+
+ or otherwise we have no elements,
+ so
+\begin_inset Formula
+\begin{align*}
+G(z) & \coloneqq\sum_{m\geq0}e_{m}z^{m}=\sum_{m=0}^{n}\sum_{1\leq j_{1}<\dots<j_{k}\leq n}x_{j_{1}}\cdots x_{j_{m}}z^{n}=\sum_{a_{1},\dots,a_{n}\in\{0,1\}}\prod_{i=1}^{n}(x_{i}z)^{a_{i}}\\
+ & =\prod_{i=1}^{n}\sum_{a\in\{0,1\}}(x_{i}z)^{a}=\prod_{i=1}^{n}(x_{i}z+1),
+\end{align*}
+
+\end_inset
+
+as we can regard the sum as taking the product of each subset of
+\begin_inset Formula $\{x_{i}z\}_{i}$
+\end_inset
+
+.
+ From here,
+\begin_inset Formula
+\[
+\ln G(z)=\sum_{i=1}^{n}\ln(1+x_{i}z)=\sum_{i=1}^{n}\sum_{k\geq1}\frac{(-1)^{k+1}}{k}x_{i}^{k}z^{k}=\sum_{k\geq1}\frac{(-1)^{k+1}}{k}S_{k}z^{k},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula
+\begin{align*}
+G(z) & =\text{e}^{\ln G(z)}=\exp\left(\sum_{k\geq1}\frac{(-1)^{k+1}}{k}S_{k}z^{k}\right)=\prod_{k\geq1}\text{e}^{(-1)^{k+1}S_{k}z^{k}/k}\\
+ & =\prod_{k\geq1}\sum_{j\geq0}\frac{1}{j!}\left(\frac{(-1)^{k+1}S_{k}}{k}\right)^{j}z^{jk}=\sum_{m\geq0}\left(\sum_{\begin{subarray}{c}
+j_{1},\dots,j_{m}\geq0\\
+j_{1}+2j_{2}+\dots+mj_{m}=m
+\end{subarray}}\prod_{k=1}^{m}\frac{1}{j_{k}!}\left(\frac{(-1)^{k+1}S_{k}}{k}\right)^{j_{k}}\right)z^{m}.
+\end{align*}
+
+\end_inset
+
+This gives us an explicit formulation for
+\begin_inset Formula $e_{m}$
+\end_inset
+
+.
+ Note that
+\begin_inset Formula
+\[
+\prod_{k=1}^{m}(-1)^{(k+1)j_{k}}=(-1)^{\sum_{k=1}^{m}kj_{k}+\sum_{k=1}^{m}j_{k}}=(-1)^{m+\sum_{k}j_{k}},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula
+\[
+e_{m}=\sum_{\begin{subarray}{c}
+j_{1},\dots,j_{m}\geq0\\
+j_{1}+2j_{2}+\dots+mj_{m}=m
+\end{subarray}}(-1)^{m+j_{1}+\dots+j_{m}}\prod_{k=1}^{m}\frac{S_{k}^{j_{k}}}{k^{j_{k}}j_{k}!}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+For example,
+ if we call
+\begin_inset Formula $p_{kj_{k}}$
+\end_inset
+
+ to each of the factors of the product in this latest formula,
+ using that each
+\begin_inset Formula $p_{k0}=1$
+\end_inset
+
+ and can therefore be ignored,
+\begin_inset Formula
+\begin{align*}
+e_{1} & =p_{11}=S_{1},\\
+e_{2} & =p_{12}+p_{21}=\frac{S_{1}^{2}}{2}-\frac{S_{2}}{2}=\frac{1}{2}(S_{1}^{2}-S_{2}),\\
+e_{3} & =p_{13}-p_{11}p_{21}+p_{31}=\frac{S_{1}^{3}}{6}-S_{1}\frac{S_{2}}{2}+\frac{S_{3}}{3}=\frac{1}{6}(S_{1}^{3}+2S_{3}-3S_{1}S_{2}),\\
+e_{4} & =p_{14}-p_{12}p_{21}+p_{11}p_{31}+p_{22}-p_{41}=\frac{S_{1}^{4}}{24}-\frac{S_{1}^{2}}{2}\frac{S_{2}}{2}+S_{1}\frac{S_{3}}{3}+\frac{S_{2}^{2}}{8}-\frac{S_{4}}{4}\\
+ & =\frac{1}{24}(S_{1}^{4}-6S_{1}^{2}S_{2}+8S_{1}S_{3}+3S_{2}^{2}-6S_{4}).
+\end{align*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[M25]
+\end_layout
+
+\end_inset
+
+Equation (39) can also be used to express the
+\begin_inset Formula $S$
+\end_inset
+
+'s in terms of the
+\begin_inset Formula $h$
+\end_inset
+
+'s:
+ We find
+\begin_inset Formula $S_{1}=h_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $S_{2}=2h_{2}-h_{1}^{2}$
+\end_inset
+
+,
+
+\begin_inset Formula $S_{3}=3h_{3}-3h_{1}h_{2}+h_{1}^{3}$
+\end_inset
+
+,
+ etc.
+ What is the coefficient of
+\begin_inset Formula $h_{1}^{k_{1}}h_{2}^{k_{2}}\cdots h_{m}^{k_{m}}$
+\end_inset
+
+ in this representation of
+\begin_inset Formula $S_{m}$
+\end_inset
+
+,
+ when
+\begin_inset Formula $k_{1}+2k_{2}+\dots+mk_{m}=m$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(I had to look up the solution.)
+\end_layout
+
+\end_inset
+
+ We ignore Eq.
+ (39) and focus on Eqs.
+ (37) and (24).
+ There,
+\begin_inset Formula
+\begin{align*}
+\sum_{k\geq1}\frac{S_{k}z^{k}}{k!} & =\ln G(z)=\ln\left(1+\sum_{j\geq1}h_{j}z^{j}\right)=\sum_{k\geq1}\frac{(-1)^{k+1}}{k}\left(\sum_{j\geq1}h_{j}z^{j}\right)^{k}\\
+ & =\sum_{k\geq1}\frac{(-1)^{k+1}}{k}\sum_{j_{1},\dots,j_{k}\geq1}h_{j_{1}}\cdots h_{j_{k}}z^{j_{1}+\dots+j_{k}}\\
+ & =\sum_{m\geq1}\sum_{\begin{subarray}{c}
+i_{1},\dots,i_{m}\geq0\\
+i_{1}+2i_{2}+\dots+mi_{m}=m
+\end{subarray}}\frac{(-1)^{i_{1}+\dots+i_{m}+1}}{i_{1}+\dots+i_{m}}\binom{i_{1}+\dots+i_{m}}{i_{1},\dots,i_{m}}h_{1}^{i_{1}}\cdots h_{m}^{i_{m}}z^{m},
+\end{align*}
+
+\end_inset
+
+so the coefficient is
+\begin_inset Formula
+\[
+\frac{(-1)^{k_{1}+\dots+k_{m}+1}(k_{1}+\dots+k_{m})!}{k_{1}!\cdots k_{m}!}.
+\]
+
+\end_inset
+
+For the last identity,
+ we have regrouped all the terms by the value of
+\begin_inset Formula $m\coloneqq j_{1}+\dots+j_{k}$
+\end_inset
+
+ and then by
+\begin_inset Formula $\{i_{j}\coloneqq|\{t\mid j_{t}=j\}|\}_{j=1}^{m}$
+\end_inset
+
+,
+ that is,
+ the number of times that each
+\begin_inset Formula $h_{j}$
+\end_inset
+
+ appears rather than the indexes of those that do.
+ When doing this,
+ we note that
+\begin_inset Formula $k=i_{1}+\dots+i_{m}$
+\end_inset
+
+ and that
+\begin_inset Formula $h_{j_{1}}\cdots h_{j_{k}}=h_{1}^{i_{1}}\cdots h_{m}^{i_{m}}$
+\end_inset
+
+,
+ so all the addends in a given group are the same,
+ and the number of addends is the number of orderings of the
+\begin_inset Formula $k$
+\end_inset
+
+ indexes without considering the order of indexes that are equal,
+ of which there are
+\begin_inset Formula $i_{1}$
+\end_inset
+
+ indexes equal to 1,
+
+\begin_inset Formula $i_{2}$
+\end_inset
+
+ equal to 2,
+ etc.,
+ and this is a multinomial coefficient.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc12[M20]
+\end_layout
+
+\end_inset
+
+Suppose we have a doubly subscripted sequence
+\begin_inset Formula $\langle a_{mn}\rangle$
+\end_inset
+
+ for
+\begin_inset Formula $m,n=0,1,\dots$
+\end_inset
+
+;
+ show how this double sequence can be represented by a
+\emph on
+single
+\emph default
+ generating function of two variables,
+ and determine the generating function for
+\begin_inset Formula $\langle\binom{n}{m}\rangle$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+A generating function in this case could be something like
+\begin_inset Formula
+\[
+G(y,z)\coloneqq\sum_{m,n\geq0}a_{mn}y^{m}z^{n}=\sum_{n\geq0}\left(\sum_{m\geq0}a_{mn}y^{m}\right)z^{n}=\sum_{m\geq0}\left(\sum_{n\geq0}a_{mn}z^{n}\right)y^{m}.
+\]
+
+\end_inset
+
+In our case,
+ by the binomial theorem,
+\begin_inset Formula
+\[
+(1+y)^{n}=\sum_{m\geq0}\binom{n}{m}y^{m},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula
+\[
+G(y,z)=\sum_{n\geq0}(1+y)^{n}z^{n}=\frac{1}{1-(1+y)z}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc18[M25]
+\end_layout
+
+\end_inset
+
+Given positive integers
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $r$
+\end_inset
+
+,
+ find a simple formula for the value of the following sums:
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\sum_{1\leq k_{1}<k_{2}<\dots<k_{r}\leq n}k_{1}k_{2}\cdots k_{r}$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\sum_{1\leq k_{1}\leq k_{2}\leq\dots\leq k_{r}\leq n}k_{1}k_{2}\cdots k_{r}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+(For example,
+ when
+\begin_inset Formula $n=3$
+\end_inset
+
+ and
+\begin_inset Formula $r=2$
+\end_inset
+
+ the sums are,
+ respectively,
+
+\begin_inset Formula $1\cdot2+1\cdot3+2\cdot3$
+\end_inset
+
+ and
+\begin_inset Formula $1\cdot1+1\cdot2+1\cdot3+2\cdot2+2\cdot3+3\cdot3$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Following Exercise 10 and then applying Equation (27),
+\begin_inset Formula
+\begin{align*}
+G(z) & \coloneqq\sum_{r\geq0}\sum_{1\leq k_{1}<\dots<k_{r}\leq n}k_{1}\cdots k_{r}=\prod_{k=1}^{n}(1+kz)=z^{n}\prod_{k=1}^{n}\left(\frac{1}{z}+k\right)\\
+ & =z^{n+1}\prod_{k=0}^{n}\left(\frac{1}{z}+k\right)=z^{n+1}\sum_{k\geq0}\stirla{n+1}{k}z^{-k}\\
+ & =\sum_{k=0}^{n+1}\stirla{n+1}{k}z^{n+1-k}=\sum_{k=0}^{n+1}\stirla{n+1}{n+1-k}z^{k},
+\end{align*}
+
+\end_inset
+
+so the sum is
+\begin_inset Formula $\stirla{n+1}{n+1-r}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Doing something similar with Equations (36) and (28),
+\begin_inset Formula
+\begin{align*}
+G(z) & \coloneqq\sum_{r\geq0}\sum_{1\leq k_{1}\leq\dots\leq k_{r}\leq n}k_{1}\cdots k_{r}=\prod_{k=1}^{n}\frac{1}{1-kz}=\frac{1}{z^{n}}\sum_{k\geq n}\stirlb{k}{n}z^{k}\\
+ & =\sum_{k}\stirlb{k+n}{n}z^{k},
+\end{align*}
+
+\end_inset
+
+so the sum is
+\begin_inset Formula $\stirlb{n+r}{n}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc25[M23]
+\end_layout
+
+\end_inset
+
+Evaluate the sum
+\begin_inset Formula $\sum_{k}\binom{n}{k}\binom{2n-2k}{n-k}(-2)^{k}$
+\end_inset
+
+ by simplifying the equivalent formula
+\begin_inset Formula $\sum_{k}[w^{k}](1-2w)^{n}[z^{n-k}](1+z)^{2n-2k}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+By the binomial theorem,
+\begin_inset Formula
+\begin{align*}
+(1-2w)^{n} & =\sum_{k\geq0}\binom{n}{k}(-2)^{k}w^{k}, & (1+z)^{2n-2k} & =\sum_{j\geq0}\binom{2n-2k}{j}z^{j},
+\end{align*}
+
+\end_inset
+
+so the second formula is indeed equivalent to the first,
+ assuming of course that
+\begin_inset Formula $n\in\mathbb{N}$
+\end_inset
+
+ and therefore terms with negative
+\begin_inset Formula $k$
+\end_inset
+
+ or
+\begin_inset Formula $k>n$
+\end_inset
+
+ are null.
+ Now,
+
+\begin_inset Formula $[z^{n-k}](1+z)^{2n-2k}=[z^{n}](z^{k}(1+z)^{2n-2k})$
+\end_inset
+
+,
+ so this is
+\begin_inset Formula
+\[
+S\coloneqq[z^{n}](1+z)^{2n}\sum_{k}[w^{k}](1-2w)^{n}\left(\frac{z}{(1+z)^{2}}\right)^{k}=[z^{n}](1+z)^{2n}\left(1-\frac{2z}{(1+z)^{2}}\right)^{n},
+\]
+
+\end_inset
+
+where we evaluating the sum by taking
+\begin_inset Formula $\frac{z}{(1+z)^{2}}$
+\end_inset
+
+ as the argument of the generating function in
+\begin_inset Formula $w$
+\end_inset
+
+.
+ Then,
+ we simplify to get
+\begin_inset Formula
+\[
+S=[z^{n}]\left(\left((1+z)^{2}(1-\nicefrac{2z}{(1+z)^{2}})\right)^{n}\right)=[z^{n}]\left((1+z^{2})^{n}\right)=\binom{n}{\nicefrac{n}{2}}[n\text{ even}].
+\]
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.3.1.lyx b/1.3.1.lyx
new file mode 100644
index 0000000..22c5cb2
--- /dev/null
+++ b/1.3.1.lyx
@@ -0,0 +1,2356 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\listings_params "basicstyle={\ttfamily}"
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+If
+\family typewriter
+MIX
+\family default
+ were a ternary (base 3) computer,
+ how many
+\begin_inset Quotes eld
+\end_inset
+
+trits
+\begin_inset Quotes erd
+\end_inset
+
+ would there be per byte?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The only power of 3 between 64 and 100 is
+\begin_inset Formula $3^{4}=81$
+\end_inset
+
+,
+ so there would be 4 trits.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[02]
+\end_layout
+
+\end_inset
+
+If a value to be represented within
+\family typewriter
+MIX
+\family default
+ may get as large as 99999999,
+ how many adjacent bytes should be used to contain this quantity.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Since
+\begin_inset Formula $\lg99999999\in(26,27)$
+\end_inset
+
+,
+ we'd need 27 bits,
+ so 5 bytes.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[02]
+\end_layout
+
+\end_inset
+
+Give the partial field specifications,
+
+\begin_inset Formula $(L:R)$
+\end_inset
+
+,
+ for the (a) address field,
+ (b) index field,
+ (c) field field,
+ and (d) operation code field for a
+\family typewriter
+MIX
+\family default
+ instruction.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $(0:2)$
+\end_inset
+
+,
+
+\begin_inset Formula $(3:3)$
+\end_inset
+
+,
+
+\begin_inset Formula $(4:4)$
+\end_inset
+
+,
+ and
+\begin_inset Formula $(5:5)$
+\end_inset
+
+,
+ respectively.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[00]
+\end_layout
+
+\end_inset
+
+The last example in (5) is `
+\family typewriter
+LDA -2000,4
+\family default
+'.
+ How can this be legitimate,
+ in view of the fact that memory addresses should not be negative?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Because we're assuming that
+\family typewriter
+r4
+\family default
+ is at least 2000.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc5[10]
+\end_layout
+
+\end_inset
+
+What symbolic notation,
+ analogous to (4),
+ corresponds to (6) if (6) is regarded as a
+\family typewriter
+MIX
+\family default
+ instruction?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\family typewriter
+DIV -80,3
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[10]
+\end_layout
+
+\end_inset
+
+Assume that location 3000 contains
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+mixbox{
+\backslash
+byte+
+\backslash
+byte5
+\backslash
+byte1
+\backslash
+twobytes{200}
+\backslash
+byte{15}}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+What is the result of the following instructions?
+ (State if any of them are undefined or only partially defined.)
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LDAN 3000
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LD2N 3000(3:4)
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LDX 3000(1:3)
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LD6 3000
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LDXN 3000(0:0)
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Set A to
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+mixbox{
+\backslash
+byte-
+\backslash
+byte5
+\backslash
+byte1
+\backslash
+twobytes{200}
+\backslash
+byte{15}}
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Set I2 to
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+mixsmbox{
+\backslash
+byte-
+\backslash
+twobytes{200}}
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Set X to
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+mixbox{
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte5
+\backslash
+byte1
+\backslash
+byte?}
+\end_layout
+
+\end_inset
+
+ (the last byte is undefined).
+\end_layout
+
+\begin_layout Enumerate
+Undefined.
+\end_layout
+
+\begin_layout Enumerate
+Set X to
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+mixbox{
+\backslash
+byte-
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0}
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[15]
+\end_layout
+
+\end_inset
+
+List all the
+\family typewriter
+MIX
+\family default
+ operators that can possibly affect the setting of the overflow toggle.
+ (Don not include floating point operators.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\family typewriter
+ADD
+\family default
+,
+
+\family typewriter
+SUB
+\family default
+,
+
+\family typewriter
+DIV
+\family default
+,
+
+\family typewriter
+INCA
+\family default
+,
+
+\family typewriter
+INCX
+\family default
+,
+
+\family typewriter
+DECA
+\family default
+,
+
+\family typewriter
+DECX
+\family default
+,
+
+\family typewriter
+NUM
+\family default
+,
+
+\family typewriter
+JOV
+\family default
+,
+
+\family typewriter
+JNOV
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[15]
+\end_layout
+
+\end_inset
+
+List all the
+\family typewriter
+MIX
+\family default
+ operators that can possibly affect the setting of rI1.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\family typewriter
+MOVE
+\family default
+,
+
+\family typewriter
+LD1
+\family default
+,
+
+\family typewriter
+LD1N
+\family default
+,
+
+\family typewriter
+INC1
+\family default
+,
+
+\family typewriter
+DEC1
+\family default
+,
+
+\family typewriter
+ENT1
+\family default
+,
+
+\family typewriter
+ENN1
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc12[10]
+\end_layout
+
+\end_inset
+
+Find a single instruction that has the effect of multiplying the current contents of rI3 by two and leaving the result in rI3.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\family typewriter
+INC3 0,3
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[10]
+\end_layout
+
+\end_inset
+
+Suppose location 1000 contains the instruction `
+\family typewriter
+JOV 1001
+\family default
+'.
+ This instruction turns off the overflow toggle if it is on (and the next instruction executed will be in location 1001,
+ in any case).
+ If this instruction were changed to `
+\family typewriter
+JNOV 1001
+\family default
+',
+ would there be any difference?
+ What if it were changed to `
+\family typewriter
+JOV 1000
+\family default
+' or `
+\family typewriter
+JNOV 1000
+\family default
+'?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+There wouldn't be any difference after changing it to `
+\family typewriter
+JNOV 1001
+\family default
+' aside from the contents of register J.
+ If it's changed to `
+\family typewriter
+JOV 1000
+\family default
+',
+ the only difference would be the timing,
+ but if it's changed to `
+\family typewriter
+JNOV 1000
+\family default
+',
+ an infinite loop would occur if the overflow toggle wasn't previously on.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc15[10]
+\end_layout
+
+\end_inset
+
+How many
+\emph on
+alphameric characters
+\emph default
+ are there in a typewriter or paper-tape block?
+ in a card-reader or card-punch block?
+ in a
+\nospellcheck on
+line-printer
+\nospellcheck default
+ block?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+70 characters in a typewriter or paper-tape block,
+ 80 in a card-reader or card-punch block,
+ and 120 in a line-printer block.
+ This is because each word can hold up to 5 characters.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc18[22]
+\end_layout
+
+\end_inset
+
+After the following
+\begin_inset Quotes eld
+\end_inset
+
+number one
+\begin_inset Quotes erd
+\end_inset
+
+ program has been executed,
+ what changes to registers,
+ toggles,
+ and memory have taken place?
+ (For example,
+ what is the setting of rI1?
+ of rX?
+ of the overflow an comparison indicators?
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+STZ 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ENNX 1
+\end_layout
+
+\begin_layout Plain Layout
+
+STX 1(0:1)
+\end_layout
+
+\begin_layout Plain Layout
+
+SLAX 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ENNA 1
+\end_layout
+
+\begin_layout Plain Layout
+
+INCX 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ENT1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+SRC 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ADD 1
+\end_layout
+
+\begin_layout Plain Layout
+
+DEC1 -1
+\end_layout
+
+\begin_layout Plain Layout
+
+STZ 1
+\end_layout
+
+\begin_layout Plain Layout
+
+CMPA 1
+\end_layout
+
+\begin_layout Plain Layout
+
+MOVE -1,1(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+NUM 1
+\end_layout
+
+\begin_layout Plain Layout
+
+CHAR 1
+\end_layout
+
+\begin_layout Plain Layout
+
+HLT 1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Assuming the program doesn't start at 0000,
+ the result is:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+soffsets
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="5" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Position
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Content
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+Address 1
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+Address 2
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte0
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+rX
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+byte{31}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+rA
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+byte{30}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\backslash
+byte{30}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil{}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Position
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Content
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+rI1
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte2
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+Overflow
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ON
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+Comparison
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+EQUAL
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+eoffsets
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc19[14]
+\end_layout
+
+\end_inset
+
+What is the execution time of the program in the preceding exercise,
+ not counting the
+\family typewriter
+HLT
+\family default
+ instruction?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+42 units of time.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc21[24]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Can the J-register ever be zero?
+\end_layout
+
+\begin_layout Enumerate
+Write a program that,
+ given a number
+\begin_inset Formula $N$
+\end_inset
+
+ in rI4,
+ sets register J equal to
+\begin_inset Formula $N$
+\end_inset
+
+,
+ assuming that
+\begin_inset Formula $0<N\leq3000$
+\end_inset
+
+.
+ Your program should start in location 3000.
+ When your program has finished its execution,
+ the contents of all memory cells must be unchanged.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Maybe at startup,
+ but then only before the first jump is executed.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+LDX -1,4
+\end_layout
+
+\begin_layout Plain Layout
+
+ENTA 3006
+\end_layout
+
+\begin_layout Plain Layout
+
+SLA 3
+\end_layout
+
+\begin_layout Plain Layout
+
+INCA 39 ;
+ [|+||3006|0|0|39| -> JMP 3006]
+\end_layout
+
+\begin_layout Plain Layout
+
+STA -1,4
+\end_layout
+
+\begin_layout Plain Layout
+
+JMP -1,4
+\end_layout
+
+\begin_layout Plain Layout
+
+STX -1,4 ;
+ position 3006
+\end_layout
+
+\begin_layout Plain Layout
+
+HLT
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[28]
+\end_layout
+
+\end_inset
+
+Location 2000 contains an integer number,
+
+\begin_inset Formula $X$
+\end_inset
+
+.
+ Write two programs that compute
+\begin_inset Formula $X^{13}$
+\end_inset
+
+ and halt with the result in register
+\begin_inset Formula $A$
+\end_inset
+
+.
+ One program should use the minimum number of
+\family typewriter
+MIX
+\family default
+ memory locations;
+ the other should require the minimum execution time possible.
+ Assume that
+\begin_inset Formula $X^{13}$
+\end_inset
+
+ fits into a single word.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Minimum time,
+ since the conditions imply
+\begin_inset Formula $|X|\leq5$
+\end_inset
+
+:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+LD1 2000
+\end_layout
+
+\begin_layout Plain Layout
+
+LDA 3500,1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Then at positions 3495 to 3505 we'd have a table of precomputed results.
+ This uses a total of 2 words for the instructions and 11 words for the table.
+\end_layout
+
+\begin_layout Standard
+Minimum number of memory locations,
+ assuming the program starts at position 0:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+LDA 2000
+\end_layout
+
+\begin_layout Plain Layout
+
+ENT1 12
+\end_layout
+
+\begin_layout Plain Layout
+
+MUL 2000
+\end_layout
+
+\begin_layout Plain Layout
+
+SLAX 5
+\end_layout
+
+\begin_layout Plain Layout
+
+DEC1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+J1NZ 2
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+This uses a total of 6 words for the instructions but no additional memory.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc25[30]
+\end_layout
+
+\end_inset
+
+Suppose that the manufacturer of
+\family typewriter
+MIX
+\family default
+ wishes to come out with a more powerful computer (
+\begin_inset Quotes eld
+\end_inset
+
+Mixmaster
+\begin_inset Quotes erd
+\end_inset
+
+?),
+ and he wants to convince as many people as possible of those people now owning a
+\family typewriter
+MIX
+\family default
+ computer to invest in the more expensive machine.
+ He wants to design this new hardware to be an
+\emph on
+extension
+\emph default
+ of
+\family typewriter
+MIX
+\family default
+,
+ in the sense that all programs correctly written for
+\family typewriter
+MIX
+\family default
+ will work on the new machines without change.
+ Suggest desirable things that could be incorporated in this extension.
+ (For example,
+ can you make better use of the I-field of an instruction?)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Some of the ways that
+\family typewriter
+MIX
+\family default
+ could be extended would be:
+\end_layout
+
+\begin_layout Enumerate
+Make the machine work faster through pipelining and other techniques.
+\end_layout
+
+\begin_layout Enumerate
+Allocate additional memory.
+ A way to do this would be to expand the size of the index registers to be one full word,
+ allowing for
+\begin_inset Formula $\unit[1]{Gword}$
+\end_inset
+
+ (equivalent to
+\begin_inset Formula $\unit[4]{GB}$
+\end_inset
+
+ by modern standards).
+ Then we'd have 8 full-word registers,
+ a bare minimum for modern processors.
+\end_layout
+
+\begin_layout Enumerate
+For normal instructions,
+ instead of having the I-field specify a range,
+ it could be used to specify which of the six fields are being used,
+ since we are warrantied at least six bits,
+ allocating the corresponding floating point instructions in the F-field value that doesn't select any of the fields (the null value).
+ For compatibility,
+ we can't use the trivial binary representation for this,
+ so we have to use a non-trivial mapping.
+\end_layout
+
+\begin_layout Enumerate
+Many more floating-point instructions could be allocated in the null value of the I-field,
+ such as square root,
+ sine,
+ cosine,
+ etc.
+ These could be allocated on instruction code 5 (special).
+\end_layout
+
+\begin_layout Enumerate
+8-bit compatibility would be desirable,
+ but on a binary
+\family typewriter
+MIX
+\family default
+,
+ we only have 31 bits per word.
+ One way to achieve compatibility is to add an extra bit per word that's not used by legacy
+\family typewriter
+MIX
+\family default
+ programs and extend the F-field in the following way:
+ if the value in the field is at least 48,
+ we take the 4 least significant bits and divide that into two groups:
+ one for the lower part of the range,which would be specified in bytes,
+ and one for the upper part.
+
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+This would allow operating on bytes,
+ and it would be incompatible with the previous proposal to extend the F-field.
+ For other values of the I-field,
+ the extra bit would be ignored.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+In the case the 8-bit compatibility is implemented,
+ it'd be nice to have a way to address individual bytes and half-words without case distinctions or code modifications.
+ This could be done with a special value 6 (half-word) and 7 (byte) for the F-field in load and store instructions,
+ which would use the full 32-bits of the specified index register.
+\end_layout
+
+\begin_layout Enumerate
+Values 7 and 8 for the I-field could be used to mean registers A and X.
+\end_layout
+
+\begin_layout Enumerate
+Values 16 to 24 for the I-field could be used for register to register arithmetic.
+ Then the I-field minus 16 would be the destination operand and the source operand would be the one specified by the first part of the address with the fields given by the second part,
+ with the same format than an F-field.
+\end_layout
+
+\begin_layout Enumerate
+Memory protection and memory management could be implemented by changing the F-field of the
+\family typewriter
+NOP
+\family default
+ operation,
+ with the instructions shown in table
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "fig:e13125"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+\begin_inset Float figure
+placement document
+alignment document
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset Tabular
+<lyxtabular version="3" rows="11" columns="3">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="10text%">
+<column alignment="center" valignment="top" width="5text%">
+<column alignment="left" valignment="top" width="75text%">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Name
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+F
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Description
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+PSET
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Set the beginning of the privileged section to
+\begin_inset Formula $M$
+\end_inset
+
+.
+ By default,
+ it's 0.
+ When an exception occurs,
+ A is saved to the first word in the privileged section,
+ the next word contains the reason of the exception,
+ the next contains a pointer to the instruction that was being run and the next contains the start of the exception-processing code,
+ to be run in privileged mode.
+ Exceptions are disabled by default.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+PGET
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Copy the address of the privileged section start to rI1.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+PUSR
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Change to user (non-privileged) mode;
+ jump to
+\begin_inset Formula $M$
+\end_inset
+
+ and set J to 0.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+VCAL
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Change to kernel (privileged) code;
+ like an exception,
+ with the reason being 0 in 0:0.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+VSET
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Enable virtual memory,
+ switch to the page table
+\begin_inset Formula $M$
+\end_inset
+
+ and flush the TLB.
+ Virtual memory addresses are 12-12-10 and each word in a table contains the address (1:4),
+ an enable/disable flag (0:0),
+ and read-write permissions (least significant 2 bits on 4:4),
+ plus anything the OS wants to put in 5:5.
+ When a page fault occurs,
+ an exception happens with reason 1 in 0:0.
+ Changes in an active page mapping have unspecified behavior when trying to access a page that depends on that before flushing the TLB.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+VFLS
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Flush the TLB.
+ The I-field must be 0.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+VDIS
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+7
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Disable virtual memory and jump to
+\begin_inset Formula $M$
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+EINT
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Enable/disable interrupts for the device in the I-field,
+ depending on whether the sign is positive or negative.
+ Interrupts are exceptions with reason 3 in 0:0 and the device ID in 1:1.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+AEX
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Enable/disable all exceptions,
+ depending on whether the sign is positive or negative.
+ The result of triggering an exception that's not an interrupt is unspecified.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+WAIT
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+10
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Wait until some device is ready.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:e13125"
+
+\end_inset
+
+System instructions for MIXMaster.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+All of those instructions except
+\family typewriter
+VCAL
+\family default
+ are illegal in user mode,
+ along with
+\family typewriter
+HLT
+\family default
+,
+
+\family typewriter
+JBUS
+\family default
+,
+
+\family typewriter
+IOC
+\family default
+,
+
+\family typewriter
+IN
+\family default
+,
+
+\family typewriter
+OUT
+\family default
+,
+ and
+\family typewriter
+JRED
+\family default
+.
+ Instructions that had unspecified behavior now cause an exception with type 4 in 0:0,
+ provided that exceptions are enabled.
+ Nonetheless,
+ the operating system is expected to treat those exceptions and act accordingly,
+ usually by checking for authorization and simulating the effects of the instructions as if they were system calls.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Bitwise operations and shifts could be added.
+\end_layout
+
+\begin_layout Enumerate
+An
+\family typewriter
+IOC
+\family default
+ number could be used to return the number of bytes per chunk for a device,
+ and another number could be self-describing,
+ to tell the type of the device.
+ This would allow for more device types to be added,
+ such as USB,
+ Ethernet,
+ PCI,
+ video,
+ timer,
+ etc.,
+ given a standard for differentiating those.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.3.2.lyx b/1.3.2.lyx
new file mode 100644
index 0000000..3e693ad
--- /dev/null
+++ b/1.3.2.lyx
@@ -0,0 +1,3414 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[00]
+\end_layout
+
+\end_inset
+
+The text remarked that `
+\family typewriter
+X EQU 1000
+\family default
+' does not assemble any instruction that sets the value of a variable.
+ Suppose that you are writing a
+\family typewriter
+MIX
+\family default
+ program in which the algorithm is supposed to set the value contained in certain memory cell (whose symbolic name is
+\family typewriter
+X
+\family default
+) equal to 1000.
+ How could you express this in
+\family typewriter
+MIXAL
+\family default
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ENTA 1000
+\end_layout
+
+\begin_layout Plain Layout
+
+STA X
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[10]
+\end_layout
+
+\end_inset
+
+Line 12 of program M says `
+\family typewriter
+JMP *
+\family default
+',
+ where
+\family typewriter
+*
+\family default
+ denotes the location of that line.
+ Why doesn't the program go into an infinite loop,
+ endlessly repeating this instruction?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Because,
+ at the entry point of the function,
+ the code self-modifies,
+ changing that instruction to a jump to the next instruction of the routine that called program M.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[23]
+\end_layout
+
+\end_inset
+
+What is the effect of the following program,
+ if it is used in conjunction with Program M?
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+START IN X+1(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JBUS *(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT1 100
+\end_layout
+
+\begin_layout Plain Layout
+
+1H JMP MAXIMUM
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDX X,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA X,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ STX X,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ DEC1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ J1P 1B
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT X+1(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ HLT
+\end_layout
+
+\begin_layout Plain Layout
+
+ END START
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It reads 100 numbers from tape 0 and prints them sorted in nondecreasing order to tape 1.
+ It first reads the 100 numbers,
+ and then it finds the maximum of the elements,
+ exchanges it with the last element in the list and repeats that with the list made of of all the remaining elements.
+ Finally,
+ it outputs the result.
+ This is known as
+\emph on
+bubble sort
+\emph default
+,
+ the slowest sensible sorting algorithm,
+ with complexity
+\begin_inset Formula $O(n^{2})$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[25]
+\end_layout
+
+\end_inset
+
+Assemble Program P by hand.
+ (It won't take as long as you think.) What are the actual numerical contents of memory,
+ corresponding to that symbolic program?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+See figure
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "fig:e1234"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+placement document
+alignment document
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+soffsets
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="20" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\family typewriter
+3000
+\family default
+
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte0
+\backslash
+byte{18}
+\backslash
+byte{35}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3001
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{2051}
+\backslash
+byte0
+\backslash
+byte5
+\backslash
+byte9
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3002
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{2050}
+\backslash
+byte0
+\backslash
+byte5
+\backslash
+byte{10}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3003
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes1
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{49}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3004
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{499}
+\backslash
+byte1
+\backslash
+byte5
+\backslash
+byte{26}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3005
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3016}
+\backslash
+byte0
+\backslash
+byte1
+\backslash
+byte{41}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3006
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes2
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{50}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3007
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes2
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte{51}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3008
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte{48}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3009
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte2
+\backslash
+byte2
+\backslash
+byte{55}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3010
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+twobytes1
+\backslash
+byte3
+\backslash
+byte5
+\backslash
+byte4
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3011
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3006}
+\backslash
+byte0
+\backslash
+byte1
+\backslash
+byte{47}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3012
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+twobytes1
+\backslash
+byte3
+\backslash
+byte5
+\backslash
+byte{56}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3013
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes1
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{51}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3014
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3008}
+\backslash
+byte0
+\backslash
+byte6
+\backslash
+byte{39}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3015
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3003}
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{39}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3016
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{1995}
+\backslash
+byte0
+\backslash
+byte{18}
+\backslash
+byte{37}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3017
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{2035}
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte{52}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3018
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+twobytes{50}
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte{53}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3019
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{501}
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{53}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil{}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="20" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\family typewriter
+3020
+\family default
+
+\begin_inset space ~
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+twobytes1
+\backslash
+byte5
+\backslash
+byte5
+\backslash
+byte8
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3021
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte0
+\backslash
+byte1
+\backslash
+byte5
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3022
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte4
+\backslash
+byte{12}
+\backslash
+byte{31}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3023
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes1
+\backslash
+byte0
+\backslash
+byte1
+\backslash
+byte{52}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3024
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{50}
+\backslash
+byte0
+\backslash
+byte1
+\backslash
+byte{53}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3025
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3020}
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte{45}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3026
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte4
+\backslash
+byte{18}
+\backslash
+byte{37}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3027
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{24}
+\backslash
+byte4
+\backslash
+byte5
+\backslash
+byte{12}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3028
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes{3019}
+\backslash
+byte0
+\backslash
+byte0
+\backslash
+byte{45}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+3029
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+twobytes0
+\backslash
+byte0
+\backslash
+byte2
+\backslash
+byte5
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+0000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+fivebytes2
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+1995
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte6
+\backslash
+byte9
+\backslash
+byte{19}
+\backslash
+byte{22}
+\backslash
+byte{23}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+1996
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte6
+\backslash
+byte9
+\backslash
+byte{25}
+\backslash
+byte5
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+1997
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte0
+\backslash
+byte8
+\backslash
+byte{24}
+\backslash
+byte{15}
+\backslash
+byte4
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+1998
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte{19}
+\backslash
+byte5
+\backslash
+byte4
+\backslash
+byte0
+\backslash
+byte{17}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+1999
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+byte{19}
+\backslash
+byte9
+\backslash
+byte{14}
+\backslash
+byte5
+\backslash
+byte{22}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+2024
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+fivebytes{2035}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+2049
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+fivebytes{2010}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+2050
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte+
+\backslash
+fivebytes3
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+2051
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+byte-
+\backslash
+fivebytes{499}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+eoffsets
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:e1234"
+
+\end_inset
+
+Machine code for Program P.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc7[10]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+What is the meaning of `
+\family typewriter
+4B
+\family default
+' in line 34 of Program P?
+\end_layout
+
+\begin_layout Enumerate
+What effect,
+ if any,
+ would be cause if the location of line 15 were changed to `
+\family typewriter
+2H
+\family default
+' and the address of line 20 were changed to `
+\family typewriter
+2B
+\family default
+'?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+It references the address at line 29,
+ the first previous line with label `
+\family typewriter
+4H
+\family default
+'.
+\end_layout
+
+\begin_layout Enumerate
+Line 14 would reference line 15 instead of line 25 and line 24 would reference line 15 instead of line 12.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[24]
+\end_layout
+
+\end_inset
+
+What does the following program do?
+ (Do not run it on a computer,
+ figure it out by hand!)
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+* MYSTERY PROGRAM
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF ORIG *+3000
+\end_layout
+
+\begin_layout Plain Layout
+
+1H ENT1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT2 0
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDX 4F
+\end_layout
+
+\begin_layout Plain Layout
+
+2H ENT3 0,1
+\end_layout
+
+\begin_layout Plain Layout
+
+3H STZ BUF,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC2 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ DEC3 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ J3P 3B
+\end_layout
+
+\begin_layout Plain Layout
+
+ STX BUF,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC2 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMP1 =75=
+\end_layout
+
+\begin_layout Plain Layout
+
+ JL 2B
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENN2 2400
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT BUF+2400,2(18)
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC2 24
+\end_layout
+
+\begin_layout Plain Layout
+
+ J2N *-2
+\end_layout
+
+\begin_layout Plain Layout
+
+ HLT
+\end_layout
+
+\begin_layout Plain Layout
+
+4H ALF AAAAA
+\end_layout
+
+\begin_layout Plain Layout
+
+ END 1B
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+An analysis shows that the code is not self-modifying and that it's equivalent to the following pseudo-C:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+r2 = 0;
+\end_layout
+
+\begin_layout Plain Layout
+
+x = *
+\begin_inset Quotes erd
+\end_inset
+
+AAAAA
+\begin_inset Quotes erd
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Plain Layout
+
+for (r1 = 1;
+ r1 < 75;
+ r1++) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ for (or3m75 = 0;
+ or3m75 < r1;
+ or3m75++)
+\end_layout
+
+\begin_layout Plain Layout
+
+ *r2++ = 0;
+\end_layout
+
+\begin_layout Plain Layout
+
+ *r2++ = x;
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+for (f2i24p100 = 0;
+ r2i24p100 < 100;
+ r2i24p100++)
+\end_layout
+
+\begin_layout Plain Layout
+
+ write(PRINTER,
+ r2i24p100 * 24);
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The program code begins at position 3000,
+ and the programs writes until position
+\begin_inset Formula
+\[
+(2+\dots+75)-1=(1+\dots+74)+74-1=\frac{74\cdot75}{2}+74-1=\frac{74\cdot77}{2}-1=2848,
+\]
+
+\end_inset
+
+so the code is indeed not self-modifying.
+ For each iteration
+\begin_inset Formula $i$
+\end_inset
+
+ from 1 to 74,
+ the code stores
+\begin_inset Formula $5i$
+\end_inset
+
+ spaces and then 5 A's,
+ and then the code prints the first 12000 characters from those.
+\end_layout
+
+\begin_layout Standard
+As an aside,
+ the same effect can be obtained with the following actual C code,
+ provided there are no runtime errors:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+#include <stdio.h>
+\end_layout
+
+\begin_layout Plain Layout
+
+#include <string.h>
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+int main()
+\end_layout
+
+\begin_layout Plain Layout
+
+{
+\end_layout
+
+\begin_layout Plain Layout
+
+ char buffer[15000];
+\end_layout
+
+\begin_layout Plain Layout
+
+ int i,
+ j,
+ k = 0;
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+ for (i = 1;
+ i < 75;
+ i++) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ for (j = 0;
+ j < i;
+ j++)
+\end_layout
+
+\begin_layout Plain Layout
+
+ strcpy(buffer + 5*(k++),
+ " ");
+\end_layout
+
+\begin_layout Plain Layout
+
+ strcpy(buffer + 5*(k++),
+ "AAAAA");
+\end_layout
+
+\begin_layout Plain Layout
+
+ }
+\end_layout
+
+\begin_layout Plain Layout
+
+ for (i = 0;
+ i < 100;
+ i++) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ fwrite(buffer + 120*i,
+ 120,
+ 1,
+ stdout);
+\end_layout
+
+\begin_layout Plain Layout
+
+ putchar('
+\backslash
+n');
+\end_layout
+
+\begin_layout Plain Layout
+
+ }
+\end_layout
+
+\begin_layout Plain Layout
+
+ return 0;
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[25]
+\end_layout
+
+\end_inset
+
+Location
+\family typewriter
+INST
+\family default
+ contains a
+\family typewriter
+MIX
+\family default
+ word that purportedly is a
+\family typewriter
+MIX
+\family default
+ instruction.
+ Write a
+\family typewriter
+MIX
+\family default
+ program that jumps to location
+\family typewriter
+GOOD
+\family default
+ if the word has a valid C-field,
+ valid
+\begin_inset Formula $\pm\text{AA}$
+\end_inset
+
+-field,
+ valid I-field,
+ and valid F-field,
+ according to Table 1.3.1–1;
+ your program should jump to location
+\family typewriter
+BAD
+\family default
+ otherwise.
+ Remember that the test for a valid F-field depends on the C-field;
+ for example,
+ if
+\begin_inset Formula $\text{C}=7$
+\end_inset
+
+ (
+\family typewriter
+MOVE
+\family default
+),
+ any F-field is acceptable,
+ but if
+\begin_inset Formula $\text{C}=8$
+\end_inset
+
+ (
+\family typewriter
+LDA
+\family default
+),
+ the F-field must have the form
+\begin_inset Formula $8L+R$
+\end_inset
+
+ where
+\begin_inset Formula $0\leq L\leq R\leq5$
+\end_inset
+
+.
+ The
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $\pm\text{AA}$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+-field is to be considered valid
+\emph on
+unless
+\emph default
+ C specifies an instruction requiring a memory address and
+\begin_inset Formula $\text{I}=0$
+\end_inset
+
+ and
+\begin_inset Formula $\pm\text{AA}$
+\end_inset
+
+ is not a valid memory address.
+\end_layout
+
+\begin_layout Standard
+
+\emph on
+Note
+\emph default
+:
+ Inexperienced programmers tend to tackle a problem like this by writing a long series of tests on the C-field,
+ such as `
+\family typewriter
+LDA C
+\family default
+;
+
+\family typewriter
+JAZ 1F
+\family default
+;
+
+\family typewriter
+DECA 5
+\family default
+;
+
+\family typewriter
+JAN 2F
+\family default
+;
+
+\family typewriter
+JAZ 3F
+\family default
+;
+
+\family typewriter
+DECA 2
+\family default
+;
+
+\family typewriter
+JAN 4F
+\family default
+;
+ ...'.
+ This is
+\emph on
+not
+\emph default
+ good practice!
+ The best way to make multiway decisions is to prepare an auxiliary
+\emph on
+table
+\emph default
+ containing information that encapsulates the desired logic.
+ If there were,
+ for example,
+ a table of 64 entries,
+ we could write `
+\family typewriter
+LD1 C
+\family default
+;
+
+\family typewriter
+LD1 TABLE,1
+\family default
+;
+
+\family typewriter
+JMP 0,1
+\family default
+'—
+thereby jumping very speedily to the desired routine.
+ Other useful information can also be kept in such a table.
+ A tabular approach to the present problem makes the program only a little bit longer (including the table) and greatly increases its speed and flexibility.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ADDR EQU 0:2
+\end_layout
+
+\begin_layout Plain Layout
+
+INDEX EQU 3:3
+\end_layout
+
+\begin_layout Plain Layout
+
+FIELD EQU 4:4
+\end_layout
+
+\begin_layout Plain Layout
+
+CODE EQU 5:5
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD1 INST(CODE)
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD3 INST(INDEX) ;
+ Load I-field
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENTA -6,3 ;
+ Check if I-field > 6
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAP BAD
+\end_layout
+
+\begin_layout Plain Layout
+
+ J3NZ 2F ;
+ I-field nonzero,
+ skip AA test
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDX TABLE,1(0:0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENTX 1(5:5) ;
+ 1 when AA is address,
+ -1 otherwise
+\end_layout
+
+\begin_layout Plain Layout
+
+ JXN 2F
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA INST(ADDR)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAN BAD ;
+ Addr relevant,
+ index 0,
+ addr negative
+\end_layout
+
+\begin_layout Plain Layout
+
+2H LDA INST(FIELD) ;
+ Field test:
+ dispatch
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD1 TABLE,1(4:5)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP 0,1
+\end_layout
+
+\begin_layout Plain Layout
+
+BOUND CMPA TABLE,1(3:3);
+ F-field in [0,CONTENTS(TABLE,1(3:3))]
+\end_layout
+
+\begin_layout Plain Layout
+
+ JL GOOD
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP BAD
+\end_layout
+
+\begin_layout Plain Layout
+
+RANSX CMPA =6= ;
+ F-field in range or 6
+\end_layout
+
+\begin_layout Plain Layout
+
+ JE GOOD
+\end_layout
+
+\begin_layout Plain Layout
+
+RANGE SRAX 5 ;
+ rAX is the F-field
+\end_layout
+
+\begin_layout Plain Layout
+
+ DIV =8= ;
+ rA:rX is the F-field
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMPA FIVE
+\end_layout
+
+\begin_layout Plain Layout
+
+ JG BAD
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMPX FIVE
+\end_layout
+
+\begin_layout Plain Layout
+
+ JG BAD
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA *+1(0:2) ;
+ rX -= rA
+\end_layout
+
+\begin_layout Plain Layout
+
+ DECX *
+\end_layout
+
+\begin_layout Plain Layout
+
+ JXN BAD ;
+ If rX < rA,
+ dat's bad
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP GOOD
+\end_layout
+
+\begin_layout Plain Layout
+
+;
+ Format is Sign(0:0),
+ F-field test (4:5),
+ where Sign is
+\end_layout
+
+\begin_layout Plain Layout
+
+;
+ positive iff the +/-AA field represents an address and
+\end_layout
+
+\begin_layout Plain Layout
+
+;
+ F-field test jumps to GOOD if the F-field is valid for the
+\end_layout
+
+\begin_layout Plain Layout
+
+;
+ given case or to BAD otherwise.
+ Fields 1:3 may contain
+\end_layout
+
+\begin_layout Plain Layout
+
+;
+ specific information
+\end_layout
+
+\begin_layout Plain Layout
+
+IODEV EQU 21(0:3),BOUND(4:5) ;
+ Field is I/O device
+\end_layout
+
+\begin_layout Plain Layout
+
+JMPBY EQU 6(0:3),BOUND(4:5) ;
+ Field is Jx+
+\end_layout
+
+\begin_layout Plain Layout
+
+IMMAT EQU 4(0:3),BOUND(4:5) ;
+ Field is INCx/DECx/ENTx/ENNx
+\end_layout
+
+\begin_layout Plain Layout
+
+TABLE CON -GOOD ;
+ NOP
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANSX ;
+ ADD/FADD
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANSX ;
+ SUB/FSUB
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANSX ;
+ MUL/FMUL
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANSX ;
+ DIV/FDIV
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON -3(0:3),BOUND(4:5) ;
+ NUM/CHAR/HLT
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON -6(0:3),BOUND(4:5) ;
+ SLA/SRA/SLAX/SRAX/SLC/SRC
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON GOOD ;
+ MOVE
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LDA
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD1
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD2
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD3
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD4
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD5
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD6
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LDX
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LDAN
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD1N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD2N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD3N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD4N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD5N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LD6N
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ LDXN
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ STA
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST1
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST2
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST3
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST4
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST5
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ ST6
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ STX
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ STJ
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ STZ
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IODEV ;
+ JBUS
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON -IODEV ;
+ IOC
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IODEV ;
+ IN
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IODEV ;
+ OUT
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IODEV ;
+ JRED
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON 10(0:3),BOUND(4:5) ;
+ JMP/JSJ/JOV/JNOV/*
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ JA+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J1+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J2+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J3+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J4+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J5+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ J6+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON JMPBY ;
+ JX+
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INCA/DECA/ENTA/ENNA
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC1/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC2/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC3/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC4/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC5/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC6/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON IMMAT ;
+ INC7/...
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANSX ;
+ CMPA/FCMP
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP1
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP2
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP3
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP4
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP5
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGE ;
+ CMP6
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON RANGe ;
+ CMPX
+\end_layout
+
+\begin_layout Plain Layout
+
+FIVE CON 5
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.3.3.lyx b/1.3.3.lyx
new file mode 100644
index 0000000..db7c653
--- /dev/null
+++ b/1.3.3.lyx
@@ -0,0 +1,1630 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[02]
+\end_layout
+
+\end_inset
+
+Consider the transformation of
+\begin_inset Formula $\{0,1,2,3,4,5,6\}$
+\end_inset
+
+ that replaces
+\begin_inset Formula $x$
+\end_inset
+
+ by
+\begin_inset Formula $2x\bmod7$
+\end_inset
+
+.
+ Show that this transformation is a permutation,
+ and write it in cycle form.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Being a permutation follows from the fact that
+\begin_inset Formula $\mathbb{Z}_{7}$
+\end_inset
+
+ is a field.
+ In cycle form,
+ this would be
+\begin_inset Formula $(1\,2\,4)(3\,6\,5)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+The text shows how we might set
+\begin_inset Formula $(a,b,c,d,e,f)\to(c,d,f,b,e,a)$
+\end_inset
+
+ by using a series of replacement operations (
+\begin_inset Formula $x\gets y$
+\end_inset
+
+) and one auxiliary variable
+\begin_inset Formula $t$
+\end_inset
+
+.
+ Show how to do the job by using a series of
+\emph on
+exchange
+\emph default
+ operations (
+\begin_inset Formula $x\leftrightarrow y$
+\end_inset
+
+) and no auxiliary variables.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Since the permutation such that
+\begin_inset Formula $(a,b,c,d,e,f)\to(c,d,f,b,e,a)$
+\end_inset
+
+ such that
+\begin_inset Formula $x_{i}\to\sigma(x_{i})$
+\end_inset
+
+ is
+\begin_inset Formula $(a\,c\,f)(b\,d)$
+\end_inset
+
+,
+ we could use
+\begin_inset Formula $a\leftrightarrow c,c\leftrightarrow f,b\leftrightarrow d$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[03]
+\end_layout
+
+\end_inset
+
+Compute the product
+\begin_inset Formula ${\small \begin{pmatrix}a & b & c & d & e & f\\
+b & d & c & a & f & e
+\end{pmatrix}}\times{\small \begin{pmatrix}a & b & c & d & e & f\\
+c & d & f & b & e & a
+\end{pmatrix}}$
+\end_inset
+
+,
+ and express the answer in two-line notation.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\begin{pmatrix}a & b & c & d & e & f\\
+d & b & f & c & a & e
+\end{pmatrix}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[10]
+\end_layout
+
+\end_inset
+
+Express
+\begin_inset Formula $(a\,b\,d)(e\,f)(a\,c\,f)(b\,d)$
+\end_inset
+
+ as a product of disjoint cycles.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $(a\,d\,c\,f\,e)$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[M10]
+\end_layout
+
+\end_inset
+
+Equation (3) shows several equivalent ways to express the same permutation in cycle form.
+ How many different ways of writing that permutation are possible,
+ if all singleton cycles are suppressed?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+There are 2 cycles which can be ordered in
+\begin_inset Formula $2!=2$
+\end_inset
+
+ different ways,
+ and since an
+\begin_inset Formula $m$
+\end_inset
+
+-cycle can be written in
+\begin_inset Formula $m$
+\end_inset
+
+ different ways,
+ there are
+\begin_inset Formula $2!\cdot2\cdot3=12$
+\end_inset
+
+ possible ways to write the permutation in cycle form.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc7[10]
+\end_layout
+
+\end_inset
+
+If Program A is presented with the input (6),
+ what are the quantities
+\begin_inset Formula $X$
+\end_inset
+
+,
+
+\begin_inset Formula $Y$
+\end_inset
+
+,
+
+\begin_inset Formula $M$
+\end_inset
+
+,
+
+\begin_inset Formula $N$
+\end_inset
+
+,
+
+\begin_inset Formula $U$
+\end_inset
+
+,
+ and
+\begin_inset Formula $V$
+\end_inset
+
+ of (19)?
+ What is the time required by Program A,
+ excluding input-output?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $X$
+\end_inset
+
+ is the number of cards of input,
+ namely
+\begin_inset Formula $\lceil30/24\rceil=2$
+\end_inset
+
+ if no space is added;
+ then
+\begin_inset Formula $Y=29$
+\end_inset
+
+.
+
+\begin_inset Formula $M=5$
+\end_inset
+
+,
+ the number of cycles in input,
+ and
+\begin_inset Formula $N=7$
+\end_inset
+
+,
+ the number of different elements.
+ Then,
+ since the output is
+\begin_inset Formula $(a\,d\,g)(c\,e\,b)(f)$
+\end_inset
+
+,
+
+\begin_inset Formula $U=3$
+\end_inset
+
+,
+ the number of cycles in the output,
+ and
+\begin_inset Formula $V=1$
+\end_inset
+
+,
+ the number of singleton cycles.
+\end_layout
+
+\begin_layout Standard
+Then the time required,
+ excluding input-output,
+ is
+\begin_inset Formula
+\begin{multline*}
+112NX+304X-2M-Y+11U+2V-11=\\
+=112\cdot7\cdot2+304\cdot2-2\cdot5-29+11\cdot3+2\cdot1-11=2161u.
+\end{multline*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[23]
+\end_layout
+
+\end_inset
+
+Would it be feasible to modify Algorithm B to go from left to right instead of from right to left through the input?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes,
+ if we're allowed to use an extra step for inverting the result.
+ For this algorithm,
+ we use an auxiliary table
+\begin_inset Formula $U[1],\dots,U[n]$
+\end_inset
+
+ where we obtain the inverse of the permutation.
+ We calculate it by noticing that
+\begin_inset Formula $(a_{11}\,\dots\,a_{1m_{1}})\cdots(a_{k1}\,\cdots\,a_{km_{k}})=((a_{km_{k}}\,\dots\,a_{k1})\cdots(a_{1m_{1}}\,\dots\,a_{11}))^{-1}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+B1.
+\end_layout
+
+\end_inset
+
+[Initialize.] Set
+\begin_inset Formula $U[k]\to k$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+.
+ Also,
+ prepare to scan the input from left to right.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+B2.
+\end_layout
+
+\end_inset
+
+[Next element.] Examine the next element of the input.
+ If the input has been exhausted,
+ go to step B5.
+ If the element is a `(',
+ set
+\begin_inset Formula $Z\gets0$
+\end_inset
+
+ and repeat step B2;
+ if it is a `)',
+ go to B4.
+ Otherwise the element is
+\begin_inset Formula $x_{i}$
+\end_inset
+
+ for some
+\begin_inset Formula $i$
+\end_inset
+
+,
+ go on to B'3.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+B3.
+\end_layout
+
+\end_inset
+
+[Change
+\begin_inset Formula $U[i]$
+\end_inset
+
+.] Exchange
+\begin_inset Formula $Z\leftrightarrow U[i]$
+\end_inset
+
+.
+ If this makes
+\begin_inset Formula $U[i]=0$
+\end_inset
+
+,
+ set
+\begin_inset Formula $j\gets i$
+\end_inset
+
+.
+ Return to step B2.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+B4.
+\end_layout
+
+\end_inset
+
+[Change
+\begin_inset Formula $U[j]$
+\end_inset
+
+.] Set
+\begin_inset Formula $U[j]\gets Z$
+\end_inset
+
+.
+ Return to step B2.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+B5.
+\end_layout
+
+\end_inset
+
+[Invert permutation.] For
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+,
+ set
+\begin_inset Formula $T[U[i]]\gets i$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc9[10]
+\end_layout
+
+\end_inset
+
+Both Programs A and B accept the same input and give the answer in essentially the same form.
+ Is the output
+\emph on
+exactly
+\emph default
+ the same under both programs?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+No.
+ For example,
+ for input (6),
+ Program A produces
+\begin_inset Formula $(a\,d\,g)(c\,e\,b)(f)$
+\end_inset
+
+ while Program B produces
+\begin_inset Formula $(a\,d\,g)(b\,c\,e)(f)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[M24]
+\end_layout
+
+\end_inset
+
+Prove that Algorithm J is valid.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove it by induction.
+ Let
+\begin_inset Formula $\sigma$
+\end_inset
+
+ be the original permutation,
+ it's enough to show that,
+ when entering step J2,
+ or when exiting step J5,
+ for each
+\begin_inset Formula $j\in\{1,\dots,n\}$
+\end_inset
+
+,
+ if
+\begin_inset Formula $\sigma^{-1}(j)>m$
+\end_inset
+
+,
+
+\begin_inset Formula $X[j]=\sigma^{-1}(j)$
+\end_inset
+
+,
+ and otherwise
+\begin_inset Formula $X[j]=-\sigma^{k+1}(j)$
+\end_inset
+
+ where
+\begin_inset Formula $k$
+\end_inset
+
+ is the least nonnegative integer with
+\begin_inset Formula $\sigma^{k}(j)\leq m$
+\end_inset
+
+ (if there were no such number,
+ since
+\begin_inset Formula $\sigma^{-1}(j)=\sigma^{p}(j)$
+\end_inset
+
+ for some
+\begin_inset Formula $p\geq0$
+\end_inset
+
+,
+ then it would be
+\begin_inset Formula $\sigma^{-1}(j)>m$
+\end_inset
+
+).
+
+\end_layout
+
+\begin_layout Standard
+If we enter J2 from J1,
+ every
+\begin_inset Formula $X[j]<0$
+\end_inset
+
+,
+ every
+\begin_inset Formula $j\leq m=n$
+\end_inset
+
+,
+ so
+\begin_inset Formula $k=1$
+\end_inset
+
+ and what we have to prove is that
+\begin_inset Formula $X[j]=-\sigma(j)$
+\end_inset
+
+,
+ which obviously holds.
+ Now,
+ provided that this holds when we enter J2,
+ we have to show that it holds when we reach J5 and the proof is complete.
+\end_layout
+
+\begin_layout Standard
+After steps J2 and J3,
+ obviously the condition still holds.
+ After these steps,
+
+\begin_inset Formula $i=-\sigma(m)$
+\end_inset
+
+ and
+\begin_inset Formula $j$
+\end_inset
+
+ is such that
+\begin_inset Formula $i=X[j]$
+\end_inset
+
+.
+ We prove this by induction,
+ showing that,
+ after
+\begin_inset Formula $k\geq1$
+\end_inset
+
+ steps,
+
+\begin_inset Formula $i$
+\end_inset
+
+ is either
+\begin_inset Formula $-\sigma(m)<0$
+\end_inset
+
+ or
+\begin_inset Formula $\sigma^{-k}(m)>0$
+\end_inset
+
+,
+ and in the latter case,
+
+\begin_inset Formula $\sigma^{-k}(m),\sigma^{-k+1}(m),\dots,\sigma^{-1}(m)>m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+After one iteration,
+
+\begin_inset Formula $i=X[m]$
+\end_inset
+
+;
+ if
+\begin_inset Formula $i>0$
+\end_inset
+
+,
+
+\begin_inset Formula $i=\sigma^{-1}(m)>m$
+\end_inset
+
+;
+ otherwise
+\begin_inset Formula $i=-\sigma^{p+1}(m)$
+\end_inset
+
+,
+ where
+\begin_inset Formula $p$
+\end_inset
+
+ is the least nonnegative integer with
+\begin_inset Formula $\sigma^{p}(m)\leq m$
+\end_inset
+
+,
+ but since
+\begin_inset Formula $p=0$
+\end_inset
+
+,
+
+\begin_inset Formula $i=-\sigma(m)$
+\end_inset
+
+.
+ Now assume that this still holds after
+\begin_inset Formula $k$
+\end_inset
+
+ iterations,
+ and that
+\begin_inset Formula $i>0$
+\end_inset
+
+ so there's a
+\begin_inset Formula $(k+1)$
+\end_inset
+
+-th iteration.
+ Then
+\begin_inset Formula $j=\sigma^{-k}(m)>0$
+\end_inset
+
+ and we assign
+\begin_inset Formula $X[j]$
+\end_inset
+
+ to
+\begin_inset Formula $i$
+\end_inset
+
+.
+ If
+\begin_inset Formula $i>0$
+\end_inset
+
+,
+
+\begin_inset Formula $i=\sigma^{-1}(\sigma^{-k}(m))=\sigma^{-k-1}(m)>m$
+\end_inset
+
+;
+ otherwise
+\begin_inset Formula $i=-\sigma^{p+1}(\sigma^{-k}(m))$
+\end_inset
+
+,
+ where
+\begin_inset Formula $p$
+\end_inset
+
+ is the least nonnegative integer with
+\begin_inset Formula $\sigma^{p-k}(m)\leq m$
+\end_inset
+
+,
+ but
+\begin_inset Formula $\sigma^{-k}(m),\dots,\sigma^{-1}(m)>m$
+\end_inset
+
+ and
+\begin_inset Formula $\sigma^{0}(m)=m$
+\end_inset
+
+,
+ so
+\begin_inset Formula $p=k$
+\end_inset
+
+ and
+\begin_inset Formula $i=-\sigma^{k+1}(\sigma^{-k}(m))=-\sigma(m)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Now,
+ at the beginning of step J4,
+
+\begin_inset Formula $i=-\sigma(m)$
+\end_inset
+
+ and
+\begin_inset Formula $j$
+\end_inset
+
+ is such that,
+ if
+\begin_inset Formula $k$
+\end_inset
+
+ is the least nonnegative integer with
+\begin_inset Formula $\sigma^{k}(j)\leq m$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\sigma^{k+1}(j)=\sigma(m)$
+\end_inset
+
+.
+ Then the new value of
+\begin_inset Formula $X[j]$
+\end_inset
+
+ is
+\begin_inset Formula $X[-i]=X[\sigma(m)]=-\sigma^{p+1}(m)$
+\end_inset
+
+,
+ where
+\begin_inset Formula $p$
+\end_inset
+
+ is the least positive integer with
+\begin_inset Formula $\sigma^{p}(m)\leq m$
+\end_inset
+
+,
+ the new value of
+\begin_inset Formula $X[-i]=X[\sigma(m)]$
+\end_inset
+
+ is
+\begin_inset Formula $m=\sigma^{-1}(\sigma(m))$
+\end_inset
+
+ and the new value of
+\begin_inset Formula $m$
+\end_inset
+
+ is
+\begin_inset Formula $m-1$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $\sigma^{-1}(\sigma(m))>m-1$
+\end_inset
+
+,
+ the condition holds for
+\begin_inset Formula $X[\sigma(m)]=X[-i]$
+\end_inset
+
+:.
+ Also,
+
+\begin_inset Formula $X[j]=-\sigma^{p+1}(m)=-\sigma^{p+k+1}(j)$
+\end_inset
+
+,
+
+\begin_inset Formula $j,\sigma(j),\dots,\sigma^{k-1}(j),\sigma^{k}(j)=m,\sigma^{k+1}(j)=\sigma(m),\dots,\sigma^{p+k}(j)=\sigma^{p-1}(m)>m-1$
+\end_inset
+
+,
+ and because
+\begin_inset Formula $\sigma^{p+k+1}(j)=\sigma^{p}(m)\leq m$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\sigma^{p}(m)\neq m$
+\end_inset
+
+ because otherwise it would be either
+\begin_inset Formula $p\leq k$
+\end_inset
+
+ and
+\begin_inset Formula $\sigma^{k-p}(j)=m\#$
+\end_inset
+
+,
+ or
+\begin_inset Formula $p>k$
+\end_inset
+
+ and
+\begin_inset Formula $\sigma^{p}(j)=\sigma^{p-k}(m)=j\leq m\#$
+\end_inset
+
+,
+ then we have
+\begin_inset Formula $\sigma^{p+k+1}(j)=\sigma^{p}(m)\leq m-1$
+\end_inset
+
+,
+ and the condition holds for
+\begin_inset Formula $X[j]$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Now the only thing left to prove is that step J3 always ends,
+ for which it suffices to prove that the cycle that
+\begin_inset Formula $m$
+\end_inset
+
+ is in contains an element
+\begin_inset Formula $t$
+\end_inset
+
+ with
+\begin_inset Formula $X[t]<0$
+\end_inset
+
+,
+ which happens if and only if it contains a
+\begin_inset Formula $t$
+\end_inset
+
+ with
+\begin_inset Formula $\sigma^{-1}(t)\leq m$
+\end_inset
+
+,
+ if and only if there's an element not greater than
+\begin_inset Formula $m$
+\end_inset
+
+,
+ but
+\begin_inset Formula $m$
+\end_inset
+
+ is such an element.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 26,
+ 34
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc26[M24]
+\end_layout
+
+\end_inset
+
+Extend the principle of inclusion and exclusion to obtain a formula for the number of elements that are in exactly
+\begin_inset Formula $r$
+\end_inset
+
+ of the subsets
+\begin_inset Formula $S_{1},S_{2},\dots,S_{M}$
+\end_inset
+
+.
+ (The text considers only the case
+\begin_inset Formula $r=0$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For the sake of abbreviation,
+ let
+\begin_inset Formula $E_{r}$
+\end_inset
+
+ be the number of elements that are exactly in
+\begin_inset Formula $r$
+\end_inset
+
+ of the subsets and let
+\begin_inset Formula
+\[
+T_{r}\coloneqq\sum_{1\leq j_{1}<\dots<j_{r}\leq M}|S_{j_{1}}\cap\dots\cap S_{j_{r}}|,
+\]
+
+\end_inset
+
+so that
+\begin_inset Formula $T_{0}=N$
+\end_inset
+
+ (we use the convention that the intersection of no subsets is the intended
+\begin_inset Quotes eld
+\end_inset
+
+domain
+\begin_inset Quotes erd
+\end_inset
+
+ set),
+
+\begin_inset Formula $T_{M}=|S_{1}\cap\dots\cap S_{M}|$
+\end_inset
+
+,
+ and for
+\begin_inset Formula $r>M$
+\end_inset
+
+,
+
+\begin_inset Formula $T_{r}=0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Obviously
+\begin_inset Formula $E_{r}=0$
+\end_inset
+
+ for
+\begin_inset Formula $r>M$
+\end_inset
+
+,
+ and
+\begin_inset Formula $E_{M}=T_{M}$
+\end_inset
+
+.
+ After calculating
+\begin_inset Formula $E_{M-1}$
+\end_inset
+
+ and
+\begin_inset Formula $E_{M-2}$
+\end_inset
+
+,
+ we formulate the hypothesis that
+\begin_inset Formula
+\[
+E_{r}=\sum_{k=r}^{M}(-1)^{k-r}\binom{k}{r}T_{k}
+\]
+
+\end_inset
+
+for
+\begin_inset Formula $0\leq r\leq M$
+\end_inset
+
+,
+ which matches what we know about
+\begin_inset Formula $E_{M}$
+\end_inset
+
+ and
+\begin_inset Formula $E_{0}$
+\end_inset
+
+.
+ We prove this by induction from
+\begin_inset Formula $r=M$
+\end_inset
+
+ to 0.
+ We have already established the base case.
+ For
+\begin_inset Formula $r<M$
+\end_inset
+
+,
+ we start by pointing out that,
+ for
+\begin_inset Formula $r\leq k\leq M$
+\end_inset
+
+,
+
+\begin_inset Formula $T_{r}$
+\end_inset
+
+ counts the elements that appear exactly
+\begin_inset Formula $k$
+\end_inset
+
+ times a total of
+\begin_inset Formula $\binom{k}{r}$
+\end_inset
+
+ times,
+ corresponding to choosing the
+\begin_inset Formula $r$
+\end_inset
+
+ indexes from those
+\begin_inset Formula $k$
+\end_inset
+
+ indexes that contain the element.
+ Thus
+\begin_inset Formula $T_{r}=\sum_{k=r}^{M}\binom{k}{r}E_{k}$
+\end_inset
+
+,
+ so
+\begin_inset Formula
+\begin{align*}
+E_{r} & =T_{r}-\sum_{k=r+1}^{M}\binom{k}{r}E_{k}=T_{r}-\sum_{k=r+1}^{M}\binom{k}{r}\sum_{j=k}^{M}(-1)^{j-k}\binom{j}{k}T_{j}\\
+ & =T_{r}-\sum_{j=r+1}^{M}\left(\sum_{k=r+1}^{j}(-1)^{j-k}\binom{j}{k}\binom{k}{r}\right)T_{j},
+\end{align*}
+
+\end_inset
+
+but by Eq.
+ 1.2.6–(23),
+\begin_inset Formula
+\[
+\sum_{k=r+1}^{j}(-1)^{j-k}\binom{j}{k}\binom{k}{r}=\sum_{k=r}^{j}(-1)^{j-k}\binom{j}{k}\binom{k}{r}-(-1)^{j-r}\binom{j}{r}=\cancel{\binom{0}{r-j}}^{=0}-(-1)^{j-r}\binom{j}{r},
+\]
+
+\end_inset
+
+and so
+\begin_inset Formula
+\[
+E_{r}=T_{r}+\sum_{j=r+1}^{M}(-1)^{j-r}\binom{j}{r}T_{j}=\sum_{j=r}^{M}(-1)^{j-r}\binom{j}{r}T_{j}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc34[M25]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Transposing blocks of data.
+\emph default
+) One of the most common permutations needed in practice is the change from
+\begin_inset Formula $\alpha\beta$
+\end_inset
+
+ to
+\begin_inset Formula $\beta\alpha$
+\end_inset
+
+,
+ where
+\begin_inset Formula $\alpha$
+\end_inset
+
+ and
+\begin_inset Formula $\beta$
+\end_inset
+
+ are substrings of an array.
+ In other words,
+ if
+\begin_inset Formula $x_{0}x_{1}\dots x_{m-1}=\alpha$
+\end_inset
+
+ and
+\begin_inset Formula $x_{m}x_{m+1}\dots x_{m+n-1}=\beta$
+\end_inset
+
+,
+ we want to change the array
+\begin_inset Formula $x_{0}x_{1}\dots x_{m+n-1}=\alpha\beta$
+\end_inset
+
+ to the array
+\begin_inset Formula $x_{m}x_{m+1}\dots x_{m+n-1}x_{0}x_{1}\dots x_{m-1}=\beta\alpha$
+\end_inset
+
+;
+ each element
+\begin_inset Formula $x_{k}$
+\end_inset
+
+ should be replaced by
+\begin_inset Formula $x_{p(k)}$
+\end_inset
+
+ for
+\begin_inset Formula $0\leq k<m+n$
+\end_inset
+
+,
+ where
+\begin_inset Formula $p(k)=(k+m)\bmod(m+n)$
+\end_inset
+
+.
+ Show that every such
+\begin_inset Quotes eld
+\end_inset
+
+cyclic-shift
+\begin_inset Quotes erd
+\end_inset
+
+ permutation has a simple cycle structure,
+ and exploit that structure to device a simple algorithm for the desired rearrangement.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $d\coloneqq\gcd\{m,n\}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $p=C_{0}C_{1}\cdots C_{d-1}$
+\end_inset
+
+ where
+\begin_inset Formula
+\[
+C_{j}\coloneqq(j\,(m+j)\,(2m+j)\,\dots\,((\tfrac{n}{d}-1)m+j))\pmod n.
+\]
+
+\end_inset
+
+Effectively,
+ each of the cycles above contains only elements with the same value modulo
+\begin_inset Formula $d$
+\end_inset
+
+,
+ so the cycles are disjoint,
+ and for any
+\begin_inset Formula $k\in\{0,\dots,n-1\}$
+\end_inset
+
+,
+ let
+\begin_inset Formula $p$
+\end_inset
+
+ and
+\begin_inset Formula $q$
+\end_inset
+
+ be the quotient and remainder of
+\begin_inset Formula $k/d$
+\end_inset
+
+ and
+\begin_inset Formula $am+bn=d$
+\end_inset
+
+ be a Bézout identity,
+ then
+\begin_inset Formula
+\[
+k=pd+q=pam+pbn+q\equiv pam+q\equiv(pa\bmod n/d)m\pmod n.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We can use this in the following algorithm.
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+Algorithm T.
+
+\series default
+ (
+\emph on
+Transpose blocks of data.
+\emph default
+)
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] Set
+\begin_inset Formula $d\gets m$
+\end_inset
+
+,
+
+\begin_inset Formula $N\gets m+n$
+\end_inset
+
+,
+ and
+\begin_inset Formula $j\gets-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Calculate
+\begin_inset Formula $d$
+\end_inset
+
+.] Set
+\begin_inset Formula $n\gets n\bmod d$
+\end_inset
+
+.
+ If
+\begin_inset Formula $n\neq0$
+\end_inset
+
+,
+ set
+\begin_inset Formula $d\leftrightarrow n$
+\end_inset
+
+ and repeat this step.
+\end_layout
+
+\begin_layout Enumerate
+[Set up cycle.] Increment
+\begin_inset Formula $j$
+\end_inset
+
+ by 1.
+ If
+\begin_inset Formula $j=d$
+\end_inset
+
+,
+ terminate the algorithm.
+ Otherwise set
+\begin_inset Formula $k\gets j$
+\end_inset
+
+ and
+\begin_inset Formula $s\gets x_{j}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Iterate.] Set
+\begin_inset Formula $l\gets(k+m)\bmod(m+n)$
+\end_inset
+
+.
+ If
+\begin_inset Formula $l=j$
+\end_inset
+
+,
+ set
+\begin_inset Formula $x_{k}\gets s$
+\end_inset
+
+ and go to the previous step.
+ Otherwise set
+\begin_inset Formula $x_{k}\gets x_{l}$
+\end_inset
+
+,
+
+\begin_inset Formula $k\gets l$
+\end_inset
+
+,
+ and repeat this step.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.4.1.lyx b/1.4.1.lyx
new file mode 100644
index 0000000..0210696
--- /dev/null
+++ b/1.4.1.lyx
@@ -0,0 +1,403 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[10]
+\end_layout
+
+\end_inset
+
+State the characteristics of subroutine (5),
+ just as (4) gives the characteristics of Subroutine 1.3.2M.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\[
+\left.\begin{array}{ll}
+\text{Calling sequences:} & \text{\texttt{JMP MAX100} if \ensuremath{n=100}, or \texttt{JMP MAXN}}.\\
+\text{Entry conditions:} & \text{For \texttt{MAXN}, }\text{rI3}=n;\ n\geq1.\\
+\text{Exit conditions:} & \text{rA}=\max_{k=1}^{n}\mathtt{CONTENTS(X}+k\mathtt{)}=\mathtt{CONTENTS(X}+\text{rI2}\mathtt{)};\\
+ & \text{rI3}=0.
+\end{array}\right\}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+Suggest code to substitute for (6) without using the
+\family typewriter
+JSJ
+\family default
+ instruction.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+MAX50 ENT3 50
+\end_layout
+
+\begin_layout Plain Layout
+
+ STJ EXIT
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP MAXN
+\end_layout
+
+\begin_layout Plain Layout
+
+EXIT JMP *
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[21]
+\end_layout
+
+\end_inset
+
+White a subroutine that generalizes
+\family typewriter
+MAXN
+\family default
+ by finding the maximum value of
+\begin_inset Formula $\mathtt{X[}a\mathtt{]},\mathtt{X[}a+r\mathtt{]},\mathtt{X[}a+2r\mathtt{]},\dots,\mathtt{X[}n\mathtt{]}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $r$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ are parameters and
+\begin_inset Formula $a$
+\end_inset
+
+ is the smallest positive number with
+\begin_inset Formula $a\equiv n\pmod r$
+\end_inset
+
+,
+ namely
+\begin_inset Formula $a=1+(n-1)\bmod r$
+\end_inset
+
+.
+ Give a special entrance for the case
+\begin_inset Formula $r=1$
+\end_inset
+
+.
+ List the characteristics of your subroutine,
+ as in (4).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+MAXIMUM ENT1 1
+\end_layout
+
+\begin_layout Plain Layout
+
+MAXMOD STJ 9F
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP 2F
+\end_layout
+
+\begin_layout Plain Layout
+
+1H CMPA X,3
+\end_layout
+
+\begin_layout Plain Layout
+
+ JGE 3F
+\end_layout
+
+\begin_layout Plain Layout
+
+2H ENT2 0,3
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA X,3
+\end_layout
+
+\begin_layout Plain Layout
+
+3H DEC3 0,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ J3P 1B
+\end_layout
+
+\begin_layout Plain Layout
+
+9H JMP *
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\[
+\left.\begin{array}{ll}
+\text{Calling sequences:} & \text{\texttt{JMP MAXIMUM} if \ensuremath{r=1}, or \texttt{JMP MAXMOD}}.\\
+\text{Entry conditions:} & \text{rI3}=n;\text{ for \texttt{MAXMOD}, }\text{rI1}=r;\ n,r\geq1.\\
+\text{Exit conditions:} & \text{rA}=\max_{k=1}^{\lfloor(n-1)/r\rfloor}\mathtt{CONTENTS(X}+n-kr\mathtt{)}=\mathtt{CONTENTS(X}+\text{rI2}\mathtt{)};\\
+ & \text{rI3}\leq0.
+\end{array}\right\}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[20]
+\end_layout
+
+\end_inset
+
+Why is self-modifying code now frowned upon?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Modern computers have separate instruction and data caches for efficiency,
+ and typically several instructions are being processed at once,
+ so modifying one of these instructions means emptying the instruction cache and pipeline,
+ severely degrading performance.
+
+\end_layout
+
+\begin_layout Standard
+These computers also support a security measure that works by preventing pieces of code intended to be executed from being written to,
+ in order to avoid attackers executing code by overriding some buffer due to a bug in the application,
+ and self-modifying code would need to have that protection disabled.
+
+\end_layout
+
+\begin_layout Standard
+Third,
+ typically these computers are running several processes or threads which may share code,
+ and if the code is self-modifying we would need to keep several copies of it,
+ which wastes memory.
+
+\end_layout
+
+\begin_layout Standard
+Finally,
+ self-modifying code is difficult to reason about unless it is restricted to a few well known patterns,
+ but these patterns can be easily replaced by constructions like stacks which do not suffer from the problems above and allow techniques like recursion.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.4.2.lyx b/1.4.2.lyx
new file mode 100644
index 0000000..7577695
--- /dev/null
+++ b/1.4.2.lyx
@@ -0,0 +1,465 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[10]
+\end_layout
+
+\end_inset
+
+Explain why short,
+ simple examples of coroutines are hard for the author of a textbook to find.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Coroutines appear when there are several parts of the program coordinating among them,
+ where each part performs a higher level task.
+ While simple coroutines appear in higher level languages such as Python (in the form of generators),
+ in languages such as assembly where they is no builtin support for them,
+ they are more complex and slower than equivalent code that doesn't use coroutines,
+ so their utility is not evident from these simple cases.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[20]
+\end_layout
+
+\end_inset
+
+The program in the text starts up the
+\family typewriter
+OUT
+\family default
+ coroutine first.
+ What would happen if
+\family typewriter
+IN
+\family default
+ were the first to be executed—
+that is,
+ if line 60 where changed from `
+\family typewriter
+JMP OUT1
+\family default
+' to `
+\family typewriter
+JMP IN1
+\family default
+'?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The first parsed character would be ignored,
+ since the
+\family typewriter
+OUT
+\family default
+ coroutine doesn't expect a character to be loaded already when it begins.
+ Here
+\family typewriter
+IN
+\family default
+ acts effectively like a generator for
+\family typewriter
+OUT
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[22]
+\end_layout
+
+\end_inset
+
+Give coroutine linkage analogous to (1) for the case of
+\emph on
+three
+\emph default
+ coroutines,
+
+\family typewriter
+A
+\family default
+,
+
+\family typewriter
+B
+\family default
+,
+ and
+\family typewriter
+C
+\family default
+,
+ each of which can jump to either of the other two.
+ (Whenever a coroutine is activated,
+ it begins where it last left off.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+In principle,
+ this would require us to extend the code to
+\emph on
+six
+\emph default
+ coroutine linkages,
+ like below:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+{
+\backslash
+tt
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Box Frameless
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+use_makebox 0
+width "25col%"
+special "none"
+height "1in"
+height_special "totalheight"
+thickness "0.4pt"
+separation "3pt"
+shadowsize "4pt"
+framecolor "foreground"
+backgroundcolor "none"
+status open
+
+\begin_layout Plain Layout
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+BTOA STJ BX
+\end_layout
+
+\begin_layout Plain Layout
+ JMP AX
+\end_layout
+
+\begin_layout Plain Layout
+CTOA STJ CX
+\end_layout
+
+\begin_layout Plain Layout
+AX JMP A1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Box Frameless
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+use_makebox 0
+width "25col%"
+special "none"
+height "1in"
+height_special "totalheight"
+thickness "0.4pt"
+separation "3pt"
+shadowsize "4pt"
+framecolor "foreground"
+backgroundcolor "none"
+status open
+
+\begin_layout Plain Layout
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+ATOB STJ AX
+\end_layout
+
+\begin_layout Plain Layout
+ JMP BX
+\end_layout
+
+\begin_layout Plain Layout
+CTOB STJ CX
+\end_layout
+
+\begin_layout Plain Layout
+BX JMP B1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Box Frameless
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+use_makebox 0
+width "25col%"
+special "none"
+height "1in"
+height_special "totalheight"
+thickness "0.4pt"
+separation "3pt"
+shadowsize "4pt"
+framecolor "foreground"
+backgroundcolor "none"
+status open
+
+\begin_layout Plain Layout
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+ATOC STJ AX
+\end_layout
+
+\begin_layout Plain Layout
+ JMP CX
+\end_layout
+
+\begin_layout Plain Layout
+BTOC STJ BX
+\end_layout
+
+\begin_layout Plain Layout
+ JMP C1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We can then elide the code for jumps that never happen.
+ When the number of coroutines is large,
+ typically each one only communicates with the next or they communicate with a central,
+ coordinating coroutine that decides which to call next based on some protocol (maybe coroutines store the index of the next coroutine to run in some register,
+ or coroutines are polled in order based on which has input data available,
+ for example.)
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.4.3.1.lyx b/1.4.3.1.lyx
new file mode 100644
index 0000000..8eda4ba
--- /dev/null
+++ b/1.4.3.1.lyx
@@ -0,0 +1,334 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[22]
+\end_layout
+
+\end_inset
+
+Write the
+\family typewriter
+MOVE
+\family default
+ routine,
+ which is missing from the program in the text (operation code 7).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The following is not tested.
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+MOVE J3Z CYCLE
+\end_layout
+
+\begin_layout Plain Layout
+ ENTA 0,3
+;
+
+\lang english
+ Calculate time
+\end_layout
+
+\begin_layout Plain Layout
+ INCA 1,3
+\end_layout
+
+\begin_layout Plain Layout
+ STA TIME(0:2)
+\end_layout
+
+\begin_layout Plain Layout
+ LD1 A1REG
+;
+
+\lang english
+ Load destination position
+\end_layout
+
+\begin_layout Plain Layout
+ LDA SIGN1
+;
+
+\lang english
+ Check positive sign
+\end_layout
+
+\begin_layout Plain Layout
+ JAP 1H
+\end_layout
+
+\begin_layout Plain Layout
+ J1NZ MEMERROR
+\end_layout
+
+\begin_layout Plain Layout
+ STZ SIGN1(0:0)
+\end_layout
+
+\begin_layout Plain Layout
+1H J3Z CYCLE
+;
+
+\lang english
+ Check loop variable
+\end_layout
+
+\begin_layout Plain Layout
+ CMP1 =BEGIN=
+;
+
+\lang english
+ Check destination
+\end_layout
+
+\begin_layout Plain Layout
+ JGE MEMERROR
+\end_layout
+
+\begin_layout Plain Layout
+ CMP5 =BEGIN=
+;
+
+\lang english
+ Check source
+\end_layout
+
+\begin_layout Plain Layout
+ JGE MEMERROR
+\end_layout
+
+\begin_layout Plain Layout
+ LDA 0,5
+;
+
+\lang english
+ Move value
+\end_layout
+
+\begin_layout Plain Layout
+ STA 0,1
+\end_layout
+
+\begin_layout Plain Layout
+ DEC3 1
+;
+
+\lang english
+ Next iteration
+\end_layout
+
+\begin_layout Plain Layout
+ INC1 1
+\end_layout
+
+\begin_layout Plain Layout
+ INC5 1
+\end_layout
+
+\begin_layout Plain Layout
+ ST1 I1REG
+\end_layout
+
+\begin_layout Plain Layout
+ JMP 1B
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[24]
+\end_layout
+
+\end_inset
+
+Determine the time required to simulate the
+\family typewriter
+LDA
+\family default
+ and
+\family typewriter
+ENTA
+\family default
+ operators,
+ compared with the actual time for
+\family typewriter
+MIX
+\family default
+ to execute these operators directly.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It takes 2 cycles to run an
+\family typewriter
+LDA
+\family default
+ instruction and 1 cycle to run an
+\family typewriter
+ENTA
+\family default
+ instruction.
+ However,
+ it takes 95 cycles to simulate
+\family typewriter
+LDA
+\family default
+,
+ plus 5 if the sign is not included in the fields to load,
+ and 52 to simulate
+\family typewriter
+ENTA
+\family default
+,
+ plus 2 if the value to load is not zero,
+ and we also have to add 15 cycles to both if the index field is nonzero.
+ This
+\emph on
+more or less
+\emph default
+ matches the solution but I'm not spending any more effort on
+\emph on
+counting cycles
+\emph default
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.4.3.2.lyx b/1.4.3.2.lyx
new file mode 100644
index 0000000..7c36188
--- /dev/null
+++ b/1.4.3.2.lyx
@@ -0,0 +1,294 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 3,
+ 4,
+ 7 (1p,
+ 1:09)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc3[10]
+\end_layout
+
+\end_inset
+
+The previous exercise suggests having the trace program write its output onto tape.
+ Discuss why this would be preferable to printing it directly.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The output of the tracer would be large,
+ and so it would need to be analyzed by another program in order to focus on interesting parts or gather some statistics.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[25]
+\end_layout
+
+\end_inset
+
+What would happen if the trace routine were tracing
+\emph on
+itself
+\emph default
+?
+ Specifically,
+ consider the behavior if the two instructions
+\family typewriter
+ENTX LEAVEX
+\family default
+;
+
+\family typewriter
+JMP *+1
+\family default
+ were placed just before
+\family typewriter
+ENTER
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Unfortunately this wouldn't work,
+ as the registers A and J of the tracing tracing program and the traced traced program would be stored in the same addresses.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[25]
+\end_layout
+
+\end_inset
+
+Discuss how to write an efficient
+\emph on
+jump trace
+\emph default
+ routine,
+ which emits much less output than a normal trace.
+ Instead of displaying the register contents,
+ a jump trace simply records the jumps that occur.
+ It outputs a sequence of pairs
+\begin_inset Formula $(x_{1},y_{1}),(x_{2},y_{2}),\dots$
+\end_inset
+
+,
+ meaning that the program jumped from location
+\begin_inset Formula $x_{1}$
+\end_inset
+
+ to
+\begin_inset Formula $y_{1}$
+\end_inset
+
+,
+ then (after performing the instructions in locations
+\begin_inset Formula $y_{1},y_{1}+1,\dots,x_{2}$
+\end_inset
+
+) it jumped from
+\begin_inset Formula $x_{2}$
+\end_inset
+
+ to
+\begin_inset Formula $y_{2}$
+\end_inset
+
+,
+ etc.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We could save this information right at the
+\family typewriter
+JUMP
+\family default
+ label.
+ At this point,
+
+\family typewriter
+PREG
+\family default
+ contains the current instruction and
+\family typewriter
+INST1
+\family default
+ contains the instruction to jump to,
+ so it should be easy to move those to values to a buffer and call a subroutine to write to tape when the buffer is full.
+\end_layout
+
+\begin_layout Standard
+If the code wasn't self-modifying,
+ we could just scan up to the next jump instruction,
+ modify that one,
+ and run up to that point,
+ and the solution from the book specifies just that except that it allows
+\family typewriter
+STJ
+\family default
+ to modify jump calls by handling this case separately during the scan.
+ Since modern processors can raise an exception when modifying their own code (W^X),
+ it should be possible to save all the jump calls in some table and substitute them by calls to a debugger routine before running,
+ accepting that the program may detect that it's being debugged by looking at its own jump calls.
+\end_layout
+
+\end_body
+\end_document
diff --git a/1.4.4.lyx b/1.4.4.lyx
new file mode 100644
index 0000000..334ff44
--- /dev/null
+++ b/1.4.4.lyx
@@ -0,0 +1,4213 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[05]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Would sequence (3) still be correct if the
+\family typewriter
+MOVE
+\family default
+ instructions were placed before the
+\family typewriter
+JBUS
+\family default
+ instruction instead of after it?
+\end_layout
+
+\begin_layout Enumerate
+What if the
+\family typewriter
+MOVE
+\family default
+ instructions were placed after the
+\family typewriter
+IN
+\family default
+ command?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+No,
+ because they would be reading the old data.
+\end_layout
+
+\begin_layout Enumerate
+No,
+ because the new data would overwrite the old data while we are reading it.
+ It would probably turn out okay since the new data is probably being read at a slower pace than the
+\family typewriter
+MOVE
+\family default
+ instructions,
+ but it's not wise to bet on it.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+The instructions `
+\family typewriter
+OUT 1000(6)
+\family default
+;
+
+\family typewriter
+JBUS *(6)
+\family default
+' may be used to output a tape block in an unbuffered fashion,
+ just as the instructions (1) did this for input.
+ Give a method analogous to (2) and (3) that buffers this output,
+ by using
+\family typewriter
+MOVE
+\family default
+ instructions and an auxiliary buffer in locations 2000–2099.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Every time a new block of data is ready in locations 1000–1099,
+ we want to clear it to allow other operations to write on it and write it to tape in the meantime,
+ making sure that the previous block has finished writing before that.
+ Therefore we could just run the following after each block is ready:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ENT1 2000
+\end_layout
+
+\begin_layout Plain Layout
+
+JBUS *(6)
+\end_layout
+
+\begin_layout Plain Layout
+
+MOVE 1000(50)
+\end_layout
+
+\begin_layout Plain Layout
+
+MOVE 1050(50)
+\end_layout
+
+\begin_layout Plain Layout
+
+OUT 2000(6)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[22]
+\end_layout
+
+\end_inset
+
+Write a buffer-swapping output subroutine analogous to (4).
+ The subroutine,
+ called
+\family typewriter
+WORDOUT
+\family default
+,
+ should store the word in rA as the next word of output,
+ and if a buffer is full it should write 100 words onto tape unit
+\family typewriter
+V
+\family default
+.
+ Index register 5 should be used to refer to the current buffer position.
+ Show the layout of buffer areas and explain what instructions (if any) are necessary at the beginning and end of the program to ensure that the first and last blocks are properly written.
+ The final block should be filled out with zeros if necessary.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The following code is not tested.
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+WORDOUT STJ 1F
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA 0,5
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC5 1
+\end_layout
+
+\begin_layout Plain Layout
+
+2H LDA 0,5
+\end_layout
+
+\begin_layout Plain Layout
+
+ DECA SENTINEL
+\end_layout
+
+\begin_layout Plain Layout
+
+1H JAZ *
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT -100,5(V)
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD5 1,5
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP 2B
+\end_layout
+
+\begin_layout Plain Layout
+
+OUTBUF1 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON SENTINEL
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON OUTBUF2
+\end_layout
+
+\begin_layout Plain Layout
+
+OUTBUF2 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON SENTINEL
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON OUTBUF1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+At the start of the program,
+ we would need to
+\family typewriter
+ENT5 OUTBUF1
+\family default
+.
+ At the end,
+ we have to fill the current block with zeroes and write it
+\emph on
+unless
+\emph default
+ we are at the beginning of the block so we have already written what we had to,
+ and then we had to wait for the remaining write to complete.
+ We can do this with the following code:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ DEC5 OUTBUF1
+\end_layout
+
+\begin_layout Plain Layout
+
+ J5Z 9H
+\end_layout
+
+\begin_layout Plain Layout
+
+ DEC5 102
+\end_layout
+
+\begin_layout Plain Layout
+
+ J5Z 9H
+\end_layout
+
+\begin_layout Plain Layout
+
+1H STZ 0,5
+\end_layout
+
+\begin_layout Plain Layout
+
+ INC5 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA 0,5
+\end_layout
+
+\begin_layout Plain Layout
+
+ DECA SENTINEL
+\end_layout
+
+\begin_layout Plain Layout
+
+ JANZ 1B
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT -100,5(U)
+\end_layout
+
+\begin_layout Plain Layout
+
+9H JBUS *(5)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Knuth's version is 2 words shorter and very slightly faster by comparing addresses rather than contents in a couple places.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[M20]
+\end_layout
+
+\end_inset
+
+Show that if a program refers to a single I/O device,
+ we might be able to cut the running time in half by buffering the I/O,
+ in favorable circumstances;
+ but we can never decrease the running time by more than a factor of two,
+ with respect to the time taken by unbuffered I/O.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+See the next exercise.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[M21]
+\end_layout
+
+\end_inset
+
+Generalize the situation of the preceding exercise to the case when the program refers to
+\begin_inset Formula $n$
+\end_inset
+
+ I/O devices instead of just one.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let's assume that reads and writes on devices are so slow that the time taken for the CPU to run the I/O operations is negligible.
+ Let's also assume that the time it takes for the CPU to complete an iteration of the program is the same time that it takes for each device to read or write a block,
+ that this time is the same for all devices,
+ and that each iteration reads or writes a block on each device at the beginning which is only needed by the next iteration,
+ if at all.
+ Moreover,
+ we assume that there are enough iterations so that the time needed for initialization and finalization is negligible.
+\end_layout
+
+\begin_layout Standard
+Then the unbuffered case takes
+\begin_inset Formula $MN(n+1)$
+\end_inset
+
+ cycles,
+ where
+\begin_inset Formula $M$
+\end_inset
+
+ is the number of iterations and
+\begin_inset Formula $N$
+\end_inset
+
+ is the number of cycles per iteration,
+ while the buffered case takes
+\begin_inset Formula $MN$
+\end_inset
+
+,
+ so in this optimal case,
+ the time is divided by
+\begin_inset Formula $n+1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+On the other hand,
+ if we have a general program where the CPU takes
+\begin_inset Formula $N_{0}$
+\end_inset
+
+ cycles and the
+\begin_inset Formula $k$
+\end_inset
+
+th device takes
+\begin_inset Formula $N_{k}$
+\end_inset
+
+ cycles for
+\begin_inset Formula $k=1,\dots,n$
+\end_inset
+
+,
+ then the unbuffered version takes
+\begin_inset Formula $N_{0}+N_{1}+\dots+N_{n}$
+\end_inset
+
+ cycles and the buffered version takes at least
+\begin_inset Formula $\max\{N_{0},\dots,N_{n}\}\geq\frac{N_{0}+\dots+N_{n}}{n+1}$
+\end_inset
+
+ cycles,
+ so we cannot go lower than this limit.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[21]
+\end_layout
+
+\end_inset
+
+A program that leads to the buffer contents shown in
+\begin_inset CommandInset ref
+LatexCommand formatted
+reference "fig:1.4.4"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ may be characterized by the following list of times:
+\end_layout
+
+\begin_layout Quotation
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000,
+\end_layout
+
+\begin_layout Quotation
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 5000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 7000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 5000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 7000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 5000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 7000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 5000,
+\end_layout
+
+\begin_layout Quotation
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000,
+
+\begin_inset Formula $A$
+\end_inset
+
+,
+ 2000,
+
+\begin_inset Formula $R$
+\end_inset
+
+,
+ 1000.
+\end_layout
+
+\begin_layout Quotation
+\begin_inset Float figure
+placement document
+alignment document
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+sp{(
+\backslash
+linewidth)}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+us{*1.0/850*
+\backslash
+sp}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+tmw{75
+\backslash
+us}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+buff{*1.4}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[style=dotted]
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,3.6
+\backslash
+buff)
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,text width=1cm,align=center]{Com
+\backslash
+-puter}
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+sp},0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,4.2
+\backslash
+buff)
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,text width=1cm,align=center]{Output unit}
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=green]
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,0) -- (0,3
+\backslash
+buff) -- ({
+\backslash
+sp},{3
+\backslash
+buff}) -- ({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+assignment{buffer}{tm_start}{tm_got}{tm_use}{tm_red}
+\end_layout
+
+\begin_layout Plain Layout
+
+% Buffer number,
+ time of ASSIGN,
+ time when the buffer is
+\end_layout
+
+\begin_layout Plain Layout
+
+% ready for use,
+ time of RELEASE,
+ time when output starts
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+assignment#1#2#3#4#5{
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=yellow]
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#3
+\backslash
+us},{#1
+\backslash
+buff}) -- ({#4
+\backslash
+us},{#1
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++(0,-1
+\backslash
+buff) -- ({#3
+\backslash
+us},{(#1-1)
+\backslash
+buff});
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=red]
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#4
+\backslash
+us},{#1
+\backslash
+buff}) -- ({#5
+\backslash
+us},{#1
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ({#4
+\backslash
+us},{(#1-1)
+\backslash
+buff});
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#2
+\backslash
+us},{3.5
+\backslash
+buff}) -- ++(0,{0.2
+\backslash
+buff}) node[above]{A}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#3
+\backslash
+us},{3.6
+\backslash
+buff}) -- ({#4
+\backslash
+us},{3.6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#4
+\backslash
+us},{3.7
+\backslash
+buff}) -- ++(0,{-0.2
+\backslash
+buff}) node[below]{R}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#5
+\backslash
+us},{4.1
+\backslash
+buff}) -- ++(0,{0.2
+\backslash
+buff}) node[above]{O}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#5
+\backslash
+us},{4.2
+\backslash
+buff}) -- ++({75
+\backslash
+us},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{0}{0}{10}{10}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{20}{20}{30}{85}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment3{40}{40}{50}{160}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{60}{85}{95}{235}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{105}{160}{230}{310}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment3{280}{280}{350}{385}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{400}{400}{470}{470}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{520}{520}{590}{590}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment3{640}{640}{650}{665}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{660}{660}{680}{740}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,0) -- (0,3
+\backslash
+buff) -- ({
+\backslash
+sp},3
+\backslash
+buff) -- ({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+bufferlbl#1{
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,{(#1-0.5)
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,rotate=90,anchor=south]{Buffer #1}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,{(#1-1)
+\backslash
+buff}) -- ++({
+\backslash
+sp},0)
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\backslash
+bufferlbl1
+\backslash
+bufferlbl2
+\backslash
+bufferlbl3;
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+axis#1{({(1#1-1000)
+\backslash
+us},0) -- ++(0,-0.2) node[below,rotate=90,anchor=east]{#100}}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\backslash
+axis{000}
+\backslash
+axis{050}
+\backslash
+axis{100}
+\backslash
+axis{150}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{200}
+\backslash
+axis{250}
+\backslash
+axis{300}
+\backslash
+axis{350}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{400}
+\backslash
+axis{450}
+\backslash
+axis{500}
+\backslash
+axis{550}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{600}
+\backslash
+axis{650}
+\backslash
+axis{700}
+\backslash
+axis{750}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{800}
+\backslash
+axis{850};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:1.4.4"
+
+\end_inset
+
+Output with two buffers (exercise 9).
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+This list means
+\begin_inset Quotes eld
+\end_inset
+
+assign,
+ compute for
+\begin_inset Formula $\unit[1000]{u}$
+\end_inset
+
+,
+ release,
+ compute for
+\begin_inset Formula $\unit[1000]{u}$
+\end_inset
+
+,
+ assign,
+ ...,
+ compute for
+\begin_inset Formula $\unit[2000]{u}$
+\end_inset
+
+,
+ release,
+ compute for
+\begin_inset Formula $\unit[1000]{u}$
+\end_inset
+
+.
+\begin_inset Quotes erd
+\end_inset
+
+ The computation times given do not include any intervals during which the computer might have to wait for the output device to catch up (as at the fourth
+\begin_inset Quotes eld
+\end_inset
+
+assign
+\begin_inset Quotes erd
+\end_inset
+
+ in
+\begin_inset CommandInset ref
+LatexCommand formatted
+reference "fig:1.4.4"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+).
+ The output device operates at a speed of
+\begin_inset Formula $\unit[7500]{u}$
+\end_inset
+
+ per block.
+\end_layout
+
+\begin_layout Standard
+The following chart specifies he actions shown in
+\begin_inset CommandInset ref
+LatexCommand formatted
+reference "fig:1.4.4"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ as the time passes:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+nopagebreak
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="17" columns="2">
+<features tabularvalignment="middle">
+<column alignment="right" valignment="top">
+<column alignment="left" valignment="top">
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Time
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Action
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF2)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF3)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF1
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+10500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF2
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+23000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+23500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+28000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF3)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+31000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+35000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="17" columns="2">
+<features tabularvalignment="middle">
+<column alignment="right" valignment="top">
+<column alignment="left" valignment="top">
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Time
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Action
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+38500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+40000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+46000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+47000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+52000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF2)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+54500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+59000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+64000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF3)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+65000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+66000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+66500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+68000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+69000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Computation stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+74000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+81500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The total time required was therefore
+\begin_inset Formula $\unit[81500]{u}$
+\end_inset
+
+;
+ the computer was idle from 6000–8500,
+ 10500–16000,
+ and 69000–81500,
+ or
+\begin_inset Formula $\unit[20500]{u}$
+\end_inset
+
+ altogether;
+ the output unit was idle from 0–1000,
+ 46000–47000,
+ and 54500–59000,
+ or
+\begin_inset Formula $\unit[6500]{u}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Make a time-action chart like the above for the same program,
+ assuming that there are only
+\emph on
+two
+\emph default
+ buffers.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+placement document
+alignment document
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+sp{(
+\backslash
+linewidth)}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+us{*1.0/900*
+\backslash
+sp}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+tmw{75
+\backslash
+us}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+buff{*1.4}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[style=dotted]
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,2.6
+\backslash
+buff)
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,text width=1cm,align=center]{Com
+\backslash
+-puter}
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+sp},0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,3.2
+\backslash
+buff)
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,text width=1cm,align=center]{Output unit}
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=green]
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,0) -- (0,2
+\backslash
+buff) -- ({
+\backslash
+sp},{2
+\backslash
+buff}) -- ({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+%
+\backslash
+assignment{buffer}{tm_start}{tm_got}{tm_use}{tm_red}
+\end_layout
+
+\begin_layout Plain Layout
+
+% Buffer number,
+ time of ASSIGN,
+ time when the buffer is
+\end_layout
+
+\begin_layout Plain Layout
+
+% ready for use,
+ time of RELEASE,
+ time when output starts
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+assignment#1#2#3#4#5{
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=yellow]
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#3
+\backslash
+us},{#1
+\backslash
+buff}) -- ({#4
+\backslash
+us},{#1
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++(0,-1
+\backslash
+buff) -- ({#3
+\backslash
+us},{(#1-1)
+\backslash
+buff});
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+fill[fill=red]
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#4
+\backslash
+us},{#1
+\backslash
+buff}) -- ({#5
+\backslash
+us},{#1
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ++({
+\backslash
+tmw},{-1/6
+\backslash
+buff}) -- ++({-
+\backslash
+tmw},{-1/6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ -- ({#4
+\backslash
+us},{(#1-1)
+\backslash
+buff});
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#2
+\backslash
+us},{2.5
+\backslash
+buff}) -- ++(0,{0.2
+\backslash
+buff}) node[above]{A}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#3
+\backslash
+us},{2.6
+\backslash
+buff}) -- ({#4
+\backslash
+us},{2.6
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#4
+\backslash
+us},{2.7
+\backslash
+buff}) -- ++(0,{-0.2
+\backslash
+buff}) node[below]{R}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#5
+\backslash
+us},{3.1
+\backslash
+buff}) -- ++(0,{0.2
+\backslash
+buff}) node[above]{O}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ({#5
+\backslash
+us},{3.2
+\backslash
+buff}) -- ++({75
+\backslash
+us},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{0}{0}{10}{10}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{20}{20}{30}{85}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{40}{85}{95}{160}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{105}{160}{170}{235}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{180}{235}{305}{310}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{355}{355}{425}{425}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{475}{475}{545}{545}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{595}{595}{665}{665}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment1{715}{715}{725}{740}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+assignment2{735}{740}{760}{815}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,0) -- (0,2
+\backslash
+buff) -- ({
+\backslash
+sp},2
+\backslash
+buff) -- ({
+\backslash
+sp},0);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+bufferlbl#1{
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,{(#1-0.5)
+\backslash
+buff})
+\end_layout
+
+\begin_layout Plain Layout
+
+ node[left,rotate=90,anchor=south]{Buffer #1}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,{(#1-1)
+\backslash
+buff}) -- ++({
+\backslash
+sp},0)
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\backslash
+bufferlbl1
+\backslash
+bufferlbl2;
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+axis#1{({(1#1-1000)
+\backslash
+us},0) -- ++(0,-0.2) node[below,rotate=90,anchor=east]{#100}}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw
+\backslash
+axis{000}
+\backslash
+axis{050}
+\backslash
+axis{100}
+\backslash
+axis{150}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{200}
+\backslash
+axis{250}
+\backslash
+axis{300}
+\backslash
+axis{350}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{400}
+\backslash
+axis{450}
+\backslash
+axis{500}
+\backslash
+axis{550}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{600}
+\backslash
+axis{650}
+\backslash
+axis{700}
+\backslash
+axis{750}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+axis{800}
+\backslash
+axis{850}
+\backslash
+axis{900};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:1.4.4-1"
+
+\end_inset
+
+Output with three buffers (see exercise 9).
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We can do this graphically as shown in
+\begin_inset CommandInset ref
+LatexCommand formatted
+reference "fig:1.4.4-1"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ giving us the following chart:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+nopagebreak
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="17" columns="2">
+<features tabularvalignment="middle">
+<column alignment="right" valignment="top">
+<column alignment="left" valignment="top">
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Time
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Action
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF2)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF1
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+10500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF2
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+17000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+18000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+23500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF1
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+30500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+31000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+35500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF2)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+38500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="17" columns="2">
+<features tabularvalignment="middle">
+<column alignment="right" valignment="top">
+<column alignment="left" valignment="top">
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Time
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Action
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+42500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+47500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+50000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+54500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+59500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF2)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+62000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+65500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE,
+ OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+71500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN(BUF1)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+72500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+73500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+ASSIGN
+\family default
+ (wait)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+74000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+BUF2
+\family default
+ assigned,
+
+\family typewriter
+OUT BUF1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+76000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+RELEASE
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+77000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Computation stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="right" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+81500
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+OUT BUF2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+89000
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Output stops.
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc14[20]
+\end_layout
+
+\end_inset
+
+Suppose the computational program does not alternate between
+\family typewriter
+ASSIGN
+\family default
+ and
+\family typewriter
+RELEASE
+\family default
+,
+ but instead gives the sequence of actions
+\family typewriter
+...ASSIGN...ASSIGN...RELEASE...RELEASE
+\family default
+.
+ What effect does this have on the algorithms described in the text?
+ Is it possibly useful?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It just means we would need at least two buffers or the program would stall.
+ It might be useful if the algorithm needs more data at a time than what fits in one buffer,
+ so that it doesn't have to copy the data elsewhere.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc15[22]
+\end_layout
+
+\end_inset
+
+Write a complete
+\family typewriter
+MIX
+\family default
+ program that copies 100 blocks from tape unit 0 to tape unit 1,
+ using just three buffers.
+ The program should be as fast as possible.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The following programs have not been tested.
+ We need to use the buffers in a circle,
+ checking input and output in a loop to see if the devices are ready and if we can move to the next buffer.
+ The following program in pseudo-C might be illustrative:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+void aread(char *buf),
+ awrite(char *buf);
+ // IN,
+ OUT
+\end_layout
+
+\begin_layout Plain Layout
+
+bool done_read(),
+ done_write();
+ // JBUS/JRED
+\end_layout
+
+\begin_layout Plain Layout
+
+char buf[3][100];
+\end_layout
+
+\begin_layout Plain Layout
+
+char *cin = buf[0],
+ *cout = buf[0],
+ *next(char *buf);
+\end_layout
+
+\begin_layout Plain Layout
+
+int n = 100;
+ // Remaining blocks to input
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+aread(cin);
+\end_layout
+
+\begin_layout Plain Layout
+
+while (1) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ if (done_read() && next(cin) != cout) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ if (--n == 0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ break;
+\end_layout
+
+\begin_layout Plain Layout
+
+ cin = next(cin);
+\end_layout
+
+\begin_layout Plain Layout
+
+ aread(cin);
+\end_layout
+
+\begin_layout Plain Layout
+
+ }
+\end_layout
+
+\begin_layout Plain Layout
+
+ }
+\end_layout
+
+\begin_layout Plain Layout
+
+ if (done_write() && next(cout) != cin) {
+\end_layout
+
+\begin_layout Plain Layout
+
+ cout = next(cout);
+\end_layout
+
+\begin_layout Plain Layout
+
+ awrite(cout);
+\end_layout
+
+\begin_layout Plain Layout
+
+ }
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\begin_layout Plain Layout
+
+do // Output remaining blocks
+\end_layout
+
+\begin_layout Plain Layout
+
+ awrite(cout = next(cout));
+\end_layout
+
+\begin_layout Plain Layout
+
+while (cout != cin);
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We may translate this as follows:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ IN BUF1(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENTA 100
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT1 BUF1 ;
+ cin
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT2 BUF1 ;
+ cout
+\end_layout
+
+\begin_layout Plain Layout
+
+READ JBUS WRITE(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMP2 100,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ JEQ WRITE
+\end_layout
+
+\begin_layout Plain Layout
+
+ DECA 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAZ EOUT
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD1 100,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ IN 0,1(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+WRITE JBUS READ(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMP1 100,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ JEQ READ
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD2 100,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT 0,2(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP READ
+\end_layout
+
+\begin_layout Plain Layout
+
+EOUT LD2 100,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ CMP2 100,1
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAZ END
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT 0,2(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP EOUT
+\end_layout
+
+\begin_layout Plain Layout
+
+END HLT
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF1 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON BUF2
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF2 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON BUF3
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF3 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+ CON BUF1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Now,
+ the behavior of this program is always the same:
+ first the input advances,
+ then the output advances,
+ and so on,
+ so we might do better (and with a lower chance of bugs) just by coding it manually and using the blocking properties of
+\family typewriter
+IN
+\family default
+ and
+\family typewriter
+OUT
+\family default
+ with respect to other operations in the same device:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ IN BUF1(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+LOOP ENTA 33
+\end_layout
+
+\begin_layout Plain Layout
+
+ IN BUF2(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT BUF1(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ IN BUF3(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT BUF2(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ IN BUF1(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT BUF3(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ DECA 1
+\end_layout
+
+\begin_layout Plain Layout
+
+ JANZ LOOP
+\end_layout
+
+\begin_layout Plain Layout
+
+ JBUS *(0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ OUT BUF1(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JBUS *(1)
+\end_layout
+
+\begin_layout Plain Layout
+
+ HLT
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF1 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF2 ORIG *+100
+\end_layout
+
+\begin_layout Plain Layout
+
+BUF3 ORIG *+100
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.1.lyx b/2.1.lyx
new file mode 100644
index 0000000..624d7cf
--- /dev/null
+++ b/2.1.lyx
@@ -0,0 +1,568 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[04]
+\end_layout
+
+\end_inset
+
+In the situation depicted in (3),
+ what is the value of
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+SUIT(NEXT(TOP))
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+NEXT(NEXT(NEXT(TOP)))
+\family default
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+4.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\Lambda$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc2[10]
+\end_layout
+
+\end_inset
+
+The text points out that in many cases
+\begin_inset Formula $\mathtt{CONTENTS(LOC(V))}=\mathtt{V}$
+\end_inset
+
+.
+ Under what conditions do we have
+\begin_inset Formula $\mathtt{LOC(CONTENTS(V))}=\mathtt{V}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\family typewriter
+V
+\family default
+ must be a valid memory address different from
+\begin_inset Formula $\Lambda$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[21]
+\end_layout
+
+\end_inset
+
+Give an algorithm that essentially undoes the effect of exercise 4:
+ Assuming that the pile is not empty and that its bottom card is face down,
+ your algorithm should remove the bottom card and make
+\family typewriter
+NEWCARD
+\family default
+ link to it.
+ (This algorithm is sometimes called
+\begin_inset Quotes eld
+\end_inset
+
+cheating
+\begin_inset Quotes erd
+\end_inset
+
+ in solitaire games.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $\mathtt{NEXT(TOP)}=\Lambda$
+\end_inset
+
+,
+ let
+\begin_inset Formula $\mathtt{NEWCARD}\gets\mathtt{TOP}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{TOP}\gets\Lambda$
+\end_inset
+
+ and terminate.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\mathtt{X}\gets\mathtt{TOP}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Y}\gets\mathtt{NEXT(TOP)}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $\mathtt{NEXT(Y)}\neq\Lambda$
+\end_inset
+
+,
+ let
+\begin_inset Formula $\mathtt{X}\gets\mathtt{Y}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Y}\gets\mathtt{NEXT(Y)}$
+\end_inset
+
+ and repeat this step.
+\end_layout
+
+\begin_layout Enumerate
+Set
+\begin_inset Formula $\mathtt{NEWCARD}\gets\mathtt{Y}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{NEXT(X)}\gets\Lambda$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc6[06]
+\end_layout
+
+\end_inset
+
+In the playing card example,
+ suppose that
+\family typewriter
+CARD
+\family default
+ is the name of a variable whose value is an entire node as in (6).
+ The operation
+\begin_inset Formula $\mathtt{CARD}\gets\mathtt{NODE(TOP)}$
+\end_inset
+
+ sets the fields of
+\family typewriter
+CARD
+\family default
+ respectively equal to those of the top of the pile.
+ After this operation,
+ which of the following notations stands for the suit of the top card?
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+SUIT(CARD)
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+SUIT(LOC(CARD))
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+SUIT(CONTENTS(CARD))
+\family default
+;
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+SUIT(TOP)
+\family default
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+2 and 4.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[04]
+\end_layout
+
+\end_inset
+
+In the text's example
+\family typewriter
+MIX
+\family default
+ program,
+ (5),
+ the link variable
+\family typewriter
+TOP
+\family default
+ is stored in the
+\family typewriter
+MIX
+\family default
+ computer word whose assembly language name is
+\family typewriter
+TOP
+\family default
+.
+ Given the field structure (1),
+ which of the following sequences of code brings the quantity
+\family typewriter
+NEXT(TOP)
+\family default
+ into register A?
+ Explain why the other sequence is incorrect.
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LDA TOP(NEXT)
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+LD1 TOP
+\begin_inset Newline newline
+\end_inset
+
+LDA 0,1(NEXT)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+2,
+ since the first loads the field
+\family typewriter
+NEXT
+\family default
+ from the memory word
+\family typewriter
+TOP
+\family default
+,
+ that only contains the address,
+ instead of from the node that
+\family typewriter
+TOP
+\family default
+ points to.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[18]
+\end_layout
+
+\end_inset
+
+Write a
+\family typewriter
+MIX
+\family default
+ program corresponding to steps B1–B3.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+NEXT EQU 4:5
+\end_layout
+
+\begin_layout Plain Layout
+
+LLEN STJ CHECK
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENTA 0 ;
+ B1
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT1 TOP
+\end_layout
+
+\begin_layout Plain Layout
+
+2H J1Z * ;
+ B2
+\end_layout
+
+\begin_layout Plain Layout
+
+ INCA 1 ;
+ B3
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD1 0,1(NEXT)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP 2B
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.1.lyx b/2.2.1.lyx
new file mode 100644
index 0000000..27287f7
--- /dev/null
+++ b/2.2.1.lyx
@@ -0,0 +1,910 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[06]
+\end_layout
+
+\end_inset
+
+An input-restricted deque is a linear list in which items may be inserted at one end but removed from either end;
+ clearly an input-restricted deque can operate either as a stack or as a queue,
+ if we consistently remove all items from one of the two ends.
+ Can an output-restricted deque also be operated either as a stack or as a queue?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes.
+ If output happens on the left,
+ we can use a deque as a queue by inserting on the right or as a stack by inserting on the left.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[15]
+\end_layout
+
+\end_inset
+
+Imagine four railroad cars positioned on the input side of the track in Fig.
+ 1,
+ numbered 1,
+ 2,
+ 3,
+ and 4,
+ from left to right.
+ Suppose we perform the following sequence of operations (which is compatible with the direction of the arrows in the diagram and does not require cars to
+\begin_inset Quotes eld
+\end_inset
+
+jump over
+\begin_inset Quotes erd
+\end_inset
+
+ other cars):
+ (i) move car 1 into the stack;
+ (ii) move car 2 into the stack;
+ (iii) move car 2 into the output;
+ (iv) move car 3 into the stack;
+ (v) move car 4 into the stack;
+ (vi) move car 4 into the output;
+ (vii) move car 3 into the output;
+ (viii) move car 1 into the output.
+\end_layout
+
+\begin_layout Standard
+As a result of these operations the original order of the cars,
+
+\begin_inset Formula $1\,2\,3\,4$
+\end_inset
+
+,
+ has been changed into
+\begin_inset Formula $2\,4\,3\,1$
+\end_inset
+
+.
+
+\emph on
+It is the purpose of this exercise and the following exercises to examine what permutations are obtainable in such a manner from stacks,
+ queues,
+ or deques.
+\end_layout
+
+\begin_layout Standard
+If there are six railroad cars numbered
+\begin_inset Formula $1\,2\,3\,4\,5\,6$
+\end_inset
+
+,
+ can they be permuted into the order
+\begin_inset Formula $3\,2\,5\,6\,4\,1$
+\end_inset
+
+?
+ Can they be permuted into the order
+\begin_inset Formula $1\,5\,4\,6\,2\,3$
+\end_inset
+
+?
+ (In case it is possible,
+ show how to do it.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For
+\begin_inset Formula $3\,2\,5\,6\,4\,1$
+\end_inset
+
+,
+ we push 1,
+ push 2,
+ push 3,
+ pop 3,
+ pop 2,
+ push 4,
+ push 5,
+ pop 5,
+ push 6,
+ pop 6,
+ pop 4,
+ and pop 1.
+ We can't get the permutation
+\begin_inset Formula $1\,5\,4\,6\,2\,3$
+\end_inset
+
+:
+ first,
+ we'd need to push 1 and pop it immediately since,
+ otherwise,
+ it couldn't be the first car to go out;
+ then we need to push trains 2 to 5 without popping anything before the 5,
+ so that no car is between the 1 and the 5,
+ but then we must pop 3 before popping 2,
+ so the order wouldn't be respected.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[M28]
+\end_layout
+
+\end_inset
+
+Show that it is possible to obtain a permutation
+\begin_inset Formula $p_{1}\,p_{2}\,\dots\,p_{n}$
+\end_inset
+
+ from
+\begin_inset Formula $1\,2\,\dots\,n$
+\end_inset
+
+ using a stack if and only if there are no indices
+\begin_inset Formula $i<j<k$
+\end_inset
+
+ such that
+\begin_inset Formula $p_{j}<p_{k}<p_{i}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Assume,
+ by contradiction,
+ that there are such indexes.
+ When the next element to pop is
+\begin_inset Formula $p_{i}$
+\end_inset
+
+,
+
+\begin_inset Formula $p_{i}$
+\end_inset
+
+ is either at the top of the stack or in the input road.
+ In the second case,
+ the only valid option is to push all elements from the input until reaching
+\begin_inset Formula $p_{i}$
+\end_inset
+
+ and then pop
+\begin_inset Formula $p_{i}$
+\end_inset
+
+,
+ so in either case,
+
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ and
+\begin_inset Formula $p_{k}$
+\end_inset
+
+ end up in the stack after popping
+\begin_inset Formula $p_{i}$
+\end_inset
+
+.
+ Then
+\begin_inset Formula $p_{k}$
+\end_inset
+
+ has to remain in the stack until the next element is
+\begin_inset Formula $p_{k}$
+\end_inset
+
+,
+ and in particular it has to remain after popping
+\begin_inset Formula $p_{j}$
+\end_inset
+
+,
+ but since higher elements in the stack have higher values (this is easily proved by induction on the size of the stack),
+
+\begin_inset Formula $p_{k}$
+\end_inset
+
+ is over
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ and thus it must be popped before popping
+\begin_inset Formula $p_{j}$
+\end_inset
+
+,
+ giving an incorrect order to the output.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Let's consider the following algorithm for generating such permutation:
+ we set
+\begin_inset Formula $m\gets1$
+\end_inset
+
+,
+ and for
+\begin_inset Formula $j\gets1$
+\end_inset
+
+ to
+\begin_inset Formula $n$
+\end_inset
+
+,
+ if
+\begin_inset Formula $p_{j}\geq m$
+\end_inset
+
+,
+ we push elements
+\begin_inset Formula $m$
+\end_inset
+
+ to
+\begin_inset Formula $p_{j}$
+\end_inset
+
+,
+ pop
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ and set
+\begin_inset Formula $m\gets p_{j}+1$
+\end_inset
+
+,
+ and otherwise we just pop
+\begin_inset Formula $p_{j}$
+\end_inset
+
+.
+ In this algorithm,
+
+\begin_inset Formula $m$
+\end_inset
+
+ represents the next element to be pushed and
+\begin_inset Formula $j$
+\end_inset
+
+ is such that
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ is to be popped,
+ so
+\begin_inset Formula $j\leq m$
+\end_inset
+
+ at the beginning of every iteration.
+ Thus,
+ if
+\begin_inset Formula $p_{j}\geq m$
+\end_inset
+
+,
+ the car is still in the input road and we have to push elements
+\begin_inset Formula $m$
+\end_inset
+
+ to
+\begin_inset Formula $p_{j}$
+\end_inset
+
+,
+ and otherwise
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ is in the stack.
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+We show that,
+ in the latter case,
+ if
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ weren't at the top of the stack,
+ there would be indices
+\begin_inset Formula $i<j$
+\end_inset
+
+ and
+\begin_inset Formula $k>j$
+\end_inset
+
+ such that
+\begin_inset Formula $p_{j}<p_{k}<p_{i}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ is in the stack but not as the top element,
+ the latest operations have been pushing
+\begin_inset Formula $m',m'+1,\dots,p_{i}$
+\end_inset
+
+ for some
+\begin_inset Formula $i<j$
+\end_inset
+
+ (
+\begin_inset Formula $m'$
+\end_inset
+
+ is the value of
+\begin_inset Formula $m$
+\end_inset
+
+ when processing
+\begin_inset Formula $i$
+\end_inset
+
+) and,
+ after that,
+ to popping
+\begin_inset Formula $p_{i},p_{i}-1,\dots,p_{j}+c$
+\end_inset
+
+ for some
+\begin_inset Formula $c\in\{2,\dots,j-i\}$
+\end_inset
+
+,
+ since at least
+\begin_inset Formula $p_{i}$
+\end_inset
+
+ is popped and at least
+\begin_inset Formula $p_{j}+1$
+\end_inset
+
+ is not popped (otherwise,
+ either
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ would have been popped too or it would be at the top).
+\end_layout
+
+\begin_layout Standard
+Let
+\begin_inset Formula $k$
+\end_inset
+
+ be the element such that
+\begin_inset Formula $p_{k}=p_{j}+1$
+\end_inset
+
+,
+ so that
+\begin_inset Formula $p_{j}<p_{k}<p_{i}$
+\end_inset
+
+.
+ We have
+\begin_inset Formula $i<j$
+\end_inset
+
+ because
+\begin_inset Formula $p_{i}$
+\end_inset
+
+ was popped earlier than
+\begin_inset Formula $p_{j}$
+\end_inset
+
+,
+ and we have to show that
+\begin_inset Formula $j<k$
+\end_inset
+
+.
+ If it were
+\begin_inset Formula $k<j$
+\end_inset
+
+,
+
+\begin_inset Formula $p_{k}$
+\end_inset
+
+ would have already been popped,
+ clearly before
+\begin_inset Formula $i$
+\end_inset
+
+,
+ but then it would be
+\begin_inset Formula $k<i$
+\end_inset
+
+ and,
+ because the value of
+\begin_inset Formula $m$
+\end_inset
+
+ when processing
+\begin_inset Formula $k$
+\end_inset
+
+ would be
+\begin_inset Formula $m''\leq m'\leq p_{j}<p_{k}$
+\end_inset
+
+,
+ we'd have pushed
+\begin_inset Formula $p_{j}$
+\end_inset
+
+ when processing
+\begin_inset Formula $k$
+\end_inset
+
+,
+ not when processing
+\begin_inset Formula $i\#$
+\end_inset
+
+.
+ Since
+\begin_inset Formula $k\neq j$
+\end_inset
+
+,
+ we conclude that
+\begin_inset Formula $j<k$
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc6[00]
+\end_layout
+
+\end_inset
+
+Consider the problem of exercise 2,
+ with a queue substituted for a stack.
+ What permutations of
+\begin_inset Formula $1\,2\,\dots\,n$
+\end_inset
+
+ can be obtained with use of a queue?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Just one;
+ a queue would be represented by a bare straight line.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[25]
+\end_layout
+
+\end_inset
+
+Consider the problem of exercise 2,
+ with a deque substituted for a stack.
+\end_layout
+
+\begin_layout Enumerate
+Find a permutation of
+\begin_inset Formula $1\,2\,3\,4$
+\end_inset
+
+ that can be obtained with an input-restricted deque,
+ but it cannot be obtained with an output-restricted deque.
+\end_layout
+
+\begin_layout Enumerate
+Find a permutation of
+\begin_inset Formula $1\,2\,3\,4$
+\end_inset
+
+ that can be obtained with an output-restricted deque but not with an input-restricted deque.
+ [As a consequence of (1) and (2),
+ there is definitely a difference between input-restricted and output-restricted deques.]
+\end_layout
+
+\begin_layout Enumerate
+Find a permutation of
+\begin_inset Formula $1\,2\,3\,4$
+\end_inset
+
+ that cannot be obtained with either an input-restricted or an output-restricted deque.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $4\,1\,3\,2$
+\end_inset
+
+ (input all from the right,
+ output 4 right,
+ 1 left,
+ 3 right,
+ then 2).
+ With an output-restricted deque,
+ to output the 4,
+ we'd first have to put 1,
+ 2,
+ and 3 in the deque and (here lies the difference) in the order of the permutation.
+ But,
+ after inserting the 1,
+ we'd have to insert the 2 at the right and then we'd have no place for the 3.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $4\,2\,1\,3$
+\end_inset
+
+ (input 1 wherever,
+ 2 left,
+ 3 right,
+ 4 left,
+ then output all to the left).
+ With an input-restricted deque,
+ to output the 4,
+ we'd first have to put 1,
+ 2,
+ and 3 in the deque and (here lies the difference) in the order of the input.
+ Then we'd have to output 2,
+ which is just between 1 and 3.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $4\,2\,3\,1$
+\end_inset
+
+.
+ With an input-restricted deque,
+ to output the 4,
+ we'd have to input 1,
+ 2,
+ 3 first,
+ but then we'd have to output the 2 which lies in the middle.
+ With an output-restricted deque,
+ we'd have to input 1,
+ 2,
+ 3 first in the order 2,
+ 3,
+ 1,
+ so we'd have to put the 2 to the left of the 1 but then we couldn't place the 3 in the middle.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc14[26]
+\end_layout
+
+\end_inset
+
+Suppose you are allowed to use only stacks as data structures.
+ How can you implement a queue efficiently with two stacks?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $A$
+\end_inset
+
+ and
+\begin_inset Formula $B$
+\end_inset
+
+ be two stacks (elements go from the top of
+\begin_inset Formula $A$
+\end_inset
+
+ to the bottom and from the bottom of
+\begin_inset Formula $B$
+\end_inset
+
+ to the top).
+ To enqueue an element,
+ we push it to
+\begin_inset Formula $A$
+\end_inset
+
+ (we could push it to
+\begin_inset Formula $B$
+\end_inset
+
+ if
+\begin_inset Formula $B$
+\end_inset
+
+ is empty).
+ To deque an element,
+ if
+\begin_inset Formula $B$
+\end_inset
+
+ is empty,
+ we do
+\begin_inset Formula $x\Leftarrow A,B\Leftarrow x$
+\end_inset
+
+ until
+\begin_inset Formula $A$
+\end_inset
+
+ is empty;
+ if
+\begin_inset Formula $B$
+\end_inset
+
+ is still empty,
+ the queue is empty,
+ and otherwise we pop the element from
+\begin_inset Formula $B$
+\end_inset
+
+.
+ The time needed to copy
+\begin_inset Formula $n$
+\end_inset
+
+ elements from
+\begin_inset Formula $A$
+\end_inset
+
+ to
+\begin_inset Formula $B$
+\end_inset
+
+ is generally amortized as we won't need to copy for the following
+\begin_inset Formula $n$
+\end_inset
+
+ deletions.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.2.lyx b/2.2.2.lyx
new file mode 100644
index 0000000..feb0672
--- /dev/null
+++ b/2.2.2.lyx
@@ -0,0 +1,563 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[15]
+\end_layout
+
+\end_inset
+
+In the queue operations given by (6a) and (7a),
+ how many items can be in the queue at one time without
+\family typewriter
+OVERFLOW
+\family default
+ occurring?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\mathtt{M}-1$
+\end_inset
+
+,
+ since
+\family typewriter
+R
+\family default
+ and
+\family typewriter
+F
+\family default
+ range between 1 and
+\family typewriter
+M
+\family default
+ and
+\begin_inset Formula $\mathtt{R}=\mathtt{F}$
+\end_inset
+
+ is used to signal an empty queue.
+ Since only the relative value of the two indexes matters,
+ this leaves us with a number of elements between 0 and
+\begin_inset Formula $\mathtt{M}-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[22]
+\end_layout
+
+\end_inset
+
+Generalize the method of (6a) and (7a) so that it will apply to any deque with fewer than
+\begin_inset Formula $\mathtt{M}$
+\end_inset
+
+ elements.
+ In other words,
+ give specifications for the other two operations,
+
+\begin_inset Quotes eld
+\end_inset
+
+delete from rear
+\begin_inset Quotes erd
+\end_inset
+
+ and
+\begin_inset Quotes eld
+\end_inset
+
+insert at front.
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{align}
+\mathtt{Y}\leftarrowtail\mathtt{X}\text{ (delete from rear):} & \left\{ \begin{array}{l}
+\text{if }\mathtt{F}=\mathtt{R},\text{ then }\mathtt{UNDERFLOW};\\
+\mathtt{Y\gets X[R]};\\
+\text{if }\mathtt{R}=1,\text{ then }\mathtt{R\gets M},\text{ otherwise }\mathtt{R}\gets\mathtt{R}-1.
+\end{array}\right.\\
+\mathtt{X}\leftarrowtail\mathtt{Y}\text{ (insert at front):} & \left\{ \begin{array}{l}
+\mathtt{X[F]\gets Y};\\
+\text{if }\mathtt{F=1},\text{ then }\mathtt{F\gets M},\text{ otherwise }\mathtt{F}\gets\mathtt{F}-1.\\
+\text{if }\mathtt{F}=\mathtt{R},\text{ then }\mathtt{OVERFLOW};
+\end{array}\right.
+\end{align}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc6[10]
+\end_layout
+
+\end_inset
+
+Starting with the memory configuration shown in Fig.
+ 4,
+ determine which of the following sequences of operations causes overflow or underflow:
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e2226a"
+
+\end_inset
+
+
+\begin_inset Formula $I_{1}$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e2226b"
+
+\end_inset
+
+
+\begin_inset Formula $I_{2}$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e2226c"
+
+\end_inset
+
+
+\begin_inset Formula $I_{3}$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e2226d"
+
+\end_inset
+
+
+\begin_inset Formula $I_{4}I_{4}I_{4}I_{4}I_{4}$
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e2226e"
+
+\end_inset
+
+
+\begin_inset Formula $D_{2}D_{2}I_{2}I_{2}I_{2}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Only
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e2226a"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e2226b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ and
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e2226d"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ are valid;
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e2226c"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ causes an overflow and
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e2226e"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ causes an underflow in the second instruction.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc19[16]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+0-origin indexing.
+\emph default
+) Experienced programmers learn that it is generally wise to denote the elements of a linear list by
+\begin_inset Formula $\mathtt{X[\text{\ensuremath{0}}]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{X[\text{\ensuremath{1}}]}$
+\end_inset
+
+,
+ ...,
+
+\begin_inset Formula $\mathtt{X[\text{\ensuremath{n-1}}]}$
+\end_inset
+
+,
+ instead of using the more traditional notation
+\begin_inset Formula $\mathtt{X[}1\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{X[}2\mathtt{]}$
+\end_inset
+
+,
+ ...,
+
+\begin_inset Formula $\mathtt{X[}n\mathtt{]}$
+\end_inset
+
+.
+ Then,
+ for example,
+ the base address
+\begin_inset Formula $\mathtt{L}_{0}$
+\end_inset
+
+ in (1) points to the smallest cell of the array.
+\end_layout
+
+\begin_layout Standard
+Revise the insertion and deletion methods (2a),
+ (3a),
+ (6a),
+ and (7a) for stacks and queues so that they conform to this convention.
+ In other words,
+ change them so that the list elements will appear in the array
+\begin_inset Formula $\mathtt{X[}0\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{X[}1\mathtt{]}$
+\end_inset
+
+,
+ ...,
+
+\begin_inset Formula $\mathtt{X[M}-1\mathtt{]}$
+\end_inset
+
+,
+ instead of
+\begin_inset Formula $\mathtt{X[}1\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{X[}2\mathtt{]}$
+\end_inset
+
+,
+ ...,
+
+\begin_inset Formula $\mathtt{X[M]}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+For the stack,
+ since we want
+\family typewriter
+T
+\family default
+ to be non-negative,
+ we have to consider
+\begin_inset Formula $\mathtt{T}=0$
+\end_inset
+
+ to represent an empty stack,
+ so
+\begin_inset Formula $\mathtt{T}$
+\end_inset
+
+ still ranges from 0 to
+\family typewriter
+M
+\family default
+ but now
+\family typewriter
+T
+\family default
+ represents one past the top element.
+ For the queue,
+ we don't need much adaptation.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\begin{align}
+\mathtt{X}\Leftarrow\mathtt{Y}\text{ (insert into stack):} & \left\{ \begin{array}{l}
+\text{if }\mathtt{T}=\mathtt{M},\text{ then }\mathtt{OVERFLOW};\\
+\mathtt{X[T]}\gets\mathtt{Y};\\
+\mathtt{T}\gets\mathtt{T}+1.
+\end{array}\right.\\
+\mathtt{Y}\Leftarrow\mathtt{X}\text{ (delete from stack):} & \left\{ \begin{array}{l}
+\text{if }\mathtt{T}=0,\text{ then }\mathtt{UNDERFLOW};\\
+\mathtt{T}\gets\mathtt{T}-1;\\
+\mathtt{Y}\gets\mathtt{X[T]}.
+\end{array}\right.\\
+\mathtt{X}\Leftarrow\mathtt{Y}\text{ (insert into queue):} & \left\{ \begin{array}{l}
+\mathtt{R}\gets(\mathtt{R}+1)\bmod\mathtt{M};\\
+\text{if }\mathtt{R}=\mathtt{F},\text{ then }\mathtt{OVERFLOW};\\
+\mathtt{X[R]}\gets\mathtt{Y}.
+\end{array}\right.\\
+\mathtt{Y}\Leftarrow\mathtt{X}\text{ (delete from queue):} & \left\{ \begin{array}{l}
+\text{if }\mathtt{F}=\mathtt{R},\text{ then }\mathtt{UNDERFLOW};\\
+\mathtt{F}\gets(\mathtt{F}+1)\bmod\mathtt{M};\\
+\mathtt{Y}\gets\mathtt{X[F]}.
+\end{array}\right.
+\end{align}
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.3.lyx b/2.2.3.lyx
new file mode 100644
index 0000000..0554045
--- /dev/null
+++ b/2.2.3.lyx
@@ -0,0 +1,1685 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[10]
+\end_layout
+
+\end_inset
+
+Operation (9) for popping up a stack mentions the possibility of
+\family typewriter
+UNDERFLOW
+\family default
+;
+ why doesn't operation (8),
+ pushing down a stack,
+ mention the possibility of
+\family typewriter
+OVERFLOW
+\family default
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Because you can allocate anywhere so this possibility doesn't exist unless you run out of memory,
+ a condition already handled by
+\begin_inset Formula $\mathtt{P}\Leftarrow\mathtt{AVAIL}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[24]
+\end_layout
+
+\end_inset
+
+Operations (14) and (17) give the effect of a queue;
+ show how to define the further operation
+\begin_inset Quotes eld
+\end_inset
+
+insert at front
+\begin_inset Quotes erd
+\end_inset
+
+ so as to obtain all the actions of an output-restricted deque.
+ How could the operation
+\begin_inset Quotes eld
+\end_inset
+
+delete from rear
+\begin_inset Quotes erd
+\end_inset
+
+ be defined (so that we would have a general deque)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Inserting at front can be handled with operation (8),
+ just like with a stack.
+ Deleting from rear is more difficult.
+ One could use doubly linked lists,
+ which are covered in section
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Doubly-Linked-Lists"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+ Alternatively,
+ if we do not want to change the structure,
+ we have to iterate from the front,
+ with a pointer called
+\family typewriter
+I
+\family default
+:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\[
+\left\{ \begin{array}{l}
+\text{If }F=\Lambda,\text{ then }\mathtt{UNDERFLOW};\\
+\mathtt{Y}\gets\mathtt{INFO(R)},\mathtt{P\gets}\mathtt{LOC(F)};\\
+\text{while }\mathtt{LINK(P)\neq R}\text{ repeat }\mathtt{P}\gets\mathtt{LINK(P)};\\
+\mathtt{AVAIL}\Leftarrow\mathtt{R},\mathtt{R}\gets\mathtt{P},\mathtt{LINK(P)}\gets\Lambda.
+\end{array}\right.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[23]
+\end_layout
+
+\end_inset
+
+Design an algorithm to
+\begin_inset Quotes eld
+\end_inset
+
+invert
+\begin_inset Quotes erd
+\end_inset
+
+ a linked linear list such as (1),
+ that is,
+ to change its links so that the items appear in the opposite order.
+ [If,
+ for example,
+ the list (1) were inverted,
+ we would have
+\family typewriter
+FIRST
+\family default
+ linking to the node containing item 5;
+ that node would link to the one containing item 4;
+ etc.] Assume that the nodes have the form (3).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We use auxiliary pointers
+\family typewriter
+P
+\family default
+,
+
+\family typewriter
+C
+\family default
+,
+ and
+\family typewriter
+N
+\family default
+.
+\end_layout
+
+\begin_layout Enumerate
+Set
+\begin_inset Formula $\mathtt{P}\gets\Lambda$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{C}\gets\mathtt{FIRST}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $\mathtt{C}\neq\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{N}\gets\mathtt{LINK(C)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LINK(C)}\gets\mathtt{P}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{P}\gets\mathtt{C}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{C}\gets\mathtt{N}$
+\end_inset
+
+,
+ and repeat.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset Formula $\mathtt{FIRST}\gets\mathtt{P}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[24]
+\end_layout
+
+\end_inset
+
+The result of topological sorting is not always completely determined,
+ since there may be several ways to arrange the nodes and to satisfy the conditions of topological order.
+ Find all possible ways to arrange the nodes of Fig.
+ 6 into topological order.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First we draw it in a way that simplifies reasoning,
+ with all arrows pointing downwards or to the right:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+1 ---> 3 ---> 7 ---> 4
+\end_layout
+
+\begin_layout Plain Layout
+
+ | |
+\end_layout
+
+\begin_layout Plain Layout
+
+ v |
+\end_layout
+
+\begin_layout Plain Layout
+
+ 9 ---> 5 |
+\end_layout
+
+\begin_layout Plain Layout
+
+ | | |
+\end_layout
+
+\begin_layout Plain Layout
+
+ v v v
+\end_layout
+
+\begin_layout Plain Layout
+
+ 2 ---> 8 ---> 6
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Then we explore possibilities by following the idea in algorithm T but backtracking.
+ We suppress the arrows for compactness.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula
+\[
+\begin{array}{cccccc}
+137492586 & 137495286 & 137924586 & 137925486 & 137925846 & 137942586\\
+137945286 & 137952486 & 137952846 & 137954286 & 139274586 & 139275486\\
+139275846 & 139724586 & 139725486 & 139725846 & 139742586 & 139745286\\
+139752486 & 139752846 & 139754286 & 192374586 & 192375486 & 192375846\\
+193274586 & 193275486 & 193275846 & 193724586 & 193725486 & 193725846\\
+193742586 & 193745286 & 193752486 & 193752846 & 193754286 & 912374586\\
+912375486 & 912375846 & 913274586 & 913275486 & 913275846 & 913724586\\
+913725486 & 913725846 & 913742586 & 913745286 & 913752486 & 913752846\\
+913754286 & 921374586 & 921375486 & 921375846
+\end{array}
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO verify from here
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[21]
+\end_layout
+
+\end_inset
+
+ What output does Algorithm T produce if it is presented with the input (18)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We follow the algorithm with the following table:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="11">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+7
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+QLINK
+\family default
+/
+\family typewriter
+COUNT
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+7
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+TOP
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $3.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $8.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $7.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $6.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $8.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $4,5.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $6.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $5,2.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+N:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+F:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+R:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+P:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+To get the output
+\begin_inset Formula $1\to9\to3\to2\to7\to4\to5\to8\to6(\to0)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc20[24]
+\end_layout
+
+\end_inset
+
+Algorithm T uses
+\family typewriter
+F
+\family default
+,
+
+\family typewriter
+R
+\family default
+,
+ and the
+\family typewriter
+QLINK
+\family default
+ table to obtain the effect of a queue that contains those nodes whose
+\family typewriter
+COUNT
+\family default
+ field has become zero but whose successor relations have not yet been removed.
+ Could a stack be used for this purpose instead of a queue?
+ If so,
+ compare the resulting algorithm with Algorithm T.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes,
+ because those are nodes that we can already print next after the ones that we have already printed.
+ The differences would be:
+\end_layout
+
+\begin_layout Enumerate
+In T4,
+ we would do
+\begin_inset Formula $\mathtt{T}\gets0$
+\end_inset
+
+ and,
+ for each
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+ with
+\begin_inset Formula $\mathtt{COUNT[}k\mathtt{]}=0$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{QLINK[}k\mathtt{]}\gets\mathtt{T}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{T}\gets k$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+In T5,
+ we would output the value of
+\family typewriter
+T
+\family default
+ rather than
+\family typewriter
+F
+\family default
+,
+ and instead of
+\begin_inset Formula $\mathtt{P}\gets\mathtt{TOP[F]}$
+\end_inset
+
+ we would do
+\begin_inset Formula $\mathtt{P}\gets\mathtt{TOP[T]}$
+\end_inset
+
+.
+ We would do
+\begin_inset Formula $\mathtt{T}\gets\mathtt{QLINK[T]}$
+\end_inset
+
+ right after T5 instead of doing T7.
+\end_layout
+
+\begin_layout Enumerate
+In T6,
+ the two assignments involving
+\family typewriter
+R
+\family default
+ would instead be
+\begin_inset Formula $\mathtt{QLINK[SUC(P)]}\gets\mathtt{T}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{T}\gets\mathtt{SUC(P)}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Then we wouldn't need
+\begin_inset Formula $\mathtt{QLINK[}0\mathtt{]}$
+\end_inset
+
+.
+ With input (18),
+ this would work as follows:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="10">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+7
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+9
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+QLINK
+\family default
+/
+\family typewriter
+COUNT
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+TOP
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $3.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $8.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $7.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $6.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $8.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $4,5.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $6.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $5,2.$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+N:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+T:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+P:
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Output:
+
+\begin_inset Formula $9\to2\to1\to3\to7\to5\to8\to4\to6(\to0)$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc29[21]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e22429a"
+
+\end_inset
+
+Give an algorithm to
+\begin_inset Quotes eld
+\end_inset
+
+erase
+\begin_inset Quotes erd
+\end_inset
+
+ an entire list like (1),
+ by putting all of its nodes on the
+\family typewriter
+AVAIL
+\family default
+ stack,
+ given only the value of
+\family typewriter
+FIRST
+\family default
+.
+ The algorithm should operate as fast as possible.
+\end_layout
+
+\begin_layout Enumerate
+Repeat part
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e22429a"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ for a list like (12),
+ given the values of
+\family typewriter
+F
+\family default
+ and
+\family typewriter
+R
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $\mathtt{FIRST}=\Lambda$
+\end_inset
+
+,
+ we don't have to do anything.
+ Otherwise,
+ let
+\begin_inset Formula $\mathtt{P}\gets\mathtt{FIRST}$
+\end_inset
+
+,
+ if
+\begin_inset Formula $\mathtt{LINK(P)}\neq\emptyset$
+\end_inset
+
+ then
+\begin_inset Formula $\mathtt{P}\gets\mathtt{LINK(P)}$
+\end_inset
+
+ and repeat,
+ finally set
+\begin_inset Formula $\mathtt{LINK(P)}\gets\mathtt{AVAIL}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{AVAIL}\gets\mathtt{FIRST}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Just set
+\begin_inset Formula $\mathtt{LINK(R)}\gets\mathtt{AVAIL}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{AVAIL}\gets\mathtt{F}$
+\end_inset
+
+.
+ This works even if the queue is empty.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.4.lyx b/2.2.4.lyx
new file mode 100644
index 0000000..5445975
--- /dev/null
+++ b/2.2.4.lyx
@@ -0,0 +1,644 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[20]
+\end_layout
+
+\end_inset
+
+What does operation (3) do if
+\begin_inset Formula $\mathtt{PTR}_{1}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{PTR}_{2}$
+\end_inset
+
+ are both pointing to nodes in the
+\emph on
+same
+\emph default
+ circular list?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It splits the list into two parts;
+ the one that goes from the right of
+\begin_inset Formula $\mathtt{PTR}_{1}$
+\end_inset
+
+ to
+\begin_inset Formula $\mathtt{PTR}_{2}$
+\end_inset
+
+ is preserved but the other one becomes a memory leak.
+ If the two pointers are equal,
+ nothing happens,
+ just
+\begin_inset Formula $\mathtt{PTR}_{2}$
+\end_inset
+
+ is set to
+\begin_inset Formula $\Lambda$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[21]
+\end_layout
+
+\end_inset
+
+Design an algorithm that takes a circular list such as (1) and reverses the direction of all the arrows.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+This is similar to exercise 2.2.3.7.
+\end_layout
+
+\begin_layout Enumerate
+Set
+\begin_inset Formula $\mathtt{P}\gets\Lambda$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{C}\gets\mathtt{PTR}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $\mathtt{C}\neq\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{N}\gets\mathtt{LINK(C)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LINK(C)}\gets\mathtt{P}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{P}\gets\mathtt{C}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{C}\gets\mathtt{N}$
+\end_inset
+
+,
+ and repeat.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc7[10]
+\end_layout
+
+\end_inset
+
+Why is it useful to assume that the
+\family typewriter
+ABC
+\family default
+ fields of a polynomial list appear in decreasing order?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Many operations on polynomials require us to match monomials with equal exponents of the variables.
+ By having a total order on them it's easy to match these in linear time.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[10]
+\end_layout
+
+\end_inset
+
+Why is it useful to have
+\family typewriter
+Q1
+\family default
+ trailing one step behind
+\family typewriter
+Q
+\family default
+ in Algorithm A?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We need
+\family typewriter
+Q
+\family default
+ to advance in order to check if the next monomial has greater,
+ lower,
+ or equal coefficient than the one pointed to by
+\family typewriter
+P
+\family default
+,
+ and if it's lower,
+ we need
+\family typewriter
+Q1
+\family default
+ to insert the one pointed to by
+\family typewriter
+P
+\family default
+ right before the one pointed to by
+\family typewriter
+Q
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc9[23]
+\end_layout
+
+\end_inset
+
+Would Algorithm A work properly if
+\begin_inset Formula $\mathtt{P}=\mathtt{Q}$
+\end_inset
+
+ (i.e.,
+ both pointer variables point at the same polynomial)?
+ Would Algorithm M work properly if
+\begin_inset Formula $\mathtt{P}=\mathtt{M}$
+\end_inset
+
+,
+ if
+\begin_inset Formula $\mathtt{P}=\mathtt{Q}$
+\end_inset
+
+,
+ or if
+\begin_inset Formula $\mathtt{M}=\mathtt{Q}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Algorithm A would work properly,
+ doubling the polynomial being pointed to (this is assuming no coefficient is 0).
+ As for Algorithm M,
+ it would work for
+\begin_inset Formula $\mathtt{P}=\mathtt{M}$
+\end_inset
+
+ since they're not mutated.
+ If
+\begin_inset Formula $\mathtt{P}=\mathtt{Q}$
+\end_inset
+
+ it wouldn't work,
+ because if
+\family typewriter
+M
+\family default
+ has more than one monomial then the addition of
+\begin_inset Formula $\mathtt{P}$
+\end_inset
+
+ times the second monomial or later (the second iteration of step M2) would add the wrong value to
+\family typewriter
+Q
+\family default
+.
+ If
+\begin_inset Formula $\mathtt{M}=\mathtt{Q}$
+\end_inset
+
+ it wouldn't work either as,
+ for example,
+ if initially
+\begin_inset Formula $\mathtt{M}=\mathtt{Q}=1$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{P}=-1$
+\end_inset
+
+,
+ then addition in the first iteration of M2 would free the current monomial pointed to by
+\begin_inset Formula $\mathtt{M}$
+\end_inset
+
+ and in the next iteration of M1,
+
+\begin_inset Formula $\mathtt{M}$
+\end_inset
+
+ would point to free memory with unpredictable consequences.
+ In cases where the constant coefficient of
+\family typewriter
+P
+\family default
+ is not
+\begin_inset Formula $-1$
+\end_inset
+
+,
+ it amazingly works,
+ as writes to
+\family typewriter
+Q
+\family default
+ are always behind where we read from
+\family typewriter
+M
+\family default
+ when considering monomials of
+\family typewriter
+P
+\family default
+ with positive degree and,
+ for the constant coefficient,
+ it writes to the same position where
+\family typewriter
+M
+\family default
+ is but only to the
+\family typewriter
+COEF
+\family default
+ field—
+unless
+\family typewriter
+P
+\family default
+ is
+\begin_inset Formula $-1$
+\end_inset
+
+ in which case the node pointed to by
+\family typewriter
+M
+\family default
+ is freed.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[20]
+\end_layout
+
+\end_inset
+
+The algorithms in this section assume that we are using three variables
+\begin_inset Formula $x$
+\end_inset
+
+,
+
+\begin_inset Formula $y$
+\end_inset
+
+,
+ and
+\begin_inset Formula $z$
+\end_inset
+
+ in the polynomials,
+ and that their exponents individually never exceed
+\begin_inset Formula $b-1$
+\end_inset
+
+ (where
+\begin_inset Formula $b$
+\end_inset
+
+ is the byte size in
+\family typewriter
+MIX
+\family default
+'s case).
+ Suppose instead that we want to do addition and multiplication of polynomials in only one variable,
+
+\begin_inset Formula $x$
+\end_inset
+
+,
+ and to let its exponent take on values up to
+\begin_inset Formula $b^{3}-1$
+\end_inset
+
+.
+ What changes should be made to Algorithms A and M?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+None,
+ as they work out of the box if we consider the
+\family typewriter
+ABC
+\family default
+ field to hold a single coefficient.
+ The sums and comparisons made on this field in the algorithms are equally valid independently of which of the two interpretations we want to give to this field,
+ assuming no overflow.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[22]
+\end_layout
+
+\end_inset
+
+What advantage is there in representing polynomials with a circular list as in this section,
+ instead of with a straight linear linked list terminated by
+\begin_inset Formula $\Lambda$
+\end_inset
+
+ as in the previous section?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Steps A2 and A5 don't need special cases to handle the end of a list,
+ only A3 does.
+ Other than that there's not much of a difference.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc18[25]
+\end_layout
+
+\end_inset
+
+Devise a way to represent circular lists inside a computer in such a way that the list can be traversed efficiently in both directions,
+ yet only one link field is used per node.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If the link field combines the location of the next and previous fields with some monoidal operation like XOR,
+ and we have an item
+\begin_inset Formula $x_{i}$
+\end_inset
+
+,
+ then knowing the location of
+\begin_inset Formula $x_{i+1}$
+\end_inset
+
+ allows us to get the location of
+\begin_inset Formula $x_{i-1}$
+\end_inset
+
+ and vice versa,
+ so knowing the location of two consecutive items allows us to traverse the list in both directions.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.5.lyx b/2.2.5.lyx
new file mode 100644
index 0000000..6bf2b5b
--- /dev/null
+++ b/2.2.5.lyx
@@ -0,0 +1,606 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[22]
+\end_layout
+
+\end_inset
+
+Explain why a list that is singly linked cannot allow efficient operation as a general deque;
+ the deletion of items can be done efficiently at only one end of a singly linked list.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+One could,
+ in fact,
+ implement it reasonably efficiently using the trick from Exercise 2.2.4.18.
+ If we assume a normal linked list,
+ however,
+ deletion of an element requires knowing the link to the previous element.
+ We know this for the head of the list,
+ as we just have to change the pointer to the head,
+ but we do not know it for the tail,
+ and if we cached a pointer to the second-to-last element to do this,
+ then we would need to update this pointer to point to the new second-to-last element,
+ whose address we cannot retrieve efficiently.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[22]
+\end_layout
+
+\end_inset
+
+The elevator system described in the text uses three call variables,
+
+\family typewriter
+CALLUP
+\family default
+,
+
+\family typewriter
+CALLCAR
+\family default
+,
+ and
+\family typewriter
+CALLDOWN
+\family default
+,
+ for each floor,
+ representing buttons that have been pushed by the users in the system.
+ It is conceivable that the elevator actually needs only one or two binary variables for the call buttons on each floor,
+ instead of three.
+ Explain how an experimenter could push buttons in a certain sequence with this elevator system to
+\emph on
+prove
+\emph default
+ that there are three independent binary variables for each floor (except the top and bottom floors).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We need an experiment that proves that,
+ for any given floor that is not the top or bottom one,
+ the elevator behaves differently for each of the 8 possible combinations of the 3 buttons.
+\end_layout
+
+\begin_layout Standard
+Let us denote the states by the values of
+\family typewriter
+CALLUP
+\family default
+,
+
+\family typewriter
+CALLCAR
+\family default
+ and
+\family typewriter
+CALLDOWN
+\family default
+ in sequence,
+ so for example only
+\family typewriter
+CALLUP
+\family default
+ would be 100 and all buttons at once would be 111.
+\end_layout
+
+\begin_layout Standard
+We first note that the three buttons are not completely independent:
+ 101 and 111 are equal,
+ because the elevator would stop in both directions and then one of
+\family typewriter
+CALLUP
+\family default
+ and
+\family typewriter
+CALLDOWN
+\family default
+ is cleared at the same time as
+\family typewriter
+CALLCAR
+\family default
+ is,
+ so there's no observable difference,
+ but this state and all others are pairwise different,
+ as we shall see.
+\end_layout
+
+\begin_layout Standard
+000 is trivially different from all the other states since,
+ if the elevator is in another floor,
+ any other combination would take it to our floor.
+ If the elevator is in the lower floor and we call 001 in the current and above floors,
+ it would go to the floor above and then to the current one,
+ the opposite of what would happen if in the current floor we would call any combination involving
+\family typewriter
+CALLUP
+\family default
+ or
+\family typewriter
+CALLCAR
+\family default
+.
+ The opposite experiment (calling 100 in the current and below floors with the elevator in the one above,
+ and then changing what we call in the current floor) shows that 100 is also different from all the others.
+\end_layout
+
+\begin_layout Standard
+To see that 010 and 101 are different,
+ we press
+\family typewriter
+CALLCAR
+\family default
+ in the current floor with the elevator in the one above and,
+ while it's going down,
+ press
+\family typewriter
+CALLUP
+\family default
+ in the floor below and tell it to go two floors up.
+ Our design wouldn't stop in our floor when going up,
+ but it would if we had pressed both
+\family typewriter
+CALLUP
+\family default
+ and
+\family typewriter
+CALLDOWN
+\family default
+ since
+\family typewriter
+CALLUP
+\family default
+ would still be 1 after stopping when going down.
+ Actually,
+ this shows that 010 and 011 are different from 101,
+ 110,
+ and 111,
+ and the opposite experiment shows that 010 and 110 are different from 101,
+ 011,
+ and 111.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[21]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+A sparse-update memory.
+\emph default
+) The following problem often arises in
+\emph on
+synchronous
+\emph default
+ simulations:
+ The system has
+\begin_inset Formula $n$
+\end_inset
+
+ variables
+\begin_inset Formula $\mathtt{V[}1\mathtt{]},\dots,\mathtt{V[}n\mathtt{]}$
+\end_inset
+
+,
+ and at every simulated step new values for some of them are calculated from the old values.
+ These calculations are assumed to be done
+\begin_inset Quotes eld
+\end_inset
+
+simultaneously
+\begin_inset Quotes erd
+\end_inset
+
+ in the sense that the variables do not change to their new values until after all assignments have been made.
+ Thus,
+ the two statements
+\begin_inset Formula
+\begin{align*}
+\mathtt{V[}1\mathtt{]} & \gets\mathtt{V[}2\mathtt{]} & & \text{and} & & \mathtt{V[}2\mathtt{]}\gets\mathtt{V[}1\mathtt{]}
+\end{align*}
+
+\end_inset
+
+appearing at the same simulated time would interchange the values of
+\begin_inset Formula $\mathtt{V[}1\mathtt{]}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{V[}2\mathtt{]}$
+\end_inset
+
+;
+ this is quite different from what would happen in a sequential calculation.
+\end_layout
+
+\begin_layout Standard
+The desired action can of course be simulated by keeping an additional table
+\begin_inset Formula $\mathtt{NEWV[}1\mathtt{]},\dots,\mathtt{NEWV[}n\mathtt{]}$
+\end_inset
+
+.
+ Before each simulated step,
+ we could set
+\begin_inset Formula $\mathtt{NEWV[}k\mathtt{]}\gets\mathtt{V[}k\mathtt{]}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+,
+ then record all changes of
+\begin_inset Formula $\mathtt{V[}k\mathtt{]}$
+\end_inset
+
+ in
+\begin_inset Formula $\mathtt{NEWV[}k\mathtt{]}$
+\end_inset
+
+,
+ and finally,
+ after the step we could set
+\begin_inset Formula $\mathtt{V[}k\mathtt{]}\gets\mathtt{NEWV[}k\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+.
+ But this
+\begin_inset Quotes eld
+\end_inset
+
+brute force
+\begin_inset Quotes erd
+\end_inset
+
+ approach is not completely satisfactory,
+ for the following reasons:
+\end_layout
+
+\begin_layout Enumerate
+Often
+\begin_inset Formula $n$
+\end_inset
+
+ is very large,
+ but the number of variables changed per step is rather small.
+\end_layout
+
+\begin_layout Enumerate
+The variables are often not arranged in a nice table
+\begin_inset Formula $\mathtt{V[}1\mathtt{]},\dots,\mathtt{V[}n\mathtt{]}$
+\end_inset
+
+,
+ but are scattered throughout memory in a rather chaotic fashion.
+\end_layout
+
+\begin_layout Enumerate
+This method does not detect the situation (usually an error in the model) when one variable is given two values in the same simulated stop.
+\end_layout
+
+\begin_layout Enumerate
+Assuming that the number of variables changed per step is rather small,
+ design an efficient algorithm that simulates the desired actions,
+ using two auxiliary tables
+\begin_inset Formula $\mathtt{NEWV[}k\mathtt{]}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{LINK[}k\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+.
+ If possible,
+ your algorithm should give an error stop if the same variables is being given two different values in the same step.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The idea,
+ of course,
+ would be to make a linked list with the
+\family typewriter
+LINK
+\family default
+ table.
+ If we assume the table is initially set to 0,
+ we could use
+\begin_inset Formula $-1$
+\end_inset
+
+ to signify the end of the linked list.
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] (This step only happens at the beginning of the simulation.) Set
+\begin_inset Formula $\mathtt{LINK[}k\mathtt{]}\gets0$
+\end_inset
+
+,
+
+\begin_inset Formula $1\leq k\leq n$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q}\gets-1$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:25521b"
+
+\end_inset
+
+[Advance time.] Advance to the next step of the synchronous simulation.
+\end_layout
+
+\begin_layout Enumerate
+[Run the current state.] For each calculation that needs to be done,
+ if
+\begin_inset Formula $k$
+\end_inset
+
+ is the variable to be updated,
+ raise an error if
+\begin_inset Formula $\mathtt{LINK[}k\mathtt{]}\neq0$
+\end_inset
+
+,
+ calculate the new value,
+ store it in
+\begin_inset Formula $\mathtt{NEWV[}k\mathtt{]}$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{LINK[}k\mathtt{]}\gets\mathtt{Q}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{Q}\gets k$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Update variables.] If
+\begin_inset Formula $\mathtt{Q}>0$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{V[Q]}\gets\mathtt{NEWV[Q]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q2}\gets\mathtt{LINK[Q]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LINK[Q]}\gets0$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{LINK[Q]}$
+\end_inset
+
+,
+ and repeat this step.
+ Otherwise go to
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:25521b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc12[22]
+\end_layout
+
+\end_inset
+
+Why is it a good idea to use doubly linked lists instead of singly linked or sequential lists in the simulation program of this section?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+This is because we often delete nodes from the middle of the list without knowing the predecessor or successor,
+ like an user who was tired of waiting,
+ and doubly linked lists are the only kind that allows doing this efficiently.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.2.6.lyx b/2.2.6.lyx
new file mode 100644
index 0000000..56b0cdd
--- /dev/null
+++ b/2.2.6.lyx
@@ -0,0 +1,577 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc[21]
+\end_layout
+
+\end_inset
+
+Formulas (5) and (6) have been derived from the assumption that
+\begin_inset Formula $0\leq\mathtt{I}_{r}\leq d_{r}$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq r\leq k$
+\end_inset
+
+.
+ Give a general formula that applies to the case
+\begin_inset Formula $l_{r}\leq\mathtt{I}_{r}\leq u_{r}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $l_{r}$
+\end_inset
+
+ and
+\begin_inset Formula $u_{r}$
+\end_inset
+
+ are any lower and upper bounds on the dimensionality.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula
+\begin{align*}
+\mathtt{LOC(A[}\mathtt{I}_{1},\mathtt{I}_{2},\dots,\mathtt{I}_{k}\mathtt{])} & =\mathtt{LOC(A[}l_{1},l_{2},\dots,l_{k}\mathtt{])}+\sum_{1\leq r\leq k}a_{r}(\mathtt{I}_{r}-l_{r})=\\
+ & =\left(\mathtt{LOC(A[}l_{1},l_{2},\dots,l_{k}\mathtt{])}-\sum_{1\leq r\leq k}a_{r}l_{r}\right)+\sum_{1\leq r\leq k}a_{r}\mathtt{I}_{r},
+\end{align*}
+
+\end_inset
+
+where
+\begin_inset Formula
+\[
+a_{r}=c\prod_{r<s\leq k}(u_{s}-l_{s}+1).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[24]
+\end_layout
+
+\end_inset
+
+Consider the
+\begin_inset Quotes eld
+\end_inset
+
+tetrahedral arrays
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Formula $\mathtt{A[}i\mathtt{,}j\mathtt{,}k\mathtt{]},$
+\end_inset
+
+
+\begin_inset Formula $\mathtt{B[}i\mathtt{,}j\mathtt{,}k\mathtt{]}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $0\leq k\leq j\leq i\leq n$
+\end_inset
+
+ in
+\family typewriter
+A
+\family default
+,
+ and
+\begin_inset Formula $0\leq i\leq j\leq k\leq n$
+\end_inset
+
+ in
+\family typewriter
+B
+\family default
+.
+ Suppose that both of these arrays are stored in consecutive memory locations in lexicographic order of the indices;
+ show that
+\begin_inset Formula $\mathtt{LOC(A[I,J,K])}=a_{0}+f_{1}\mathtt{(I)}+f_{2}\mathtt{(J)}+f_{3}\mathtt{(K)}$
+\end_inset
+
+ for certain functions
+\begin_inset Formula $f_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $f_{2}$
+\end_inset
+
+,
+
+\begin_inset Formula $f_{3}$
+\end_inset
+
+.
+ Can
+\begin_inset Formula $\mathtt{LOC(B[I,J,K])}$
+\end_inset
+
+ be expressed in a similar manner?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $c$
+\end_inset
+
+ be the size of an entry,
+
+\begin_inset Formula $a_{0}\coloneqq\mathtt{LOC(A[}0\mathtt{,}0\mathtt{,}0\mathtt{])}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $x(i,j,k)$
+\end_inset
+
+ be the number of positions from
+\begin_inset Formula $a_{0}$
+\end_inset
+
+ to
+\begin_inset Formula $\mathtt{LOC(A[}i\mathtt{,}j\mathtt{,}k\mathtt{])}$
+\end_inset
+
+,
+ so that
+\begin_inset Formula $\mathtt{LOC(A[}i\mathtt{,}j\mathtt{,}k\mathtt{])}=a_{0}+cx(i,j,k)$
+\end_inset
+
+,
+ then
+\begin_inset Formula
+\[
+x(i,j,k)=x(i,0,0)+(x(i,j,0)-x(i,0,0))+(x(i,j,k)-x(i,j,0)),
+\]
+
+\end_inset
+
+but
+\begin_inset Formula
+\begin{align*}
+x(i,j,k)-x(i,j,0) & =k,\\
+x(i,j,0)-x(i,0,0) & =\sum_{p=0}^{j-1}(x(i,p+1,0)-x(i,p,0))=\sum_{p=0}^{j-1}(p+1)=\sum_{p=1}^{j}p=\frac{j(j+1)}{2},
+\end{align*}
+
+\end_inset
+
+and
+\begin_inset Formula $x(i,0,0)$
+\end_inset
+
+ is already a function of
+\begin_inset Formula $i$
+\end_inset
+
+,
+ so in fact locations can be put in this form.
+\end_layout
+
+\begin_layout Standard
+Now let
+\begin_inset Formula $b_{0}\coloneqq\mathtt{LOC(B[}0\mathtt{,}0\mathtt{,}0\mathtt{])}$
+\end_inset
+
+ and
+\begin_inset Formula $y(i,j,k)\coloneqq\frac{\mathtt{LOC(B[}0\mathtt{,}0\mathtt{,}0\mathtt{])}-\mathtt{LOC(B[}i\mathtt{,}j\mathtt{,}k\mathtt{])}}{c}$
+\end_inset
+
+,
+ the functions,
+ if they exist,
+ would depend on
+\begin_inset Formula $n$
+\end_inset
+
+,
+ since
+\begin_inset Formula $y(0,1,1)=y(0,0,n)+1=n+1$
+\end_inset
+
+,
+ but still
+\begin_inset Formula
+\begin{align*}
+y(i,j,k) & =y(i,n,n)+(y(i,j,n)-y(i,n,n))+(y(i,j,k)-y(i,j,n))
+\end{align*}
+
+\end_inset
+
+with
+\begin_inset Formula
+\begin{align*}
+y(i,j,k)-y(i,j,n) & =n-k,\\
+y(i,j,n)-y(i,n,n) & =\sum_{p=j+1}^{n}(y(i,p-1,n)-y(i,p,n))=\sum_{p=j+1}^{n}(1+y(i,p,p)-y(i,p,n))\\
+ & =\sum_{p=j+1}^{n}(n-p+1)=\sum_{p=1}^{n-p}p,
+\end{align*}
+
+\end_inset
+
+and
+\begin_inset Formula $y(i,n,n)$
+\end_inset
+
+ is already a function of
+\begin_inset Formula $i$
+\end_inset
+
+ (and
+\begin_inset Formula $n$
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc12[20]
+\end_layout
+
+\end_inset
+
+What are
+\family typewriter
+VAL(Q0)
+\family default
+,
+
+\family typewriter
+VAL(P0)
+\family default
+,
+ and
+\family typewriter
+VAL(P1)
+\family default
+ at the beginning of step S7,
+ in terms of the notation
+\begin_inset Formula $a$
+\end_inset
+
+,
+
+\begin_inset Formula $b$
+\end_inset
+
+,
+
+\begin_inset Formula $c$
+\end_inset
+
+,
+
+\begin_inset Formula $d$
+\end_inset
+
+ used in (13)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\mathtt{VAL(P1)}=d$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{VAL(Q0)}=c$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{VAL(P0)}=b/a$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[22]
+\end_layout
+
+\end_inset
+
+Why were circular lists used in Fig.
+ 14 instead of straight linear lists?
+ Could Algorithm S be rewritten so that it does not make use of the circular linkage?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Circular lists are used as an optimization and simplification:
+ since many lists have to be traversed many times,
+ it is advantageous to not have to reset the pointer to the list every time as the pointer is already situated at the beginning of the list by the time the previous iteration ends.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc24[25]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+The sparse array trick.
+\emph default
+) Suppose you want to use a large array for random access,
+ although you won't actually be referring to very many of its entries.
+ You want
+\begin_inset Formula $\mathtt{A[}k\mathtt{]}$
+\end_inset
+
+ to be zero the first time you access it,
+ yet you don't want to spend the time to set every location to zero.
+ Explain how it is possible to read and write any desired elements
+\begin_inset Formula $\mathtt{A[}k\mathtt{]}$
+\end_inset
+
+ reliably,
+ given
+\begin_inset Formula $k$
+\end_inset
+
+,
+ without assuming anything about the actual initial memory contents,
+ by doing only a small fixed number of additional operations per array access.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+One could have an auxiliary array
+\family typewriter
+L
+\family default
+ containing pairs of index and value,
+ and have
+\family typewriter
+A
+\family default
+ contain pointers to
+\family typewriter
+L
+\family default
+.
+ If the pointer is within bounds and
+\family typewriter
+L
+\family default
+ contains the index
+\begin_inset Formula $k$
+\end_inset
+
+ in that position,
+ then the value contained is the value of
+\begin_inset Formula $\mathtt{A[}k\mathtt{]}$
+\end_inset
+
+,
+ otherwise the value is 0.
+
+\family typewriter
+L
+\family default
+ could actually be the size of
+\family typewriter
+A
+\family default
+ but have an upper limit
+\begin_inset Formula $n$
+\end_inset
+
+ with the number of elements actually allocated,
+ which is considered the upper bound and which increases whenever a value that has not been yet allocated is written to.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.1.lyx b/2.3.1.lyx
new file mode 100644
index 0000000..92b6c2b
--- /dev/null
+++ b/2.3.1.lyx
@@ -0,0 +1,1075 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc1[01]
+\end_layout
+
+\end_inset
+
+In the binary tree (2),
+ let
+\family typewriter
+INFO(P)
+\family default
+ denote the letter stored in
+\family typewriter
+NODE(P)
+\family default
+.
+ What is
+\begin_inset Formula $\mathtt{INFO(LLINK(RLINK(RLINK(T))))}$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $H$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[20]
+\end_layout
+
+\end_inset
+
+The text defines three basic orders for traversing a binary tree;
+ another alternative would be to proceed in three steps as follows:
+\end_layout
+
+\begin_layout Enumerate
+Visit the root,
+\end_layout
+
+\begin_layout Enumerate
+traverse the right subtree,
+\end_layout
+
+\begin_layout Enumerate
+traverse the left subtree,
+\end_layout
+
+\begin_layout Standard
+using the same rule recursively on all nonempty subtrees.
+ Does this new order bear any simple relation to the three orders already discussed?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes,
+ this is the same as postorder but backwards.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[20]
+\end_layout
+
+\end_inset
+
+What is the largest number of entries that can be in the stack at once,
+ during the execution of Algorithm T,
+ if the binary tree has
+\begin_inset Formula $n$
+\end_inset
+
+ nodes?
+ (The answer to this question is very important for storage allocation,
+ if the stack is being stored consecutively.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+There can be up to
+\begin_inset Formula $n$
+\end_inset
+
+ nodes in the stack,
+ in the case that all the right links are null and the tree is just a linked list using the
+\begin_inset Formula $\mathtt{RLINK}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[24]
+\end_layout
+
+\end_inset
+
+Design an algorithm analogous to Algorithm T that traverses a binary tree in
+\emph on
+preorder
+\emph default
+,
+ and prove that your algorithm is correct.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] Set stack
+\family typewriter
+A
+\family default
+ empty,
+ and set the link variable
+\begin_inset Formula $\mathtt{P}\gets\mathtt{T}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:23113b"
+
+\end_inset
+
+[
+\begin_inset Formula $\mathtt{P}=\Lambda$
+\end_inset
+
+?] If
+\begin_inset Formula $\mathtt{P}=\Lambda$
+\end_inset
+
+,
+ go to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113d"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:23113c"
+
+\end_inset
+
+[Visit
+\begin_inset Formula $\mathtt{P}$
+\end_inset
+
+.] Visit
+\begin_inset Formula $\mathtt{NODE(P)}$
+\end_inset
+
+.
+ Do
+\begin_inset Formula $\mathtt{A}\Leftarrow\mathtt{RLINK(P)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{P}\gets\mathtt{LLINK(P)}$
+\end_inset
+
+,
+ and return to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:23113d"
+
+\end_inset
+
+[Visit right hand side.] If
+\family typewriter
+A
+\family default
+ is empty,
+ the algorithm terminates.
+ Otherwise set
+\begin_inset Formula $\mathtt{P}\Leftarrow\mathtt{A}$
+\end_inset
+
+ and return to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+We now prove by induction on the number of nodes that,
+ if we start in step 2,
+ we traverse the subtree starting at
+\begin_inset Formula $\mathtt{P}$
+\end_inset
+
+ in preorder,
+ leave the stack unchanged,
+ and proceed to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113d"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ which clearly would show that the algorithm is correct.
+\end_layout
+
+\begin_layout Standard
+For an empty tree,
+ this is obvious.
+ For a tree with
+\begin_inset Formula $n$
+\end_inset
+
+ nodes,
+ that we start with the root is obvious,
+ we do that at step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113c"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ with the stack empty.
+ After that step,
+ setting
+\begin_inset Formula $\mathtt{P}\gets\mathtt{LLINK(P)}$
+\end_inset
+
+ and returning to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ means that we get to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23113d"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ after traversing the left subtree,
+ which by the induction hypothesis would leave us on step 4 with the stack like it was before but adding the node
+\begin_inset Formula $\mathtt{RLINK(P)}$
+\end_inset
+
+.
+ Then step 4 clearly means to traverse
+\begin_inset Formula $\mathtt{RLINK(P)}$
+\end_inset
+
+ and leave
+\family typewriter
+A
+\family default
+ like it was before starting processing
+\family typewriter
+P
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc16[22]
+\end_layout
+
+\end_inset
+
+The diagrams in Fig.
+ 24 help to provide an intuitive characterization of the position of
+\begin_inset Formula $\mathtt{NODE(Q}\$\mathtt{)}$
+\end_inset
+
+ in a binary tree,
+ in terms of the structure near
+\begin_inset Formula $\mathtt{NODE(Q)}$
+\end_inset
+
+:
+ If
+\begin_inset Formula $\mathtt{NODE(Q)}$
+\end_inset
+
+ has a nonempty right subtree,
+ consider
+\begin_inset Formula $\mathtt{Q}=\$\mathtt{P}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q}\$=\mathtt{P}$
+\end_inset
+
+ in the upper diagrams;
+
+\begin_inset Formula $\mathtt{NODE(Q}\$\mathtt{)}$
+\end_inset
+
+ is the
+\begin_inset Quotes eld
+\end_inset
+
+leftmost
+\begin_inset Quotes erd
+\end_inset
+
+ node of that right subtree.
+ If
+\family typewriter
+
+\begin_inset Formula $\mathtt{NODE(Q)}$
+\end_inset
+
+
+\family default
+ has an empty right subtree,
+ consider
+\begin_inset Formula $\mathtt{Q}=\mathtt{P}$
+\end_inset
+
+ in the lower diagrams;
+
+\begin_inset Formula $\mathtt{NODE(Q}\$\mathtt{)}$
+\end_inset
+
+ is located by proceeding upward in the tree until after the first upward step to the right.
+\end_layout
+
+\begin_layout Standard
+Give a similar
+\begin_inset Quotes eld
+\end_inset
+
+intuitive
+\begin_inset Quotes erd
+\end_inset
+
+ rule for finding the position of
+\begin_inset Formula $\mathtt{NODE(Q}*\mathtt{)}$
+\end_inset
+
+ in a binary tree in terms of the structure near
+\family typewriter
+NODE(Q)
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $\mathtt{NODE(Q)}$
+\end_inset
+
+ has a nonempty left subtree,
+ consider
+\begin_inset Formula $\mathtt{Q}=*\mathtt{P}$
+\end_inset
+
+ in the upper diagrams;
+ then
+\begin_inset Formula $\mathtt{Q}*=\mathtt{P}$
+\end_inset
+
+ is the left child of
+\begin_inset Formula $\mathtt{Q}$
+\end_inset
+
+.
+ Otherwise,
+ if
+\begin_inset Formula $\mathtt{NODE(Q)}$
+\end_inset
+
+ has a nonempty right subtree,
+
+\begin_inset Formula $\mathtt{Q}*$
+\end_inset
+
+ is the right child of
+\begin_inset Formula $\mathtt{Q}$
+\end_inset
+
+.
+ Otherwise both subtrees are empty and
+\begin_inset Formula $\mathtt{Q}*$
+\end_inset
+
+ can be found by going upward until finding a node that is a left child (which could be
+\begin_inset Formula $\mathtt{Q}$
+\end_inset
+
+ itself) and taking its right sibling.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[22]
+\end_layout
+
+\end_inset
+
+Give an algorithm analogous to Algorithm S for determining
+\begin_inset Formula $\mathtt{P}*$
+\end_inset
+
+ in a threaded binary tree.
+ Assume that the tree has a list head as in (8),
+ (9),
+ and (10).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If
+\family typewriter
+P
+\family default
+ points to a node of a threaded binary tree,
+ this algorithm sets
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{P}*$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Is the left subtree nonempty?] If
+\begin_inset Formula $\mathtt{LTAG(P)}=1$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{LLINK(P)}$
+\end_inset
+
+ and terminate the algorithm.
+\end_layout
+
+\begin_layout Enumerate
+[Search to the right.] Set
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{RLINK(P)}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $\mathtt{RTAG(P)}=1$
+\end_inset
+
+,
+ terminate the algorithm.
+ Otherwise set
+\begin_inset Formula $\mathtt{P}\gets\mathtt{Q}$
+\end_inset
+
+ and repeat this step.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc28[00]
+\end_layout
+
+\end_inset
+
+After Algorithm C has been used to make a copy of a tree,
+ is the new binary tree
+\emph on
+equivalent
+\emph default
+ to the original,
+ or
+\emph on
+similar
+\emph default
+ to it?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It's equivalent (and similar).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc30[22]
+\end_layout
+
+\end_inset
+
+Design an algorithm that threads an unthreaded tree;
+ for example,
+ it should transform (2) into (10).
+
+\emph on
+Note:
+
+\emph default
+ Always use notations like
+\begin_inset Formula $\mathtt{P}*$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{P}\$$
+\end_inset
+
+ when possible,
+ instead of repeating the steps for traversal algorithms like Algorithm T.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+This algorithm threads an unthreaded tree
+\begin_inset Formula $\mathtt{T}$
+\end_inset
+
+.
+ The fields
+\begin_inset Formula $\mathtt{LTAG}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{RTAG}$
+\end_inset
+
+ in the nodes of
+\begin_inset Formula $\mathtt{T}$
+\end_inset
+
+ are considered to initially contain arbitrary values that we do not need to preserve.
+\end_layout
+
+\begin_layout Enumerate
+[Initialize list head and variables.] Get
+\begin_inset Formula $\mathtt{P}\Leftarrow\mathtt{AVAIL}$
+\end_inset
+
+ and set
+\begin_inset Formula $\mathtt{LTAG(P)}\gets\mathtt{RTAG(P)}\gets0$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LLINK(P)}\gets\mathtt{T}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{RLINK(P)}\gets\mathtt{P}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{T}\gets\mathtt{P}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{P}\$$
+\end_inset
+
+.
+
+\emph on
+(We'll use
+\begin_inset Formula $\mathtt{Q}$
+\end_inset
+
+ as a pointer to the node being considered and
+\begin_inset Formula $\mathtt{P}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{R}$
+\end_inset
+
+ as pointers to the next and previous nodes,
+ respectively.
+ We only ever compute the next node in inorder from the last node calculated this way,
+ which makes it trivial to use algorithm T as a coroutine.)
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:23122b"
+
+\end_inset
+
+[Are we over?] If
+\begin_inset Formula $\mathtt{RLINK(Q)}=\mathtt{Q}$
+\end_inset
+
+,
+ the algorithm terminates.
+
+\emph on
+(This loop only happens in the list head.)
+\end_layout
+
+\begin_layout Enumerate
+[Step.] Set
+\begin_inset Formula $\mathtt{R}\gets\mathtt{Q}\$$
+\end_inset
+
+.
+ If
+\begin_inset Formula $\mathtt{LLINK(Q)}=\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{LTAG(Q)}\gets0$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{LLINK(Q)}\gets\mathtt{P}$
+\end_inset
+
+,
+ otherwise set
+\begin_inset Formula $\mathtt{LTAG(Q)}\gets1$
+\end_inset
+
+.
+ Similarly,
+ if
+\begin_inset Formula $\mathtt{RLINK(Q)}=\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{RTAG(Q)}\gets0$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{RLINK(Q)}\gets\mathtt{R}$
+\end_inset
+
+,
+ otherwise set
+\begin_inset Formula $\mathtt{RTAG(Q)}\gets1$
+\end_inset
+
+.
+ Finally set
+\begin_inset Formula $\mathtt{P}\gets\mathtt{Q}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{R}$
+\end_inset
+
+,
+ and return to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:23122b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc37[24]
+\end_layout
+
+\end_inset
+
+(D.
+ Ferguson.) If two computer words are necessary to contain two link fields and an
+\begin_inset Formula $\mathtt{INFO}$
+\end_inset
+
+ field,
+ representation (2) requires
+\begin_inset Formula $2n$
+\end_inset
+
+ words of memory for a tree with
+\begin_inset Formula $n$
+\end_inset
+
+ nodes.
+ Design a representation scheme for binary trees that uses less space,
+ assuming that
+\emph on
+one
+\emph default
+ link and an
+\begin_inset Formula $\mathtt{INFO}$
+\end_inset
+
+ field will fit in a single computer word.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+If we allow for a second null value (call it
+\begin_inset Formula $\lambda$
+\end_inset
+
+,
+ which could be e.g.
+ a pointer to a specific word in the program code or to a sentinel constant,
+ or 4001 in MIX,
+ or 1 in MMIX),
+ then we could implement the solution in the book,
+ which is that,
+ if
+\begin_inset Formula $\mathtt{LINK(P)}=\Lambda$
+\end_inset
+
+,
+ then
+\begin_inset Formula $\mathtt{LLINK(P)}=\mathtt{RLINK(P)}=\Lambda$
+\end_inset
+
+,
+ and otherwise
+\begin_inset Formula $\mathtt{LLINK(P)}=\mathtt{LINK(P)}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{RLINK(P)}=\mathtt{LINK(P)}+1$
+\end_inset
+
+ (or
+\begin_inset Formula $+\mathtt{sizeof(int)}$
+\end_inset
+
+),
+ except that if
+\begin_inset Formula $\mathtt{LINK(LINK(P))}=\lambda$
+\end_inset
+
+ or
+\begin_inset Formula $\mathtt{LINK(LINK(P)}+1\mathtt{)}=\lambda$
+\end_inset
+
+ then
+\begin_inset Formula $\mathtt{LLINK(P)}$
+\end_inset
+
+ or
+\begin_inset Formula $\mathtt{RLINK(P)}$
+\end_inset
+
+ is respectively
+\begin_inset Formula $\Lambda$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.2.lyx b/2.3.2.lyx
new file mode 100644
index 0000000..97aca3c
--- /dev/null
+++ b/2.3.2.lyx
@@ -0,0 +1,1316 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[20]
+\end_layout
+
+\end_inset
+
+The text gives a formal definition of
+\begin_inset Formula $B(F)$
+\end_inset
+
+,
+ the binary tree corresponding to a forest
+\begin_inset Formula $F$
+\end_inset
+
+.
+ Give a formal definition that reverses the process;
+ in other words,
+ define
+\begin_inset Formula $F(B)$
+\end_inset
+
+,
+ the forest corresponding to a binary tree
+\begin_inset Formula $B$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $F(B)$
+\end_inset
+
+ is the forest such that
+\begin_inset Formula $B(F(B))=B$
+\end_inset
+
+,
+ so
+\begin_inset Formula $F=B^{-1}$
+\end_inset
+
+.
+ Now we shall give an explicit definition of
+\begin_inset Formula $F$
+\end_inset
+
+ and see that
+\begin_inset Formula $B$
+\end_inset
+
+ and
+\begin_inset Formula $F$
+\end_inset
+
+ are,
+ in fact,
+ inverses.
+\end_layout
+
+\begin_layout Standard
+Given a binary tree
+\begin_inset Formula $B$
+\end_inset
+
+:
+\end_layout
+
+\begin_layout Enumerate
+If
+\begin_inset Formula $B$
+\end_inset
+
+ is empty,
+
+\begin_inset Formula $F(B)$
+\end_inset
+
+ is the empty forest.
+\end_layout
+
+\begin_layout Enumerate
+Otherwise,
+ let
+\begin_inset Formula $\text{root}(P)$
+\end_inset
+
+ be the root node of a given nonempty binary tree,
+
+\begin_inset Formula $\text{left}(P)$
+\end_inset
+
+ be its left subtree,
+ and
+\begin_inset Formula $\text{right}(P)$
+\end_inset
+
+ be its right subtree.
+ Then,
+ if
+\begin_inset Formula $T_{1}$
+\end_inset
+
+ is the tree whose root is
+\begin_inset Formula $\text{root}(T)$
+\end_inset
+
+ and whose children are the trees of the forest
+\begin_inset Formula $F(\text{left}(B))$
+\end_inset
+
+,
+ then
+\begin_inset Formula $F(B)=(T_{1},F(\text{right}(B)))$
+\end_inset
+
+,
+ that is,
+ the forest made up of the tree
+\begin_inset Formula $T_{1}$
+\end_inset
+
+ followed by the trees in
+\begin_inset Formula $F(\text{right}(B))$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+We can prove that they are inverses by structural induction,
+ which is a case of strong induction in the number of nodes.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $B(F(B))=B$
+\end_inset
+
+ is obvious if
+\begin_inset Formula $B$
+\end_inset
+
+ is empty;
+ otherwise
+\begin_inset Formula $F(B)=((\text{root}(B);F(\text{left}(B)));F(\text{right}(B)))$
+\end_inset
+
+ is made up of a tree
+\begin_inset Formula $T_{1}$
+\end_inset
+
+ with
+\begin_inset Formula $\text{root}(B)$
+\end_inset
+
+ as root and the trees in
+\begin_inset Formula $F(\text{left}(B))$
+\end_inset
+
+ as children,
+ and then the trees in
+\begin_inset Formula $F(\text{right}(B))$
+\end_inset
+
+,
+ and so
+\begin_inset Formula $B(F(B))$
+\end_inset
+
+ has
+\begin_inset Formula $\text{root}(T_{1})=\text{root}(B)$
+\end_inset
+
+ as its root,
+ its left subtree is
+\begin_inset Formula $B(F(\text{left}(B)))=\text{left}(B)$
+\end_inset
+
+,
+ and its right subtree is
+\begin_inset Formula $B(F(\text{right}(B)))=\text{right}(B)$
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $F(B(F))=F$
+\end_inset
+
+ is obvious for an empty forest
+\begin_inset Formula $F$
+\end_inset
+
+;
+ if
+\begin_inset Formula $F=(T_{1},\dots,T_{n})$
+\end_inset
+
+ is nonempty,
+ then
+\begin_inset Formula $B(F)$
+\end_inset
+
+ has
+\begin_inset Formula $\text{root}(T_{1})$
+\end_inset
+
+ as its root,
+
+\begin_inset Formula $B(T_{11},\dots,T_{1m})$
+\end_inset
+
+ as its left subtree,
+ where
+\begin_inset Formula $T_{11},\dots,T_{1m}$
+\end_inset
+
+ are the subtrees of
+\begin_inset Formula $T_{1}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $B(T_{2},\dots,T_{n})$
+\end_inset
+
+ as the right subtree,
+ so
+\begin_inset Formula $F(B(F))$
+\end_inset
+
+ is made up of a tree
+\begin_inset Formula $T'_{1}$
+\end_inset
+
+ whose root is
+\begin_inset Formula $\text{root}(B(F))=\text{root}(T_{1})$
+\end_inset
+
+ and whose children are the trees in
+\begin_inset Formula $F(\text{left}(B(F)))=F(B(T_{11},\dots,T_{1m}))=(T_{11},\dots,T_{1m})$
+\end_inset
+
+ (therefore
+\begin_inset Formula $T'_{1}=T_{1}$
+\end_inset
+
+),
+ followed by the trees in
+\begin_inset Formula $F(\text{right}(B))=F(B(T_{2},\dots,T_{n}))=(T_{2},\dots,T_{n})$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc2[20]
+\end_layout
+
+\end_inset
+
+We defined Dewey decimal notation for forests in Section 2.3,
+ and for binary trees in exercise 2.3.1–5.
+ Thus the node
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $J$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ in (1) is represented by
+\begin_inset Quotes eld
+\end_inset
+
+2.2.1
+\begin_inset Quotes erd
+\end_inset
+
+,
+ and in the equivalent binary tree (3) it is represented by
+\begin_inset Quotes eld
+\end_inset
+
+11010
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+
+\emph on
+(this is a 1 for the root following by zero or more 0s or 1s,
+ where 0 means moving to the left subtree and 1 means moving to the right)
+\end_layout
+
+\end_inset
+
+.
+ If possible,
+ give a rule that directly expresses the natural correspondence between the Dewey decimal notations.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+One can get the forest notation from the binary tree notation by switching the 1 at the start by a 0 and then counting the number of 1s after each 0 and adding 1 to that number.
+ In this case,
+ we would change
+\begin_inset Quotes eld
+\end_inset
+
+11010
+\begin_inset Quotes erd
+\end_inset
+
+ to
+\begin_inset Quotes eld
+\end_inset
+
+01010
+\begin_inset Quotes erd
+\end_inset
+
+,
+ then count
+\begin_inset Quotes eld
+\end_inset
+
+1.1.0
+\begin_inset Quotes erd
+\end_inset
+
+ and add 1 to each number to get
+\begin_inset Quotes eld
+\end_inset
+
+2.2.1
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[26]
+\end_layout
+
+\end_inset
+
+Write a
+\family typewriter
+MIX
+\family default
+ program for the
+\family typewriter
+COPY
+\family default
+ subroutine (which fits in the program of the text between lines 063–104).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We have 40 lines.
+ We use Algorithm 2.3.1C to copy the tree in rI1.
+ In C5,
+ to take the next node in preorder,
+ we follow the
+\family typewriter
+RLINK
+\family default
+ up to and including that of a node with
+\begin_inset Formula $\mathtt{RTAG}=0$
+\end_inset
+
+ (positive sign),
+ unless the node has a left child.
+ In C4,
+ when inserting a node to the left,
+ we set
+\begin_inset Formula $\mathtt{RTAG}=1$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{RLINK}$
+\end_inset
+
+ to the parent node,
+ In C2,
+ when inserting a node to the right,
+ we set
+\begin_inset Formula $\mathtt{RTAG}=1$
+\end_inset
+
+ and
+\family typewriter
+RLINK
+\family default
+ to the previous
+\family typewriter
+RLINK
+\family default
+ of the parent node.
+\end_layout
+
+\begin_layout Standard
+We also need to copy the
+\family typewriter
+INFO
+\family default
+ of the
+\family typewriter
+HEAD
+\family default
+,
+ which is easily achieved by going from C1 to C3 rather than to C4.
+ This code is slightly less efficient than the one by Knuth,
+ and it has not been tested.
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+ ST2 1F
+\end_layout
+
+\begin_layout Plain Layout
+
+ ST3 2F
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP ALLOC ;
+ C1 [Initialize]
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT2 0,3
+\end_layout
+
+\begin_layout Plain Layout
+
+ ST2 0,2(RLINK) ;
+ RLINK(U) <- U
+\end_layout
+
+\begin_layout Plain Layout
+
+3H LDA 1,1 ;
+ C3 [Copy INFO]
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA 1,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA 0,1(TYPE)
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA 0,2(TYPE)
+\end_layout
+
+\begin_layout Plain Layout
+
+4H LDA 0,1(LLINK) ;
+ C4 [Anything to the left?]
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAZ 5F
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP ALLOC ;
+ R <= AVAIL
+\end_layout
+
+\begin_layout Plain Layout
+
+ ST3 0,2(LLINK) ;
+ LLINK(Q) <- R
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENNA 0,2
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA 0,3(RLINKT)
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD1 0,1(LLINK)
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT2 0,3
+\end_layout
+
+\begin_layout Plain Layout
+
+5H LD1N 0,1(RLINKT) ;
+ C5 [Advance]
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD2 0,2(RLINK)
+\end_layout
+
+\begin_layout Plain Layout
+
+ J1P 5B
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENN1 0,1
+\end_layout
+
+\begin_layout Plain Layout
+
+6H CMP2 0,2(RLINK) ;
+ C6 [Test if complete]
+\end_layout
+
+\begin_layout Plain Layout
+
+ JEQ 2F ;
+ Finish when Q = RLINK(Q)
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA 0,1 ;
+ C2 [Anything to the right?]
+\end_layout
+
+\begin_layout Plain Layout
+
+ JAN 3B
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP ALLOC ;
+ R <= AVAIL
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDA 0,2(RLINKT) ;
+ RLINK(Q) <- R
+\end_layout
+
+\begin_layout Plain Layout
+
+ STA 0,3(RLINKT)
+\end_layout
+
+\begin_layout Plain Layout
+
+ ST3 0,2(RLINKT)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP 3B
+\end_layout
+
+\begin_layout Plain Layout
+
+ALLOC STJ 8F
+\end_layout
+
+\begin_layout Plain Layout
+
+ LD3 AVAIL
+\end_layout
+
+\begin_layout Plain Layout
+
+ J3Z OVERFLOW
+\end_layout
+
+\begin_layout Plain Layout
+
+ LDX 0,3(LLINK)
+\end_layout
+
+\begin_layout Plain Layout
+
+ STX AVAIL
+\end_layout
+
+\begin_layout Plain Layout
+
+ STZ 0,3(LLINK)
+\end_layout
+
+\begin_layout Plain Layout
+
+ JMP *
+\end_layout
+
+\begin_layout Plain Layout
+
+2H ENT3 *
+\end_layout
+
+\begin_layout Plain Layout
+
+ ENT1 0,2
+\end_layout
+
+\begin_layout Plain Layout
+
+1H ENT2 *
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc14[M21]
+\end_layout
+
+\end_inset
+
+How long does it take the program of exercise 13 to copy a tree with
+\begin_inset Formula $n$
+\end_inset
+
+ nodes?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+There are 20 cycles for the initialization,
+ then 11 for every node including the header until
+\family typewriter
+JAZ 5F
+\family default
+,
+ then 21 for each left node,
+ plus 5 to go back in C5 if needed (once for each left node or for the header),
+ plus 1 to arrive at the right node (including the header),
+ then 2 cycles per node (including the header at the end) to test for termination,
+ 20 for each right node,
+ and 3 for termination.
+\end_layout
+
+\begin_layout Standard
+In total,
+ we spend 63 cycles,
+ plus 39 cycles for each left child and 34 for each right child.
+ As said before,
+ this is just slightly less efficient than Knuth's code.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 18,
+ 20 (2pp,
+ 0:52)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc18[25]
+\end_layout
+
+\end_inset
+
+An oriented tree specified by
+\begin_inset Formula $n$
+\end_inset
+
+ links
+\begin_inset Formula $\mathtt{PARENT}[j]$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j\leq n$
+\end_inset
+
+ implicitly defines an ordered tree if the nodes in each family are oriented by their location.
+ Design an efficient algorithm that constructs a doubly linked circular list containing the nodes of this ordered tree in preorder.
+ For example,
+ given
+\begin_inset Formula
+\[
+\begin{array}{rcccccccc}
+j= & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\
+\mathtt{PARENT}[j]= & 3 & 8 & 4 & 0 & 4 & 8 & 3 & 4
+\end{array}
+\]
+
+\end_inset
+
+your algorithm should produce
+\begin_inset Formula
+\[
+\begin{array}{rcccccccc}
+\mathtt{LLINK}[j]= & 3 & 8 & 4 & 6 & 7 & 2 & 1 & 5\\
+\mathtt{RLINK}[j]= & 7 & 6 & 1 & 3 & 8 & 4 & 5 & 2
+\end{array}
+\]
+
+\end_inset
+
+and it should also report that the root node is 4.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The way to do this would be to look at the indices in decreasing order,
+ and for each index we insert the child node and its subtree to the right of the parent node,
+ as follows:
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] Set
+\begin_inset Formula $\mathtt{LLINK}[j]\gets\mathtt{RLINK}[j]\gets j$
+\end_inset
+
+ for
+\begin_inset Formula $1\leq j\leq n$
+\end_inset
+
+,
+ then let
+\begin_inset Formula $j\gets n$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e23218b"
+
+\end_inset
+
+[Set parent.] If
+\begin_inset Formula $\mathtt{PARENT}[j]=0$
+\end_inset
+
+,
+ set
+\begin_inset Formula $r\gets j$
+\end_inset
+
+.
+ Otherwise set
+\begin_inset Formula $p\gets\mathtt{PARENT}[j]$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LLINK}[\mathtt{RLINK}[p]]\gets\mathtt{LLINK}[j]$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{RLINK}[\mathtt{LLINK}[j]]\gets\mathtt{RLINK}[p]$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{RLINK}[p]\gets j$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mathtt{LLINK}[j]\gets p$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Are we done?] Decrease
+\begin_inset Formula $j$
+\end_inset
+
+ by 1.
+ If
+\begin_inset Formula $j=0$
+\end_inset
+
+,
+ terminate and report
+\begin_inset Formula $r$
+\end_inset
+
+ as the root node.
+ Otherwise go to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23218b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+First,
+ each element is in a circular list by its own.
+ Then,
+ in step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23218b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ we place the circular list of the child to the right of the circular list of the parent.
+ To see that this produces a preorder,
+ we see by induction that,
+ at the end of step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23218b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+,
+ we have the preorder of each connected component in the
+\begin_inset Quotes eld
+\end_inset
+
+subforest
+\begin_inset Quotes erd
+\end_inset
+
+ whose edges are
+\begin_inset Formula $(k,\mathtt{PARENT}[k])$
+\end_inset
+
+ for
+\begin_inset Formula $j\leq k\leq n$
+\end_inset
+
+,
+ each preorder in a separate circular list.
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $j=n$
+\end_inset
+
+,
+ this is easy to check.
+ For
+\begin_inset Formula $1\leq j<n$
+\end_inset
+
+,
+ at the beginning of the step,
+
+\begin_inset Formula $j$
+\end_inset
+
+ will not be connected with
+\begin_inset Formula $\mathtt{PARENT}[j]$
+\end_inset
+
+ in the graph,
+ so all the nodes in its connected component will be descendants of
+\begin_inset Formula $j$
+\end_inset
+
+,
+ and
+\begin_inset Formula $j$
+\end_inset
+
+ will be the root of a subtree.
+ Thus connecting
+\begin_inset Formula $j$
+\end_inset
+
+ as the leftmost child of
+\begin_inset Formula $\mathtt{PARENT}[j]$
+\end_inset
+
+ would affect the preorder of the subtree
+\begin_inset Formula $\mathtt{PARENT}[j]$
+\end_inset
+
+ is in by adding the preorder of the child's subtree precisely to the right of its parent.
+
+\end_layout
+
+\begin_layout Standard
+Furthermore,
+ since we add children from right to left,
+ the order of the subtrees is always preserved.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc20[M22]
+\end_layout
+
+\end_inset
+
+Prove that if
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ are nodes of a forest,
+
+\begin_inset Formula $u$
+\end_inset
+
+ is a proper ancestor of
+\begin_inset Formula $v$
+\end_inset
+
+ if and only if
+\begin_inset Formula $u$
+\end_inset
+
+ precedes
+\begin_inset Formula $v$
+\end_inset
+
+ in preorder and
+\begin_inset Formula $u$
+\end_inset
+
+ follows
+\begin_inset Formula $v$
+\end_inset
+
+ in postorder.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Trivial.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Certainly
+\begin_inset Formula $u$
+\end_inset
+
+ cannot be a descendant of
+\begin_inset Formula $v$
+\end_inset
+
+.
+ If
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ were in different tree,
+ their relative ordering would be decided by the order of those trees,
+ not by whether we use preorder or postorder.
+ Similarly,
+ if
+\begin_inset Formula $r$
+\end_inset
+
+ is the closest common ancestor of
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ and
+\begin_inset Formula $r\neq u$
+\end_inset
+
+,
+ let
+\begin_inset Formula $u_{1}$
+\end_inset
+
+ be the child of
+\begin_inset Formula $r$
+\end_inset
+
+ whose subtree contains
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v_{1}$
+\end_inset
+
+ that whose subtree contains
+\begin_inset Formula $v$
+\end_inset
+
+,
+ then
+\begin_inset Formula $u_{1}\neq v_{1}$
+\end_inset
+
+,
+ but
+\begin_inset Formula $u_{1}$
+\end_inset
+
+ and
+\begin_inset Formula $v_{1}$
+\end_inset
+
+ and therefore
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ would always have the same order if the tree is ordered.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.3.lyx b/2.3.3.lyx
new file mode 100644
index 0000000..56bc0e1
--- /dev/null
+++ b/2.3.3.lyx
@@ -0,0 +1,2031 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\usepackage{calc}
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[20]
+\end_layout
+
+\end_inset
+
+If we had only
+\family typewriter
+LTAG
+\family default
+,
+
+\family typewriter
+INFO
+\family default
+ and
+\family typewriter
+RTAG
+\family default
+ fields (not
+\family typewriter
+LLINK
+\family default
+) in a level order sequential representation like (8),
+ would it be possible to reconstruct the
+\family typewriter
+LLINK
+\family default
+s?
+ (In other words,
+ are the
+\family typewriter
+LLINK
+\family default
+s redundant in (8),
+ as the
+\family typewriter
+RLINK
+\family default
+s are in (3)?)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Yes,
+ although the traversal might be less efficient.
+ First,
+ we would have to collect the roots of the trees to form the first level.
+ These roots are precisely the first family,
+ that is,
+ the first sequence of nodes up to an including one with
+\begin_inset Formula $\mathtt{RTAG}=1$
+\end_inset
+
+.
+ We count the number of such nodes that have children,
+ which are the ones with
+\begin_inset Formula $\mathtt{LTAG}=0$
+\end_inset
+
+.
+ For the second level,
+ we take as many families as nodes with children in the first level.
+ Each of those families corresponds to the children of one of those nodes,
+ in order.
+ For the third level,
+ we take as many families as nodes with children in the second level,
+ and so on.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[24]
+\end_layout
+
+\end_inset
+
+Modify Algorithm 2.3.2D so that it follows the ideas of Algorithm F,
+ placing the derivatives it computes as intermediate results on a stack,
+ instead of recording their locations in an anomalous fashion as is done in step D3.
+ (See exercise 2.3.2–21.) The stack may be maintained by using the
+\family typewriter
+RLINK
+\family default
+ field in the root of each derivative.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+[Initalize.] Set
+\begin_inset Formula $\mathtt{P}\gets\mathtt{Y}\$$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e23324b"
+
+\end_inset
+
+[Differentiate.] Set
+\begin_inset Formula $d\gets\mathtt{DEGREE(P)}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $d=0$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{ARGS}\gets0$
+\end_inset
+
+,
+ otherwise set
+\begin_inset Formula $t\gets\mathtt{RLINK}^{d-1}\mathtt{(LLINK(DY))}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{DY}\gets\mathtt{RLINK(}t\mathtt{)}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mathtt{RLINK(}t\mathtt{)}\gets\Lambda$
+\end_inset
+
+.
+ Then perform the routine
+\begin_inset Formula $\mathtt{DIFF[TYPE(P)]}$
+\end_inset
+
+.
+ (This routine uses
+\family typewriter
+P
+\family default
+ and
+\family typewriter
+ARGS
+\family default
+ as its arguments and it is in change of freeing the nodes of
+\family typewriter
+ARGS
+\family default
+ that will not be part of the result,
+ which it should store in
+\family typewriter
+Q
+\family default
+.)
+\end_layout
+
+\begin_layout Enumerate
+[Save link.] Set
+\begin_inset Formula $\mathtt{RLINK(Q)}\gets\mathtt{LLINK(DY)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LLINK(DY)}\gets\mathtt{Q}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mathtt{P}\gets\mathtt{P}\$$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+[Done?] If
+\begin_inset Formula $\mathtt{P}=\mathtt{Y}$
+\end_inset
+
+,
+ terminate.
+ Otherwise go back to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23324b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[24]
+\end_layout
+
+\end_inset
+
+Suppose that the nodes of an
+\emph on
+oriented
+\emph default
+ forest have three link fields,
+
+\family typewriter
+PARENT
+\family default
+,
+
+\family typewriter
+LCHILD
+\family default
+,
+ and
+\family typewriter
+RLINK
+\family default
+,
+ but only the
+\family typewriter
+PARENT
+\family default
+ link has been set up to indicate the tree structure.
+ The
+\family typewriter
+LCHILD
+\family default
+ field of each node is
+\begin_inset Formula $\Lambda$
+\end_inset
+
+ and the
+\family typewriter
+RLINK
+\family default
+ fields are set as a linear list that simply links the nodes together in some order.
+ The link variable
+\family typewriter
+FIRST
+\family default
+ points to the first node,
+ and the last node has
+\begin_inset Formula $\mathtt{RLINK}=\Lambda$
+\end_inset
+
+.
+ Design an algorithm that goes through these nodes and fills in the
+\family typewriter
+LCHILD
+\family default
+ and
+\family typewriter
+RLINK
+\family default
+ fields compatible with the
+\family typewriter
+PARENT
+\family default
+ links,
+ so that a triply linked tree representation like that in Fig.
+ 26 is obtained.
+ Also,
+ reset
+\family typewriter
+FIRST
+\family default
+ so that it now points to the root of the first tree in the representation.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] Set
+\begin_inset Formula $\mathtt{C}\gets\mathtt{FIRST}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{FIRST}\gets\Lambda$
+\end_inset
+
+ (we haven't found any root yet).
+\end_layout
+
+\begin_layout Enumerate
+[Done?] If
+\begin_inset Formula $\mathtt{C}=\Lambda$
+\end_inset
+
+,
+ terminate.
+\end_layout
+
+\begin_layout Enumerate
+[Add child.] Set
+\begin_inset Formula $p\gets\mathtt{PARENT(C)}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{N}\gets\mathtt{RLINK(C)}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $p=\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{RLINK(C)}\gets\mathtt{FIRST}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{FIRST}\gets\mathtt{C}$
+\end_inset
+
+,
+ otherwise set
+\begin_inset Formula $\mathtt{RLINK(C)}\gets\mathtt{FCHILD(}p\mathtt{)}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{FCHILD(}p\mathtt{)}\gets\mathtt{C}$
+\end_inset
+
+.
+ (In assembly we might just set
+\begin_inset Formula $p$
+\end_inset
+
+ to some function of
+\family typewriter
+LOC(FIRST)
+\family default
+ whenever
+\begin_inset Formula $p=\Lambda$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Enumerate
+[Advance.] Set
+\begin_inset Formula $\mathtt{C}\gets\mathtt{N}$
+\end_inset
+
+ and go to the previous step.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc11[24]
+\end_layout
+
+\end_inset
+
+(
+\emph on
+Equivalence declarations.
+\emph default
+) Several compiler languages,
+ notably FORTRAN,
+ provide a facility for overlapping the memory locations assigned to sequentially stored tables.
+ The programmer gives the compiler a set of relations of the form
+\begin_inset Formula $\mathtt{X[}j\mathtt{]}\equiv\mathtt{Y[}k\mathtt{]}$
+\end_inset
+
+,
+ which means that variable
+\begin_inset Formula $\mathtt{X[}j+s\mathtt{]}$
+\end_inset
+
+ is to be assigned to the same location as variable
+\begin_inset Formula $\mathtt{Y[}k+s\mathtt{]}$
+\end_inset
+
+ for all
+\begin_inset Formula $s$
+\end_inset
+
+.
+ Each variable is also given a range of allowable subscripts:
+
+\begin_inset Quotes eld
+\end_inset
+
+
+\family typewriter
+ARRAY X[
+\begin_inset Formula $l:u$
+\end_inset
+
+]
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+ means that space is to be set aside in memory for the table entries
+\family typewriter
+X[
+\begin_inset Formula $l$
+\end_inset
+
+]
+\family default
+,
+
+\family typewriter
+X[
+\begin_inset Formula $l+1$
+\end_inset
+
+]
+\family default
+,
+ ...,
+
+\family typewriter
+X[
+\begin_inset Formula $u$
+\end_inset
+
+]
+\family default
+.
+ For each equivalence class of variables,
+ the compiler reserves as small a block of consecutive memory locations as possible,
+ to contain all the table entries for the allowable subscript values of these variables.
+\end_layout
+
+\begin_layout Standard
+For example,
+ suppose we have
+\family typewriter
+ARRAY X[
+\begin_inset Formula $0:10$
+\end_inset
+
+]
+\family default
+,
+
+\family typewriter
+ARRAY Y[
+\begin_inset Formula $3:10$
+\end_inset
+
+]
+\family default
+,
+
+\family typewriter
+ARRAY A[
+\begin_inset Formula $1:1$
+\end_inset
+
+]
+\family default
+,
+ and
+\family typewriter
+ARRAY Z[
+\begin_inset Formula $-2:0$
+\end_inset
+
+]
+\family default
+,
+ plus the equivalences
+\begin_inset Formula $\mathtt{X[}7\mathtt{]}\equiv\mathtt{Y[}3\mathtt{]}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Z[}0\mathtt{]}\equiv\mathtt{A[}0\mathtt{]}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $\mathtt{Y[}1\mathtt{]}\equiv\mathtt{A[}8\mathtt{]}$
+\end_inset
+
+.
+ We must set aside 20 consecutive locations
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}[scale=0.55,circle dotted/.style={
+\end_layout
+
+\begin_layout Plain Layout
+
+ dash pattern=on 0 off .55cm,
+ line cap=round}]
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+small
+\backslash
+def
+\backslash
+sep{0.15}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+ab#1#2{++(1cm,
+\backslash
+sep) node[above]{$
+\backslash
+mathtt{#2}_{#1}$} ++(0,-
+\backslash
+sep)}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+be#1#2{++(1cm,-
+\backslash
+sep) node[below]{$
+\backslash
+mathtt{#2}_{#1}$} ++(0,
+\backslash
+sep)}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+abe#1#2#3#4{++(1cm,
+\backslash
+sep) node[above]{$
+\backslash
+mathtt{#2}_{#1}$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ ++(0,-2*
+\backslash
+sep) node[below]{$
+\backslash
+mathtt{#4}_{#3}$} ++(0,
+\backslash
+sep)}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[line width = 3,circle dotted] (0,0) -- (19cm,0);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (-1,0)
+\backslash
+be{-2}Z
+\backslash
+be{-1}Z
+\backslash
+be0Z
+\backslash
+be1A ++(1cm,0)
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+ab0X
+\backslash
+ab1X
+\backslash
+ab2X
+\backslash
+ab3X
+\backslash
+ab4X
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+ab5X
+\backslash
+ab6X
+\backslash
+abe7X3Y
+\backslash
+abe8X4Y
+\backslash
+abe9X5Y
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+abe{10}X6Y
+\backslash
+be7Y
+\backslash
+be8Y
+\backslash
+be9Y
+\backslash
+be{10}Y;
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+for these variables.
+ (The location following
+\begin_inset Formula $\mathtt{A[}1\mathtt{]}$
+\end_inset
+
+ is not an allowable subscript value for any of the arrays,
+ but it must be reserved anyway.)
+\end_layout
+
+\begin_layout Standard
+The object of this exercise is to modify Algorithm E so that it applies to the more general situation just described.
+ Assume that we are writing a compiler for such a language,
+ and the tables inside our compiler program itself have one node for each array,
+ containing the fields
+\family typewriter
+NAME
+\family default
+,
+
+\family typewriter
+PARENT
+\family default
+,
+
+\family typewriter
+DELTA
+\family default
+,
+
+\family typewriter
+LBD
+\family default
+,
+ and
+\family typewriter
+UBD
+\family default
+.
+ Assume that the compiler program has previously processed all the
+\family typewriter
+ARRAY
+\family default
+ declarations,
+ so that if
+\family typewriter
+ARRAY X[
+\begin_inset Formula $l:u$
+\end_inset
+
+]
+\family default
+ has appeared and if
+\family typewriter
+P
+\family default
+ points to the node for
+\family typewriter
+X
+\family default
+,
+ then
+\begin_inset Formula
+\begin{align*}
+\mathtt{NAME(P)} & =\text{``\texttt{X}''}, & \mathtt{PARENT(P)} & =\Lambda, & \mathtt{DELTA(P)} & =0,\\
+\mathtt{LBD(P)} & =l, & \mathtt{UBD(P)} & =u.
+\end{align*}
+
+\end_inset
+
+The problem is to design an algorithm that processes the equivalence declarations,
+ so that,
+ after this algorithm has been performed,
+\end_layout
+
+\begin_layout Quote
+\begin_inset Formula $\mathtt{PARENT(P)}=\Lambda$
+\end_inset
+
+ means that locations
+\begin_inset Formula $\mathtt{X[LBD(P)]},...,\mathtt{X[UBD(P)]}$
+\end_inset
+
+ are to be reserved in memory for this equivalence class;
+\end_layout
+
+\begin_layout Quote
+\begin_inset Formula $\mathtt{PARENT(P)}=\mathtt{Q}\neq\Lambda$
+\end_inset
+
+ means that location
+\begin_inset Formula $\mathtt{X[}k\mathtt{]}$
+\end_inset
+
+ equals location
+\begin_inset Formula $\mathtt{Y[}k+\mathtt{DELTA(P)]}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $\mathtt{NAME(Q)}=\text{``\texttt{Y}''}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{samepage}
+\end_layout
+
+\end_inset
+
+For example,
+ before the equivalences listed above we might have the nodes
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+vspace{2pt}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="5" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+P
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+NAME(P)
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+PARENT(P)
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+DELTA(P)
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+LBD(P)
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+UBD(P)
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\alpha$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+X
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+10
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\beta$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+Y
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+10
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\gamma$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+A
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\delta$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+Z
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\Lambda$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-2$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+vspace{4pt}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+noindent
+\end_layout
+
+\end_inset
+
+After the equivalences are processed,
+ the nodes might appear thus:
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+vspace{2pt}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{P}}][c]{\ensuremath{\alpha}}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{NAME(P)}}][c]{\texttt{X}}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{PARENT(P)}}][c]{\ensuremath{\Lambda}}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{DELTA(P)}}][c]{\ensuremath{*}}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{LBD(P)}}][c]{\ensuremath{-5}}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\text{\makebox[\widthof{\texttt{UBD(P)}}][c]{14}}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\beta$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+Y
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\alpha$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\gamma$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+A
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\delta$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\delta$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family typewriter
+Z
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $\alpha$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $-3$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Formula $*$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+noindent
+\end_layout
+
+\end_inset
+
+(
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $*$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ denotes irrelevant information.)
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{samepage}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Design an algorithm that makes this transformation.
+ Assume that inputs to your algorithm have the form
+\begin_inset Formula $(\mathtt{P},j,\mathtt{Q},k)$
+\end_inset
+
+,
+ denoting
+\begin_inset Formula $\mathtt{X[}j\mathtt{]}\equiv\mathtt{Y[}k\mathtt{]}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $\mathtt{NAME(P)}=\text{``X''}$
+\end_inset
+
+ and
+\begin_inset Formula $\mathtt{NAME(Q)}=\text{``Y''}$
+\end_inset
+
+.
+ Be sure to check whether the equivalences are contradictory;
+ for example,
+
+\begin_inset Formula $\mathtt{X[}1\mathtt{]}\equiv\mathtt{Y[}2\mathtt{]}$
+\end_inset
+
+ contradicts
+\begin_inset Formula $\mathtt{X[}2\mathtt{]}\equiv\mathtt{Y[}1\mathtt{]}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e23311a"
+
+\end_inset
+
+[Read input.] Read a line
+\begin_inset Formula $(\mathtt{P},j,\mathtt{Q},k)$
+\end_inset
+
+,
+ but if there are no more lines,
+ terminate the algorithm.
+\end_layout
+
+\begin_layout Enumerate
+[Find roots.] If
+\begin_inset Formula $\mathtt{PARENT(P)}\neq\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $j\gets j+\mathtt{DELTA(P)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{P}\gets\mathtt{PARENT(P)}$
+\end_inset
+
+,
+ and repeat this step.
+ If
+\begin_inset Formula $\mathtt{PARENT(Q)}\neq\Lambda$
+\end_inset
+
+,
+ set
+\begin_inset Formula $k\gets k+\mathtt{DELTA(Q)}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{Q}\gets\mathtt{PARENT(Q)}$
+\end_inset
+
+,
+ and repeat this step.
+\end_layout
+
+\begin_layout Enumerate
+[Merge trees.] If
+\begin_inset Formula $\mathtt{P}\neq\mathtt{Q}$
+\end_inset
+
+,
+ set
+\begin_inset Formula $\mathtt{PARENT(P)}\gets\mathtt{Q}$
+\end_inset
+
+
+\begin_inset Formula $\mathtt{DELTA(P)}\gets k-j$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{LBD(Q)}\gets\min\{\mathtt{LBD(Q)},\mathtt{LBD(P)}+\mathtt{DELTA(P)}\}$
+\end_inset
+
+,
+
+\begin_inset Formula $\mathtt{UBD(Q)}\gets\max\{\mathtt{UBD(Q)},\mathtt{UBD(P)}+\mathtt{DELTA(P)}\}$
+\end_inset
+
+.
+ Otherwise,
+ if
+\begin_inset Formula $j\neq k$
+\end_inset
+
+,
+ notify a contradiction and terminate the algorithm.
+ Finally go to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23311a"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc17[25]
+\end_layout
+
+\end_inset
+
+Algorithm F evaluates a
+\begin_inset Quotes eld
+\end_inset
+
+bottom-up
+\begin_inset Quotes erd
+\end_inset
+
+ locally defined function,
+ namely,
+ one that should be evaluated at the children of a node before it is evaluated at the node.
+ A
+\begin_inset Quotes eld
+\end_inset
+
+top-down
+\begin_inset Quotes erd
+\end_inset
+
+ locally defined function
+\begin_inset Formula $f$
+\end_inset
+
+ is one in which the value of
+\begin_inset Formula $f$
+\end_inset
+
+ at a node
+\begin_inset Formula $x$
+\end_inset
+
+ depends only on
+\begin_inset Formula $x$
+\end_inset
+
+ and the value of
+\begin_inset Formula $f$
+\end_inset
+
+ at the
+\emph on
+parent
+\emph default
+ of
+\begin_inset Formula $x$
+\end_inset
+
+.
+ Using an auxiliary stack,
+ design an algorithm analogous to Algorithm F that evaluates a
+\begin_inset Quotes eld
+\end_inset
+
+top-down
+\begin_inset Quotes erd
+\end_inset
+
+ function
+\begin_inset Formula $f$
+\end_inset
+
+ at each node of a tree.
+ (Like Algorithm F,
+ your algorithm should work efficiently on trees that have been stored in
+\emph on
+postorder
+\emph default
+ with degrees,
+ as in (9).)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+[Initialize.] Set the stack to the single element
+\begin_inset Formula $(\infty,\Lambda)$
+\end_inset
+
+,
+ and let
+\family typewriter
+P
+\family default
+ point to the
+\emph on
+last
+\emph default
+ ode of the forest in post-order.
+\end_layout
+
+\begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:e23317b"
+
+\end_inset
+
+[Evaluate
+\begin_inset Formula $f$
+\end_inset
+
+.] Let
+\begin_inset Formula $(d,v)$
+\end_inset
+
+ be the value at the top of the stack.
+ Evaluate
+\begin_inset Formula $f(\mathtt{NODE(P)},v)$
+\end_inset
+
+ and save the result as
+\begin_inset Formula $\mathtt{VALUE(P)}$
+\end_inset
+
+.
+ Then push
+\begin_inset Formula $(\mathtt{DEGREE(P)},\mathtt{VALUE(P)})$
+\end_inset
+
+ to the stack.
+\end_layout
+
+\begin_layout Enumerate
+[Update the stack.] Pop the element
+\begin_inset Formula $(p,v)$
+\end_inset
+
+ from the stack.
+ If
+\begin_inset Formula $p=0$
+\end_inset
+
+,
+ repeat this step.
+ Otherwise push
+\begin_inset Formula $(p-1,v)$
+\end_inset
+
+ into the stack.
+\end_layout
+
+\begin_layout Enumerate
+[Advance.] If
+\family typewriter
+P
+\family default
+ is the first node in postorder,
+ terminate the algorithm.
+ Otherwise set
+\family typewriter
+P
+\family default
+ to its predecessor in postorder and return to step
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:e23317b"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.1.lyx b/2.3.4.1.lyx
new file mode 100644
index 0000000..0eeec27
--- /dev/null
+++ b/2.3.4.1.lyx
@@ -0,0 +1,760 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[M20]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $G'$
+\end_inset
+
+ be a finite free tree in which arrows have been drawn on its edges
+\begin_inset Formula $e_{1},\dots,e_{n-1}$
+\end_inset
+
+;
+ let
+\begin_inset Formula $E_{1},\dots,E_{n-1}$
+\end_inset
+
+ be numbers satisfying Kirchhoff's law (1) in
+\begin_inset Formula $G'$
+\end_inset
+
+.
+ Show that
+\begin_inset Formula $E_{1}=\dots=E_{n-1}=0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove this by induction on
+\begin_inset Formula $n$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n=1$
+\end_inset
+
+ it is trivial.
+ For
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+ there always exists a node of degree 1 (in an oriented tree,
+ this would be a leaf).
+ Let
+\begin_inset Formula $e_{r}$
+\end_inset
+
+ be the only edge connected to that node,
+ clearly
+\begin_inset Formula $E_{r}=0$
+\end_inset
+
+,
+ so removing
+\begin_inset Formula $e_{r}$
+\end_inset
+
+ leaves us with an isolated node and a free tree of degree 0 which follows Kirchhoff's law and has
+\begin_inset Formula $n-1$
+\end_inset
+
+ nodes,
+ but then by the induction hypothesis all the other
+\begin_inset Formula $E_{k}$
+\end_inset
+
+ are also 0.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[M25]
+\end_layout
+
+\end_inset
+
+When applying Kirchhoff's first law to program flow charts,
+ we usually are interested only in the
+\emph on
+vertex flows
+\emph default
+ (the number of times each box of the flow chart is performed),
+ not the edge flows analyzed in the text.
+ For example,
+ in the graph of exercise 7,
+ the vertex flows are
+\begin_inset Formula $A=E_{2}+E_{4}$
+\end_inset
+
+,
+
+\begin_inset Formula $B=E_{5}$
+\end_inset
+
+,
+
+\begin_inset Formula $C=E_{3}+E_{7}+E_{8}$
+\end_inset
+
+,
+
+\begin_inset Formula $D=E_{6}+E_{9}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+If we group some vertices together,
+ treating them as one
+\begin_inset Quotes eld
+\end_inset
+
+supervertex,
+\begin_inset Quotes erd
+\end_inset
+
+ we can combine edge flows that correspond to the same vertex flow.
+ For example,
+ edges
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ and
+\begin_inset Formula $e_{4}$
+\end_inset
+
+ can be combined in the flow chart above if we also put
+\begin_inset Formula $B$
+\end_inset
+
+ with
+\begin_inset Formula $D$
+\end_inset
+
+:
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}[node distance=2cm]
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[circle,draw](Start){Start};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[rectangle,draw,right of=Start](A){$A$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[rectangle,draw,right of=A](BD){$B,D$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[rectangle,draw,right of=BD](C){$C$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[circle,draw,right of=C](Stop){Stop};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (Start) -- node[above]{$e_1$} (A);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (A) -- node[below]{$e_2+e_4$} (BD);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=2pt}] (BD)--node[above]{$e_5$}(C);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=-2pt}] (C)--node[below]{$e_7$}(BD);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (C) -- node[above]{$e_8$} (Stop);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (BD) to[bend right] node[below]{$e_9$} (Stop);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (BD) to[loop below] node[left]{$e_6$} (BD);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (C) to[bend right] node[above]{$e_3$} (A);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (Stop) to[bend right] node[above]{$e_0$} (Start);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+(Here
+\begin_inset Formula $e_{0}$
+\end_inset
+
+ has also been added from Stop to Start,
+ as in the text.) Continuing this procedure,
+ we can combine
+\begin_inset Formula $e_{3}+e_{7}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $(e_{3}+e_{7})+e_{8}$
+\end_inset
+
+,
+ then
+\begin_inset Formula $e_{6}+e_{9}$
+\end_inset
+
+,
+ until we obtain the
+\emph on
+reduced flow chart
+\emph default
+ having edges
+\begin_inset Formula $s=e_{1}$
+\end_inset
+
+,
+
+\begin_inset Formula $a=e_{2}+e_{4}$
+\end_inset
+
+,
+
+\begin_inset Formula $b=e_{5}$
+\end_inset
+
+,
+
+\begin_inset Formula $c=e_{3}+e_{7}+e_{8}$
+\end_inset
+
+,
+
+\begin_inset Formula $d=e_{6}+e_{9}$
+\end_inset
+
+,
+
+\begin_inset Formula $t=e_{0}$
+\end_inset
+
+,
+ precisely one edge for each vertex in the original flow chart:
+\begin_inset Formula $\text{}$
+\end_inset
+
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}[node distance=3cm]
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[circle,draw](S){Start};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[rectangle,draw,right of=S](M){$A,B,D,
+\backslash
+text{Stop}$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+node[rectangle,draw,right of=M](C){$C$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=2pt}] (S) -- node[above]{$s$} (M);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=-2pt}] (M) -- node[below]{$t$} (S);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=2pt}] (M) -- node[above]{$b$} (C);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->,transform canvas={yshift=-2pt}] (C) -- node[below]{$c$} (M);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (M) to[out=120,in=60,looseness=4] node[left]{$a$
+\backslash
+
+\backslash
+ } (M);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (M) to[out=300,in=240,looseness=4] node[right]{
+\backslash
+ $d$} (M);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+By construction,
+ Kirchhoff's law holds in this reduced flow chart.
+ The new edge flows are the vertex flows of the original;
+ hence the analysis in the text,
+ applied to the reduced flow chart,
+ shows how the original vertex flows depend on each other.
+\end_layout
+
+\begin_layout Standard
+Prove that this reduction process can be reversed,
+ in the sense that any set of flows
+\begin_inset Formula $\{a,b,\dots\}$
+\end_inset
+
+ satisfying Kirchhoff's law in the reduced flow chart can be
+\begin_inset Quotes eld
+\end_inset
+
+split up
+\begin_inset Quotes erd
+\end_inset
+
+ into a set of edge flows
+\begin_inset Formula $\{e_{0},e_{1},\dots\}$
+\end_inset
+
+ in the original flow chart.
+ These flows
+\begin_inset Formula $e_{j}$
+\end_inset
+
+ satisfy Kirchhoff's law and combine to yield the given flows
+\begin_inset Formula $\{a,b,\dots\}$
+\end_inset
+
+;
+ some of them might,
+ however,
+ be negative.
+ (Although the reduction procedure has been illustrated for only one particular flow chart,
+ your proof should be valid in general.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+(I had to look up the solution,
+ this one is difficult.)
+\end_layout
+
+\end_inset
+
+ We only have to show that there exists an assignment in the original flowchart that produces any given set of flows in the reduced flowchart.
+\end_layout
+
+\begin_layout Standard
+Since we get from one to the other by reductions,
+ we only have to prove that we can reverse reductions.
+ In these reductions,
+ there are two arrows
+\begin_inset Formula $e_{1}$
+\end_inset
+
+ from vertex or supervertex
+\begin_inset Formula $a$
+\end_inset
+
+ to
+\begin_inset Formula $b$
+\end_inset
+
+ and
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ from
+\begin_inset Formula $a$
+\end_inset
+
+ to
+\begin_inset Formula $c$
+\end_inset
+
+,
+ to get an edge
+\begin_inset Formula $f=e_{1}+e_{2}$
+\end_inset
+
+ from
+\begin_inset Formula $a$
+\end_inset
+
+ to
+\begin_inset Formula $b,c$
+\end_inset
+
+,
+ and reverting means recovering
+\begin_inset Formula $e_{1}$
+\end_inset
+
+ and
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ from
+\begin_inset Formula $f$
+\end_inset
+
+ and the other edges.
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $b=c$
+\end_inset
+
+,
+ we can just make up
+\begin_inset Formula $e_{1}$
+\end_inset
+
+ and set
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ to
+\begin_inset Formula $f-e_{1}$
+\end_inset
+
+.
+ If
+\begin_inset Formula $a=b\neq c$
+\end_inset
+
+,
+ then
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ must be such that Kirchhoff's law is preserved for
+\begin_inset Formula $c$
+\end_inset
+
+,
+ and we can just set
+\begin_inset Formula $e_{1}=f-e_{2}$
+\end_inset
+
+.
+ The situation
+\begin_inset Formula $a=c\neq b$
+\end_inset
+
+ is symmetrical.
+ Finally,
+ if the three nodes are distinct,
+ setting
+\begin_inset Formula $e_{1}$
+\end_inset
+
+ and
+\begin_inset Formula $e_{2}$
+\end_inset
+
+ such that they follow Kirchhoff's law for
+\begin_inset Formula $b$
+\end_inset
+
+ and
+\begin_inset Formula $c$
+\end_inset
+
+ makes
+\begin_inset Formula $e_{1}+e_{2}$
+\end_inset
+
+ follow Kirchhoff's law in
+\begin_inset Formula $b,c$
+\end_inset
+
+ in the reduced flowchart.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.2.lyx b/2.3.4.2.lyx
new file mode 100644
index 0000000..f1f1d4e
--- /dev/null
+++ b/2.3.4.2.lyx
@@ -0,0 +1,859 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc4[M20]
+\end_layout
+
+\end_inset
+
+The concept of
+\emph on
+topological sorting
+\emph default
+ can be defined for any finite directed graph
+\begin_inset Formula $G$
+\end_inset
+
+ as a linear arrangement of the vertices
+\begin_inset Formula $V_{1}V_{2}\dots V_{n}$
+\end_inset
+
+ such that
+\begin_inset Formula $\text{init}(e)$
+\end_inset
+
+ precedes
+\begin_inset Formula $\text{fin}(e)$
+\end_inset
+
+ in the ordering for all arcs
+\begin_inset Formula $e$
+\end_inset
+
+ of
+\begin_inset Formula $G$
+\end_inset
+
+.
+ (See Section 2.2.3,
+ Figs.
+ 6 and 7.) Not all finite directed graphs can be topologically sorted;
+ which ones can be?
+ (Use the terminology of this section to give the answer.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Only the ones with no directed cycles,
+ except possibly for cycles of length 1.
+ If
+\begin_inset Formula $G$
+\end_inset
+
+ has a cycle (of length 2 or more),
+ the nodes in the cycle cannot be topologically ordered;
+ otherwise the transitive closure of the edges of the graph is a partial ordering between the vertices,
+ so they can be topologically ordered.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc7[M22]
+\end_layout
+
+\end_inset
+
+True or false:
+ A directed graph satisfying properties (a) and (b) of the definition of oriented tree,
+ and having no oriented cycles,
+ is an oriented tree.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+True for finite graphs.
+ If there were cycles,
+ they would be oriented because no vertex is the initial vertex of two arcs,
+ and a graph with no cycles and exactly one edge less than the number of vertices is a free tree.
+ Then the way to orient the edges such that (a) and (b) follow is unique,
+ which can be proved by induction on the distance of a node to the root,
+ and we know that this way follows (c).
+\end_layout
+
+\begin_layout Standard
+False for infinite graphs.
+ A graph whose vertices are
+\begin_inset Formula $R,V_{1},V_{2},\dots,V_{n},\dots$
+\end_inset
+
+ and whose edges are
+\begin_inset Formula $V_{1}\to V_{2}\to V_{3}\to\dots$
+\end_inset
+
+ follows (a) and (b) and has no cycles but it doesn't follow (c).
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc13[M24]
+\end_layout
+
+\end_inset
+
+Prove that if
+\begin_inset Formula $R$
+\end_inset
+
+ is a root of a (possibly infinite) directed graph
+\begin_inset Formula $G$
+\end_inset
+
+,
+ then
+\begin_inset Formula $G$
+\end_inset
+
+ contains an oriented subtree with the same vertices as
+\begin_inset Formula $G$
+\end_inset
+
+ and with root
+\begin_inset Formula $R$
+\end_inset
+
+.
+ (As a consequence,
+ it is always possible to choose the free subtree in flow charts like Fig.
+ 32 of Section 2.3.4.1 so that it is actually an
+\emph on
+oriented
+\emph default
+ subtree;
+ this would be the case in that diagram if we had selected
+\begin_inset Formula $e''_{13}$
+\end_inset
+
+,
+
+\begin_inset Formula $e''_{19}$
+\end_inset
+
+,
+
+\begin_inset Formula $e_{20}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $e_{17}$
+\end_inset
+
+ instead of
+\begin_inset Formula $e'_{13}$
+\end_inset
+
+,
+
+\begin_inset Formula $e'_{19}$
+\end_inset
+
+,
+
+\begin_inset Formula $e_{23}$
+\end_inset
+
+,
+ and
+\begin_inset Formula $e_{15}$
+\end_inset
+
+.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We prove by induction that there is a family of oriented subtrees
+\begin_inset Formula $\{T_{n}\}_{n\geq0}$
+\end_inset
+
+ of
+\begin_inset Formula $G$
+\end_inset
+
+ with root
+\begin_inset Formula $R$
+\end_inset
+
+ such that
+\begin_inset Formula $T_{n}$
+\end_inset
+
+ contains exactly all the vertices
+\begin_inset Formula $V$
+\end_inset
+
+ in
+\begin_inset Formula $G$
+\end_inset
+
+ such that there is an oriented path from
+\begin_inset Formula $V$
+\end_inset
+
+ to
+\begin_inset Formula $R$
+\end_inset
+
+ of length at most
+\begin_inset Formula $n$
+\end_inset
+
+ and,
+ furthermore,
+
+\begin_inset Formula $T_{n-1}\subseteq T_{n}$
+\end_inset
+
+ for every
+\begin_inset Formula $n\geq1$
+\end_inset
+
+.
+ It is easy to check that the union of this family of trees is a tree with all the vertices in
+\begin_inset Formula $G$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+ we just take the trivial oriented tree,
+ which only contains
+\begin_inset Formula $R$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n\geq1$
+\end_inset
+
+,
+ and for every node
+\begin_inset Formula $V$
+\end_inset
+
+ such that the shortest oriented path from
+\begin_inset Formula $V$
+\end_inset
+
+ to
+\begin_inset Formula $R$
+\end_inset
+
+ has length
+\begin_inset Formula $n$
+\end_inset
+
+,
+ we choose one such path
+\begin_inset Formula $VV_{1}\cdots V_{n-1}R$
+\end_inset
+
+,
+ which we can do for all such vertices because of the axiom of choice.
+ Since
+\begin_inset Formula $V_{1}$
+\end_inset
+
+ is in
+\begin_inset Formula $T_{n-1}$
+\end_inset
+
+,
+ we just have to add
+\begin_inset Formula $V$
+\end_inset
+
+ and the arc
+\begin_inset Formula $(V,V_{1})$
+\end_inset
+
+ to
+\begin_inset Formula $T_{n-1}$
+\end_inset
+
+,
+ for all such
+\begin_inset Formula $V$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 16,
+ 24
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc16[M24]
+\end_layout
+
+\end_inset
+
+In a popular solitaire game called
+\begin_inset Quotes eld
+\end_inset
+
+clock,
+\begin_inset Quotes erd
+\end_inset
+
+ the 52 cards of an ordinary deck of playing cards are dealt face down into 13 piles of four each;
+ 12 piles are arranged in a circle like the 12 hours of a clock and the thirteenth pile goes in the center.
+ The solitaire game now proceeds by turning up the top card of the center pile,
+ and then if its face value is
+\begin_inset Formula $k$
+\end_inset
+
+,
+ by placing it next to the
+\begin_inset Formula $k$
+\end_inset
+
+th pile.
+ (The numbers
+\begin_inset Formula $1,2,\dots,13$
+\end_inset
+
+ are equivalent to
+\begin_inset Formula $\text{A},2,\dots,10,\text{J},\text{Q},\text{K}$
+\end_inset
+
+.) Play continues by turning up the top card of the
+\begin_inset Formula $k$
+\end_inset
+
+th pile and putting it next to
+\emph on
+its
+\emph default
+ pile,
+ etc.,
+ until we reach a point where we cannot continue since there are no more cards to turn up on the designated pile.
+ (The player has no choice in the game,
+ since the rules completely specify what to do.) The game is won if all cards are face up when the play terminates.
+\end_layout
+
+\begin_layout Standard
+Show that the game will be won if and only if the following directed graph is an oriented tree:
+ The vertices are
+\begin_inset Formula $V_{1},V_{2},\dots,V_{13}$
+\end_inset
+
+;
+ the arcs are
+\begin_inset Formula $e_{1},e_{2},\dots,e_{12}$
+\end_inset
+
+,
+ where
+\begin_inset Formula $e_{j}$
+\end_inset
+
+ goes from
+\begin_inset Formula $V_{j}$
+\end_inset
+
+ to
+\begin_inset Formula $V_{k}$
+\end_inset
+
+ if
+\begin_inset Formula $k$
+\end_inset
+
+ is the
+\emph on
+bottom
+\emph default
+ card in pile
+\begin_inset Formula $j$
+\end_inset
+
+ after the deal.
+\end_layout
+
+\begin_layout Standard
+(In particular,
+ if the bottom card of pile
+\begin_inset Formula $j$
+\end_inset
+
+ is a
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $j$
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+,
+ for
+\begin_inset Formula $j\neq13$
+\end_inset
+
+,
+ it is easy to see that the game is certainly lost,
+ since this card could never be turned up.
+ The result proved in this exercise gives a much faster way to play the game!)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+First we note that this graph already follows conditions (a) and (b) of the definition of an oriented tree,
+ so it will be a tree if an only if
+\begin_inset Formula $V_{13}$
+\end_inset
+
+ is a root,
+ if and only if there are no cycles (see Exercise 7).
+ We also note that,
+ since there are only 4 cards of each denomination,
+ and we only take a card from a pile when we find its denomination except from one from
+\begin_inset Formula $V_{13}$
+\end_inset
+
+ at the start of the game,
+ the only case where we cannot continue is after finding the last card with face value K.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Assume that the game is not an oriented tree,
+ then there is a cycle
+\begin_inset Formula $V_{k_{1}}\cdots V_{k_{m}}$
+\end_inset
+
+.
+ We can assume that the
+\begin_inset Formula $k_{1}$
+\end_inset
+
+th pile is the first whose bottom card we turn up.
+ Since clearly
+\begin_inset Formula $k_{1}\neq13$
+\end_inset
+
+,
+ this means that we had already turned up all cards with denomination
+\begin_inset Formula $k_{1}$
+\end_inset
+
+,
+ but we had not turned up
+\begin_inset Formula $k_{m}\#$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Assume we lost
+\begin_inset CommandInset href
+LatexCommand href
+name "the game"
+target "https://en.wikipedia.org/wiki/The_Game_(mind_game)"
+literal "false"
+
+\end_inset
+
+,
+ which means that we have turned up all the cards with face value 13 and that,
+ furthermore,
+ we have turned up as many cards from the
+\begin_inset Formula $k$
+\end_inset
+
+th pile as cards with face value
+\begin_inset Formula $k$
+\end_inset
+
+.
+ This means that,
+ if
+\begin_inset Formula
+\[
+U\coloneqq\{V_{j}\mid\text{the }j\text{th pile's bottom card is down}\},
+\]
+
+\end_inset
+
+then
+\begin_inset Formula $V_{13}\notin U$
+\end_inset
+
+ and each vertex of
+\begin_inset Formula $U$
+\end_inset
+
+ has one outgoing edge that points to another vertex in
+\begin_inset Formula $U$
+\end_inset
+
+,
+ as we have already turned up all the cards with face value
+\begin_inset Formula $k$
+\end_inset
+
+ for
+\begin_inset Formula $V_{k}\notin U$
+\end_inset
+
+.
+ Thus
+\begin_inset Formula $V_{13}$
+\end_inset
+
+ is not a root.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc24[M20]
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $G$
+\end_inset
+
+ be a connected digraph with arcs
+\begin_inset Formula $e_{0},e_{1},\dots,e_{m}$
+\end_inset
+
+.
+ Let
+\begin_inset Formula $E_{0},E_{1},\dots,E_{m}$
+\end_inset
+
+ be a set of positive integers that satisfy Kirchhoff's law for
+\begin_inset Formula $G$
+\end_inset
+
+;
+ that is,
+ for each vertex
+\begin_inset Formula $V$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+\sum_{\text{init}(e_{j})=V}E_{j}=\sum_{\text{fin}(e_{j})=V}E_{j}.
+\]
+
+\end_inset
+
+Assume further that
+\begin_inset Formula $E_{0}=1$
+\end_inset
+
+.
+ Prove that there is an oriented walk in
+\begin_inset Formula $G$
+\end_inset
+
+ from
+\begin_inset Formula $\text{init}(e_{0})$
+\end_inset
+
+ such that edge
+\begin_inset Formula $e_{j}$
+\end_inset
+
+ appears exactly
+\begin_inset Formula $E_{j}$
+\end_inset
+
+ times,
+ for
+\begin_inset Formula $1\leq j\leq m$
+\end_inset
+
+,
+ while edge
+\begin_inset Formula $e_{0}$
+\end_inset
+
+ does not appear.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We apply Theorem G to the graph whose vertices are those of
+\begin_inset Formula $G$
+\end_inset
+
+ and whose edges are the
+\begin_inset Formula $e_{j}$
+\end_inset
+
+ repeated
+\begin_inset Formula $E_{j}$
+\end_inset
+
+ times.
+ This is valid,
+ since we could as well place an intermediate vertex among each edge to avoid repeating edges,
+ and it would give us an Eulerian cycle in that graph that goes through
+\begin_inset Formula $e_{0}$
+\end_inset
+
+ once.
+ Coalescing the repeated edges into one gives us back graph
+\begin_inset Formula $G$
+\end_inset
+
+ and a cycle though
+\begin_inset Formula $G$
+\end_inset
+
+ that goes though edge
+\begin_inset Formula $e_{j}$
+\end_inset
+
+ exactly
+\begin_inset Formula $E_{j}$
+\end_inset
+
+ times,
+ and we just have to remove the only appearance of
+\begin_inset Formula $e_{0}$
+\end_inset
+
+.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.3.lyx b/2.3.4.3.lyx
new file mode 100644
index 0000000..44b134e
--- /dev/null
+++ b/2.3.4.3.lyx
@@ -0,0 +1,508 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 1,
+ 3,
+ 6 (2pp.,
+ 0:46)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc1[M10]
+\end_layout
+
+\end_inset
+
+The text refers to a set
+\begin_inset Formula $S$
+\end_inset
+
+ containing finite sequences of positive integers,
+ and states that this set is
+\begin_inset Quotes eld
+\end_inset
+
+essentially an oriented tree.
+\begin_inset Quotes erd
+\end_inset
+
+ What is the root of this oriented tree,
+ and what are the arcs?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+The vertices are the elements of
+\begin_inset Formula $S$
+\end_inset
+
+,
+ the root is
+\begin_inset Formula $\emptyset$
+\end_inset
+
+,
+ and the arcs go from
+\begin_inset Formula $(x_{1},\dots,x_{n})$
+\end_inset
+
+ to
+\begin_inset Formula $(x_{1},\dots,x_{n-1})$
+\end_inset
+
+,
+ for every
+\begin_inset Formula $(x_{1},\dots,x_{n})\in S\setminus\{\emptyset\}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc3[M23]
+\end_layout
+
+\end_inset
+
+If it is possible to tile the upper right quadrant of the plane when given an
+\emph on
+infinite
+\emph default
+ set of tetrad types,
+ is it always possible to tile the whole plane?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+No.
+ For example,
+ our tiles might be of the form
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0) -- (2,2)
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,2) -- (2,0)
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0.5,1) node{$n$} (1,0.5) node{$n$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (1.5,1) node{$n+1$} (1,1.5) node{$n+1$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+for
+\begin_inset Formula $n\in\mathbb{N}$
+\end_inset
+
+.
+ Then in the
+\begin_inset Formula $(x,y)$
+\end_inset
+
+ square we might place the tile with
+\begin_inset Formula $n=\max\{x,y\}$
+\end_inset
+
+ and this would tile the upper right quadrant,
+ but there's obviously no way to tile the whole plane.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[M23]
+\end_layout
+
+\end_inset
+
+(Otto Schreier.) In a famous paper,
+ B.
+ L.
+ van der Waerden proved the following theorem:
+\end_layout
+
+\begin_layout Quote
+
+\shape slanted
+If
+\begin_inset Formula $k$
+\end_inset
+
+ and
+\begin_inset Formula $m$
+\end_inset
+
+ are positive integers,
+ and if we have
+\begin_inset Formula $k$
+\end_inset
+
+ sets
+\begin_inset Formula $S_{1},\dots,S_{k}$
+\end_inset
+
+ of positive integers with every positive integer included in at least one of these sets,
+ then at least of the sets
+\begin_inset Formula $S_{j}$
+\end_inset
+
+ contains an arithmetic progression of length
+\begin_inset Formula $m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+(The latter statement means there exist integers
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $\delta>0$
+\end_inset
+
+ such that
+\begin_inset Formula $a+\delta$
+\end_inset
+
+,
+
+\begin_inset Formula $a+2\delta$
+\end_inset
+
+,
+ ...,
+
+\begin_inset Formula $a+m\delta$
+\end_inset
+
+ are all in
+\begin_inset Formula $S_{j}$
+\end_inset
+
+.) If possible,
+ use this result and the infinity lemma to prove the following stronger statement:
+\end_layout
+
+\begin_layout Quote
+
+\shape slanted
+If
+\begin_inset Formula $k$
+\end_inset
+
+ and
+\begin_inset Formula $m$
+\end_inset
+
+ are positive integers,
+ there is a number
+\begin_inset Formula $N$
+\end_inset
+
+ such that if we have
+\begin_inset Formula $k$
+\end_inset
+
+ sets
+\begin_inset Formula $S_{1},\dots,S_{k}$
+\end_inset
+
+ of integers with every integer between 1 and
+\begin_inset Formula $N$
+\end_inset
+
+ included in at least one of these sets,
+ then at least one of the sets
+\begin_inset Formula $S_{j}$
+\end_inset
+
+ contains an arithmetic progression of length
+\begin_inset Formula $m$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It is enough to prove it when the set that contains every integer between 1 and
+\begin_inset Formula $N$
+\end_inset
+
+ is
+\begin_inset Formula $S_{1}$
+\end_inset
+
+.
+ We define a tree whose vertices are the tuples
+\begin_inset Formula $(S_{1},\dots,S_{k})$
+\end_inset
+
+ of finite sets of integers such that,
+ if
+\begin_inset Formula $n=\max\bigcup_{i=1}^{k}S_{i}$
+\end_inset
+
+,
+ every positive integer up to
+\begin_inset Formula $n$
+\end_inset
+
+ is in one of the sets,
+ and such that no set contains an arithmetic progression of length
+\begin_inset Formula $m$
+\end_inset
+
+.
+ The edges go from one such tuple to
+\begin_inset Formula $(S_{1}\setminus\{n\},\dots,S_{k}\setminus\{n\})$
+\end_inset
+
+,
+ so the root is
+\begin_inset Formula $(\emptyset,\dots,\emptyset)$
+\end_inset
+
+ and
+\begin_inset Formula $n$
+\end_inset
+
+ is the height of the node in the tree.
+\end_layout
+
+\begin_layout Standard
+Since each vertex contains a finite number of children (
+\begin_inset Formula $2^{k}-1$
+\end_inset
+
+,
+ corresponding to the ways of adding the next number to one or more of the sets),
+ it follows that if this tree were infinite,
+ there would be an infinite path.
+ By van der Waerden theorem,
+ the component-wise union of this path would give us a tuple
+\begin_inset Formula $(S_{1},\dots,S_{k})$
+\end_inset
+
+ such that some
+\begin_inset Formula $S_{j}$
+\end_inset
+
+ contains an arithmetic progression of length
+\begin_inset Formula $m$
+\end_inset
+
+,
+ so by construction one of the nodes in the path would follow this condition.
+\begin_inset Formula $\#$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Thus the tree is finite and we just need to take
+\begin_inset Formula $N$
+\end_inset
+
+ as one plus the depth of the tree.
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.4.lyx b/2.3.4.4.lyx
new file mode 100644
index 0000000..4f62d33
--- /dev/null
+++ b/2.3.4.4.lyx
@@ -0,0 +1,796 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 5,
+ 10,
+ 14,
+ 21 (3pp.,
+ 1:08)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc5[M25]
+\end_layout
+
+\end_inset
+
+(A.
+ Cayley.) Let
+\begin_inset Formula $c_{n}$
+\end_inset
+
+ be the number of (unlabeled) oriented trees having
+\begin_inset Formula $n$
+\end_inset
+
+ leaves (namely,
+ vertices with in-degree zero) and having at least two subtrees at every other vertex.
+ Thus
+\begin_inset Formula $c_{3}=2$
+\end_inset
+
+,
+ by virtue of the two trees
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+def
+\backslash
+dot#1{node(#1){
+\backslash
+textbullet}}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (0,1)
+\backslash
+dot R (-.5,0)
+\backslash
+dot A (0,0)
+\backslash
+dot B (.5,0)
+\backslash
+dot C
+\end_layout
+
+\begin_layout Plain Layout
+
+ (0,-1) node{};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (A) -> (R);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (B) -> (R);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (C) -> (R);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+hfil
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (0,1)
+\backslash
+dot R (-.5,0)
+\backslash
+dot A (.5,0)
+\backslash
+dot B
+\end_layout
+
+\begin_layout Plain Layout
+
+ (-1,-1)
+\backslash
+dot C (0,-1)
+\backslash
+dot D;
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (C) -> (A);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (D) -> (A);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (B) -> (R);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw[->] (A) -> (R);
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+Find a formula analogous to (3) for the generating function
+\begin_inset Formula
+\[
+C(z)=\sum_{n}c_{n}z^{n}.
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+Every tree has at least one leaf,
+ so
+\begin_inset Formula $c_{0}=0$
+\end_inset
+
+.
+ This includes subtrees,
+ so
+\begin_inset Formula $c_{1}=1$
+\end_inset
+
+ as,
+ if the root weren't also a leaf,
+ it would have at least two children and therefore two trees.
+ For
+\begin_inset Formula $n>1$
+\end_inset
+
+,
+ the root has a tree and various subtrees.
+ Let
+\begin_inset Formula $j_{k}$
+\end_inset
+
+ be the number of subtrees with
+\begin_inset Formula $k$
+\end_inset
+
+ leaves,
+
+\begin_inset Formula $1\leq k<n$
+\end_inset
+
+,
+ for those subtrees we may choose up to
+\begin_inset Formula
+\[
+\binom{c_{k}+j_{k}-1}{j_{k}}
+\]
+
+\end_inset
+
+possibilities,
+ since these are combinations with repetition (see exercise 1.2.6–60),
+ so
+\begin_inset Formula
+\[
+c_{n}=\sum_{\begin{subarray}{c}
+j_{1},\dots,j_{n-1}\geq0\\
+j_{1}+2j_{2}+\dots+(n-1)j_{n-1}=n
+\end{subarray}}\binom{c_{1}+j_{1}-1}{j_{1}}\cdots\binom{c_{n-1}+j_{n-1}-1}{j_{n-1}}.
+\]
+
+\end_inset
+
+Note that this is like (2) except that we have
+\begin_inset Formula $n$
+\end_inset
+
+ under the sum instead of
+\begin_inset Formula $n-1$
+\end_inset
+
+.
+ Thus,
+ using the same identity as in the derivation of (3),
+\begin_inset Formula
+\begin{align*}
+C(z) & =c_{0}+c_{1}z+\sum_{n\geq2}\sum_{\begin{subarray}{c}
+j_{1},\dots,j_{n-1}\geq0\\
+j_{1}+2j_{2}+\dots+(n-1)j_{n-1}=n
+\end{subarray}}\prod_{k=1}^{n-1}\binom{c_{k}+j_{k}-1}{j_{k}}z^{kj_{k}}\\
+ & =z+\sum_{(j_{n})_{n}\in\mathbb{N}^{(\mathbb{N}^{*})}}\prod_{n\geq1}\binom{c_{n}+j_{n}-1}{j_{n}}z^{nj_{n}}-\sum_{n\geq1}c_{n}z^{n}-1\\
+ & =\prod_{n\geq1}\sum_{j\geq1}\binom{c_{n}+j-1}{j}z^{nj_{n}}-C(z)+z-1\\
+ & =\frac{1}{(1-z)^{c_{1}}(1-z^{2})^{c_{2}}\cdots(1-z^{n})^{c_{n}}\cdots}-C(z)+z-1,
+\end{align*}
+
+\end_inset
+
+where
+\begin_inset Formula $\mathbb{N}^{(\mathbb{N}^{*})}$
+\end_inset
+
+ is the set of sequences of natural numbers starting at
+\begin_inset Formula $j_{1}$
+\end_inset
+
+ and with a finite amount of nonzero coefficients;
+ the subtracted term
+\begin_inset Formula $\sum_{n\geq1}c_{n}z^{n}$
+\end_inset
+
+ is there to cancel the terms which correspond to nodes having just one child,
+ and likewise for
+\begin_inset Formula $-1$
+\end_inset
+
+ for the term with all zeroes.
+\end_layout
+
+\begin_layout Standard
+Thus,
+\begin_inset Formula
+\[
+C(z)=\frac{1}{2}\left(\prod_{n\geq1}\frac{1}{(1-z^{n})^{c_{n}}}+z-1\right).
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc10[M22]
+\end_layout
+
+\end_inset
+
+Prove that a free tree with
+\begin_inset Formula $n$
+\end_inset
+
+ vertices and two centroids consists of two free trees with
+\begin_inset Formula $n/2$
+\end_inset
+
+ vertices,
+ joined by an edge.
+ Conversely,
+ if two free trees with
+\begin_inset Formula $m$
+\end_inset
+
+ vertices are joined by an edge,
+ we obtain a free tree with
+\begin_inset Formula $2m$
+\end_inset
+
+ vertices and two centroids.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\implies]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ be the two centroids,
+ with weight
+\begin_inset Formula $m$
+\end_inset
+
+.
+ If
+\begin_inset Formula $u$
+\end_inset
+
+ had weight
+\begin_inset Formula $m$
+\end_inset
+
+ from an edge that wasn't the one that leads to
+\begin_inset Formula $v$
+\end_inset
+
+,
+ then
+\begin_inset Formula $v$
+\end_inset
+
+ would have weight at least
+\begin_inset Formula $m+1$
+\end_inset
+
+,
+ owing to the
+\begin_inset Formula $m$
+\end_inset
+
+ nodes that stem from that edge in
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $u$
+\end_inset
+
+ itself.
+\begin_inset Formula $\#$
+\end_inset
+
+ By a similar argument,
+ if there were an intermediate node
+\begin_inset Formula $w\neq u,v$
+\end_inset
+
+ in the path connecting
+\begin_inset Formula $u$
+\end_inset
+
+ with
+\begin_inset Formula $v$
+\end_inset
+
+,
+ its weight must necessarily be at most
+\begin_inset Formula $m-1\#$
+\end_inset
+
+.
+ Therefore
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ are the only centroids,
+ they are connected with an edge and the subtrees that result from removing that edge have
+\begin_inset Formula $m$
+\end_inset
+
+ nodes each.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Argument item:1
+status open
+
+\begin_layout Plain Layout
+\begin_inset Formula $\impliedby]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Let
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+ be the two nodes that are newly connected,
+ then
+\begin_inset Formula $u$
+\end_inset
+
+ has weight
+\begin_inset Formula $m$
+\end_inset
+
+ because of its connection with
+\begin_inset Formula $v$
+\end_inset
+
+,
+
+\begin_inset Formula $v$
+\end_inset
+
+ has weight
+\begin_inset Formula $m$
+\end_inset
+
+ because of its connection with
+\begin_inset Formula $u$
+\end_inset
+
+,
+ and any other node has weight at least
+\begin_inset Formula $m+1$
+\end_inset
+
+ because of their connection to
+\begin_inset Formula $u$
+\end_inset
+
+ and
+\begin_inset Formula $v$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc14[10]
+\end_layout
+
+\end_inset
+
+True or false:
+ The last entry,
+
+\begin_inset Formula $f(V_{n-1})$
+\end_inset
+
+,
+ in the canonical representation of an oriented tree is always the root of that tree.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+True.
+ After each removal step,
+ we still have a tree with the same root,
+ and by the end the tree has no edges and therefore it only has one node,
+ which is the root.
+ Just before that,
+ it only has one edge,
+ which must connect a direct child of the root to the root.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc21[M20]
+\end_layout
+
+\end_inset
+
+Enumerate the number of labeled oriented trees in which each vertex has in-degree zero or two.
+ (See exercise 20 and exercise 2.3–20.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+These are precisely the 0-2-trees in exercise 2.3–20.
+ We know 0-2-trees always have an odd number of nodes.
+ Let
+\begin_inset Formula $b_{n}$
+\end_inset
+
+ be the number of such trees with
+\begin_inset Formula $2n+1$
+\end_inset
+
+ nodes,
+ then
+\begin_inset Formula $b_{0}=1$
+\end_inset
+
+ and,
+ for
+\begin_inset Formula $n>0$
+\end_inset
+
+,
+\begin_inset Formula
+\[
+b_{n}=\sum_{m=0}^{n-1}b_{m}b_{n-m-1},
+\]
+
+\end_inset
+
+as the root would have
+\begin_inset Formula $2m+1$
+\end_inset
+
+ nodes in the left side and
+\begin_inset Formula $2(n-m-1)+1=2n-2m-1$
+\end_inset
+
+ nodes in the right side.
+ Then,
+\begin_inset Formula
+\[
+B(z)\coloneqq\sum_{n\geq0}b_{n}z^{n}=1+\sum_{n\geq1}\sum_{m=0}^{n-1}b_{m}b_{n-m-1}z^{n}=1+z\sum_{m,k\geq0}b_{m}b_{k}z^{m+k}=1+zB(z)^{2},
+\]
+
+\end_inset
+
+so
+\begin_inset Formula $zB(z)^{2}-B(z)+1=0$
+\end_inset
+
+ and
+\begin_inset Formula $B(z)=\frac{1-\sqrt{1-4z}}{2z}$
+\end_inset
+
+,
+ where we take the negative sign as it is the one where the solution converges at
+\begin_inset Formula $z=0$
+\end_inset
+
+.
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.5.lyx b/2.3.4.5.lyx
new file mode 100644
index 0000000..e9a694e
--- /dev/null
+++ b/2.3.4.5.lyx
@@ -0,0 +1,111 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 3,
+ 4,
+ 12 (2pp.,
+ 1:14)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.4.6.lyx b/2.3.4.6.lyx
new file mode 100644
index 0000000..2f0c667
--- /dev/null
+++ b/2.3.4.6.lyx
@@ -0,0 +1,109 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 1 (1p.,
+ 0:15)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.5.lyx b/2.3.5.lyx
new file mode 100644
index 0000000..d1dccb9
--- /dev/null
+++ b/2.3.5.lyx
@@ -0,0 +1,110 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+TODO 1,
+ 6 (1p.,
+ 0:15)
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/2.3.lyx b/2.3.lyx
new file mode 100644
index 0000000..a1ad67d
--- /dev/null
+++ b/2.3.lyx
@@ -0,0 +1,884 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc4[01]
+\end_layout
+
+\end_inset
+
+True or false:
+ In a conventional tree diagram (root at the top),
+ if node
+\begin_inset Formula $X$
+\end_inset
+
+ has a
+\emph on
+higher
+\emph default
+ level number than node
+\begin_inset Formula $Y$
+\end_inset
+
+,
+ then node
+\begin_inset Formula $X$
+\end_inset
+
+ appears
+\emph on
+lower
+\emph default
+ in the diagram than node
+\begin_inset Formula $Y$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+True.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc5[02]
+\end_layout
+
+\end_inset
+
+If node
+\begin_inset Formula $A$
+\end_inset
+
+ has three siblings and
+\begin_inset Formula $B$
+\end_inset
+
+ is the parent of
+\begin_inset Formula $A$
+\end_inset
+
+,
+ what is the degree of
+\begin_inset Formula $B$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+4.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc6[21]
+\end_layout
+
+\end_inset
+
+Define the statement
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Formula $X$
+\end_inset
+
+ is an
+\begin_inset Formula $m$
+\end_inset
+
+th cousin of
+\begin_inset Formula $Y$
+\end_inset
+
+,
+
+\begin_inset Formula $n$
+\end_inset
+
+ times removed
+\begin_inset Quotes erd
+\end_inset
+
+ as a meaningful relation between nodes
+\begin_inset Formula $X$
+\end_inset
+
+ and
+\begin_inset Formula $Y$
+\end_inset
+
+ of a tree,
+ by analogy with family trees,
+ if
+\begin_inset Formula $m>0$
+\end_inset
+
+ and
+\begin_inset Formula $n\geq0$
+\end_inset
+
+.
+ (See a dictionary for the meaning of these terms in regard to family trees.)
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+It means that there exists a node
+\begin_inset Formula $X'$
+\end_inset
+
+ such that either
+\begin_inset Formula $X$
+\end_inset
+
+ is the
+\begin_inset Formula $n$
+\end_inset
+
+th ancestor of
+\begin_inset Formula $X'$
+\end_inset
+
+ or vice versa (that is,
+ the ancestor
+\begin_inset Formula $n$
+\end_inset
+
+ levels below,
+ where for
+\begin_inset Formula $n=0$
+\end_inset
+
+ we would take
+\begin_inset Formula $X'=X$
+\end_inset
+
+),
+
+\begin_inset Formula $X'$
+\end_inset
+
+ and
+\begin_inset Formula $Y$
+\end_inset
+
+ are at the same level,
+ the
+\begin_inset Formula $(m+1)$
+\end_inset
+
+th ancestor of
+\begin_inset Formula $X'$
+\end_inset
+
+ and
+\begin_inset Formula $Y$
+\end_inset
+
+ is the same,
+ and the
+\begin_inset Formula $m$
+\end_inset
+
+th ancestor isn't.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc8[03]
+\end_layout
+
+\end_inset
+
+What binary tree is not a tree?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+By the definitions in this book,
+ the empty binary tree.
+ Actually binary trees and trees are very separate concepts and therefore none is.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc9[00]
+\end_layout
+
+\end_inset
+
+In the two binary trees of (1),
+ which node is the root (
+\begin_inset Formula $B$
+\end_inset
+
+ or
+\begin_inset Formula $A$
+\end_inset
+
+)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+By the current conventions,
+
+\begin_inset Formula $A$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc13[10]
+\end_layout
+
+\end_inset
+
+Suppose that node
+\begin_inset Formula $X$
+\end_inset
+
+ is numbered
+\begin_inset Formula $a_{1}.a_{2}.\cdots.a_{k}$
+\end_inset
+
+ in the Dewey decimal system;
+ what are the Dewey numbers of the nodes in the path from
+\begin_inset Formula $X$
+\end_inset
+
+ to the root (see exercise 3)?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+They would be
+\begin_inset Formula $a_{1}.a_{2}.\cdots.a_{k};a_{1}.a_{2}.\cdots.a_{k-1};\dots;a_{1}.a_{2};a_{1}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc15[20]
+\end_layout
+
+\end_inset
+
+Invent a notation for the nodes of binary trees,
+ analogous to the Dewey decimal notation for nodes of trees.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We could call the root
+\begin_inset Formula $\%$
+\end_inset
+
+ and,
+ for a given nonempty node called
+\begin_inset Formula $\lambda$
+\end_inset
+
+ (a string),
+ its left child could be called
+\begin_inset Formula $\lambda L$
+\end_inset
+
+ and its right child
+\begin_inset Formula $\lambda R$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc17[01]
+\end_layout
+
+\end_inset
+
+If
+\begin_inset Formula $Z$
+\end_inset
+
+ stands for Fig.
+ 19 regarded as a forest,
+ what node is
+\begin_inset Formula $\text{parent}(Z[1,2,2])$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $\text{parent}(Z[1,2,2])=\text{parent}(\text{children of node }1.2.2)=E$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+exerc18[08]
+\end_layout
+
+\end_inset
+
+In List (3),
+ what is
+\begin_inset Formula $L[5,1,1]$
+\end_inset
+
+?
+ What is
+\begin_inset Formula $L[3,1]$
+\end_inset
+
+?
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+
+\begin_inset Formula $L[5,1,1]=(2)$
+\end_inset
+
+,
+
+\begin_inset Formula $L[3,1]$
+\end_inset
+
+ doesn't exist.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc20[M21]
+\end_layout
+
+\end_inset
+
+Define a
+\emph on
+0-2-tree
+\emph default
+ as a tree in which each node has exactly zero or two children.
+ (Formally,
+ a 0-2-tree consists of a single node,
+ called its root,
+ plus 0 or 2 disjoint 0-2-trees.) Show that every 0-2-tree has an odd number of nodes;
+ and give a one-to-one correspondence between binary trees with
+\begin_inset Formula $n$
+\end_inset
+
+ nodes and (ordered) 0-2-trees with
+\begin_inset Formula $2n+1$
+\end_inset
+
+ nodes.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+We can prove that 0-2-trees have an odd number of nodes by induction on the depth of the tree:
+ for depth 0,
+ we just have one node with no children,
+ and for depth greater than 0,
+ we have the root and two children whose subtrees have each an odd number of nodes,
+ so the main tree also has an odd number of nodes.
+\end_layout
+
+\begin_layout Standard
+For the bijection,
+ an empty binary tree corresponds to a node with 0 children,
+ and any other binary tree corresponds to a node whose children are the left and right nodes.
+ This is clearly bijective,
+ and we can prove that the bijection sends binary trees with
+\begin_inset Formula $n$
+\end_inset
+
+ nodes to ordered 0-2-trees with
+\begin_inset Formula $2n+1$
+\end_inset
+
+ nodes by induction on
+\begin_inset Formula $n$
+\end_inset
+
+.
+ For
+\begin_inset Formula $n=0$
+\end_inset
+
+,
+ this is obvious;
+ for
+\begin_inset Formula $n>0$
+\end_inset
+
+,
+ let
+\begin_inset Formula $m$
+\end_inset
+
+ be the number of nodes in the left subtree,
+ clearly
+\begin_inset Formula $0\leq m<n$
+\end_inset
+
+ and the right subtree has
+\begin_inset Formula $n-m-1$
+\end_inset
+
+ nodes,
+
+\begin_inset Formula $0<n-m-1\leq n$
+\end_inset
+
+,
+ so by the induction hypothesis on the subtrees the corresponding 0-2-tree has
+\begin_inset Formula $1+(2m+1)+(2(n-m-1)+1)=1+2m+1+2n-2m-2+1=2n+1$
+\end_inset
+
+ nodes.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+rexerc22[21]
+\end_layout
+
+\end_inset
+
+Standard European paper sizes A0,
+ A1,
+ A2,
+ ...,
+
+\begin_inset Formula $\text{A}n$
+\end_inset
+
+,
+ ...
+ are rectangles whose sides are in the ratio
+\begin_inset Formula $\sqrt{2}$
+\end_inset
+
+ to 1 and whose areas are
+\begin_inset Formula $2^{-n}$
+\end_inset
+
+ square meters.
+ Therefore if we cut a sheet of
+\begin_inset Formula $\text{A}n$
+\end_inset
+
+ paper in half,
+ we get two sheets of
+\begin_inset Formula $\text{A}(n+1)$
+\end_inset
+
+ paper.
+ Use this principle to design a graphic representation of binary trees,
+ and illustrate your idea by drawing the representation of 2.3.1–(1) below.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+answer
+\end_layout
+
+\end_inset
+
+One idea would be to represent an empty binary tree as nothing and a nonempty binary tree as dividing the sheet in two by a line parallel to the short side,
+ interrupted by the label of the root node,
+ and then draw the left and right subtrees in the left/top and right/bottom sides of the paper.
+ In fact,
+ one might not even need to draw the whole line,
+ drawing only the line from the label of the parent node (or from the top of the sheet for the root) to the own label is enough and would probably be clearer.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{center}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+begin{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (0,0) -- (0,5.656854) -- (8,5.656854) -- (8,0) -- cycle;
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+draw (4,5.656854) -- (4,2.828427) node(A)[fill=white]{$A$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (A) -- (2,2.828427) node(B)[fill=white]{$B$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (B) -- (2,4.2426405) node[fill=white]{$D$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (B) -- (6,2.828427) node(C)[fill=white]{$C$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (C) -- (6,4.2426405) node(E)[fill=white]{$E$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (E) -- (5,4.2426405) node[fill=white]{$G$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (C) -- (6,1.4142135) node(F)[fill=white]{$F$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (F) -- (5,1.4142135) node[fill=white]{$H$}
+\end_layout
+
+\begin_layout Plain Layout
+
+ (F) -- (7,1.4142135) node[fill=white]{$J$};
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{tikzpicture}
+\end_layout
+
+\begin_layout Plain Layout
+
+
+\backslash
+end{center}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/defs.tex b/defs.tex
new file mode 100644
index 0000000..626fd3e
--- /dev/null
+++ b/defs.tex
@@ -0,0 +1,86 @@
+% Documentation:
+% \exerc{n} -- Begin exercise number "n".
+% \rexerc{n} -- Begin recommended exercise number "n".
+% \answer -- Answer to the exercise (currently just disable indentation).
+% Usually this would be like: \(r)exerc{(n)} (question) \par\answer (answer).
+%
+% \soffsets -- Place before a table to avoid horizontal margins on cells.
+% \eoffsets -- Place after.
+% \offset{a}{b} -- An offset indication.
+% Usually, there's one row for the offset indication, with 3% of page width per
+% bit. Then 32 bits per row. This is usually used for illustrating a binary
+% format.
+%
+% \mixbox{...} -- A box for MIX 5-byte (plus sign) registers.
+% \mixsmbox{...} -- A box for MIX 2-byte (plus sign) registers.
+% \byte{n} -- Byte with contents "n".
+% \twobytes{n} -- Two bytes.
+% \threebytes{n} -- Three bytes.
+% \fourbytes{n} -- Four bytes.
+% \fivebytes{n} -- Five bytes.
+% \sixbytes{n} -- Six bytes.
+% The last six commands should only be used inside \mixbox or \mixsmbox. These
+% two commands should have the appropiate number of bytes including sign (six or
+% three, respectively).
+% Note: For tables, don't use \mixbox or \mixsmbox. Instead, put the table
+% between \soffsets and \eoffsets, add ~ when some separation is needed and
+% make sure the cells containing the bytes (one cell per box) has borders.
+\usepackage{tikz}
+% TODO Maybe tikzpicture would be a better way to implement mixboxes
+
+\font\manual=manfnt
+\outer\def\exerc#1[#2]{\medbreak\paragraph{ #1. {\rm [{\it #2\/}]}\kern-.3em}}
+\outer\def\rexerc#1[#2]{\medbreak\paragraph{\noindent\llap{\manual\char'170\rm\kern.15em} #1. {\rm [{\it #2\/}]}\kern-.3em}}
+\outer\def\answer{\par\vskip3pt\nobreak\noindent}
+
+% Deprecated
+%\outer\def\exercise#1{\medbreak\noindent\llap{\manual\char'170\rm\kern.15em}{\bf\small EJERCICIO #1}\par\nobreak\noindent}
+%\def\onpart#1#2{\setcounter{part}{#1}\part{#2}}
+%\def\onchapter#1#2{\setcounter{chapter}{#1}\chapter{#2}}
+%\def\onsection#1#2{\setcounter{section}{#1}\section{#2}}
+%\def\onsubsection#1#2{\setcounter{subsection}{#1}\section{#2}}
+
+%% MACROS FOR MIX BOXES (mostly from taocpmac.tex)
+\def\ticky#1{\leavevmode\hbox{\chardef\_=`\_\tt#1}}
+\def\Hedge#1{\vbox{\dimen0=#1 em \advance\dimen0 .4 pt \hrule width \dimen0}} \def\Hed#1{\vbox{\dimen0=1.4em\relax \dimen0=#1\dimen0\relax \advance\dimen0 .4pt\relax \hrule width \dimen0}}
+\def\hedge{\Hedge{8.4}}
+\def\smhedge{\Hedge{4.2}}
+
+\def\vedge{\vrule height 1.05em depth .55em} % 16pt
+\def\tick{\vrule height 0.2em}
+\def\Byte#1#2{\hbox to #1em{\hfill\ticky{#2}\hfill\hskip.4 pt }\hskip-.4pt \vrule}
+\def\byte{\Byte{1.4}}
+
+\newcount\nbytes
+\newdimen\byteswidth
+\newdimen\clearance
+\clearance=4.175pt
+\def\cb{\hskip-\clearance plus 1 fill } %center bytes
+% #1=number of bytes, #2=total width, #3=height to tick, #4=depth to tick,
+% #5=contents
+\def\multibytes#1#2#3#4#5{\nbytes=1 \byteswidth=#2em
+ \hbox to \byteswidth{\hfill{\tt#5}\hskip\clearance \hskip.4pt}\hskip-\byteswidth
+ \divide\byteswidth #1
+ \loop\ifnum\nbytes<#1 \advance\nbytes by1
+ \hskip\byteswidth
+ \hskip-.4pt\vrule height -#4 em \hskip -.4pt \vrule depth -#3 em \repeat
+ \hskip\byteswidth \hskip-.4pt \vrule}
+
+\def\twobytes{\multibytes2{2.8}{.85}{.35}}
+\def\threebytes{\multibytes3{4.2}{.85}{.35}}
+\def\fourbytes{\multibytes4{5.6}{.85}{.35}}
+\def\fivebytes{\multibytes5{7.0}{.85}{.35}}
+\def\sixbytes{\multibytes6{9.0}{.95}{.45}}
+
+\def\opensign#1{\lower 5.5pt\vbox to 16pt{\hbox to 14pt{\hfil\tick}\vfill
+\hbox to 14pt{\hfil\ticky{#1}\hfil}\vfill\hbox to 14pt{\hfil\tick}}}
+\def\textindentindent#1{\noindent\hbox to 40pt{\hss#1\ }\!}
+
+\def\punct#1{\ifinner \,#1 \else\rlap{\enspace#1}\fi} % punctuation after box
+
+\def\mixbox#1{\,\hbox{\lower 5.5pt\vbox{\hedge\vskip-1.2pt\hbox{\vedge#1}\vskip-5.5pt\hedge}}\,}
+\def\mixsmbox#1{\,\hbox{\lower 5.5pt\vbox{\smhedge\vskip-1.2pt\hbox{\vedge#1}\vskip-5.5pt\smhedge}}\,}
+
+\def\soffsets{\bgroup\setlength\tabcolsep{0pt}}
+\def\offset#1#2{\small\ #1\hfill{}#2\ }
+\def\eoffsets{\egroup}
diff --git a/index.lyx b/index.lyx
new file mode 100644
index 0000000..300f62e
--- /dev/null
+++ b/index.lyx
@@ -0,0 +1,1721 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 620
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass book
+\begin_preamble
+\input defs
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype true
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize 10
+\spacing single
+\use_hyperref true
+\pdf_bookmarks true
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks false
+\pdf_backref false
+\pdf_pdfusetitle true
+\papersize custom
+\use_geometry true
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_formatted_ref 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\paperwidth 198mm
+\paperheight 297mm
+\leftmargin 23mm
+\topmargin 33mm
+\rightmargin 43mm
+\bottommargin 66mm
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 2
+\paperpagestyle fancy
+\tablestyle default
+\listings_params "basicstyle={\ttfamily}"
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\docbook_mathml_prefix 1
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Exercises on
+\emph on
+The Art Of Computer Programming
+\end_layout
+
+\begin_layout Author
+Juan Marín Noguera
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset toc
+LatexCommand tableofcontents
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+Equivalent page size can be obtained with the following layouts (in mm):
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Tabular
+<lyxtabular version="3" rows="3" columns="7">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Height
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Width
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Top
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Bottom
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Inner
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Outer
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Recommended headers
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+297
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+198
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+33
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+66
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+23
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+43
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Fancy
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+210
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+140
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Empty
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+The first one follows Tschichold's canon except for
+\begin_inset Formula $\unit[1]{mm}$
+\end_inset
+
+ given to the inner margin from the outer one to account for a minimal folding.
+ The golden ratio resulted in way too narrow pages on A5 paper.
+\end_layout
+
+\begin_layout Plain Layout
+Proposed notation for in-progress:
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+atom = (
+\begin_inset Quotes eld
+\end_inset
+
+A
+\begin_inset Quotes erd
+\end_inset
+
+|
+\begin_inset Quotes erd
+\end_inset
+
+R
+\begin_inset Quotes erd
+\end_inset
+
+) ?(
+\begin_inset Quotes eld
+\end_inset
+
+B
+\begin_inset Quotes erd
+\end_inset
+
+|
+\begin_inset Quotes erd
+\end_inset
+
+M
+\begin_inset Quotes erd
+\end_inset
+
+) ((
+\begin_inset Quotes eld
+\end_inset
+
+0
+\begin_inset Quotes erd
+\end_inset
+
+..
+\begin_inset Quotes erd
+\end_inset
+
+4
+\begin_inset Quotes erd
+\end_inset
+
+) (
+\begin_inset Quotes eld
+\end_inset
+
+0
+\begin_inset Quotes erd
+\end_inset
+
+..
+\begin_inset Quotes erd
+\end_inset
+
+9
+\begin_inset Quotes erd
+\end_inset
+
+) /
+\begin_inset Quotes eld
+\end_inset
+
+@
+\begin_inset Quotes erd
+\end_inset
+
+) / 1DIGIT *DIGIT / *1(1DIGIT *DIGIT)
+\begin_inset Quotes eld
+\end_inset
+
+..
+\begin_inset Quotes erd
+\end_inset
+
+ *1(1DIGIT *DIGIT)
+\end_layout
+
+\begin_layout Plain Layout
+
+base = atom /
+\begin_inset Quotes eld
+\end_inset
+
+(
+\begin_inset Quotes eld
+\end_inset
+
+ progress
+\begin_inset Quotes eld
+\end_inset
+
+)
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+
+intersection = atom / intersection
+\begin_inset Quotes eld
+\end_inset
+
+*
+\begin_inset Quotes erd
+\end_inset
+
+ atom
+\end_layout
+
+\begin_layout Plain Layout
+
+progress = intersection / progress (
+\begin_inset Quotes eld
+\end_inset
+
++
+\begin_inset Quotes erd
+\end_inset
+
+/
+\begin_inset Quotes erd
+\end_inset
+
+-
+\begin_inset Quotes erd
+\end_inset
+
+) intersection
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+An
+\family typewriter
+atom
+\family default
+ represents all/recommended exercises,
+ optionally excluding M or HM/excluding HM,
+ and up to the given difficulty level/all difficulty levels,
+ or else a single exercise with the given number,
+ or a range of exercises (both ends inclusive).
+ Then
+\family typewriter
+*
+\family default
+ is used for intersection,
+
+\family typewriter
++
+\family default
+ for union,
+ and
+\family typewriter
+-
+\family default
+ for set difference.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Chapter*
+Notes on the Exercises
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "0.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R30
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Chapter
+Basic Concepts
+\end_layout
+
+\begin_layout Section
+Algorithms
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.1.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R30
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Mathematical Preliminaries
+\end_layout
+
+\begin_layout Subsection
+Mathematical Induction
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.1.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R30
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Numbers,
+ Powers,
+ and Logarithms
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.2.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Sums and products
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.3.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25+29
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Integer Functions and Elementary Number Theory
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.4.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Permutations and Factorials
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.5.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25+11
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Binomial Coefficients
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.6.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25+44
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Harmonic Numbers
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.7.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Fibonacci Numbers
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.8.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Generating Functions
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.9.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Analysis of an Algorithm
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.10.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Asymptotic Representations
+\end_layout
+
+\begin_layout Subsubsection
+The
+\begin_inset Formula $O$
+\end_inset
+
+-notation
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.11.1.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Euler's summation formula
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.11.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Some asymptotic calculations
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.2.11.3.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+
+\family typewriter
+MIX
+\end_layout
+
+\begin_layout Subsection
+Description of
+\family typewriter
+MIX
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.3.1.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25+22
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+The
+\family typewriter
+MIX
+\family default
+ Assembly Language
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.3.2.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Applications to permutations
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.3.3.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Some Fundamental Programming Techniques
+\end_layout
+
+\begin_layout Subsection
+Subroutines
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.4.1.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Coroutines
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.4.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Interpretive Routines
+\end_layout
+
+\begin_layout Subsubsection
+A
+\family typewriter
+MIX
+\family default
+ simulator
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.4.3.1.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Trace Routines
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.4.3.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Input and Output
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "1.4.4.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25+4
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+
+\family typewriter
+MMIX
+\end_layout
+
+\begin_layout Subsection
+Description of
+\family typewriter
+MMIX
+\end_layout
+
+\begin_layout Subsection
+The
+\family typewriter
+MMIX
+\family default
+ Assembly Language
+\end_layout
+
+\begin_layout Section
+Some Fundamental Programming Techniques (
+\family typewriter
+MMIX
+\family default
+)
+\end_layout
+
+\begin_layout Subsection
+Subroutines
+\end_layout
+
+\begin_layout Subsection
+Coroutines
+\end_layout
+
+\begin_layout Subsection
+Interpretive Routines
+\end_layout
+
+\begin_layout Chapter
+Information structures
+\end_layout
+
+\begin_layout Section
+Introduction
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.1.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Linear lists
+\end_layout
+
+\begin_layout Subsection
+Stacks,
+ Queues,
+ and Deques
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.1.lyx"
+literal "true"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R30
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Sequential Allocation
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Linked Allocation
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.3.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Circular Lists
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.4.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Doubly-Linked-Lists"
+
+\end_inset
+
+Doubly Linked Lists
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.5.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Arrays and Orthogonal Lists
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.2.6.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Traversing Binary Trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.1.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Binary Tree Representation of Trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Other Representations of Trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.3.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Basic Mathematical Properties of Trees
+\end_layout
+
+\begin_layout Subsubsection
+Free trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.1.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Oriented trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.2.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+The
+\begin_inset Quotes eld
+\end_inset
+
+infinity lemma
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.3.lyx"
+literal "false"
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\family typewriter
+A10+R25
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Enumeration of trees
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.4.lyx"
+literal "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+Path length
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.5.lyx"
+literal "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+History and bibliography
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.4.6.lyx"
+literal "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Lists and Garbage Collection
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "2.3.5.lyx"
+literal "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Multilinked Structures
+\end_layout
+
+\begin_layout Section
+Dynamic Storage Allocation
+\end_layout
+
+\end_body
+\end_document