# Errata in the Textbook

Errors in the third draft of A Mathematical Foundation for Computer Science (course packet #56, Collective Copies) will be listed here as they are discovered. My thanks to all who have reported errors!

• Page 1-13: In Exercise 1.2.2, the final period is not part of the last specified string. This should probably be made clearer.
• Page 1-17: middle of page, "in the word" should be "in the world".
• Page 1-20: missing semicolon after "y++" in Java code.
• Page 1-24: end of fifth-to-last line, delete "it".
• Page 1-26: second paragraph, "in the next section" should say "in Section 1.6".
• Page 1-28: In Problem 1.4.4 (not assigned in S05), it does matter what the initial values of p and q are in order to determine the final value of q.
• Page 1-37: In Problem 1.5.1 (e), the "and" sign (∧) should be an "intersection" sign (∩).
• Page 1-50: Fourth line of third paragraph should say "the AND of them".
• Page 1-51: Under "Vacuous Proof" it should say "If ¬P happens to be..."
• Page 1-52: "E1.812" should be "E1.8.2".
• Page 1-60: The Problems should be labeled P1.10.1 through P1.10.5. In Problem 5 (a), there should be a second left parenthesis after the two-way arrow.
• Page 2-2: In the second Definition, the "ldots" should be "...".
• Page 2-5: Exercise E2.1.4 (c)should have another ")" at the end.
• Page 2-6: In Problem 2.1.6 (a), "πi" should be "π1".
• Page 2-22: In the fifth paragraph, the word "calculus" is misspelled. In Exercise 2.6.1 (a), the word "all" should be capitalized.
• Page 2-29: In the definition of "transitive", the outermost pair of parentheses is inconsistent with the other definitions and should be removed, though it actually doesn't change the meaning of the definition at all.
• Page 2-31: In Problem 2.8.2, ``total orders" refers to ``linear orders" as defined on page 2-39.
• Page 2-38: In Problem 2.9.5 (c), it should say ``g ° f" instead of ``f ° g", where ``°" is meant to be the composition operator. In part (d), instead of ``g ° f" it should say ``f ° g".
• Page 2-39: The definition of ``linear order" should include the fact that they are sometimes called ``total orders".
• Page 2-46: In the second bullet of the definition it should say ``X ∩ Y" instead of ``X ∪ Y".
• Page 3-8: The statement in Problem 3.1.5 (b) should be "for any natural z, z is a common factor of x and y if and only if z divides xy and xy/z is a common multiple of x and y".
• Page 3-9: The "619" in the fourth to last line should be "719".
• Page 3-12: In the last full paragraph, the words "multiplicative inverse" should be in boldface rather than italics. After the last line (which extends onto page 3-13), it should say "That is, x has an inverse if and only if ∃y:xy ≡ 1 (mod r), and y is the inverse."
• Page 3-13: Just before the statement of the Inverse Theorem it should say "These definitions allow us..."
• Page 3-13: The last line of the Euclidean Algorithm calculation should say "6 % 2 = 0", not "6 % 0 = 0".
• Page 3-15: first line, "6 = 26 - 20" instead of "6 = 26 = 20".
• Page 4-12: References to "mod" in the Writing Exercise should be replaced by "%". The hint in the first bullet should say "...with e > 1 and e < d".
• Page 4-25: The second formula in the first bullet should be \$F(2n-1)=F(n+1)F(n) - F(n-1)F(n-2).
• Page 4-27: In the first line of section 4.6.2, the "x+0=0" should say "x+0=x".
• Page 4-30: In Problem 4.6.1 (c), capitalize "Use" in the Hint.
• Pages 4-32 and 4-33: In the three pseudo-Java code segments, all six uses of "`String`" should be changed to "`string`" because we are using the pseudo-Java primitive type rather than the real Java object class.
• Page 5-22: In the first line of Problem 5.5.3, there should be a ")" just before the comma.
• Page 6-43: Near the end of the next to last paragraph, the expression "|a*baa*ba*|" should be "|a*ba*ba*|n".
• Page 6-44: In Figure 6-17, in all three diagrams, the right-hand side of the tree is wrong. The right child of the root should be "ab", and an "a" should be added to every string in the right subtree.
• Page 11-3: In the solution to Exercise 1.2.3, the last string should be gargarmadage.
• Page 11-3: In the solution to Exercise 1.2.4, am should be given as a substring that is neither a prefix nor a suffix.
• Page 11-4: The solution to Exercise 1.4.8 (c) should be "(p∧q)→¬q".
• Page 11-5: In the solution to Exercise 1.5.3, the references to "five letters" should all be to "five or more letters".
• Page 11-7: In the solution to Exercise 1.6.3, the boldface 0 in the fifth row of the truth table should be a 1.
• Page 11-11: In the solution to Exercise 1.10.1, the given answer for (c) is actually the answer for (d). The answer for (c) should be:

Signature: Team X, Template "the first three runners were from X".

• Page 11-12: In the solution to Exercise 1.10.2 (c), the final "0" should be a "1".
• Page 11-13: In the solution to Exercise 2.3.1 (d), there should be a period before the final ")".
• Page 11-14: In the solution to Exercise 2.3.5 (a) it should say "x and z are bound". In the solution to Exercise 2.3.5 (c), "x" and "y" should be switched.
• Page 11-19: In Exercise 2.10.2, relation (c) is transitive and is a partial order -- the given counterexample is wrong as (3,7) is in this relation but (3,5) and (5,7) are not.
• Page 11-22: In the solution to Exercise 3.1.4, the period in the set should be a comma.
• Page 11-22: The solution to Exercise 3.3.3 (a) has an error in the first line. It should say "553 = 1(315) + 238", after which the sequence continues 77, 74, 3, 2, 1 and the gcd is 1.
• Page 11-23: The solution to Exercise 3.3.3 (b) is also wrong -- the first line should be "553 = 1(317) + 236" and the sequence continues 81, 74, 7, 4, 3, 1 and these two numbers are also relatively prime. Perhaps the best solution is to change the question on page 3-16 to replace the two "553"'s with "453"'s -- then the calculations in the book's solutions are correct.
• Page 11-24: In the solution to Exercise 3.3.5 (b) "it's" should be "its".
• Page 11-25: In the solution to Exercise 3.4.3 f(7) should be 211 rather than 2114. In the solution to Exercise 3.4.4 "arbitrary" is misspelled.
• Page 11-32: In the solution to Exercise 4.4.2, remove the second question mark in the first line.
• Page 11-39: In the solution to Exercise 5.5.2, "individual" is misspelled.