Mathematics: A Discrete Introduction, Third Edition [3rd Ed] (Instructor Solution Manual, Solutions) [3 ed.] 0840049420, 9780840049421


1,007 90 2MB

English Pages 282 Year 2012

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Mathematics: A Discrete Introduction, Third Edition [3rd Ed]  (Instructor Solution Manual, Solutions) [3 ed.]
 0840049420, 9780840049421

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Instructor’s Manual with complete solutions for

Mathematics: A Discrete Introduction Third Edition

Edward R. Scheinerman The Johns Hopkins University

This title page will be replaced by Cengage Version: 2012:03:01:11:12

To Kelly, Jeff, and Andrew

Contents Preface

ix

1

1

Fundamentals 1 2 3 4 5 6 7

2

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

Relations . . . . . . . Equivalence Relations . Partitions . . . . . . . Binomial Coefficients . Counting Multisets . . Inclusion-Exclusion . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Contradiction . . . . . . Smallest Counterexample Induction . . . . . . . . Recurrence Relations . .

22 24 26 29 31 41

44 . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

More Proof 20 21 22 23

1 1 2 4 7 10 12

22

Lists . . . . . . . . . . . . . . . . . Factorial . . . . . . . . . . . . . . . Sets I: Introduction, Subsets . . . . Quantifiers . . . . . . . . . . . . . . Sets II: Operations . . . . . . . . . Combinatorial Proof: Two Examples

Counting and Relations 14 15 16 17 18 19

4

. . . . . . .

Collections 8 9 10 11 12 13

3

Joy . . . . . . . . . . . . . . . . . . . . Speaking (and Writing) of Mathematics Definition . . . . . . . . . . . . . . . . Theorem . . . . . . . . . . . . . . . . . Proof . . . . . . . . . . . . . . . . . . Counterexample . . . . . . . . . . . . . Boolean Algebra . . . . . . . . . . . .

44 48 52 56 66 70

76 . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . . v

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. 76 . 80 . 85 . 103

vi

5

Mathematics: A Discrete Introduction

Functions 24 25 26 27 28 29

6

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Sample Space . . . . . . . . . . . . . . . Events . . . . . . . . . . . . . . . . . . . Conditional Probability and Independence Random Variables . . . . . . . . . . . . . Expectation . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Groups . . . . . . . . . . . . . . . . . . . . . Group Isomorphism . . . . . . . . . . . . . . Subgroups . . . . . . . . . . . . . . . . . . . Fermat’s Little Theorem . . . . . . . . . . . Public Key Cryptography I: Introduction . . . Public Key Cryptography II: Rabin’s Method Public Key Cryptography III: RSA . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Fundamentals of Graph Theory Subgraphs . . . . . . . . . . . Connection . . . . . . . . . . Trees . . . . . . . . . . . . . . Eulerian Graphs . . . . . . . .

143 145 149 156 160

166

Dividing . . . . . . . . . . . . . . Greatest Common Divisor . . . . Modular Arithmetic . . . . . . . . The Chinese Remainder Theorem Factoring . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

166 171 177 183 186

194

Graphs 47 48 49 50 51

109 116 121 128 134 138

143

Algebra 40 41 42 43 44 45 46

9

. . . . . .

Number Theory 35 36 37 38 39

8

. . . . . .

Probability 30 31 32 33 34

7

Functions . . . . . . . . The Pigeonhole Principle Composition . . . . . . . Permutations . . . . . . Symmetry . . . . . . . . Assorted Notation . . . .

109

194 203 208 213 215 217 220

223 . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

223 227 232 236 242

Instructor’s Manual 52 53

10

vii

Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

Partially Ordered Sets 54 55 56 57 58 59

Fundamentals of Partially Ordered Sets Max and Min . . . . . . . . . . . . . . Linear Orders . . . . . . . . . . . . . . Linear Extensions . . . . . . . . . . . . Dimension . . . . . . . . . . . . . . . . Lattices . . . . . . . . . . . . . . . . .

256 . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

256 260 262 264 266 272

Preface This is the Instructor’s Manual for Mathematics: A Discrete Introduction, third edition. This manual has two purposes. First, we give solutions for the problems in the text. The problems are on a variety of difficulty levels, and reading through the solutions will give you a sense of how difficult the problem is. Second, comments and helpful hints on teaching are given at the beginning of each section. Sections are meant to be covered (roughly) at a rate of one per lecture. Of course, some sections can be covered more rapidly, while others may require two full lectures. A semester course based on this text would be in two halves: core material and topics. The core consists of Sections 1 through 24 (optionally omitting Sections 18 and 19). I hope you find this supplement helpful. Please send me your feedback by email to [email protected]. Thank you. –ES

ix

Chapter 1

Fundamentals 1

Joy

This section may be assigned as reading. The purpose of this section is to instill in students a sense of the pleasure mathematical work can bring. I recommend that you assign the one problem contained herein but not for course credit. Admonish your students thoroughly not to discuss the problem with each other or else they will spoil the experience. 1.1 Do not, under any circumstances, tell students the answer to this problem or you will rob them of the joy of discovering the answer themselves. Do not give them hints. Do not ask leading questions such as “What is the 24th factor in the expression?” Let students work this out for themselves. Be encouraging and reassure them that when they have found the answer, they will know they are correct.

2

Speaking (and Writing) of Mathematics

This section may also be assigned as reading. The goal here is to emphasize that clarity of language is vital in mathematics. The extent to which students can articulate their thoughts is a good indicator of how well they understand them. Furthermore, the very act of putting their thoughts into clear sentences helps with the learning process. Students often have the unhealthy notion that to do mathematics is to “grunt out” a series of equations with no words of explanation. They also believe that mathematics instructors will accept lousy writing, horrible penmanship, and innumerable crossouts on crumpled paper that has been torn out of a spiral notebook. We need to expect a lot better! 2.1 This diagram gives a solution to the puzzle.

1

2

Mathematics: A Discrete Introduction Here are written instructions. You will find before you six pieces: a large isosceles right triangle, a small isosceles right triangle, a square, a parallelogram, a trapezoid (with one side perpendicular to the parallel sides), and an oddly shaped (nonconvex) pentagon. 1. Place the square in the upper right with its sides vertical and horizontal. 2. Place the trapezoid to the left of the square so that its long parallel side aligns with the top of the square and its short parallel side aligns with the bottom of the square. Note that the side perpendicular to the parallel sides exactly abuts the left side of the square. 3. Place the parallelogram so that one of the long sides of the parallelogram matches the long non-parallel side of the trapezoid. Thus, the parallelogram is just below the left portion of the trapezoid. On the left, the short side of the parallelogram should complete a right angle with the long parallel side of the trapezoid. 4. Place the small right triangle below the square. One of the legs of the small right triangle exactly aligns with the bottom of the square and the other leg of the right triangle faces the inside of the puzzle. The hypotenuse of the small right triangle should slope from the lower left to the upper right. 5. Hold the large right triangle so that its legs are vertical and horizontal, and its right angle is to the lower right. Now place the large right triangle so that its upper 45◦ angle just touches the lower right corner of the square. Half of the hypotenuse of the large right triangle should align with all of the hypotenuse of the small right triangle. 6. Finally, hold the pentagon so that its right angle is in the lower left and the two sides that form that right angle are vertical and horizontal. It will now slide so that its right edge matches the lower half of the hypotenuse of the big right triangle and its upper edge meets up with the lower, long side of the parallelogram.

3

Definition

If we think of mathematics as a dramatic production, there are three main characters: Definition, Theorem, and Proof. (We can think of Counterexample as being the “evil” side of Proof. Important, supporting roles in this show are Conjecture and Example.) Thus the first few sections of this book are dedicated to introducing these main characters. Perhaps conspicuous by its absence is Axiom. (The term is introduced later in the book.) This omission is intentional. In my philosophy of mathematics, axioms are a form of definition. For example, the axioms of Euclidean geometry form the definition of the Euclidean plane. Any collection of objects we call points and lines that satisfy the Euclidean axioms is “honored” with the title Euclidean plane. Likewise the so-called axioms of group theory are actually the definition of a group. I have found that introducing axioms as “unproved assumptions” undermines the truth and beauty of mathematics. It unnecessarily introduces some doubt and confusion in students’ minds.

Instructor’s Manual

3

And while we are speaking of philosophy, I try to be rather clear about mine in the text. To me, mathematics is a purely mental construction. Definitions, theorems, proofs, etc., are the invention of and exist only in the human mind. If you agree with me, great. If you disagree with me (e.g., you think proofs are discovered as opposed to created) so much the better! You can use the text in a point-counterpoint discussion. Ultimately, I do not think these philosophical questions have much bearing on the day-to-day work of mathematicians. In any case, the essential point to convey from this section is that mathematical definitions must be much clearer than ordinary definitions. (Try having students define chair or love; as mathematicians we are lucky to be able to define our terms precisely.) Furthermore, we cannot in this book define everything down to first principles. It is much too difficult for students on this level to go reduce everything to axiomatic set theory. It is reasonable for students to subsume sets and integers and to proceed from there. 3.1 (a) False. (b) True. (c) True. (d) True. (e) False. (f) False. (g) True. (h) True. 3.2 In the “official definition” (Definition 3.2) we have 0|0, but in the alternative definition 0|0 is false because 00 is not an integer. 3.3 Only the first number, 21, is composite because 21 = 3 × 7 satisfies Definition 3.6. None of the other numbers are composite because they are not positive integers. 3.4 It is easiest if we define ≤ first. For integers x, y we say x is less than or equal to y, and we write x ≤ y, provided y − x is a natural number. We write x < y provided x ≤ y and x 6= y. We write x ≥ y provided y ≤ x. We write x > y provided y < x. 3.5 Let x be an integer. Then x is also a rational number because we can write x = 1x , satisfying the definition of rational. On the other hand, 12 is rational, but not an integer. 3.6 An integer x is called a perfect square provided there is an integer y such that x = y2 . 3.7 A number x is a square root of a number y provided x2 = y. 3.8 The perimeter of a polygon is the sum of the lengths of its sides. 3.9 Suppose A, B,C are points in the plane. We say that C is between A and B provided the d(A,C) + d(C, B) = d(A, B) where d(·, ·) denotes the distance between the two given points. Suppose A, B,C are points in the plane. We say that they are collinear provided one of them is between the other two. 3.10 The midpoint of a line segment AB is a point C on the segment such that the distance from A to C equals the distance from C to B. 3.11

(a) A person X is called a teenager provided X is at least 13 years old and less than 20 years old.

4

Mathematics: A Discrete Introduction (b) Person A is the grandmother of person B provided A is female and A is the parent of one of B’s parents. Alternatively: A person X is a grandmother if X is female and X is the parent of someone who is also a parent. (c) A year is a leap year if it is 366 days long. (d) A dime is a U.S. coin worth 10 cents, i.e., one-tenth of a dollar. (e) A palindrome is a word that when written backwards spells the same word. (f) A word X is called a homophone of a word Y if X and Y are spelled differently but are pronounced the same.

3.12 (a) 4. (b) 6. (c) n + 1. (d) 4. (e) 9. (f) 49. (g) (n + 1)2 . (h) 8. (i) 8. (j) 25 = 32. (k) 8 × 3 × 2 × 2 = 96 because 8! = 27 · 32 · 51 · 71 . (l) ∞. The reason 30 and 42 have the same number of divisors is they are both the product of three distinct primes. Prime factorization is developed formally later (see Section 39). 3.13 The first perfect number is 6. The next perfect number after 28 is 496. The divisors of 496 are 1, 2, 4, 8, 16, 31, 62, 124, and 248, and they sum to 496. The following is a Mathematica program to find the next perfect number after 28. IsPerfect[n_] := Apply[Plus, Divisors[n]]==2*n; n = 29; While[Not[IsPerfect[n]], n++]; n 3.14 Presumably, the umpire’s word is law. Regardless of what really happened or what the umpire saw, if the umpire says “Out!” by definition, the runner is out. This is akin to mathematical definitions. A number is prime because we crafted the definition a certain way.

4

Theorem

If Definition, Theorem, and Proof are our main characters, the most glamorous role is played by Theorem. It is important for students to understand what a mathematical Statement is, and that Theorems are true mathematical statements that can be proved (with Proof to be introduced in the next section). Philosophical discussions are unavoidable here! We must distinguish theorem from the scientists’ theory and be utterly rigid about what truth is. Compare and contrast statements such as

Instructor’s Manual

5

Love is wonderful versus The square of an odd integer is odd. The former is true, despite the fact that the words are undefined and sometimes love hurts or can be overbearing (and so isn’t always wonderful). In mathematics, truth does not tolerate any exceptions. In this section we discuss the various forms theorems can take (with if-then being the archetype) and synonyms for the word theorem. We also introduce Mathspeak. Mathematicians use the English language well, but our use of certain words is different from standard usage. Mathematicians are comfortable with these modifications to English, but they must be explicitly explained to newcomers to our discipline. It may be tempting to skip the material on vacuous truth. However, I recommend you cover this. It is necessary for proving propositions such as for any set A, ∅ ⊆ A. New and noteworthy: We recommend you assign Exercise 4.12 to encourage students to create their own conjectures. 4.1

(a) If x is an odd integer and y is an even integer, then xy is even. (b) If x is an odd integer, then x2 is also odd. (c) If p is a prime, then p2 is not a prime. (d) If x and y are integers with x and y negative, then xy is negative. (e) If ABCD is a rhombus, then AC ⊥ BD. ∼ 4XY Z, then the area of 4ABC equals the area of 4XY Z. (f) If 4ABC = (g) If n is an integer, then 3|[n + (n + 1) + (n + 2)].

4.2 (a) If B, then A is true. The other statements are false. (b) If A, then B is true. The other statements are false. (c) If A, then B is true. The other statements are false. (d) If A, then B is true. The other statements are false. (e) If B, then A is true. The other statements are false. (f) None of the three statements are true. (g) If A, then B is true. The other statements are false. (h) All three statements are true. (i) All three statements are true. (j) If B, then A is true. The other statements are false. (k) If B, then A is true. The other statements are false. 4.3 Many answers are possible. Here is one. Let statement A be “the integer x is positive” and let B be the statement “the integer x2 is positive.” The statement “If A, then B” is true, but the statement “If B, then A” is false.

6

Mathematics: A Discrete Introduction 4.4 Statement (a) is true unless A is true and B is false. Statement (b) is true unless (not A) and B are both false, i.e., in case A is true and B is false. Thus (a) and (b) are true under exactly the same situations, and therefore make the same assertion. 4.5 Statement (a) is true unless A is true and B is false. Statement (b) is true unless (not B) is true and (not A) is false. This is the same as B is false and A is true. Thus (a) and (b) are true under exactly the same situations, and therefore make the same assertion. 4.6 The statement “A iff B” is true precisely when A and B are both true, or both false. The statement “(not A) iff (not B)” is true precisely when (not A) and (not B) are both true, or both false. This is the same as A and B are both false, or both true. Thus both statements are true when A and B are both true, or both false; and both statements are false when A and B are not both true or both false. The two statements are therefore true under the identical circumstances. In this sense, they make the same assertion. 4.7 The Pythagorean Theorem applies only to right triangles. Equilateral triangles are not right triangles. 4.8 The Pythagorean Theorem applies only to triangles in the plane. The “difficulty” comes from not being precise about the definition of triangle. 4.9 The sentence is nonsense because a line is a geometric object and distance is a number; these cannot be equal. Also, a line is an infinite object. Here is a better way to write this: Of all paths (or curves) joining two given points A and B, the line segment with end points A and B has the smallest length.

4.10 This is vacuously true because guinea pigs don’t have tails (or, at least, none to speak of). 4.11 Lemmas and lemmata. 4.12

(a) The sum of the first n odd numbers is n2 . (b) The sum of the first n cubes is 41 n2 (n + 1)2 . A very good partial answer is that the sum of the first n cubes is a perfect square. (c) If n pairwise nonparallel lines are drawn in the plane, (n2 + n + 2)/2 regions are created.

Instructor’s Manual

7

(d) When the path goes to every second point, we visit all points in case n is odd. When the path goes to every third point, we visit all points in case n is not divisible by 3. In the general case (skips of size k), we visit all points exactly when n and k have no common divisor greater than 1. (e) The closed lockers are those whose numbers are perfect squares.

5

Proof

If the most glamorous part in the mathematical play is played by Theorem, the real star of the show is Proof. Proof is what distinguishes mathematics from all other disciplines. This section is an introduction to proof writing, but proof writing continues throughout the text. Many forms of proof follow a rigid format. Scattered throughout the text are proof templates that are meant to demystify the proof-writing process. One of the key steps to writing a proof is getting students simply to write the first and the last sentences of the proof. This sets up the questions: What do we know? and What do we want to show? Although these steps are obvious to working mathematicians, students are either reluctant and/or unable to do them. Their importance should be emphasized. Whenever I present a proof of a theorem in class, I insist that students give me the first and last sentences. The next step is “unraveling definitions.” Students should be taught to work both ends of the proof at once, unfolding the definitions in the hypothesis and working back from the conclusion. For simple problems, this is almost all that is needed. Once the appropriate facts are laid out in the proper form, bridging the gap from hypothesis to conclusion is easy (at least at this point in the course). Only direct proofs of if-then and if-and-only-if statements are discussed at this point. More elaborate proof techniques follow in later sections. Teaching proof writing in a vacuum is difficult. I use elementary number theory to demonstrate the methods. Be sure to emphasize to students that you know that they know that the sum of even integers is even. That is not the point in this section. The point is learning how to construct a proof, and that is easier to do if the proof deals with easy, familiar concepts. Once you have done that simple example, you can prove the less obvious fact that n3 + 1 is composite for integers n ≥ 2. 5.1 Let x and y be odd integers. By definition, there are integers a and b such that x = 2a + 1 and y = 2b + 1. Therefore x + y = (2a + 1) + (2b + 1) = 2a + 2b + 2 = 2(a + b + 1). Therefore x + y is divisible by 2. Therefore x + y is even. 5.2 Let x be an odd integer and let y be an even integer. By definition, there is an integer a such that x = 2a + 1. By definition, 2|y, so (again, by definition) there is an integer b such that

8

Mathematics: A Discrete Introduction y = 2b. We have x + y = (2a + 1) + (2b) = 2(a + b) + 1, and therefore, by definition, x + y is odd. 5.3 Let n be an odd integer. Therefore there is an integer a such that n = 2a + 1. Let b be the integer −a − 1. Then 2b + 1 = 2(−a − 1) + 1 = −2a − 2 + 1 = −2a − 1 = −(2a + 1) = −n. Since −n = 2b + 1 where b is an integer, −n is odd. 5.4 Let x and y be even integers. Therefore x = 2a and y = 2b for some integers a and b. Now xy = (2a)(2b) = 4ab = 2(2ab) and so xy is even. 5.5 Let x be an even integer and let y be an odd integer. Therefore there are integers a and b with x = 2a and y = 2b + 1. Note that xy = (2a)(2b + 1) = 2(2ab + a) and so xy is even. 5.6 Let x, y be odd. There exist integers a, b such that x = 2a + 1 and y = 2b + 1 and so xy = (2a + 1)(2b + 1) = 4ab + 2a + 2b + 1 = 2(2ab + a + b) + 1 and so xy is odd. 5.7 This is a corollary of Exercise 5.6. 5.8 Proof #1: Let n be an odd integer. Thus n = 2a + 1 for some integer a. Therefore n3 = (2a + 1)3 = 8a3 + 12a2 + 6a + 1 = 2(4a3 + 6a2 + 3a) + 1 = 2b + 1 where b = 4a3 + 6a2 + 3a is an integer. Since n3 = 2b + 1, n3 is odd. Proof #2: Let n be an odd integer. By Exercise 5.6, n · n = n2 is odd. And since n2 and n are odd, again by Exercise 5.6, n2 · n = n3 is odd. 5.9 Suppose a|b and a|c. By definition, there are integers x and y with b = ax and c = ay. Therefore b + c = ax + ay = a(x + y) and so b + c is divisible by a, i.e., a|(b + c).

5.10 Suppose a|b. Then there is an integer x such that ax = b. Multiplying both sides by c we have a(xc) = bc and so a|(bc). 5.11 We are given that d|a and d|b. By the previous problem, d|(ax) and d|(by). By the problem before that, d|[(ax) + (by)]. 5.12 Suppose a|b and c|d. By definition, there are integers x and y with ax = b and cy = d. Multiplying these equations we get bd = (ax)(cy) = (ac)(xy) and so bd is divisible by ac. 5.13 (⇒) Suppose x is odd. Therefore x = 2a + 1 for some integer a. Now x + 1 = (2a + 1) + 1 = 2a + 2 = 2(a + 1), and so 2|(x + 1) and therefore x + 1 is even. (⇐) Suppose x + 1 is even. Therefore 2|(x + 1) and hence there is an integer b such that x + 1 = 2b. Thus x = 2b − 1 = 2(b − 1) + 1 and so x is odd.

Instructor’s Manual

9

5.14 (⇒) Suppose x is odd. Then there is an integer a such that x = 2a + 1. Let b = a + 1; notice that b is an integer. Observe that 2b − 1 = 2(a + 1) − 1 = 2a + 2 − 1 = 2a + 1 = x. Therefore x = 2b − 1 for some integer b. (⇐) Suppose x = 2b − 1 for some integer b. Let a = b − 1; note that a is an integer. Observe that 2a + 1 = 2(b − 1) + 1 = 2b − 2 + 1 = 2b − 1 = x. Since x = 2a + 1 for an integer a, it follows that x is odd. 5.15 (⇒) Suppose 0|x. This means there is an integer a so that 0 · a = x. Therefore x = 0. (⇐) Clearly 0|0 because 0 · 1 = 0. 5.16 (⇒) Suppose a < b. Therefore b − a > 0, so b − a is a positive integer. Since 1 is the smallest positive integer, b − a ≥ 1 whence b − 1 ≥ a, in other words, a ≤ b − 1. (⇐) Suppose a ≤ b − 1. Since b − 1 < b we have a < b. √ √ 5.17 (⇒) Suppose that x is strictly between 1 and a; that is, 1 < x < a. Since 1 < x we have √ that 1/1 > 1/x; multiplying both sides by a gives a > a/x. Likewise, since x < a we have √ √ √ √ 1/x > 1/ a; multiplying both sides by a gives a/x > a/ a = a. Thus a < a/x < a; that √ is, a/x is strictly between a and a. √ √ √ (⇐) Suppose that x is strictly between a and a; that is, a < x < a. Since a < x, we √ √ √ have that 1/ a > 1/x. Multiplying both sides by a gives a = a/ a > a/x. Similarly, since √ x < a we have that 1/x > 1/a. Multiplying through by a gives a/x > 1. Thus 1 < a/x < a √ and thus we see that a/x is strictly between 1 and a. 5.18 Let n2 and (n + 1)2 be consecutive perfect squares (where n is an integer). Their difference is (n + 1)2 − n2 = (n2 + 2n + 1) − n2 = 2n + 1 which is odd by Definition 3.4. 5.19 Suppose a is a perfect square. Then there is some integer n so that n2 = a. If n ≥ 0 there is nothing more to prove. But if n < 0, then −n > 0 and note that (−n)2 = n2 = a, so a is the square of a positive integer. 5.20 We are given that 0 < a < b. Since a is positive, multiplying both sides of a < b by a gives a2 < ab. Likewise, since b is positive, multiplying both sides of a < b by b gives ab < b2 . Since a2 < ab and ab < b2 , we have a2 < b2 . 5.21 Suppose the perfect squares are A and B where A = a2 and B = b2 for integers a and b. By Exercise 5.19 we may assume a and b are nonnegative.

10

Mathematics: A Discrete Introduction Since A and B are distinct nonconsecutive squares, we know that a and b differ by at least 2, say b ≥ a + 2. Thus B − A = b2 − a2 = (b − a)(b + a). Since b ≥ a + 2 and a ≥ 0, we know b ≥ 2 and so b + a ≥ 2. From b ≥ a + 2 we also know (by subtracting a from both sides) that b − a ≥ 2. Thus B − A is the product of two integers, both of which are at least 2. Therefore B − A is composite.

5.22 (⇒) Suppose x is odd. By definition, there is an integer a such that x = 2a + 1 = a + (a + 1) and so x is the sum of two consecutive integers. (⇐) Suppose x is the sum of two consecutive integers, say b and b + 1. Then x = b + (b + 1) = 2b + 1, and so x is odd. 5.23 Consider a statement such as, “Let x ≥ 3 be an integer. If x is even or x is square, then x is not prime.” If we only prove “If x is even, then x is not prime” then we have not covered the case when x is square but not even (e.g., x = 25). If we have shown A ⇒ C and B ⇒ C, then we have covered all the possibilities. Worse, if we only prove A ⇒ C, we have have a “proof” of an invalid statement. Consider the statement, “Let x be an integer with x ≥ 3. If x is even or if x is odd, then x is not prime.” Of course, this statement is false, so proving only “If x is even, then x is not prime” is not a valid proof. This problem is easier, and I recommend it be reassigned, after Section 7. Students can then make a truth table of (a ∨ b) → c and (a → c) ∧ (b → c). This is the point of Exercise 7.8. 5.24 Suppose we proved A ⇒ B and (not A) ⇒ (not B). Then when A is true, we must have B be true (by the first proof). Now suppose B is true, so (not B) is false. By the second proof, this can only happen if (not A) is false, i.e., A is true. Thus A iff B is proven. As with the previous problem, this is more natural after we do Section 7. See Exercise 7.7.

6

Counterexample

A counterexample is a form of proof; it proves that a statement is false. Counterexamples are conceptually simpler than proofs. However, students sometimes have difficulty understanding what constitutes a counterexample. Be sure to emphasize: For an if-then statement, any example that satisfies the if but not the then will do. For an if-and-only-if statement, a counterexample to either implication suffices.

Instructor’s Manual

11

There is an urban legend about a student who was presented with a test item that asked students to prove or disprove a certain statement. The statement was false, so a counterexample was appropriate. The student wrote an erroneous proof. When the question was marked wrong, the student sought out the professor. The professor explained that the statement is false and showed the student a counterexample. “That’s fine,” said the student, “but the problem says to prove or disprove. You chose to disprove, but I decided to prove!” We need to be sure our students understand the nature of mathematical truth and the role of proof and counterexample! 6.1 There are many possible counterexamples. Let a = 3 and b = −6. Then a|b but a 6≤ b. 6.2 Let a = 10 and b = 0. Then a|b but a 6≤ b. 6.3 For example, let a = 15, b = 3, and c = 5. Then a|(bc) but a divides neither b nor c. c

4

6.4 Let a = 2, b = 3, and c = 4. Note that a(b ) = 23 = 281 but (ab )c = (23 )4 = 212 . 6.5 Counterexample: p = 2 and q = 5 are primes, but p + q = 7 is not composite. 6.6 11 is prime, but 211 − 1 = 2047 = 23 × 89 is not. 5

6.7 22 + 1 = 641 × 6700417. 6.8 131 is a palindrome, but it is not divisible by 11. 6.9

(a) For n = 1, 2, . . . , 10 the values of n2 + n + 41 are, respectively, 43, 47, 53, 61, 71, 83, 97, 113, 131, and 151, all of which are prime. (b) However, for n = 41, clearly n2 + n + 41 is divisible by 41. (Indeed 412 + 41 + 41 = 1763 = 43 · 41.)

6.10 A counterexample to the statement “A iff B” can be either an instance where A is true and B is false, or an instance where B is true and A is false. 6.11 x = 0 is a counterexample; the only counterexample. 6.12 Let the first right have side lengths 6, 8, and 10, and let the second right triangle have √ triangle √ side lengths 50, 50, and 10. The areas of these triangles are 24 and 25, respectively. 6.13 The positive integer 9 is composite, but does not have two different prime factors.

12

7

Mathematics: A Discrete Introduction

Boolean Algebra

It is natural to introduce symbolic logic together with proof writing. Furthermore, it is useful to have a mechanical way to deal with logical reasoning. Students new to logical thinking can become confused between a statement and its converse, and can find it difficult to understand why a statement and its contrapositive are logically equivalent. Boolean algebra makes these issues more mechanical. The notation of Boolean algebra is useful in mathematics and computer science. The downside to Boolean algebra is that it can be boring. My recommendation is to move quickly through this subject. Truth tables are easy for students to grasp, and provide an easy way to prove results. It is possible to prove logical equivalences using Theorem 7.2, but this can be time consuming, and there are more interesting topics ahead. Exercises 7.11(g) and (h) foreshadow the technique of proof by contradiction, so we recommend that they be assigned. So the bottom line is: The material in this section is worthwhile, but should not be overemphasized. However, there are two interesting projects you can assign based on this material. For electrical engineers, you can have your students create circuits (either using discrete components or in an emulator program such as Spice) to model Boolean expressions. For computer scientists, you can assign a project in which students write a program to evaluate Boolean expressions, test if those expressions are tautologies, test if two expressions are logically equivalent, etc. 7.1 (a) FALSE. (b) TRUE. (c) FALSE. (d) FALSE. (e) TRUE. The answer to (a) does not depend on how the expression is parenthesized. 7.2 Truth tables for the various parts of Theorem 7.2.

x T T F F

x∧y = y∧x y x∧y y∧x T T T F F F T F F F F F

x T T F F

x∨y = y∨x y x∨y y∨x T T T F T T T T T F F F

Instructor’s Manual

13 (x ∧ y) ∧ z = x ∧ (y ∧ z)

x T T T T F F F F

y T T F F T T F F

z T F T F T F T F

x∧y T T F F F F F F

(x ∧ y) ∧ z T F F F F F F F

y∧z T F F F T F F F

x ∧ (y ∧ z) T F F F F F F F

(x ∨ y) ∨ z = x ∨ (y ∨ z)

x T T T T F F F F

y T T F F T T F F

z T F T F T F T F

x∨y T T T T T T F F

(x ∨ y) ∨ z T T T T T T T F

x = x∧T x x∧T T T F F

x T F

y∨z T T T F T T T F

x = x∨F x x∨F T T F F

x = ¬(¬x) ¬x ¬(¬x) F T T F

x = x∧x x x∧x T T F F

x = x∨x x x∨x T T F F

x ∨ (y ∨ z) T T T T T T T F

14

Mathematics: A Discrete Introduction x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z)

x T T T T F F F F

y T T F F T T F F

z T F T F T F T F

y∨z T T T F T T T F

x∧ (y ∨ z) T T T F F F F F

x∧y T T F F F F F F

x∧z T F T F F F F F

(x ∧ y)∨ (x ∧ z) T T T F F F F F

x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z)

x T T T T F F F F

y T T F F T T F F

z T F T F T F T F

y∧z T F F F T F F F

x∨ (y ∧ z) T T T T T F F F

x ∧ (¬x) = FALSE x ¬x x ∧ (¬x) T F F F T F

x∨y T T T T T T F F

x∨z T T T T T F T F

(x ∨ y)∧ (x ∨ z) T T T T T F F F

x ∨ (¬x) = TRUE x ¬x x ∨ (¬x) T F T F T T

¬(x ∧ y) = (¬x) ∨ (¬y)

x T T F F

y T F T F

x∧y T F F F

¬(x ∧ y) F T T T

¬x F F T T

¬y F T F T

(¬x) ∨ (¬y) F T T T

Instructor’s Manual

15 ¬(x ∨ y) = (¬x) ∧ (¬y)

x T T F F

y T F T F

x∨y T T T F

¬(x ∨ y) F F F T

¬x F F T T

¬y F T F T

(¬x) ∧ (¬y) F F F T

7.3 We make a truth table for (x ∧ y) ∨ (x ∧ ¬y) and compare to x. x T T F F

y T F T F

x∧y T F F F

x ∧ ¬y F T F F

(x ∧ y) ∨ (x ∧ ¬y) T T F F

x T T F F

7.4 Truth table for x → y and (¬y) → (¬x). x T T F F

y T F T F

x→y T F T T

¬y F T F T

¬x F F T T

(¬y) → (¬x) T F T T

¬x F F T T

¬y F T F T

(¬x) ↔ (¬y) T F F T

7.5 Truth table for x ↔ y and (¬x) ↔ (¬y). x T T F F

y T F T F

x↔y T F F T

7.6 Truth table for x ↔ y and (x → y) ∧ (y → x). x T T F F

y T F T F

x↔y T F F T

x→y T F T T

y→x T T F T

7.7 Truth table for x ↔ y and (x → y) ∧ ((¬x) → (¬y)).

(x → y) ∧ (y → x) T F F T

16

Mathematics: A Discrete Introduction

x T T F F

y T F T F

x↔y T F F T

x→y T F T T

(¬x) → (¬y) T T F T

(x → y)∧ (¬x) → (¬y) T F F T

7.8 Truth table for (x ∨ y) → z and (x → z) ∧ (y → z). x T T T T F F F F

y T T F F T T F F

x∨ y T T T T T T F F

z T F T F T F T F

(x ∨ y) →z T F T F T F T T

x→ z T F T F T T T T

y→ z T F T T T F T T

(x → z)∧ (y → z) T F T F T F T T

7.9 210 = 1024. Each addition of a variable doubles the number of rows. 7.10 To disprove a logical equivalence between two formulas, find values for the variables that give different values for the formulas. Correct answers to these include: (a) x = TRUE, y = FALSE, (b) x = FALSE, y = TRUE, and (c) x = TRUE, y = TRUE. Other answers may be possible. 7.11 The last column of the truth table should contain the entry TRUE in every row.

(a)

(b)

x T T F F x T T F F

y T F T F y T F T F

x∨y T T T F x→y T F T T

x ∨ ¬y T T F T

(x ∨ y)∨ (x ∨ ¬y) T T T T

x∧ (x → y) T F F F

(x ∧ (x → y)) →y T T T T

Instructor’s Manual

17

(c)

x T F

¬x F T

(d)

x T F

x→x T T

x

y

z

x→ y

y→ z

(x → y)∧ (y → z)

x→ z

T T T T F F F F

T T F F T T F F

T F T F T F T F

T T F F T T T T

T F T T T F T T

T F F F T F T T

T F T F T T T T

(f)

x T F

F→x T T

(g)

x T F

x→F F T

x

y

x→y

x → ¬y

T T F F

T F T F

T F T T

F T T T

(e)

(h)

¬(¬x) T F

¬x F T

x ↔ ¬(¬x) T T

((x → y) ∧(y → z)) → (x → z) T T T T T T T T

(x → F) → ¬x T T (x → y)∧ (x → ¬y) F F T T

¬x F F T T

((x → y) ∧ (x → ¬y)) → ¬x T T T T

7.12 A solution to (a) is given in the Hints and a solution to (b) in the statement of the problem. The other formulas are proved here. (c) (¬(¬x)) ↔ x = x ↔ x = (x → x) ∧ (x → x) = (x → x) = ¬x ∨ x = T. (d) x → x = (x → x) ∧ (x → x) = (x → x) = ¬x ∨ x = T.

18

Mathematics: A Discrete Introduction (e) This one qualifies as cruel and unusual punishment: ((x → y) ∧ (y → z)) → (x → z) = [(¬x ∨ y) ∧ (¬y ∨ z)] → (x → z) = [(¬x ∧ (¬y ∨ z)) ∨ (y ∧ (¬y ∨ z))] → (x → z) = [(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ ¬y) ∨ (y ∧ z)] → (x → z) = [(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ F ∨ (y ∧ z)] → (x → z) = [(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ z)] → (x → z) = ¬[(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ z)] ∨ (x → z) = ¬[(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ z)] ∨ ¬x ∨ z = ¬[(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ z)] ∨ ¬x ∨ ¬¬z h i = ¬ [(¬x ∧ ¬y) ∨ (¬x ∧ z) ∨ (y ∧ z)] ∧ x ∧ ¬z h i = ¬ [((¬x ∧ ¬y) ∧ x) ∨ ((¬x ∧ z) ∧ x) ∨ ((y ∧ z) ∧ x)] ∧ ¬z h i = ¬ [F ∨ F ∨ F ∨ ((y ∧ z) ∧ x)] ∧ ¬z = ¬[(y ∧ z ∧ x) ∧ ¬z] = ¬F = T.

(f) F → x = ¬F ∨ x = T ∨ x = T. (g) (x → F) → ¬x = (¬x ∨ F) → ¬x = ¬x → ¬x = ¬¬x ∨ ¬x = x ∨ ¬x = T. (h) ((x → y) ∧ (x → ¬y)) → ¬x = [(¬x ∨ y) ∧ (¬x ∨ ¬y) → ¬x = [¬x ∨ (y ∧ ¬y)] → ¬x = [¬x ∨ F] → ¬x = ¬x → ¬x = ¬¬x ∨ ¬x = x ∨ ¬x = T.

7.13

(a)

(b)

x T T F F

y T F T F

x∨y T T T F

x ∨ ¬y T T F T

x T T F F

y T F T F

x→y T F T T

¬y F T F T

¬x F F T T

(x ∨ y)∧ (x ∨ ¬y) ∧ ¬x F F F F

x ∧ (x → y) ∧ (¬y) F F F F

Instructor’s Manual

(c)

x T T F F

y T F T F

19 x→y T F T T

(¬x) → y T T T F

(x → y) ∧ ((¬x) → y) ∧ ¬y F F F F

7.14 (⇒) Suppose A is logically equivalent to B. This means that whenever we substitute for the variables in A and B we get the same truth value. Since T ↔ T = T and F ↔ F = T, whenever we substitute into A ↔ B we always get T. Therefore, A ↔ B is a tautology. (⇐) Suppose A ↔ B is a tautology. Then whenever we substitute into the variables in A and B we get A ↔ B = TRUE. Now the only way that ↔ evaluates to TRUE is when both A and B have the same truth value (because T ↔ F = F ↔ T = F) and so A and B always yield the same truth value upon substitution for their variables. Thus A is logically equivalent to B. 7.15 The expression x ↔ y is logically equivalent to (x ∧ y) ∨ ((¬x) ∧ (¬y)). We can show this via truth table: x T T F F

y T F T F

x↔y T F F T

x∧y T F F F

(¬x) ∧ (¬y) F F F T

(x ∧ y) ∨ ((¬x) ∧ (¬y)) T F F T

Other answers are possible. 7.16 For (a) it is easy to see that Y is commutative as F Y T = T Y F = T. To show that Y is associative, we can use a truth table: x T T T T F F F F

y T T F F T T F F

z T F T F T F T F

xYy F F T T T T F F

(x Y y) Y z T F F T F T T F

yYz F T T F F T T F

x Y (y Y z) T F F T F T T F

For (b) we show x Y y = (x ∧ ¬y) ∨ ((¬x) ∧ y) via the following truth table:

20

Mathematics: A Discrete Introduction x T T F F

y T F T F

xYy F T T F

x ∧ ¬y F T F F

(¬x) ∧ y F F T F

(x ∧ ¬y) ∨ ((¬x) ∧ y) F T T F

For (c) we show x Y y = (x ∨ y) ∧ (¬(x ∧ y)) via the following truth table. x T T F F

y T F T F

xYy F T T F

x∨y T T T F

¬(x ∧ y) F T T T

(x ∨ y) ∧ (¬(x ∧ y)) F T T F

We call Y exclusive or because it captures the exclusive nature of English or: you may have option A or B, but not both. In the same way x Y y when x or y but not both are TRUE. 7.17 There are 24 = 16 possible binary Boolean operations. 7.18 Consider the four expressions x∧y

x ∧ (¬y)

(¬x) ∧ y

(¬x) ∧ (¬y)

Notice that in each case there is a unique substitution for x and y that makes the expression TRUE . For example, (¬x) ∧ y is TRUE exactly when x = FALSE and y = TRUE (and otherwise it is FALSE). We can combine these basic four expressions using ∨s to make any binary Boolean operation we want. We just decide which of the ? entries in the chart x

y

TRUE

TRUE

TRUE

FALSE

FALSE

TRUE

FALSE

FALSE

x∗y ? ? ? ?

we want to be TRUE and we link together the appropriate expressions above with ∨s. For example, if we want x

y

x∗y

TRUE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

FALSE

FALSE

FALSE

Instructor’s Manual

21

we would take x ∧ y together with (¬x) ∧ y as x ∗ y = (x ∧ y) ∨ ((¬x) ∧ y). For the special case where all entries in the last column are TRUE, we can use x ∗ y = x ∨ ¬x, and in case all the entries in the last column are FALSE, we can use x ∗ y = x ∧ ¬x. Therefore all 16 binary Boolean functions can be expressed in terms of ∧, ∨, and ¬. 7.19 Note that x ∨ y = ¬((¬x) ∧ (¬y)) and so in any expression that uses ∨ we can replace ∨ with ∧s and ¬s. 7.20 For (a), a truth table for Z: x T T F F

y T F T F

xZy F T T T

For (b), the operation Z is commutative but not associative. Commutativity is clear from the defining truth table and from the fact that x Z y = ¬(x ∧ y): x Z y = ¬(x ∧ y) = ¬(y ∧ x) = y Z x. However, to see that Z is not associative, we compute: T Z (T Z F) = T Z T = F

and

(T Z T) Z F = F Z F = T.

For (c), we have ¬x = ¬(x ∧ x) = x Z x, and since x ∧ y = ¬(x Z y) we have x ∧ y = (x Z y) Z (x Z y). Therefore (for (d)) we have that ¬ and ∧ can be expressed in terms of Z. Since all Boolean operations can be expressed just in terms of ¬ and ∧, we can express all binary Boolean operations just in terms of Z.

Chapter 2

Collections 8

Lists

In this chapter we introduce two basic concepts of collections: lists and sets. Lists are ordered collections in which repetition is permitted and sets are unordered collections in which repetition is forbidden. The classical counting problems are to compute the number of permutations of n objects taken k at a time, and the number of combinations of n objects taken k at a time. Students find these words confusing. I think it is much better to say that we are counting the number of lists or the number of sets with the required properties. I do not use the words permutation and combination in this way. (Furthermore, I prefer to define a permutation as a bijection from a set to itself.) Mathematicians use sets as the fundamental building block of all of mathematics. This is the right way to proceed for a more advanced course. Technically, we ought to define a list as a function defined on a finite totally ordered set. However, only a mathematician would find that description natural or useful! After the entire course is finished, it might be reasonable to revisit the concept of list and give this more accurate, technical definition. We will be happy if the students understand and appreciate this more technical definition. We will be ecstatic if they (correctly) criticize us by saying: to define lists, you have used functions, but to define functions, you needed the concept of ordered pairs,  which are lists! We can then present them with the set theory trick of defining (a, b) as the set {a, b}, {a} . However, this approach will completely confuse students who are new to the subject. 8.1 Here are all the two-letter words made from the vowels A, E, I, O, and U: AA EA IA OA UA

AE EE IE OE UE

Of these, 20 do not have a repeated letter. 8.2 263 . 8.3 2k . 8.4 4 × 3 × 2 × 4 × 2. 22

AI EI II OI UI

AO EO IO OO UO

AU EU IU OU UU

Instructor’s Manual

23

8.5 If the lists may overlap, there are [(500)20 ]2 possible ways to load songs. If the lists must not overlap, then there are (500)20 × (480)20 = (500)40 ways to load the songs. 8.6 If the first and last entries must be the same, there are n × n × 1 = n2 possible lists. If the first and last entries must be different, there are n × n × (n − 1) = n2 (n − 1) or n3 − n2 possible lists. 8.7

(a) There are (31)31 ways: Create a list, without repetition, whose entries are the photos and a “go to next page” symbol. (b) 230 .

8.8 (8)3 = 8 × 7 × 6. 8.9 82 × 72 . 8.10 (a) 26 × 26 × 26 × 10 × 10 × 10. (b) 26 × 25 × 24 × 10 × 9 × 8. 8.11 8 × 109 , or 8 billion. This answer is correct based on the problem statement. However, a phone number cannot begin 911 (as 911 is already a phone number). 8.12 (a) 109 . (b) 21 × 109 = 5 × 108 . (c) 59 . (d) 105 . (e) 99 . (f) 109 − 99 . (g) 9 × 98 = 99 . 8.13 Here is the algebraic argument: (n)2 + n = n(n − 1) + n = n2 − n + n = n2 . Here is the list counting (i.e., combinatorial) argument. There are n2 possible 2-element lists. Of these (n)2 have no repeated entry and n must have a repeated entry (n choices for the first element and then only 1 option for the second). So n2 = (n)2 + n. 8.14 36 + 36 × 36 + 363 + · · · + 368 . 8.15 95 . 8.16 10 × 7 × 7 × 7. 8.17 20 × 19 × 18 × · · · × 2 × 1. 8.18 2 × (10 × 9 × · · · × 2 × 1)2 . 8.19 52 × 36 × 22 × 10.

24

9

Mathematics: A Discrete Introduction

Factorial

This is a short section whose main purpose is to introduce the factorial function and notation. A fair amount of space is devoted to trying to convince students that 0! is 1. It is a common misconception that 0! “ought” to be zero. The product notation should also be easy for students to absorb if they are comfortable with ∑ notation. If ∑ notation is awkward for your students, then this would be a good place to review that concept. 9.1 n = 6. 9.2 (a) (6 + 8 + 5)! = 19!. (b) 3! × 6! × 8! × 5!. 9.3 Alice and Bob need to multiply a list of numbers. Carlos gives all but one of the numbers to Alice and only one number to Bob. Alice multiplies her numbers as usual. What should Bob do? In order for the final answer to be correct, Bob reports his answer simply as the number on his list. The same argument holds for addition. 9.4 The formula is correct provided 0 ≤ k ≤ n. If k > n then we have the nonsensical situation where the denominator contains the factorial of a negative integer. If k < 0 the notation (n)k is nonsense. The correct statement is: If n, k are integers with 0 ≤ k ≤ n, then (n)k =

n! (n−k)! .

Proof. We know (Theorem 8.6) that (∗)

(n)k = n(n − 1)(n − 2) · · · (n − k + 1).

Since n ≥ k we have n − k ≥ 0 and so we can multiply both sides of (∗) by (n − k)! to give (n)k · (n − k)! = [(n) · · · (n − k + 1)] · (n − k)! = n! Now (n − k)! 6= 0 so we can divide both sides of this by (n − k)! to give the result. 9.5 9900. 9.6 1002 < 1010 < 2100 < 100! < 100100 . 9.7 The values of n!, its approximation, and the relative error for n = 10, 20, 30, 40, 50 are given in the following chart.

Instructor’s Manual

25 n 10 20 30 40 50

true 3.629 × 106 2.433 × 1018 2.653 × 1032 8.159 × 1047 3.041 × 1064

approx 3.599 × 106 2.423 × 1018 2.645 × 1032 8.142 × 1047 3.036 × 1064

error −0.83% −0.42% −0.28% −0.21% −0.17%

9.8 (a) 945. (b) 0. (c) n + 1. (d) 1/n!. 9.9 (a) 1. (b) 5. (c) 23. (d) 119. (e) 719. Conjecture: 1 × 1! + 2 × 2! + · · · + n × n! = (n + 1)! − 1. This is proved combinatorially in Proposition 13.2. 9.10 In 1 × 2 × 3 × · · · × 100 there are 24 factors of 5 (20 from the numbers 5, 10, 15, . . . ) plus 4 more (from 25, 50, 75, and 100). There are more factors of 2. So all told there are 24 factors of 10 in 100!, so in base-10, 100! ends in 24 zeros. 9.11 Since 1000! is obviously divisible by all numbers between 2 and 1000, we see that 1000! + k is divisible by k so long as 2 ≤ k ≤ 1000. Now 1001 is divisible by 11, so 1000! + 1001 is divisible by 11, and 1002 is divisible by 2 (also 3), so 1000! + 1002 is divisible by 2. Therefore all the integers from 1000! + 2 through 1000! + 1002 are composite. 9.12 4! + 0! + 5! + 8! + 5! = 24 + 1 + 120 + 40320 + 120 = 40585 and so 40585 is a factorion. There are no others (which is an interesting challenge problem for your students). 9.13 To maintain n! = n×(n−1)! we would have 0! = 0×(−1)! but this is impossible since 0! = 1 and 1 6= 0 × x for any real number x. 9.14 00 = 1. From the perspective of list counting, we seek the number of lists of length 0 whose elements are drawn from a pool of 0 possibilities. This is convoluted, but there is one such list: the empty list: (). Alternatively, any empty product (i.e., a product with no factors) should be considered to be 1. 9.15

(a) 9!! = 9 × 7 × 5 × 3 × 1 = 945. (b) No, n!! 6= (n!)!. For example, 5!! = 15, but (5!)! = 120! ≈ 6.7 × 10198 . (c) Let n = 2k + 1. Then,

k

n!! = ∏ (2 j + 1). j=0

26

Mathematics: A Discrete Introduction

(d) Expand the RHS: (2k)! (2k)(2k − 1)(2k − 2)(2k − 3) · · · (2)(1) = k!2k (k)(k − 1)(k − 2) · · · (2)(1)2k and then rearrange the denominator to combine the factors of 2k with the factors of k!, like this: (2k)! (2k)(2k − 1)(2k − 2)(2k − 3) · · · (2)(1) = . k!2k [2k][2(k − 1)][2(k − 2)] · · · [2(2)][2(1)] Notice that the terms in the denominator exactly cancel the even terms in the numerator leaving only the odd terms: (2k − 1)(2k − 3) · · · (3)(1) which is exactly (2k − 1)!!. 9.16 n!. 9.17 The denominators give an archaic notation for factorial, e.g, the denominator below (x − a)2 stands for 2!. 9.18 For n = 0, 1, 2, 3, 4, the integral evaluates to √ 1, 1, 2, 6, and 24 respectively. In general, it 1 1 evaluates to n!. In case n = 2 it evaluates to 2 π.

10

Sets I: Introduction, Subsets

Many students will have seen this material, so it may be possible to move through the introduction of these topics. However, the proof techniques need to be emphasized. Encourage your students to use the proof templates. I have found many students stubbornly refusing to use the standard template for proving sets are equal and, as a result, are unable to write a decent proof. To prove A = B, have your students write “Suppose x ∈ A,” leave a huge blank space and write “and so x ∈ B” at the bottom of one page. And then have them write “Suppose x ∈ B” at the top of a second page and “therefore x ∈ A, and so A = B” at the bottom. Then have them go back and fill in the blanks1. Another great source of confusion is the difference between ∈ and ⊆. This needs to be emphasized. We avoid using the symbol ⊂ favoring the symbol ⊆. I know that many mathematicians use ⊂ to mean ⊆, but I doubt they use < to mean ≤! 10.1 (a) {0,  3, 6, 9}. (b) {2}. (c) {−2, 2}. (d) { }. (e) {∅}. (f) {−10, 10, −20, 20, −50, 50, −100, 100}. (g) ∅, {1}, {2}, {3}, {4}, {5} . 10.2

(a) {x ∈ Z : 1 ≤ x ≤ 10}. (b) {x ∈ Z : |x| ≤ 8 and 2|x}.

Instructor’s Manual

27

(c) {x ∈ Z : x > 0 and x is odd}. (d) {x ∈ Z : x ≤ 100 and x is a perfect square}. 3

10.3 (a) 21. (b) 2. (c) 0. (d) 0. (e) ∞. (f) 2(2 ) = 28 = 256. (g) 4. (h) 2. 10.4

(a) 2 ∈ {1, 2, 3}. (b) {2} ⊆ {1, 2, 3}.  (c) {2} ∈ {1}, {2}, {3} . (d) ∅ ⊆ {1, 2, 3}. (e) N ⊆ Z. (f) {2} ⊆ Z. (g) {2} ∈ 2Z .

10.5 Many answers are possible; here are some examples. (a) A = {1, 2}, B = {1, 2, 3}, and C = {1, 2, 3, 4}. (b) A = 1, B = {1}, and C = {1, 2}.  (c) A = 1, B = {1, 2}, C = {1, 2}, {3} .  (d) A = {1}, B = {1, 2}, and C = {1, 2}, {3} . 10.6

(a) Any set will do, say, A = {1, 2, 3}. (b) A = {∅}. (c) A = ∅, and this is the only answer possible. (d) No answer possible as ∅ cannot have any elements.

10.7

(a) This is true. Proof. We are given that A ⊆ B and B ⊆ C. Let x ∈ A. Then since A ⊆ B, we know that x ∈ B. Since B ⊆ C, we know x ∈ C. Therefore A ⊆ C.   (b) This is false. For example, take A = {1}, B = {1}}, and C = {1}, {2} . Note that A is not a subset of C because A’s only element, 1, is not an element of C. (c) This is true. Proof. We are given that A ∈ B and B ⊆ C. By definition of subset, every element of B is also an element of C. Therefore A ∈ C. n  o (d) This is false. For example, take A = {1}, B = {1}, {2} , and C = {1}, {2} .

28

Mathematics: A Discrete Introduction

10.8 (⇒) Suppose A = B. We first show A ⊆ B. Suppose x ∈ A. Since A = B, we have x ∈ B. Therefore A ⊆ B. By a similar argument, B ⊆ A. (⇐) Suppose A ⊆ B and B ⊆ A. We want to show A = B. Suppose x ∈ A. Since A ⊆ B, we have x ∈ B. Suppose y ∈ B. Since B ⊆ A, we have y ∈ A. Therefore A = B. 10.9 Proof. We are given that A ⊆ B, B ⊆ C, and C ⊆ A. From A ⊆ B and B ⊆ C, we know A ⊆ C [by Exercise 10.7(a)[. Since A ⊆ C and C ⊆ A, we have A = C [by Exercise 10.8]. 10.10 Suppose x ∈ A = {x ∈ Z : 4|x}. This means that x ∈ Z and 4|x. By definition of divisibility, there is an integer a so that x = 4a. We can write 4a as 2(2a), hence x = 2(2a) and so x is an integer divisible by 2. Thus x ∈ {x ∈ Z : 2|x} = B and therefore A ⊆ B. 10.11 Let a and b be integers. Let A = {x ∈ Z : a|x} and B = {x ∈ Z : b|x}. Claim A ⊆ B iff b|a. Proof. (⇒) Suppose A ⊆ B. Since a|a we have a ∈ B. Therefore b|a. (⇐) Suppose b|a. Let x ∈ A. Therefore a|x. Since b|x and x|a, we have (Proposition 5.3) b|a. 10.12 Let x ∈ C = {x ∈ Z : x|12}, so x is a divisor of 12; i.e., 12 = xa for some integer a. Multiply both sides by 3 and we have 36 = 3xa = (3a)x. Therefore x is a divisor of 36 and so x ∈ D. Therefore C ⊆ D. 10.13 Let c and d be integers, and let C = {x ∈ Z : x|c} and D = {x ∈ Z : x|d}. Then C ⊆ D iff c|d. Proof. (⇒) Suppose C ⊆ D. Note that c ∈ C and thus c ∈ D. Since c ∈ D we have c|d. (⇐) On the other hand, suppose c|d. To show C ⊆ D let x ∈ C. Thus x|c. We have c|d so, by Proposition 5.3, we have x|d, and so x ∈ D. Therefore C ⊆ D. 10.14 If x = ∅ then x ⊆ {x} because ∅ is a subset of any set. 10.15 Note that the middle term, q, of any triple (p, q, r) in T must be even because q = 2xy where x and y are integers. Observe that (8, 15, 17) ∈ P but (8, 15, 17) ∈ / T because 15 is not even.

Instructor’s Manual

11

29

Quantifiers

Singly quantified statements are usually easy to grasp. Doubly quantified statements are more difficult, and statements with three or more quantifiers become especially challenging for students. Negating quantified statements can be hard until students learn the rules ¬∀ = ∃¬ and ¬∃ = ∀¬. Negation of the statements becomes much easier when they can be done mechanically. 11.1 (a) ∀x ∈ Z, x is prime. (b) ∃x ∈ Z, x is not prime and x is not composite. (c) ∃x ∈ Z, x2 = 2. (d) ∀x ∈ Z, 5|x. (e) ∃x ∈ Z, 7|x. (f) ∀x ∈ Z, x2 ≥ 0. (g) ∀x ∈ Z ∃y ∈ Z, xy = 1. (h) ∃x ∈ Z ∃y ∈ Z, x/y = 10. (i) ∃x ∈ Z ∀y ∈ Z, xy = 0. (j) ∀x ∈ Z ∃y ∈ Z, y > x. (k) Let P denote the set of people and let T denote the set of possible times. The answer is ∀x ∈ P ∃y ∈ P ∃t ∈ T, x loves y at time t. 11.2 (a) ∃x ∈ Z, x is not prime. “There is an integer that is not prime.” (b) ∀x ∈ Z, x is prime or x is composite. “There is an integer that is either prime or composite.” (c) ∀x ∈ Z, x2 6= 2. “No matter what integer you choose, when you square it the answer is never 2.” Alternatively: “The square root of 2 is not an integer.” (d) ∃x ∈ Z, x is not divisible by 5. “There is an integer that is not divisible by 5.” (e) ∀x ∈ Z, x is not divisible by 7. “Every integer is not divisible by 7.” (f) ∃x ∈ Z, x2 6≥ 0. “There is an integer whose square is not greater than or equal to zero.” Alternatively: “There is an integer whose square is negative.” (g) ∃x ∈ Z ∀y ∈ Z, xy 6= 1. “There is an integer x such that no matter what integer we multiply x by, the answer is never 1.” (h) ∀x ∈ Z ∀y ∈ Z, x/y 6= 10. “For all integers x and y, x/y is never 10.” (i) ∀x ∈ Z ∃y ∈ Z, xy 6= 0. “Given any integer x, we can find an integer y such that xy is nonzero.”

30

Mathematics: A Discrete Introduction (j) ∃x ∈ Z ∀y ∈ Z, y 6> x. “There is an integer x such that every integer is not greater than x.” Alternatively: “There is greatest integer.” (k) There is a person who never loved anyone ever.

11.3 The sentence is ∀x ∈ P, ¬x is invited to my party which is equivalent to ¬∃x ∈ P, x is invited to my party or in plain English, no one is invited to my party. (Here P denotes the set of all people.) Presumably, the speaker meant ¬∀x ∈ P, x is invited to my party which is equivalent to ∃x ∈ P, ¬x is invited to my party meaning “Not everyone is invited to my party” or “There is at least one person who is not invited to my party.” 11.4 (a) False. (b) True. (c) False. (d) True. (e) False. (f) True. (g) True. (h) True. 11.5

(a) ∃x ∈ Z, x 6< 0: There is an integer that is not negative. (b) ∀x ∈ Z, x 6= x + 1: For every integer x, it is the case that x is not equal to x + 1. (c) ∀x ∈ N, x 6> 10: Every natural number is not larger than 10. (d) ∃x ∈ N, x + x 6= 2x: There is a natural number x for which x + x is not equal to 2x. (e) ∀x ∈ Z, ∃y ∈ Z, x 6> y: For every integer x, there is an integer y for which x is not greater than y. (f) ∃x ∈ Z, ∃y ∈ Z, x 6= y: There are integers x and y that are unequal. (g) ∃x ∈ Z, ∀y ∈ Z, x + y 6= 0: There is an integer x with the property that for any integer y the sum of x and y is not zero.

11.6 The sentences within both pairs mean the same thing. 11.7

(a) True. The only natural number whose square equals 4 is 2. (b) False. There are two integers whose squares equal 4, namely 2 and −2. (c) False. There are no natural numbers whose square equals 3. (d) True. The integer x = 0 has the property that xy = x for all integers y. Only 0 has this property because we must have 2x = x (y = 2) and from that we have x = 0.

Instructor’s Manual

31

(e) True. The integer x = 1 has the property that xy = y for all integers y. Only x = 1 has this property because if we take y to be any nonzero value, then xy = x yields x = 1 when we divide both sides by y. 11.8

(a) A region R is convex provided ∀a ∈ R, ∀b ∈ R, ∀x ∈ L(a, b), x ∈ R. (b) A region R is not convex provided ∃a ∈ R, ∃b ∈ R, ∃x ∈ L(a, b), x ∈ / R. (c) A region is not convex provided there are two points in that region such that the line segment joining those points contains a point that is not in the region. (d) Here’s a diagram to illustrate (b) [and (c)]:

R

a

x

b

L(a, b)

12

Sets II: Operations

The operations of union and intersection will undoubtedly be familiar to most students. The difference, symmetric difference, and Cartesian product of sets may be novel. The symmetric difference plays only a limited role in the sequel and you can consider omitting that material. The emphasis of this section is on writing proofs and basic counting problems. 12.1 (a) {1, 2, 3, 4, 5, 6, 7}. (b) {4, 5}. (c) {1, 2, 3}. (d) {6, 7}. (e) {1, 2, 3, 6, 7}. (f) {(1, 4), (1, 5), (1, 6), (1, 7), (2, 4), (2, 5), (2, 6), (2, 7), (3, 4), (3, 5), (3, 6), (3, 7), (4, 4), (4, 5), (4, 6), (4, 7), (5, 4), (5, 5), (5, 6), (5, 7)}.

32

Mathematics: A Discrete Introduction (g) {(4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (7, 1), (7, 2), (7, 3), (7, 4), (7, 5)}.

12.2 By Proposition 12.4, |A ∩ B| + |A ∪ B| = |A| + |B| = 10 + 7 = 17. 12.3 We have 10 ≤ |A ∪ B| ≤ 17. We know that |A ∪ B| = |A| + |B| − |A ∩ B|. If A and B have no overlap, we get the upper bound. If A and B overlap as much as possible, then |A ∪ B| = 10 + 7 − 7 = 10. Specifically, if A = {1, 2, . . . , 10} and B = {11, 12, . . . , 17}, then |A ∪ B| = 17. But if A = {1, 2, . . . , 10} and B = {1, 2, . . . , 7}, then |A ∪ B| = 10. By similar reasoning, 0 ≤ |A ∩ B| ≤ 7. If A = {1, 2, . . . , 10} and B = {11, 12, . . . , 17}, then |A ∩ B| = 0. But if A = {1, 2, . . . , 10} and B = {1, 2, . . . , 7}, then |A ∩ B| = 7. 12.4

(a) |`1 ∩ `2 | may be either 0 or 1. |`1 ∩ `2 | = 0 iff the lines are parallel or else |`1 ∩ `2 | = 1 iff they intersect (cross). (b) |C1 ∩C2 | may be one of 0, 1, or 2 exactly when the circles do not intersect, are tangent to each other, or intersect without being tangent, respectively.

12.5

• A ∪ B = B ∪ A: Suppose x ∈ A ∪ B. Then (x ∈ A) ∨ (x ∈ B). This is logically equivalent to (x ∈ B) ∨ (x ∈ A). Thus x ∈ B ∪ A. Likewise if x ∈ B ∪ A, we can show that x ∈ A ∪ B. Therefore A ∪ B = B ∪ A. • A ∩ B = B ∩ A: Same as previous proof, but replace ∧ for ∨. • A ∪ (B ∪C) = (A ∪ B) ∪C: Suppose x ∈ A ∪ (B ∪ C). This means that (x ∈ A) ∨ (x ∈ B ∪ C). This means that (x ∈ A) ∨ ((x ∈ B) ∨ (x ∈ C)). By the associative property for ∨ we have ((x ∈ A) ∨ (x ∈ B)) ∨ (x ∈ C) and so x ∈ (A ∪ B) or x ∈ C, hence x ∈ ((A ∪ B) ∪C). Likewise, if y ∈ ((A ∪ B) ∪ C) we have y ∈ A ∪ (B ∪ C). Therefore, A ∪ (B ∪ C) = (A ∪ B) ∪C. • A ∩ (B ∩C) = (A ∩ B) ∩C: Same as previous proof, only we change ∨ to ∧.

Instructor’s Manual

33

• A ∪ ∅ = A: Suppose x ∈ A ∪ ∅. This means that x ∈ A or x ∈ ∅. But x ∈ ∅ is impossible, so x ∈ A. On the other hand, x ∈ A certainly implies x ∈ A or x ∈ ∅, so x ∈ A ∪ ∅. Therefore A ∪ ∅ = A. • A ∩ ∅ = ∅: Since there can be no elements in ∅, there can be no elements that A and ∅ have in common. Therefore A ∩ ∅ can have no elements, i.e., A ∩ ∅ = ∅. • A ∪ (B ∩C) = (A ∪ B) ∩ (A ∪C): Suppose x ∈ A ∪ (B ∩ C). By definition, this means that (x ∈ A) ∨ ((x ∈ B) ∧ (x ∈ C). This is logically equivalent to ((x ∈ A) ∨ (x ∈ B)) ∧ ((x ∈ A) ∨ (x ∈ C)), hence x ∈ (A ∪ B) ∩ (A ∪C). On the other hand, if y ∈ (A∪B)∩(A∪C) this means that ((y ∈ A)∨(y ∈ B))∧((y ∈ A)∨ (y ∈ C)). This is logically equivalent to (y ∈ A) ∨ ((y ∈ B) ∧ (y ∈ C), i.e., y ∈ A ∪ (B ∩C). Therefore A ∪ (B ∩C) = (A ∪ B) ∩ (A ∪C). • A ∩ (B ∪C) = (A ∩ B) ∪ (A ∩C): Same as previous proof only we switch ∧ and ∨. 12.6 The elements of A ∩ B are in both A and B, while the elements of A ∆ B are either in A but not B, or else in B but not A; that is, they are not in both. 12.7 Here is a Venn diagram for the other distributive property. A

B

A

C

B

A∩ B

A ∩ (B ∪ C)

A

C

B

C A∩ C

B

C

B∪C

A

A

C

A

12.8 In my opinion, yes.

B

A

B

C (A ∩ B) ∪ (A ∩ C)

34

Mathematics: A Discrete Introduction

12.9 This is false. Let A = {1, 2, 3}, B = {3, 4, 5}, and C = {1, 5}. Notice that A ∩ B ∩C = ∅, so these sets satisfy the hypothesis of the statement. Now |A ∪ B ∪C| = 5, but |A| + |B| + |C| = 8. 12.10 Since A, B, and C are pairwise disjoint, we know that A and B ∪C are disjoint because A ∩ (B ∪C) = (A ∩ B) ∪ (A ∩C) = ∅ ∪ ∅ = ∅. Therefore |A ∪ (B ∪C)| = |A| + |B ∪C| and since B ∩C = ∅ we have |A ∪ (B ∪C)| = |A| + |B ∪C| = |A| + |B| + |C|. 12.11 This is true. Here is the proof. (⇒) Suppose A ∪ B = A ∩ B. We want to show that A = B. Let x ∈ A. Therefore x ∈ A ∪ B (definition of union). Therefore x ∈ A ∩ B (because A ∪ B = A ∩ B). Therefore x ∈ B (definition of intersection). Likewise, if x ∈ B, then x ∈ A. Thus A = B. (⇐) Suppose A = B. Then A ∪ B = A ∪ A = A and A ∩ B = A ∩ A = A. Therefore A ∪ B = A ∩ B. 12.12 This is false; here is a counterexample. Let A = {1, 2, 3} and B = {3, 4, 5}. Then |A ∆ B| = 4 but |A| + |B| − |A ∩ B| = 3 + 3 − 1 = 5. 12.13 This is true; here is a proof. We know that A ∆ B = (A − B) ∪ (B − A). To show |A ∆ B| = |A − B| + |B − A| it is enough to show that A − B and B − A are disjoint. Is it possible for there to be an element in both A − B and B − A? Clearly not because if x were in A − B it would be in A, but not B, and if x were also in B − A then x would not be in A. We clearly can’t have an element that is both in and not in A, so A − B and B − A have no element in common. Note: This is a primordial proof by contradiction. You may wish to postpone assigning this problem until after Section 20. 12.14 (1) Suppose x ∈ A−∅, therefore x ∈ A. If x ∈ A then also x ∈ / ∅, so x ∈ A−∅. Thus A−∅ = A. (2) The set ∅ − A is everything in ∅ that isn’t in A. Since there are no elements in ∅, we have ∅ − A = ∅. 12.15 (1) A ∆ A = (A − A) ∪ (A − A) = ∅ ∪ ∅ = ∅. (2) A ∆ ∅ = (A − ∅) ∪ (∅ − A) = A ∪ ∅ = A. (We used the previous problem to show this.)

Instructor’s Manual

35

12.16 If A − B = ∅, then if x ∈ A, then x must also be in B (otherwise A − B wouldn’t be empty), so A ⊆ B. On the other hand, if A ⊆ B, clearly there are no elements in A that are not in B, so A − B = ∅. 12.17 (⇒) Suppose A × B = B × A. We want to show that A = B. Suppose x ∈ A. Since B 6= ∅, there is a b ∈ B. Thus (x, b) ∈ A × B. Since A × B = B × A, we have (x, b) ∈ B × A. Therefore x ∈ B. Likewise, if x ∈ B, we have that x ∈ A. Therefore A = B. (⇐) Suppose A = B. Then A × B = A × A = B × A. Notice that if A = ∅ but B 6= ∅, then A × B = ∅ = B × A, but A 6= B. 12.18 Claim: A − B = B − A if and only if A = B.

Proof. (⇒) Suppose A = B. Then A − B = ∅ and B − A = ∅ (earlier problem) and so A − B = B − A. (⇐) Suppose A − B = B − A. Note that this implies that A − B = B − A = ∅ an element cannot both be in A (as in A − B) and not in A (as in B − A). Since A − B = ∅, we have A ⊆ B, and since B − A = ∅ we have B ⊆ A. Therefore A = B.

12.19 First, a standard proof. x ∈ A − (B ∪C) ⇐⇒ (x ∈ A) ∧ ¬(x ∈ B ∪C) ⇐⇒ (x ∈ A) ∧ ¬(x ∈ B ∨ x ∈ C) ⇐⇒ (x ∈ A) ∧ (x ∈ / B∧x ∈ / C) ⇐⇒ (x ∈ A ∧ x ∈ / B) ∧ (x ∈ A ∧ x ∈ / C) ⇐⇒ (x ∈ A − B) ∧ (x ∈ A −C) ⇐⇒ x ∈ (A − B) ∩ (A −C) hence A − (B ∪C) = (A − B) ∩ (A −C). And a Venn diagram “proof.”

36

Mathematics: A Discrete Introduction

A

B

A

C

B

C

B

A−B

A − (B ∪ C)

A

C

B

C

B∪C

A A

A

B

C A−C

A

B

C ( A − B) ∩ ( A − C)

The proofs of A − (B ∩C) = (A − B) ∪ (A −C) are similar. 12.20

(a) The union of convex regions is not necessarily convex as the following diagram (which is the union of two convex rectangles) shows:

(b) The intersection of convex sets is convex. Proof. Let R and R0 be convex sets, and let S = R ∩ R0 . Let a and b be any two points of S. We must show that x ∈ S. Note that a and b are both in R and both in R0 . Let x be any point on the line segment joining a and b. Since R is convex, x ∈ R. Since R0 is convex, x ∈ R0 . Therefore x ∈ R ∩ R0 = S as required. 12.21 (a) False. Take A = {1, 2, 3}, B = {3, 4, 5}, and C = {5, 6, 1}. Then A−(B−C) = A−{3, 4} = {1, 2} and (A − B) −C = {1, 2} −C = {2}. (b) True. If x ∈ (A − B) −C, then x ∈ A − B and x ∈ / C, and so x ∈ A but x ∈ / B and x ∈ / C. Thus x ∈ A −C (because x ∈ A and x ∈ / C) and x ∈ (A −C) − B (because x ∈ A −C and x ∈ / B). Thus (A − B) −C ⊆ (A −C) − B. Likewise, (A −C) − B ⊆ (A − B) −C. (c) False. Let A = {1, 2}, B = {2, 3}, and C = {2}. Then (A ∪ B) −C = {1, 3} but (A −C) ∩ (B −C) = ∅.

Instructor’s Manual

37

(d) False. Let B = {1, 2, 3} and C = {3, 4, 5}. Then A = B−C = {1, 2} but A∪C = {1, 2, 3, 4, 5} = 6 B. (e) False. Let A = {1, 2, 3} and C = {3, 4, 5} and B = A ∪C = {1, 2, 3, 4, 5}. Note that B −C = {1, 2} 6= A. (f) False. Let A = {1, 2, 3} and B = {3, 4, 5}. Then |A − B| = 2 6= 0 = |A| − |B|. (g) False. Let A = {1, 2, 3} and B = {3, 4, 5}. Then (A − B) ∪ B = {1, 2, 3, 4, 5} 6= A. (h) False. Let A = {1, 2, 3} and B = {3, 4, 5}. Then (A ∪ B) − B = {1, 2, 3, 4, 5} − {3, 4, 5} = {1, 2} 6= A. 12.22

(a) (⇒) Suppose A = B. Let x ∈ A. Then x ∈ / A. Then x ∈ / B. Then x ∈ B. Similarly, x ∈ B =⇒ x ∈ A. Therefore A = B. (⇐) Conversely, suppose A = B. Suppose x ∈ A. Then x ∈ / A. Then x ∈ / B. Then x ∈ B. Similarly, x ∈ B =⇒ x ∈ A. Therefore A = B. (b) Suppose x ∈ A. This means x ∈ / A. This means x ∈ A. On the other hand, suppose x ∈ A. Then x ∈ / A. So x ∈ A. Therefore A = A. (c) We use the fact that X ∪Y = X ∩Y . We have,  A ∪ B ∪C = (A ∪ B) ∪C = (A ∪ B) ∩C = A ∩ B ∩C = A ∩ B ∩C.

12.23 The following figure shows a four-set Venn diagram.

B

A

D C

The shaded portion is A ∆ B ∆C ∆ D. The figure has 16 “regions” if we define region based on which of the sets A, B, C, and/or D to which a point belongs. In the figure, some “regions” are disconnected. If we count connected regions, there must be at least 16.

38

Mathematics: A Discrete Introduction

12.24 Let X = A ∪ B. Then we have |A ∪ B ∪C| = |X ∪C| = |X| + |C| − |X ∩C|. Into this equation we make the following substitutions |X| = |A ∪ B| = |A| + |B| − |A ∩ B| |X ∩C| = |(A ∪ B) ∩C| = |(A ∩C) ∪ (B ∩C)| by distributive law = |A ∩C| + |B ∩C| − |(A ∩C) ∩ (B ∩C)| = |A ∩C| + |B ∩C| − |A ∩ B ∩C| which gives  |A ∪ B ∪C| = |A| + |B| − |A ∩ B| + |C|  − |A ∩C| + |B ∩C| − |A ∩ B ∩C| = |A| + |B| + |C| − |A ∩ B| − |A ∩C| − |B ∩C| + |A ∩ B ∩C|. 12.25 First, ⊆ corresponds to ⇒: We have A ⊆ B if and only if (x ∈ A) ⇒ (x ∈ B). Proof. (⇒) Suppose A ⊆ B. We must prove (x ∈ A) ⇒ (x ∈ B). To this end, suppose x ∈ A. Then, since A ⊆ B, we have x ∈ B, thus proving (x ∈ A) ⇒ (x ∈ B). (⇐) Suppose (x ∈ A) ⇒ (x ∈ B). We must prove A ⊆ B. To this end, suppose x ∈ A. Since (x ∈ A) ⇒ (x ∈ B), we know that x ∈ B. Therefore A ⊆ B. Second, ∆ corresponds to Y: We have z ∈ A ∆ B if and only if (z ∈ A) Y (z ∈ B). In this proof we use Exercise 7.16(b) that x Y y is logically equivalent to (x ∧ ¬y) ∨ ((¬x) ∧ y). Proof. By Definition 12.9 x ∈ A ∆ B if and only if x ∈ (A − B) ∪ (B − A). By definition of ∪ and − this is equivalent to ((x ∈ A) ∧ ¬(x ∈ B)) ∨ (¬(x ∈ A) ∧ (x ∈ B)) which, by Exercise 7.16(b) is equivalent to (x ∈ A) Y (x ∈ B).

Instructor’s Manual

39

12.26 Since ∪ is commutative (Theorem 12.3) we have A ∆ B = (A − B) ∪ (B − A) = (B − A) ∪ (A − B) = B ∆ A. 12.27 We have, since Y is associative, x ∈ A ∆ (B ∆C) ⇐⇒ (x ∈ A) Y [(x ∈ B) Y (x ∈ C)] ⇐⇒ [(x ∈ A) Y (x ∈ B)] Y (x ∈ C) ⇐⇒ x ∈ (A ∆ B) ∆C and therefore A ∆ (B ∆C) = (A ∆ B) ∆C. 12.28 A Venn diagram illustration of A ∆ (B ∆C) = (A ∆ B) ∆C. A

B

A

C

B

C

A∆B

(A ∆ B)∆ C

A

B

C B∆ C

A

B

C A ∆(B ∆ C)

12.29 This follows immediately from the Multiplication Principle (Theorem 8.2): The number of ordered pairs in A × B is the number of two-element lists we can form where there are |A| choices for the first element and (for each such choice) |B| choices for the second element. Thus |A × B| = |A| × |B|. 12.30 Four statements to prove: (a) A × (B ∪C) = (A × B) ∪ (A ×C).

40

Mathematics: A Discrete Introduction First, suppose x ∈ A × (B ∪ C). This means that x = (a, z) where a ∈ A and z ∈ B ∪ C. Since z ∈ B ∪ C we know either z ∈ B (in which case x = (a, z) ∈ A × B) or z ∈ C (in which case x = (a, z) ∈ A × C). Thus we know that x ∈ A × B or x ∈ A × C, hence x ∈ (A × B) ∪ (A ×C). Second, suppose x ∈ (A × B) ∪ (A × C). This means that x ∈ A × B or x ∈ A × C. If x ∈ A × B, this means that x = (a, b) with a ∈ A and b ∈ B. Since b ∈ B, clearly b ∈ B ∪C, so x = (a, b) ∈ A × (B ∪ C). Similarly, if x ∈ A × C, then x = (a, c) where a ∈ A and c ∈ C. Since c ∈ C, clearly we have c ∈ B ∪C, so x = (a, c) ∈ A × (B ∪C). In both cases, x ∈ A × (B ∪C). Therefore A × (B ∪C) = (A × B) ∪ (A ×C). (b) A × (B ∩C) = (A × B) ∩ (A ×C). Suppose first that x ∈ A × (B ∩ C). This means x = (a, z) where a ∈ A and z ∈ B ∩ C, i.e., z ∈ B and z ∈ C. Since a ∈ A and z ∈ B, we have x = (a, z) ∈ A × B. Similarly, x = (a, z) ∈ A ×C. Thus x ∈ (A × B) ∩ (A ×C). Suppose second that x ∈ (A × B) ∩ (A × C). This means that x ∈ A × B and x ∈ A × C. Because x ∈ A × B we can write x = (a, z) where a ∈ A and z ∈ B. Since x = (a, z) is also in A ×C we know that z ∈ C. Therefore z ∈ B ∩C and so x = (a, z) ∈ A × (B ∩C). Therefore A × (B ∩C) = (A × B) ∩ (A ×C). (c) A × (B −C) = (A × B) − (A ×C). Suppose first that x ∈ A × (B − C). Thus we can write x = (a, z) where a ∈ A and z ∈ B −C, i.e., z ∈ B, but z ∈ / C. Since z ∈ B we know that x = (a, z) ∈ A × B, but since z∈ / C we know that x = (a, z) ∈ / A ×C. Therefore x ∈ (A × B) − (A ×C). Suppose second that x ∈ (A × B) − (A × C). Thus we can write x = (a, z) where a ∈ A and z ∈ B, but (a, z) ∈ / A ×C so (since a ∈ A) we have z ∈ / C. Since z ∈ B but z ∈ / C, we have z ∈ B −C and therefore x = (a, z) ∈ A × (B −C). Therefore A × (B −C) = (A × B) − (A ×C). (d) A × (B ∆C) = (A × B) ∆ (A ×C). Suppose first that x ∈ A×(B∆C). Thus we can write x = (a, z) where a ∈ A and z ∈ B∆C. Thus either z ∈ B − C or z ∈ C − B. In case z ∈ B − C we have x = (a, z) ∈ A × B but x∈ / A ×C, and so x ∈ (A × B) ∆ (A ×C). Similarly, in case z ∈ C − B we have x = (a, z) ∈ A ×C but x ∈ / A × B, and so x ∈ (A × B) ∆ (A ×C). In both cases, x ∈ (A × B) ∆ (A ×C). Suppose second that x ∈ (A × B) ∆ (A ×C). This means that either (1) x ∈ (A × B) − (A × C), or (2) x ∈ (A ×C) − (A × B). In case (1) we have x = (a, z) with a ∈ A and z ∈ B −C, and so z ∈ B ∆C, so x = (a, z) ∈ A × (B ∆C). Case (2) is similar. Thus A × (B ∆C) = (A × B) ∆ (A ×C).

Instructor’s Manual

13

41

Combinatorial Proof: Two Examples

Combinatorial proof was gently introduced in Section 12. This section gives two solid examples of its use. This material precedes the introduction of binomial coefficients (Section 17), so we are somewhat constrained in the range of examples that can be presented. If you choose to emphasize combinatorial proof in your course, this section should prove most useful. One simple idea to present in your class: show that for positive integers a and b we have |a + a + {z· · · + a} = b| + b + {z· · · + b} b times

a times

by considering an a × b grid of dots counted in two different ways. 13.1 Proof. How many length-n lists can we form using the elements 0 and 1 (repetition allowed) in which the elements are not all zero? Answer 1: There are 2n − 1 such lists. Answer 2: Suppose the first 1 on the list appears in position k. How many such lists can we form? The first k − 1 elements of the list must be 0, position k must be a 1, and then the remaining n − k positions may be 0 or 1. Thus, there are 2n−k such lists. Summing over k = 1, 2, . . . , n gives 2n−1 + 2n−2 + · · · + 22 + 21 + 20 . Since answers 1 and 2 are both correct, we conclude that 20 + 21 + · · · + 2n−1 = 2n − 1. 13.2 (x − 1)(1 + x + x2 + · · · + xn−1 ) = (x + x2 + · · · xn ) − (1 + x + · · · + xn−1 ) = xn − 1. If we substitute x = 2, we get 20 + 21 + · · · + 2n−1 = 2n − 1. 13.3 For the first part, consider the question: “How many length-n lists can we form using the elements in {1, 2, 3} in which the elements are not all 3?” Answer 1: 3n − 1. Answer 2: In how many such lists does the first 1 or 2 appear in position k? For such lists, the first k − 1 elements must be 3 and then there are two choices for element k. The remaining n − k elements can be any of 1, 2, or 3, so there are 2 · 3n−k such lists. Summing over k = 1, 2, . . . , n gives 2 · 3n−1 + 2 · 3n−2 + · · · + 2 · 30 . Since answers 1 and 2 are both correct, we have 2 · 30 + 2 · 31 + · · · + 2 · 3n−1 = 3n − 1.

42

Mathematics: A Discrete Introduction For the second part, the identity 9 · 100 + · · · + 9 · 10n−1 = 10n − 1 is encapsulated in the following addition problem: n

+

z }| { 999 . . . 999 1 1000 . . . 000

13.4 See the following diagram.

a+b a−b a

b

a a−b

b a−b

b

There are clearly (a − b)(a + b) dots in the upper figure. We move (and rotate) the right (a − b) × b rectangle of dots as shown. The second figure is an a × a square from which a b × b square of dots has been deleted. Thus the second figure has a2 − b2 dots. Since no dots were created or destroyed, (a − b)(a + b) = a2 − b2 . 13.5 How many length-two lists can we make from n elements? On the one hand, the answer is n2 .

Instructor’s Manual

43

On the other hand, the list might contain two distinct elements or the same element repeated. In the former case, there are n(n − 1) such lists and in the latter there are n. Thus the number of lists is n(n − 1) + n. Since these are both correct answers to the same question, we have n2 = n(n − 1) + n. 13.6

(a) There are (n + 1)2 lists with a < b or a > b. Since there are the same number of lists in which a is smaller as in which b is smaller, the number of lists with a < b is 12 (n + 1)2 = (n + 1)n/2. (b) Consider those lists (a, b) with a < b in which b equals the number k (where k is between 1 and n inclusive). Since 0 ≤ a < b when b = k, there are k choices for a. Taken together, there are 1 + 2 + · · · + n possible lists.

13.7 The answer to the first question is 2a − 1 because there are a lists of the form (?, a) and another a lists of the form (a, ?). However, this counts the list (a, a) twice, so the final answer is 2a − 1. For the second part, we consider the number of two-element lists using the integers 1 through n. There are n2 such lists. But another way to think about this is to consider two-element lists whose largest entry is 1, 2, 3, . . . , n. The number of such lists is 1, 3, 5, . . . , 2n − 1, respectively. Thus, in total, there are 1 + 3 + 5 + · · · + (2n − 1) two-element lists. Since these are both correct answers to the same counting problem, the formula follows.

Chapter 3

Counting and Relations 14

Relations

In the previous chapters we did not give explicit definitions of terms such as integer, list, or set. It would be possible to be soft on the notion of relation as well as “defining” it as a binary “predicate.” However, the abstract definition of relation is not terribly difficult, and is a good introduction to an abstract definition. There are two choices for defining relations. One method would be to define a relation from A to B as a triple (A, B, R) where A and B are sets and R ⊆ A × B. I think this definition is too baroque for new students. They have enough trouble thinking about a relation as a set of ordered pairs! Also, with this definition, we might have two relations (A, B, R) and (A0 , B0 , R) where A ⊂ A0 and B ⊂ B0 . Technically, these relations are not the same even though the extra elements in A0 and B0 never appear in R. I dislike this. It is much simpler, and completely correct, to define a relation as simply a set of ordered pairs. (This has implications on how we define functions in Section 24.) The phrase “R is a relation from A to B” then means R ⊆ A × B. In this section we define the various adjectives that qualify relations such as reflexive, transitive, etc. You may safely omit irreflexive—it is not used in the sequel. And you may also omit antisymmetric if you do not plan to cover partially ordered sets. A good way to discuss these adjectives is to use human relations. Discuss the relations hasthe-same-birthday-as, has-a-common-parent-as, is-the-parent-of, and is-a-sibling-of relations and which of the various properties these relations enjoy. Technically it is incorrect to say “R is a reflexive relation.” The term reflexive applies only in the context of a given domain for R. So we may say “R is reflexive on A” to mean {(a, a) : a ∈ A} ⊆ R. However, in most applications, the set A is either explicitly or implicitly known, and so “R is reflexive” is an abbreviation for “R is reflexive on A.” 14.1

(a) {(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}. (b) {(1, 1), (2, 1), (2, 2), (3, 1), (3, 3), (4, 1), (4, 2), (4, 4), (5, 1), (5, 5)}. (c) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)}. (d) {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)}.

14.2

(a) is-one-less-than. (b) is-greater-than-or-equal-to. (c) adds-to-six. (d) is-a-factor-of (or, more simply, divides). 44

Instructor’s Manual 14.3

45

(a) reflexive, symmetric, antisymmetric, transitive. (b) irreflexive, antisymmetric. (c) antisymmetric, transitive. (d) symmetric. (e) reflexive, symmetric, transitive.

14.4

(a) reflexive, symmetric, transitive. (b) irreflexive, antisymmetric. (c) reflexive, symmetric, transitive. (d) reflexive, symmetric. (e) irreflexive, symmetric. (f) irreflexive, antisymmetric, transitive.

14.5 This is rather silly. For arbitrary integers x and y, we have to show that if x = y and y = x, then x = y. But since we are given that x = y, there is nothing to prove. 14.6

(a) R = {(x, y) : |x − y| ≤ 2}. (b) R is reflexive: True. Proof. Let x be any integer. We have x R x because |x − x| = 0 ≤ 2. (c) R is irreflexive: False. Counterexample. Note that 0 R 0. (d) R is symmetric: True. Proof. Suppose x R y. Then |x − y| ≤ 2. Note that |x − y| = |y − x|, so |y − x| ≤ 2. Therefore y R x. (e) R is antisymmetric: False. Counterexample. Note that 1 R 2 and 2 R 1 because |1 − 2| = 1 ≤ 2. However, 1 6= 2. (f) R is transitive: False. Counterexample. Note that 1 R 3 and 3 R 5, but 1 6R 5.

14.7

(a) R−1 = {(2, 1), (3, 2), (4, 3)}. (b) R−1 = {(1, 1), (2, 2), (3, 3)}. (c) R−1 = {(x, y) : x, y ∈ Z, x − y = −1} or R−1 = {(x, y) : x, y ∈ Z, y − x = 1}. (d) R−1 = {(x, y) : x, y ∈ N, y|x}. (e) R−1 = {(x, y) : x, y ∈ Z, xy > 0}.

46

Mathematics: A Discrete Introduction

14.8 We are given that R = S−1 and want to show that S = R−1 . Suppose (x, y) ∈ S. Then (y, x) ∈ S−1 . Because S−1 = R, (y, x) ∈ R. Therefore (x, y) ∈ R−1 . Suppose (x, y) ∈ R−1 . Therefore (y, x) ∈ R. Because R = S−1 , (y, x) ∈ S−1 . Therefore (x, y) ∈ S. We have shown (x, y) ∈ S ⇐⇒ (x, y) ∈ R−1 . Therefore S = R−1 . Alternatively, this is just a disguised version of Proposition 14.6. 14.9 This is false. For example, let A = {1, 2, 3} and let R = {(1, 1), (2, 2), (3, 3)}. Note that R is antisymmetric (whenever x R y and y R x we have x = y), but not irreflexive (e.g., 1 R 1). 14.10 Properties of the “has-the-same-size-as” relation R defined on the set of finite subsets of Z. 1. R is reflexive: True. Proof. Let A be a finite subset of Z. Since |A| = |A|, we have A R A. 2. R is irreflexive: False. Counterexample. Clearly any finite set is the same size as itself, e.g., {1, 2} R {1, 2}. 3. R is symmetric: True. Proof. Let A, B be finite subsets of Z. Suppose A R B. This means that |A| = |B|, hence |B| = |A|. Therefore B R A. 4. R is antisymmetric: False. Counterexample. Note that {1, 2} R {3, 4} and {3, 4} R {1, 2}, but {1, 2} 6= {3, 4}. 5. R is transitive: True. Proof. Let A, B, and C be finite sets of integers and suppose A R B and B R C. This means that |A| = |B| and |B| = |C|. Therefore |A| = |C| and so A R C. Therefore R is transitive. 14.11 Properties of ⊆ on 2Z . 1. ⊆ is reflexive: True. Proof. For any set A we have A ⊆ A because if x ∈ A, clearly x ∈ A. 2. ⊆ is irreflexive: False. Counterexample. {1, 2, 3} ⊆ {1, 2, 3}.

Instructor’s Manual

47

3. ⊆ is symmetric: False. Counterexample. {1, 2} ⊆ {1, 2, 3}, but {1, 2, 3} 6⊆ {1, 2}. 4. ⊆ is antisymmetric: True. Proof. Suppose A ⊆ B and B ⊆ A. By Exercise 10.8, this implies A = B. 5. ⊆ is transitive: True. Proof. Suppose A ⊆ B and B ⊆ C. To show that A ⊆ C, suppose x ∈ A. Since A ⊆ B, we have x ∈ B. Since B ⊆ C, we have x ∈ C. Therefore A ⊆ C. 14.12 ≤−1 is ≥. 14.13

(a) Let A = {1, 2, 3} and let R = {(1, 2), (3, 3)}. Note that R is not reflexive (because 1 6R 1) and R is not irreflexive (because 3 R 3). (b) Let A = R = ∅. Note that R is both reflexive (vacuously) and irreflexive. This is the only possible example.

14.14 (⇒) Suppose R is symmetric. To show that R = R−1 we need to prove that the two sets, R and R−1 are the same. We use Proof Template 5. Suppose (x, y) ∈ R. Since R is symmetric, we have (y, x) ∈ R. This is equivalent to (x, y) ∈ R−1 . Suppose (x, y) ∈ R−1 . This means that (y, x) ∈ R. Because R is symmetric, we have (x, y) ∈ R. Therefore R = R−1 . (⇐) Suppose R = R−1 . We must prove that R is symmetric. Suppose x R y, i.e., (x, y) ∈ R. Because R = R−1 , we have (x, y) ∈ R−1 , which is equivalent to (y, x) ∈ R. Therefore y R x, so R is symmetric. 14.15 (⇒) Suppose R is antisymmetric. We need to prove that the set R ∩ R−1 is a subset of {(a, a) : a ∈ A} are equal. We use Proof Template 6. Suppose (x, y) ∈ R ∩ R−1 . This means that (x, y) ∈ R and (x, y) ∈ R−1 . The latter equation means that (y, x) ∈ R, i.e., we have x R y and y R x. Since R is antisymmetric, we have x = y. Therefore (x, y) = (x, x) and so (x, x) ∈ {(a, a) : a ∈ A}. Therefore R ∩ R−1 ⊆ {(a, a) : a ∈ A}. (⇐) Suppose R ∩ R−1 ⊆ {(a, a) : a ∈ A}. We must prove that R is antisymmetric. Suppose x R y and y R x. This means that (x, y) ∈ R and (y, x) ∈ R, i.e., (x, y) ∈ R−1 . Therefore (x, y) ∈ R ∩ R−1 . Since R ∩ R−1 ⊆ {(a, a) : a ∈ A}, we have (x, y) ∈ {(a, a) : a ∈ A}, and so x = y. Therefore R is antisymmetric.

48

Mathematics: A Discrete Introduction

14.16 Let A = {1, 2, 3} and let R = ∅. Note that (vacuously) R is both symmetric and transitive. However, R is not reflexive (since 1 6R 1). The problem with the proof is that it tacitly assumes there is a pair of elements (x, y) ∈ R. 14.17

(a) 1

2

5

10

(b) 2

1

3

4

5

(c) 1

2

3

4

5

(d) 1 2 2 3 3 4 4 5 5

(e)

15

–1

1

–2

2

–3

3

–4

4

–5

5

Equivalence Relations

Equivalence relations are central ideas in mathematics. Congruence of integers (mod n) is a particularly good example. It is vital that this be covered carefully if you plan to venture into the Number Theory material.

Instructor’s Manual

49

The square bracket notation [a] for an equivalence class is less than ideal because it does not include reference to the relation R. A better notation might be [a]R , but this becomes awkward to write. The only time this more elaborate notation would be needed is if we are discussing two different equivalence relations on a set. Then the unadorned [a] would be ambiguous. Equivalence relations motivate partitions (the subject of the following section) and are useful in counting problems. The phrase “R is an equivalence relation” is an abbreviation for “R is an equivalence relation on A” where (we hope) the set A is obvious. 15.1

(a) 2, 5, 10. (b) 5. (c) 2, 3, 6, 9, 18, 27, 54. (d) There are no integers N > 1 for which 23 ≡ 22 (mod N).

15.2 The largest integer N such that a ≡ b (mod N) is |a − b|. The possible integers for which the congruence is true are the divisors of a − b; these include ±(a − b), and so the largest is |a − b|. 15.3 (a) Yes. (b) No. (c) No. (d) No. (e) Yes. (f) No. (g) Yes. 15.4 Suppose x and y are both odd. By definition, we can find integers a and b so that x = 2a + 1 and y = 2b + 1. Now x − y = (2a + 1) − (2b + 1) = 2a − 2b = 2(a − b), so 2|(x − y). Therefore x ≡ y (mod 2). Suppose x and y are both even. Therefore, we can find integers a and b so that x = 2a and y = 2b. Now x − y = 2a − 2b = 2(a − b), so 2|(x − y). Therefore x ≡ y (mod 2). 15.5 Note that a − (−a) = 2a, hence a − (−a) is divisible by 2. Therefore a ≡ −a (mod 2). 15.6 Suppose x ≡ y (n) and y ≡ z (n). This means that n|(y − x) and n|(z − y). By Exercise 5.9, we have n|(y − x) + (z − y), i.e., n|z − x, so x ≡ z (n). 15.7

(a) [1] = {1, 2}. (b) [4] = {4}. (c) [123] = {120, 121, 122, 123, . . . , 129}. (d) [you] is the set containing you and your siblings. (e) [you] is the set containing all people born on your birthday.  (f) [{1, 3}] = {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 3}, {2, 4}, {2, 5}, {3, 4}, {3, 5}, {4, 5} .

15.8

(a) 10. (b) 366 (one for each day of the year, including February 29th).

50

Mathematics: A Discrete Introduction (c) 8 as there are eight blood types: A, B, AB, and O—each either plus or minus. (d) 50 (one for each U.S. state).

15.9 We use Proposition 15.12: To prove that [1] = [3], we just need to show that they have a common element. Note that 3 ∈ [1] because 3 ≡ 1 (mod 2). Also 3 ∈ [3] because 3 ≡ 3. Therefore [1] ∩ [3] 6= ∅, and so [1] = [3]. 15.10 We need to prove [

[a] = A.

a∈A

To prove two sets are equal we use Proof Template 5. Suppose x ∈ a∈A [a]. Then x ∈ [a] for some a ∈ A. Now [a] is the set of all elements in A equivalent to a, so clearly [a] ⊆ A. Since x ∈ [a], we have x ∈ A. S

On the other hand, suppose x ∈ A. Since x ∈ [x], we have x ∈ in the union is [x].

a∈A [a] because one of the terms

S

15.11 (⇒) Suppose a ∈ [b]. This means a R b. By symmetry, b R a. Therefore b ∈ [a]. The implication b ∈ [a] ⇒ a ∈ [b] has the same proof. 15.12 Suppose x, y ∈ [a]. This means x R a and y R a. This latter relation can be rewritten a R y. Applying transitivity to x R a and a R y, we have x R y. 15.13 Let us write [a]R for the equivalence class of a with respect to the relation R and [a]S for the equivalence class of a with respect to the relation S. (⇒) Suppose R = S. Then [a]R = {x ∈ A : x R a} = {x ∈ A : x S a} = [a]S (the middle equality is because R = S). Therefore the equivalence classes of R and S are the same. (⇐) Suppose the equivalence classes of R and S are the same. To prove R = S we can simply show, for all x, y ∈ A, that x R y ⇐⇒ x S y. Suppose x R y. This means x ∈ [y]R . Now we know that the equivalence classes of R and S are the same. So [y]R = [z]S for some z ∈ A. But since y ∈ [y]R , we know that y ∈ [z]S , therefore y S z and so (by Proposition 15.10) [z]S = [y]S . We have: x ∈ [y]R = [z]S = [y]S , and so x S y. The proof that x S y ⇒ x R y is the same. Therefore R = S. 15.14

(a) Here are four pictures (only three were requested). Each line in the diagram should be interpreted as a double arrow.

Instructor’s Manual

51

1

1

10

10

2

2

9

3

9

3

8

4

8

4

7

7

5

5

6

6

1

1

10

10

2

2

9

3

9

3

8

4

8

4

7

7

5

5

6

6

(b) The equivalence classes for these four relations are as follows: ∗ ∗ ∗ ∗

{1, 2}, {3, 4, 5}, and {6, 7, 8, 9, 10}. {1, 2, 3, 9, 10}, {4, 5, 6, 7, 8}. {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, and {10}. {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.

(c) An equivalence class’s picture consists of one or more collections of dots. Any two dots in one collection are joined to each other (in both directions) by arrows. There are no arrows between separate collections. 15.15 1

2

6 7 9 8 10

4

3 5

1 4

2 10

9 5

7 8

3

1

6

4 7

2 5

3

1

6

4 7

8 9

10

2

3 6

5

8 9

10

15.16 There are 5 equivalence relations on a 3-element set. They are 123, 12/3, 13/2, 23/1, and 1/2/3. (This notation is a shorthand. The meaning of 12/3 is the equivalence relation with the two equivalence classes {1, 2} and {3}.) There are 15 equivalence relations on a 4-element set. They are 1234, 1/234, 2/134, 3/124, 4/123, 12/34, 13/24, 14/23, 1/2/34, 1/3/24, 1/4/23, 2/3/14, 2/4/13, 3/4/34, and 1/2/3/4.

52

Mathematics: A Discrete Introduction

15.17 Every equivalence class of triangles in the is-similar-to relation can be described (uniquely) by three positive real numbers x, y, and z where x + y + z = 180. The numbers x, y, and z are the angles (measured in degrees) of the triangles in the class.

16

Partitions

Partitions are the “flip side” of equivalence relations. In this section we motivate the concept of partitions based on the fact that equivalence classes of a relation defined on a set A form a partition of A. We then apply the partition concept to solve counting problems.  16.1 We use the notation 1/23 to stand for the partition {1}, {2, 3} . The partitions of {1, 2, 3} are 1/2/3, 1/23, 2/13, 3/12, and 123. The partitions of {1, 2, 3, 4} are 1/2/3/4, 1/2/34, 1/3/24, 1/4/23, 2/3/14, 2/4/13, 3/4/12, 12/34, 13/24, 14/23, 1/234, 2/134, 3/124, 4/123, and 1234. 16.2 (a) 6!. (b)

8! 2! .

(c)

11! . 2!3

(d)

7! 2!×3! .

(e)

11! . 4!2 ×2!

16.3 5!/2!. 16.4 11!/6!. P

16.5 Let P be a partition on a set A and let ≡ be the is-in-the-same-part-as relation. We have P

two tasks: (1) every equivalence class of ≡ is a part of P and (2) every part of P is an P

equivalence class of ≡. P

For (1), let a ∈ A and let [a] be an equivalence class of ≡. We need to show that [a] is a part of P. Now one of the parts of P must contain a; let’s call that part P. We claim [a] = P. P

If x ∈ [a], this means that x≡a, which in turn means that x is-in-the-same-part-as a, i.e., x ∈ P. P

If x ∈ P, then x is-in-the-same-part-as a, i.e., x≡a, so x ∈ [a]. Therefore [a] = P, and so [a] is a part of the partition P. P

For (2), let P be a part of P. We need to prove that there is an equivalence class of ≡ equal to P. Since parts must be nonempty, the part P must contain at least one element, say a ∈ P. Claim [a] = P. P

Suppose x ∈ [a]. Thus x≡a, i.e., x is-in-the-same-part-as a, so x ∈ P. P

Suppose x ∈ P. Thus x is-in-the-same-part-as a, so x≡a, so x ∈ [a]. Therefore [a] = P.

Instructor’s Manual

53 P

We have shown that every part of P equals an equivalence class of ≡ and, conversely, every P

equivalence class of ≡ equals a part of P. This proves the result. 16.6 Let R be an equivalence class on A in which all equivalence classes contain exactly m elements. Let these equivalence classes be called C1 ,C2 , . . . ,Ct —this list of classes does not contain the same class twice. We know (1) |Ci | = m for every i, (2) the classes are pairwise disjoint, and (3) the union of the classes is A, i.e., C1 ∪C2 ∪ · · · ∪Ct = A. Because the classes are pairwise disjoint, but the generalized Addition Principle, we have |C1 | + |C2 | + · · · + |Ct | = |A|. Now since all |Ci | = m, we have mt = |A|



t=

|A| m

where t is the number of equivalence classes. 16.7 There are 12! ways to form a circle of 12 people (where we imagine the 12 people are standing on the 12 numbers of a clock face). Now two circles are equivalent if we can form one from the other by rotating the circle of dancers. Each equivalence class has size 12, so there are 12! 12 = 11! different arrangements. 16.8 The six men and six women stand on the numbers of a clock face. The 12 o’clock position can be occupied by any of the 12 people. Now the 1 o’clock is occupied by a member of the opposite gender (6 choices). The 2 o’clock position must switch gender again (5 choices), etc. All told, they can stand on the clock face in 12 × 6 × 5 × 5 × 4 × 4 × · · · × 1 × 1 ways. This number can be written 2(6!2 ). [Another argument: If the 12 o’clock position is occupied by a woman, then the even positions fill in in 6! ways and the odd positions in 6! ways for a total of 6!2 possibilities. Likewise, if the 12 o’clock position is occupied by a man, there are another 6!2 possibilities. Thus, all told, there are 2(6!2 ) possibilities.] Two circular arrangements of dancers are equivalent if we can get from one to another by a rotation. Each arrangement is in an equivalence class of size 12, so the answer is: 2(6!)2 6!2 = = 6!5!. 12 6

54

Mathematics: A Discrete Introduction

16.9 We can put beads onto the necklace in 20! ways. Two necklaces are the same if we can get one from the other by rotating or flipping it. Each equivalence class has size 40. Thus there are 20!/40 different possible necklaces. 16.10 There are 25! ways to fill the numbers into the array. Call two arrays equivalent if we can form one from the other by rearranging its columns. Each array is in an equivalence class of size 5!. Thus there are 25!/5! different possible arrays. 16.11 Line up the 20 players into a line; there are 20! ways of doing this. The first 10 players form one team, and the other 10 form a second team. Two line-ups are equivalent if they result in the formation of the same pair of teams. The size of an equivalence class is 10! × 10! × 2 because we can rearrange the line within a team (the first 10 or last 10) and we can switch the front and back halves of the line. Thus there are 20! 10! · 10! · 2 possible ways to form the teams. 16.12 Singles matches: The 40 club members line up; there are 40! ways to do this. We say that two of these lineups are equivalent if they result in the same matches. The first two players are to play against each other, the 3rd and 4th against each other, and so on. Each pair can swap their places in line (220 ways) and the 20 pairs can rearrange among themselves (20! ways); thus each lineup is in an equivalence class of size 220 20!. Hence there are

40! 220 20!

ways to make the matches. Doubles matches: From the analysis of singles matches, we know there are 40!/(220 20!) ways to form the twenty teams. By the exact same analysis, there are 20!/(210 10!) ways to partition those teams into ten matches. Thus, the number of ways to arrange the doubles matches is 40! 20! 40! · 10 = 30 . 20 2 20! 2 10! 2 10! Here is another analysis. The 40 players line up. The first match will be by the first two players versus the second two players. That is, if the first four players on the line are A, B, C, and D, then A and B are to play a doubles match against C and D. We now consider two lineups to be equivalent if they result in the same teams/matches. Note that A and B can swap places with each other, C and D can swap places with each other, and the first two players swap with the second two. That is, among the first four players, any of the following gives the same result:

Instructor’s Manual

55 AB/CD CD/AB

AB/DC DC/AB

BA/CD CD/BA

BA/DC DC/BA

Thus the first four players may rearrange among themselves in eight ways with no change to the final match up. Likewise for all ten groups of four. Finally, the ten groups of four can rearrange among themselves in 10! ways. Thus each equivalence class has size 810 10!. Thus, the number of ways to arrange the doubles matches is 40! 810 10!

=

40! 230 10!

.

16.13 There are 100! ways to line the 100 people up. We then put them into discussion groups by taking 10 people at a time off the line. Call two line-ups equivalent if they result in the same partition. Within a cluster of 10, the people can rearrange themselves and there will be no change in the groups. They can do this in 10!10 ways. Furthermore, the 10 clusters can be rearranged in 10! different ways, so each equivalence class has size 10!11 . Therefore, there are 100!/10!11 different ways to form the discussion groups. 16.14 There are 10!3 ways to form the quartets. Imagine the students form four lines of ten: one line for violinists, one for the violists, one for cellists, and one for the string bass players. The first students on the four lines form the first quartet, then the second students form the second quartet, and so forth. There are 10!4 ways to form these lines. However, two line-ups are equivalent if they result in the same partition, and there are 10! ways for the quartets to rearrange the quartets, so the number of different ways to partition the students into quartets is 10!4 /10! = 10!3 . 16.15 Let’s think about element 1’s part. Each of the other 3 elements (2, 3, and 4) might or might not be together with element 1. This suggests there are 23 = 8 different partitions possible. The error with this reasoning is that if all the other elements are in 1’s part, there are no elements left for the other part. There are only 7 partitions of {1, 2, 3, 4} into two parts. We can write these out: 1/234, 2/134, 3/124, 4/123, 12/34, 13/24, and 14/23. The analysis for the set {1, 2, 3, . . . , 100} is similar. There are 299 different ways to choose the elements in 1’s part, but we can’t take them all. So there are 299 − 1 different partitions (into two parts) possible. 16.16 There are 397 such partitions. Each number k, with 3 ≤ k ≤ 100, we must choose into which part to include k: 1’s part, 2’s part, or 3’s part. This is the same as counting 97-long lists each of whose elements is a 1, 2, or 3. 16.17 The number of partitions of A into 20 parts of size 5 is 100! ≈ 1098 5!20 20!

56

Mathematics: A Discrete Introduction and the number of partitions into 5 parts of size 20 is 100! ≈ 1064 . 20!5 5! So the number of partitions into 20 parts of size 5 is larger.

16.18 Here is a complicated answer: There are 642 ways to place the coins on the chess board. Each coin can go to 32 different locations, for a total of 322 equivalent positions. Thus there are 642 /322 = 4 different possibilities. The simple answer: Place coin #1 on either a black or a white square (2 possibilities) and place coin #2 on either a black or white square (again, two possibilities), for a total of 2 × 2 = 4 possibilities. 16.19 The answer is three. The coins can be both on black, both on white, one each on black and white. 16.20 Yes. Take A = P = ∅.

17

Binomial Coefficients

Binomial coefficients play a central  role in discrete mathematics. Indeed, the term combinatorics derives from combinations and nk is often described as the number of combinations of n things taken k at a time. The phrase “number of combinations of n things taken k at a time” is terribly confusing to students. It is much better to use the phrase “the number of k-element subsets of an n-element set.” The words combinations, things, and taken obscure a clear, simple concept.  It is also acceptable to think of nk as counting “unordered lists without repetition.” And if we seek a word beginning with the letter C, I like committee: Given n people, how many committees can we form that contain k members?  The approach I find clearest is to define nk as the number of k-element subsets of an n-element   set. (Then 35 makes sense—it’s zero.) We begin by working out the value of nk for special  values of n and k. From there, we derive the formula for nk , and prove that these numbers are the coefficients of (x + y)n and live in Pascal’s triangle. Students who have previously been exposed to binomial coefficients   may believe that the forn n n! mula k!(n−k)! is the definition of k . Of course, we could define k that way, and then prove it counts what we say it does. However, I think this is backwards, putting the answer before the question. n! As a difficult challenge, invite your students to prove k!(n−k)! is an integer without using the fact that its the answer to a counting problem. A rigorous proof that Pascal’s triangle generates the binomial coefficients requires induction; we revisit this issue later.

Instructor’s Manual

57

The poker problems are presented in the probability material as well. 17.1 (a) 1. (b) 1. (c) 9. (d) 9. (e) 0. (f) 1. (g) 1. (h) 0. 17.2 The twenty 3-element subsets of {1, 2, 3, 4, 5, 6} are these: {1, 2, 3} {1, 3, 5} {2, 3, 4} {2, 5, 6}

17.3

6 3

(a)



{1, 2, 4} {1, 3, 6} {2, 3, 5} {3, 4, 5}

{1, 2, 5} {1, 4, 5} {2, 3, 6} {3, 4, 6}

{1, 2, 6} {1, 4, 6} {2, 4, 5} {3, 5, 6}

{1, 3, 4} {1, 5, 6} {2, 4, 6} {4, 5, 6}

= 20.

6 3

 (2x)3 (−3)3 = −4320x3 so the answer is −4320.  3 17  20 3 17 (c) 20 3 x 1 + 3 x (−1) = 0, so the answer is 0.  (d) 63 = 20.

(b)

(e) 0. 17.4 There are 17.5

30 2

ways to select the socks and 2



30 2



ways to select socks and wear them.

20 2

 .

17.6 (a)

  . (b) 2n−k nk .

n k

17.7 This problem can be considered an anagram counting problem which leads immediately to 12! the answer 4!4!4! , but here is another analysis.  There are 12 ways to choose the location for the As and then, for each selection of the As, 4   8 8 there are 4 ways to choose the locations for the Bs. So the answer is 12 4 4 . This simplifies to 12! . 4!3 See also Exercises 17.28–31. 17.8 (a) 50!. (b)

50 10

 . (c) (50)3 = 50 · 49 · 48.

58

Mathematics: A Discrete Introduction

17.9 Here is the chart: {1, 2, 3} ↔ {4, 5, 6, 7}

{1, 2, 4} ↔ {3, 5, 6, 7}

{1, 2, 5} ↔ {3, 4, 6, 7}

{1, 2, 6} ↔ {3, 4, 5, 7}

{1, 2, 7} ↔ {3, 4, 5, 6}

{1, 3, 4} ↔ {2, 5, 6, 7}

{1, 3, 5} ↔ {2, 4, 6, 7}

{1, 3, 6} ↔ {2, 4, 5, 7}

{1, 3, 7} ↔ {2, 4, 5, 6}

{1, 4, 5} ↔ {2, 3, 6, 7}

{1, 4, 6} ↔ {2, 3, 5, 7}

{1, 4, 7} ↔ {2, 3, 5, 6}

{1, 5, 6} ↔ {2, 3, 4, 7}

{1, 5, 7} ↔ {2, 3, 4, 6}

{1, 6, 7} ↔ {2, 3, 4, 5}

{2, 3, 4} ↔ {1, 5, 6, 7}

{2, 3, 5} ↔ {1, 4, 6, 7}

{2, 3, 6} ↔ {1, 4, 5, 7}

{2, 3, 7} ↔ {1, 4, 5, 6}

{2, 4, 5} ↔ {1, 3, 6, 7}

{2, 4, 6} ↔ {1, 3, 5, 7}

{2, 4, 7} ↔ {1, 3, 5, 6}

{2, 5, 6} ↔ {1, 3, 4, 7}

{2, 5, 7} ↔ {1, 3, 4, 6}

{2, 6, 7} ↔ {1, 3, 4, 5}

{3, 4, 5} ↔ {1, 2, 6, 7}

{3, 4, 6} ↔ {1, 2, 5, 7}

{3, 4, 7} ↔ {1, 2, 5, 6}

{3, 5, 6} ↔ {1, 2, 4, 7}

{3, 5, 7} ↔ {1, 2, 4, 6}

{3, 6, 7} ↔ {1, 2, 4, 5}

{4, 5, 6} ↔ {1, 2, 3, 7}

{4, 5, 7} ↔ {1, 2, 3, 6}

{4, 6, 7} ↔ {1, 2, 3, 5}

{5, 6, 7} ↔ {1, 2, 3, 4}. h i3 17.10 (a) 5 + 52 = 153 = 3375. (b) The problem can be broken into three cases depending on how many double actions are in the combination. Number of doubles Number of combinations Equals None 5×4×3 60  5 One 2×3 180 2 × 3 ×  5 3 Two × × 3 90 2 2 Grand total 330  17.11 We can choose the four elements for the size-4 part in n4 ways, and then the other elements are whatever they please. However, in case n= 8 both parts have size 4. In this case we have double counted, so the correct answer is 12 84 . 17.12 Every n-element subset  of a 2n-set can be paired with its complement, another n-element n subset. Since the 2 n subsets can be paired off, there must be an even number of them. This does not work when n = 0 because, in this context, ∅ is paired with itself.

Instructor’s Manual

59

17.13 Note that   n n! and = k k!(n − k)!   n n! n! = = n−k (n − k)![n − (n − k)]! (n − k)!k! and so

n k



=

n n−k

 .

17.14 We use combinatorial proof. Question: How many subsets does an n-element set have? Answer #1: 2n . Answer #2: For a given k, how many subsets of size k does an n-element set have? The sum of these, as k ranges from 0 to n is exactly the number of subsets of an n-element set. This can be written n   n ∑ k . k=0 Since #1 and #2 are both correct answers to the same question, we have n   n n 2 =∑ . k=0 k 17.15 By the Binomial Theorem,     n   n n n k n−k k n k n 0 = (1 − 1) = ∑ =∑ (−1) 1 (−1) 1 = ∑ (−1) k k=0 k k=0 k k=0         n n n n = − + −···± . 0 1 2 n n

The equation

n

            n n n n n n + + +··· = + + +··· 0 2 4 1 3 5

says that the number of subsets of an n-element set with an even number of elements equals the number of subsets with an odd number of elements. To find a one-to-one pairing between subsets of odd size with those of even size, consider that element n is “weird.” Given a subset that contains the weird element, pair it with the subset formed by deleting that weird element. This changes the subset size by exactly one, so even subsets are paired with odd subsets. Therefore, there must be an equal number of even and odd subsets.

60

Mathematics: A Discrete Introduction

17.16 Using the formula:   n n! n! =k k = k k!(n − k)! (k − 1)!(n − k)!   n−1 (n − 1)! n! n =n = k−1 (k − 1)![(n − 1) − (k − 1)]! (k − 1)!(n − k)! n k

and so k



=n

n−1 k−1

 .

Now a combinatorial proof. We ask: In how many ways can we choose a committee of k people chosen from n people, and designate one committee member as its chair? Answer #1: First  choose the k people, and then select one to be the chair. We can choose the n k people in k ways, andfor each such choice, there are k choices for who will chair. This  gives a total of nk k = k nk possibilities. Answer #2: First choose the chair, and then choose the remaining committee members. The chair can be selected in n ways. The members are then chosen  remaining k − 1 committeen−1  from the n − 1 other people in n−1 ways. This gives a total of n possibilities. k−1 k−1   Since #1 and #2 are correct answers to the same question, we have k nk = n n−1 k−1 . 17.17 Using the formula:    n k! n! k n! · = = k!(n − k)! m!(k − m)! (n − k)!m!(k − m)! k m    (n − m)! n! n n−m n! · = = m!(n − m)! (k − m)![(n − m) − (k − m)]! (n − k)!m!(k − m)! m k−m and so

n k

 k m

=

n m



n−m k−m

 .

Combinatorially. Imagine a collection of n people from which we select k to form a committee, and then m of the committee members are to be leaders for the committee. In how many ways can we make this selection?  Answer #1: Choose the committee in nk ways, and then choose the leaders from among the    members of the committee in mk ways for a total of nk mk .  Answer #2: Choose the leaders first in mn ways and then select the remaining k − m ordinary  members of the committee from the remaining n − m people in n−m ways for a total of k−m   n n−m m k−m .     Since these two results are correct answers to the same question, we have nk mk = mn n−m k−m .

Instructor’s Manual 17.18

m+1 2

61

n+1 2

 . To understand why, pick the row boundaries in  boundaries in n+1 ways. 2 

m+1 2



ways and pick the column

17.19 Suppose we have a set of 2n + 2 people that contains two weirdos, X and Y . We ask: In how many ways can we select a subset of size n + 1 from these 2n + 2 people? Answer #1:

2n+2 n+1

 .

Answer #2: We might have no, one, or two weirdos in the subset.  2n If there are no weirdos, there are n+1 ways to select the subset.    If there is one weirdo, then there are 2n + 2n = 2 2n ways to pick the subset. [The first n n n  2n n counts those subsets containing X and the second counts those containing Y .]  2n If there are two weirdos, then there are n−1 ways to pick the remaining normal people.    2n 2n Thus, all together, there are n+1 + 2 2n n + n−1 ways to choose the subset. Since the two answers are correct, we have         2n + 2 2n 2n 2n + . = +2 n+1 n+1 n n−1  17.20 Note that n − n2 = (2n − n(n − 1))/2 = n(3 − n)/2. For n = 1 or n = 2 this evaluates to 1.  For n = 3 this evaluates to 0. And for n > 3 this is negative. So, in all cases, n − n2 ≤ 1. 17.21 Using Stirling’s formula: p   2π(2n)(2n)2n e−2n 2n (2n)! (2n)! √ = ≈ = n!n! (n!)2 n [ 2πnnn e−n ]2 √ 4πn · 22n n2n e−2n 1 = = √ 4n 2πn · n2n e−2n πn Notice that this is less than 4n . For the second part, note that the number of n-element subsets of a 2n-set is clearly less than the number of all subsets of a 2n-set (except when n = 0) and so   2n < 22n = 4n . n

62

Mathematics: A Discrete Introduction

17.22 We write everything in terms of factorials, find a common denominator, and hope for the best:     n−1 n−1 (n − 1)! (n − 1)! + = + k−1 k (k − 1)![(n − 1) − (k − 1)]! k![(n − 1) − k]! (n − 1)! (n − 1)! = + (k − 1)!(n − k)! k!(n − k − 1)! (n − 1)! n−k (n − 1)! k + · = · k (k − 1)!(n − k)! n − k k!(n − k − 1)! (k)(n − 1)! (n − k)(n − 1)! = + k!(n − k)! k!(n − k)! [k + (n − k)](n − 1)! = k!(n − k)!   n n! = = . k!(n − k)! k 17.23 Question: How many 3-element subsets does {1, 2, 3, . . . , n} have?  Answer #1: n3 . Answer #2: Consider the largest element in the 3-element subset. It might be 3, 4, 5, . . . ,  or n. If the largest element is 3, there are only 22 ways to select the smaller elements. If  the largest element is 4, there are 32 ways to pick the remaining elements. In general, if the  largest element is k, there are k−1 ways to fill in the other two elements. This holds for 2 k = 3, . . . , n, giving a total of         2 3 4 n−1 + + +···+ 2 2 2 2 3-element subsets of {1, 2, . . . , n}. Since #1 and #2 are correct answers to the same question, the result follows. 17.24 The general result is:           n m m+1 m+2 n−1 = + + +···+ . m+1 m m m m The answer is similar to the previous one. We ask: How many (m + 1)-element subsets does {1, 2, . . . , n} have?  n Answer #1: m+1 .  Answer #2: How many such subsets have largest element k? Clearly: k−1 m . Summing over all possible k (namely k = m + 1 to k = n) we get         m m+1 m+2 n−1 + + +···+ . m m m m

Instructor’s Manual

63

Since #1 and #2 are correct answers to the same question, the result follows. 17.25 Algebraic solution: We have (by Proposition 17.5):   n+1 1 + 2 + · · · + (n − 1) + n = 2   n 1 + 2 + · · · + (n − 1) = . 2 Adding these, on the left we get 1 + 2 + 3 + · · · + (n − 1) + n + (n − 1) + (n − 2) + · · · + 2 + 1 and on the right we have     n+1 n (n + 1)n n(n − 1) (n2 + n) + (n2 − n) 2n2 + = + = = = n2 . 2 2 2 2 2 2 Geometric solution:

17.26 Consider a class of 2n children with exactly n boys and n girls. Question: In how many ways can we choose n of them to serve on a special committee?  Answer #1: 2n n .  n  Answer #2: Suppose the committee has a girls and n − a boys. Then there are na n−a ways    n  n n n to select the children. Summing over all possible values of a we get 0 n + 1 n−1 +  n   n   n n n n + · · · + + 2 n−2 n−1 1 n 0 . Since #1 and #2 are correct answers to the same question, the result follows.  17.27 10 9 .  17.28 nk .  17.29 (a) 6. (b) 0. (c) 1. (d) 10 7 = 120. (e) 0.

64 17.30

Mathematics: A Discrete Introduction (a) We can think of the label assignment procedure as proceeding in two steps. First, we select those elements of the n-set that get Type 1 labels. There are na ways to make that selection. Then, from among  the remaining n − a elements we selected b to receive n−a Type 2 labels; there are b ways to make that selection. (The n−a−b  remaining  elements must now get Type 3 labels.) All told there are nk n−a ways to affix the b labels. (b) Here are two proofs. First, we can use part (a) and expand the binomial coefficients into factorials as follows:      n n n−a (n − a)! n! n! = = · = . abc a b a!(n − a)! b!(n − a − b)! a!b!c! Alternatively, we can give a combinatorial proof. There are n! ways to line the elements up, i.e., to place them into a list (without repetition). We then put Type 1 labels on the first a elements, Type 2 labels on the next b elements, and Type 3 labels on the last c elements. We consider two of the n! lists to be equivalent if they result in the same label assignments; this is clearly an equivalence relation. Each equivalence class has size a!b!c! because we can reorder the first a, the middle b, and the last c among themselves in any way we desire and the result is the same distribution. Therefore (by Theorem 16.6) there are n!/(a!b!c!) different equivalence classes. (c) Since a + b + c 6= n, there is no way to distribute the requisite number of labels to the elements of an n-set, so a nb c = 0.

17.31 If we completely expand (x + y + z)n but do not collect like terms, we can think of each term as a list of xs, ys, and zs. How  many of these terms have exactly a x-terms, b y-terms, and c n z-terms? The answer is a b c . Thus when we collect like terms, we have n

(x + y + z) =

 n xa yb zc . abc





a+b+c=n

17.32

52 5

17.33

(a) 13 × 48. Choose the card to be repeated four times in 13 ways, and for each such choice, there are 48 choices for the last card. As a probability, this is exactly 1 in 4165, or about 0.00024.   (b) 13 × 43 × 12 the card to be tripled in 13 ways. 2 × 4 × 4. Choose the numerical value of  4 Of these, we need to select which three we use in 3 ways. Now the numerical value of the remaining cards are selected from among 12 different possibilities, and we must

 . This equals 2,598,960.

Instructor’s Manual

65

select two different such values. Finally, the suits of the two leftover cards are chosen in 4 × 4 possible ways. 88 As a probability, this is 4165 , or about 0.021.  13 (c) 5 × 4. Choose the 5 numerical values from among 13 possibilities, and then select the suit they will all have in 4 ways. 33 As a probability, this is 16660 , or about 0.00198.   (d) 13 × 43 × 12 × 42 . Select the numerical value of the tripled card in 13 ways, the suits  of those in 43 ways, the numerical value of the doubled card in 12 ways, and the suits  of the pair in 42 ways. 6 As a probability, this is 4165 , or about 0.00144.

(e) 9 × 45 . Select the starting card of the straight in 9 possible ways (from 2 to 10) and then the suits of the cards in 45 ways. 192 , or about 0.003546. As a probability, this is 54145 (f) 9 × 4. Select the starting card of the straight in 9 possible ways, and the suit in just 4 possible ways (since all the cards must be the same suit). 3 As a probability, this is 216580 , or about 0.00001385.

17.34 Multiplying the expanded (x + y)k by (x + y) is the same as adding the kth row of Pascal’s triangle to a shifted copy of itself. These are the same calculations we would do to compute the row k + 1 of Pascal’s triangle from row k. 17.35 For the first part, we have   n n! n(n − 1)(n − 2)(n − 3) = = . 4 4!(n − 4)! 4! For the main question, note that   n n! n(n − 1)(n − 2) · · · (n − k + 1) = = k!(n − k)! k! k and so   −(2k−1) −1 −1 −5 ( −1 )( −1 ( −1 )( −3 ) −1/2 2 − 1)( 2 − 2) · · · ( 2 − k + 1) 2 )( 2 ) · · · ( 2 = 2 = 2 k k! k! k k (−1) (1)(3)(5) · · · (2k − 1) (−1) (2k − 1)!! = = . 2k k! 2k k!   100 17.36 We can compute 100 See the Hint for this problem to establish the 30 in  30 − 1 additions.  n n pattern that to compute k it takes k − 1 additions. You may wish to revisit this problem after doing the sections on induction.

66

Mathematics: A Discrete Introduction To compute the entire 30th row we compute the 29th row (which contains 30 numbers) and do 29 additions (the 1s on the end of row 30 don’t require an addition). To compute row 29 from row 28 takes 28 additions. Continuing this way, we see that we can compute row 30 of Pascal’s triangle in   30 1 + 2 + 3 + · · · + 29 = = 435 2 additions. Of course, if we take advantage of the symmetry of Pascal’s triangle, we can do these calculations even faster.

17.37 Sierpinski’s triangle. (See Invitation to Dynamical Systems if you are intrigued.,)

18

Counting Multisets

This section is optional. None of the following material relies on it. It is not a difficult section, but you may choose to omit it if you are pressed for time. This section rounds out the four basic collection-counting problems. We can ask for the number of collections of size-k whose members are drawn from an n-element set. The four variations are: • The collection is ordered (i.e., a list) and repetition is forbidden. • The collection is ordered (i.e., a list) and repetition is allowed. • The collection is unordered and repetition is forbidden (i.e., a set). • The collection is unordered and repetition is allowed (i.e., a multiset). h· · · i is rather nonstandard, and alternatives should be freely used. HowThe angle-bracket notation  ever, the notation nk is especially nice, and I highly recommend its adoption. I learned of it in Richard Stanley’s Enumerative Combinatorics book. This section concludes with an extension of the Binomial Theorem to negative exponents. It’s difficult to be completely rigorous here without introducing either the notion of convergence or developing the theory of formal power series. We opt for an informal version of formal power series.  18.1 For 32 : We list all six 2-element multisets we can form with the elements in {1, 2, 3}. They are h1, 1i, h1, 2i, h1, 3i, h2, 2i, h2, 3i, h3, 3i.    Theorem 18.8 gives 32 = 3+2−1 = 42 = 6. 2  For 23 : We list all four 3-element multisets we can form with the elements in {1, 2}.They are h1, 1, 1i, h1, 1, 2i, h1, 2, 2i, h2, 2, 2i.    Theorem 18.8 gives 23 = 2+3−1 = 43 = 4. 3

Instructor’s Manual 18.2 For For 18.3

3 2 :  2 3 :



67

**||, *|*|, *||*, |**|, |*|*, and ||**. ***|, **|*, *|**, and |***.

0 n

(a)

= 0. Since n is positive, it is impossible to form a multiset of size n without any elements from which to choose. So no multisets of this form are possible.  (b) n0 = 1. There is only one empty multiset hi.  (c) 00 = 1. As in (b), there is only one empty multiset. 

18.4 Infinitely many. 18.5 h1, 4, 4, 4i. 18.6 There are k + 1 multisets of size k we can form from the elements of {1, 2} because the multiset can have j 1s (for any  value of j from 0 to k) and then the rest of the elements of the multiset must be 2s. Thus 2k = k + 1. 18.7

8 4

= 330 which is double

18.8

n k

=

 

n+k−1 k



=

4 8



= 165.

(n+k−1)! k!(n−1)! .

  18.9 By Theorem 18.8, nn = 2n−1 ; this is the number of n-element subsets of {1, 2, . . . , 2n − 1}. n  2n However, n is the number of n-element subsets of a larger set, namely {1, 2, . . . , n} and so    is greater than 2n−1 . Thus nn < 2n n n .   2n−1  By Pascal’s identity (Theorem 17.10) we have 2n = 2n−1 + n . But notice that 2n−1 = n n−1 n−1  2n−1 (by Proposition 17.7). Thus n       2n 2n − 1 n =2 =2 n n n and so

2n n



is twice as large as

n n



for all n > 0.

18.10 The result for x = 2 is nonsensical. We get 1 + 2 + 4 + 8 + · · · = −1. However, for x =

1 10

we get 1+

1 1 1 + + +··· 10 100 1000

which, when expressed as a decimal, is 1.11111 . . .. This repeating decimal evaluates to 10/9 and, indeed, substituting 1/10 into 1/(1 − x) gives 10/9—the correct answer. The point is that identities with infinite sums need to be handled carefully.

68

Mathematics: A Discrete Introduction

18.11 We have

      2a 2a + a − 1 3a − 1 (3a − 1)! = = = a a a a!(2a − 1)!

and

      a a + 2a − 1 3a − 1 (3a − 1)! . = = = (2a)!(a − 1)! 2a 2a 2a

Dividing the first by the second we have 2a a  a 2a



Therefore

2a a



=

(3a−1)! a!(2a−1)! (3a−1)! (2a)!(a−1)!

is twice as large as

a 2a



=

(2a)!(a − 1)! 2a = = 2. (2a − 1)!a! a

for all positive integers a.

Notice that the proof breaks down for a = 0. This problem makes a good jumping-off for a student project. One can show that for  point  an n positive integers a and n that n ÷ an = a. This can be done by expanding everything into factorials, but it can also be by fiddling with stars and bars. After  done combinatorially  an bn that, students can consider bn ÷ an for positive a, b, and n.     . From Theorem 18.8 we have nk = n+k−1 . Letting n = 18.12 We claim that ab = a−b+1 b k a − b + 1 and k = b in this formula gives       a−b+1 (a − b + 1) + b − 1 a = = . b b b 18.13 To count

n k we form sequences of n + k − 1 symbols of which k are stars  k+1 n−1 we form sequences of (k + 1) + (n − 1) − 1 = n + k − 1



To count n − 1 are stars and (n + k − 1) − (n − 1) = k are bars.

and n − 1 are bars. symbols of which

So, if we swap stars for bars, we have a one-for-one correspondence between k-element multisets formed from {1, 2, . . . , n} and (n − 1)-element subsets formed from {1, 2, . . . , k + 1}. 18.14

(a) Since we must use all the elements in {1, 2, . . . , n} at least once, and since the multisets weare forming have exactly n elements, the only possible multiset is h1, 2, . . . , ni. Thus,  n n = 1. (b) We must have all of the elements {1, 2, . . . , n} in the multisets M. We may as well assume they are all in M. So far we have n elements in M. Theremaining k − n elements n may be chosen freely from {1, 2, . . . , n} and there are k−n ways to do this. Thus n   n k = k−n .

Instructor’s Manual

69

18.15 We use combinatorial proof. The question is: How many k-element multisets can we form  n using the integers 1 through n? The first answer is k . For the second answer, we consider how many times element n is in the multiset, M. If element n has multiplicity  0 in M, then the multiset M is made up solely of the integers 1 through n − 1, giving n−1 choices. k If element n has multiplicity 1 in M, then the rest of M is  a multiset with cardinality equal to n−1 k − 1 using the integers 1 through n − 1. There are k−1 ways to form M. If element n has multiplicity 2 in M, then the rest of M is  a multiset with cardinality equal to k − 2 using the integers 1 through n − 1. There are n−1 k−2 ways to form M. In general, if n has multiplicity j in M, then the rest  of M is a multiset with cardinality k − j using the integers 1 through n − 1. There are n−1 k− j ways to form M. This holds for all j with 0 ≤ j ≤ k. Thus the second answer to the question is  k  n−1 ∑ k− j j=0 which equals (after we reverse the order of its terms)         n−1 n−1 n−1 n−1 + + +···+ . 0 1 2 k 18.16 This calls for combinatorial proof. The question is “How many multisets of size k can we form using the integers 1 through n?”  The simple answer: nk . The complicated answer: How many such multisets can we form whose largest element is . . .  1 – . . . 1? One! Or a fancy way to write one: k−1 . – . . . 2? This is more interesting. If the  largest element is 2, then the other elements are 2 k − 1 ones and twos. There are k−1 ways to fill in the set. – . . . and in general, j? If the largest  element is j, the remaining k − 1 elements can be j chosen from {1, 2, . . . , j} in k−1 ways. This holds for all j with 0 ≤ j ≤ n. Thus, another answer to the question is: n



j=1

 j k−1



which can be written 1 k−1





2 k−1

 +



 n . k−1

 +···+

70 18.17

Mathematics: A Discrete Introduction    (n+3)! (a) By Theorem 18.8, n4 = n+4−1 = n+3 = (n−1)!4! = (n + 3)(n + 2)(n + 1)n/4!. 4 4   n n 4 3 2 (b) We have 4 = (n − 6n + 11n − 6n)/4! and 4 = (n4 + 6n3 + 11n2 + 6n)/4!. The two expressions are nearly the same except the signs alternate in one and are all positive in the other.   k x (c) We show that −x k = (−1) k :   −x (−x)(−x − 1)(−x − 2) · · · (−x − k + 1) x(x + 1)(x + 2) · · · (x + k − 1) = = (−1)k k k! k!     x+k−1 x = (−1)k = (−1)k . k k (d) Applying part (c) and the answer to Exercise 17.35, we have     1/2 (−1)k (2k − 1)!! (2k − 1)!! k −1/2 = . = (−1) = (−1)k 2k k! 2k k! k k

18.18 Let n be a positive integer. Then       −n n n −n k k k (1 − x) = ∑ (−x) = ∑(−1) (−x) = ∑ xk . k k k k k k 18.19 Substituting n =

1 2

into ∑k

n k



xk gives

∞ 1 3 5 35 4 63 5 1 (2k − 1)!!  x k √ = 1 + x + x2 + x3 + x + x +··· . =∑ k! 2 2 8 16 128 256 1 − x k=0

Plugging in x =

1 2

gives

√ 11531 ≈ 1.40759 2≈ 8192 a rather disappointing approximation to 1.41421 . . .. √ Indeed, if we want to approximate √ 2 as a fraction whose denominator is 8192, the best numerator is 11585 which would give 2 ≈ 1.41418457 which is much closer.

19

Inclusion-Exclusion

The material in this section is optional and is used only rarely in the sequel. This material is more difficult and may be safely omitted from your course. It is also acceptable to return to this material at the end of the course if time permits. Even if you do not cover this section in its entirety, it may be worthwhile to present the inclusionexclusion formula for three sets (see Exercise 12.24).

Instructor’s Manual

71

19.1 Call the four groups of people A1 , A2 , A3 , and A4 . We are given: |Ai | = 1000 |Ai ∩ A j | = 100 |Ai ∩ A j ∩ Ak | = 10

4 such terms 6 such terms 4 such terms

|A1 ∩ A2 ∩ A3 ∩ A4 | = 1 Therefore, |A1 ∪ A2 ∪ A3 ∪ A4 | = 4 · 1000 − 6 · 100 + 4 · 10 − 1 = 3439. 19.2 Let A be those integers between 1 and 100 that are divisible by 2. Let B be those that are divisible by 5. The problem asks us to find |A ∪ B|. Note that A ∩ B are those integers between 1 and 100 that are divisible by both 2 and 5, i.e., that are divisible by 10. We calculate that |A| = 100/2 = 50, |B| = 100/5 = 20, and |A ∩ B| = 100/10 = 10. Therefore |A ∪ B| = |A| + |B| − |A ∩ B| = 50 + 20 − 10 = 60. 19.3 Put Z = {1, 2, . . . , 106 } and let A = {n ∈ Z : 2|n},

B = {n ∈ Z : 3|n},

and C = {n ∈ Z : 5|n}.

Then |A| = 500000, |B| = 333333, |C| = 200000, |A ∩ B| = 166666, |A ∩ C| = 100000, |B ∩ C| = 66666, and |A ∩ B ∩C| = 33333. We calculate |A ∪ B ∪C| = |A| + |B| + |C| − |A ∩ B| − |A ∩C| − |B ∩C| + |A ∩ B ∩C| = 500000 + 333333 + 200000 − 166666 − 100000 − 66666 + 33333 = 733334. Therefore the number of integers between 1 and one million that are divisible by none of 2, 3, or 5 is 1000000 − 733334 = 266666. 19.4 We are given that |A ∪ B ∪C| = |A| + |B| + |C|. We can also write |A ∪ B ∪C| = |A| + |B| + |C| − |A ∩ B| − |A ∩C| − |B ∩C| + |A ∩ B ∩C| Eliminating |A ∪ B ∪C| = |A| + |B| + |C|, this gives |A ∩ B ∩C| = |A ∩ B| + |A ∩C| + |B ∩C|. Now clearly |A ∩ B ∩C| ≤ |A ∩ B| |A ∩ B ∩C| ≤ |A ∩C| |A ∩ B ∩C| ≤ |B ∩C|

72

Mathematics: A Discrete Introduction and adding these inequalities gives 3|A ∩ B ∩C| ≤ |A ∩ B| + |A ∩C| + |B ∩C| = |A ∩ B ∩C|. Since |A ∩ B ∩C| is nonnegative the only way we could have 3|A ∩ B ∩C| ≤ |A ∩ B ∩C| is if |A ∩ B ∩C| = 0. But then we have |A ∩ B| + |A ∩C| + |B ∩C| = 0 and this is only possible if all three terms are zero. Therefore A, B, and C are pairwise disjoint!

19.5 Let Bi denote the set of “bad” words that are bad because letters i and i + 1 are the same (for i = 1, 2, 3, 4). We have: |Bi | = 264 |Bi ∩ B j | = 263 |Bi ∩ B j ∩ Bk | = 262 |B1 ∩ B2 ∩ B3 ∩ B4 | = 26 And so,

|B1 ∪ B2 ∪ B3 ∪ B4 | = 4 · 264 − 6 · 263 + 4 · 262 − 261

which we subtract from 265 to get 265 − 4 · 264 + 6 · 263 − 4 · 262 + 261 . Notice we can factor 26 out of this expression to give 26 264 − 4 · 263 + 6 · 262 − 4 · 261 + 1



and the term in parentheses is, by the Binomial Theorem, (26 − 1)4 , so the answer is 26 × 254 . 19.6 For (a), write 9 = (10 − 1), so n

  n 9 = [10 + (−1)] = ∑ 10n−k (−1)k . k k=0 n

n

For (b), we ask: How many length-n lists can we form using the digits 0 through 9 in which the digit 0 does not appear?

Instructor’s Manual

73

Answer #1: Clearly 9n since this is just a list in which we draw the element from 9 possibilities (the digits 1 through 9). Answer #2: Let Bi denote the set of lists in which the ith digit is a 0. Notice that |Bi | = 10n−1 , |Bi ∩ B j | = 10n−2 , etc., and the k-fold intersection has size 10n−k since k positions are fixed to be 0 and the remaining n − k positions may be any digit. Thus the number of “bad” lists is         n n n n n−1 n−2 n−3 10 − 10 + 10 − · · · ± 10n−n 1 2 3 n which we subtract from 10n (the total number of lists) to get the number of good lists:         n n n n 100 10n−3 + · · · ∓ 10n−2 − 10n−1 + 10n − n 3 2 1 which we can rewrite as

n

  n ∑ k (−1)k 10n−k . k=0

19.7 Let Bi denote those 6-digit numbers in which digits i, i + 1, and i + 2 are the same (for i = 1, 2, 3, 4). The sizes of the various intersections are as follows: – All Bi have size 104 . – B1 ∩ B2 , B2 ∩ B3 , and B3 ∩ B4 , all have size 103 . – B1 ∩ B3 , and B2 ∩ B4 , have size 102 . – B1 ∩ B4 has cardinality 102 . – The triple intersections B1 ∩ B2 ∩ B3 and B2 ∩ B3 ∩ B4 have size 102 . – The other triple intersections, B1 ∩ B2 ∩ B4 and B1 ∩ B3 ∩ B4 , have size 10. – The quadruple intersection has size 10. Thus, the number of bad 6-digit numbers is (by inclusion exclusion) 4 · 104 − (3 · 103 + 3 · 102 ) + (2 · 102 + 2 · 10) − 10 which equals 36,910. Subtracting this from 106 gives 963,090. 19.8 Let A be the set of paths that go through point A and let B be those that go through B. We  18 want to calculate 9 − |A ∪ B|. Notice that    6 12 |A| = , 4 5

   12 6 |B| = , 6 3

    6 6 6 and |A ∩ B| = 4 2 3

74

Mathematics: A Discrete Introduction and therefore           6 12 12 6 6 6 6 − |A ∪ B| = |A| + |B| − |A ∩ B| = + 4 5 6 3 4 2 3 and so the number of paths that avoid points A and B is             18 6 12 12 6 6 6 6 − − + . 9 4 5 6 3 4 2 3

19.9 The formula is exactly the same as the ordinary inclusion-exclusion formula, except that ∪ and ∩ are reversed. 19.10 For the first inequality (a) we want to show that |A| ≤ ∑ |Ai |. Pick an element x ∈ A and let nx denote the number of sets Ai for which x ∈ Ai . Note that nx ≥ 1 for all x ∈ A. Imagine a large chart whose columns are labeled by the set A1 , A2 , . . . , An and whose rows are labeled by the elements of A. Put a 1 in row x and column Ai if x ∈ Ai . Then the column sums are |Ai | and the row sums are nx and so n

∑ |Ai | = ∑ nx

i=1

x∈A

is the sum of all the entries in the chart. Thus, n

∑ |Ai | = ∑ nx ≥ ∑ 1 = |A|

i=1

x∈A

x∈A

and the proof of (a) is complete. The proof of (b) is similar. For each x ∈ A we consider how many times it is counted in n ∑i |Ai | − ∑i< j |Ai ∩ A j |. It is added to the total nx times and subtracted from the total 2x nx times, for a net nx − 2 contribution.  Recall from Exercise 17.20 that for all positive integers m we have m − m2 ≤ 1. We apply this to the numbers nx to finish the proof of (b):    nx ∑ |Ai | − ∑ |Ai ∩ A j | = ∑ nx − 2 ≤ ∑ 1 = |A|. i i< j x∈A x∈A 19.11 Let B = A1 ∩ A2 ∩ · · · ∩ An . The expression ∑i |Ai | counts every element at least once and overcounts those elements in more than one Ai . But it counts elements in B a total of n times each. So if we subtract (n − 1)|B| from ∑i |Ai |, the elements in B are only counted once each. Still, every element is counted at least once so we have |A| ≤ ∑i |Ai | − (n − 1)|B| as desired.

Instructor’s Manual

75

To show that the n − 1 coefficient cannot be strengthened to n, let A1 = {1, 2, 3},

A2 = {1, 4, 5},

A3 = {1, 6, 7},

and A4 = {1, 8, 9}.

Note that |A| = 9 but

∑ |Ai | − 4|A1 ∩ A2 ∩ A3 ∩ A4 | = 12 − 4 = 8 i

which would lead to the false conclusion that |A| ≤ 8. 19.12 limn→∞ pn = 1/e.

Chapter 4

More Proof 20

Contradiction

We begin by introducing proof of contrapositive in place of direct proof. This is a simple form of proof by contradiction and a reasonable way to “warm up” to the general idea of proof by contradiction. One way to demystify proof by contradiction is to think of trapping someone in a lie. Have students imagine that someone told them a lie. How would they “trap” the liar? Suppose Alice borrows Bob’s car, and tells him that she only drove a few miles when, in fact, she actually drove extensively. Bob might confront Alice by saying, “When you borrowed my car, I know it had a full tank of gas. When you returned it, it was nearly empty. If you had only driven a few miles, then the tank would not be almost empty. Therefore your assertion that you only drove a few miles must be false!” Proof by contradiction is akin to trapping a liar. We accept the lie for the moment, and then show that the lie leads to an impossible conclusion. Therefore the lie must be false. A natural way to introduce proof by contradiction is through Sudoku puzzles and we have end with a brief section on that theme. 20.1

(a) If x2 is not odd, then x is not odd. (b) If 2 p − 2 is not divisible by p, then p is not prime. (c) If x2 is not positive, then x is zero. (d) If a parallelogram is not a rhombus, then its diagonals are not perpendicular. (e) If the car will not start, then the battery is not fully charged. (f) If not C, then not A and not B.

20.2 The contrapositive of the contrapositive of an if-then statement is the original statement. Statement: a → b. Contrapositive: (¬b) → (¬a). Contrapositive of the contrapositive: [¬(¬a)] → [¬(¬b)] and canceling the double negatives gives a → b. 20.3 The two methods for proving A ⇐⇒ B are equivalent because ¬A ⇒ ¬B is the contrapositive of B ⇒ A. 20.4

(a) Let A, B, and C be sets with A ⊆ B and B ⊆ C. Suppose, for the sake of contradiction that A is not a subset of C. 76

Instructor’s Manual

77

(b) Let a and b be negative integers. Suppose, for the sake of contradiction, that a + b is nonnegative. (c) Let x be a rational number for which x2 is an integer. Suppose, for the sake of contradiction, that x is not an integer. (d) Let p and q be primes for which p + q is also prime. Suppose, for the sake of contradiction, neither p nor q is equal to 2. (e) Let ` be a line and let T be a triangle. Suppose, for the sake of contradiction, that ` intersects all three sides of T . (f) Let C1 and C2 be distinct circles. Suppose, for the sake of contradiction, there are three (or more) distinct points where C1 and C2 intersect. (g) Suppose, for the sake of contradiction, there were only finitely many primes. 20.5 Let x and x + 1 be consecutive integers. Suppose, for the sake of contradiction x and x + 1 were both even. Since x is even, there is an integer a with x = 2a. Since x + 1 is even, there is an integer b with x + 1 = 2b. Adding 1 to both sides of x = 2a we have x + 1 = 2a + 1, and since x + 1 = 2b, we have 2b = 2a + 1, which we can rewrite as 2(b − a) = 1 and so b − a = 12 . Since b and a are integers, so is 12 . But 12 is not an integer.⇒⇐ Therefore, consecutive integers cannot both be even. 20.6 We could write a proof nearly identical to the one from the previous problem (20.5), but here is another approach. Suppose x and x + 1 were consecutive odd integers. Then x + 1 and x + 2 are consecutive even integers (easy to prove), contradicting Exercise 20.5.⇒⇐ Therefore, consecutive integers cannot both be odd. 20.7 Let p and q be primes for which p + q is also prime. Suppose neither p nor q is 2. It follows that p and q are not divisible by 2, and so are odd. Furthermore, p, q > 2, so p + q > 4. Since p and q are odd, p + q is even, and so divisible by 2. Therefore p + q is not prime.⇒⇐ Therefore one of p or q must be 2. 20.8 Suppose, for the sake of contradiction, there is a real number x whose square is negative. By the trichotomy property, one of the following holds: x > 0, x = 0, or x < 0. (a) If x > 0, multiplying both sides by x (a positive quantity) gives x2 > x · 0 = 0, so x2 is positive.⇒⇐ (b) If x = 0, then x2 = 0.⇒⇐ (c) If x < 0, then x2 = (−x)(−x) and from case (a) we again have x2 > 0.⇒⇐

78

Mathematics: A Discrete Introduction In all cases we reach a contradiction, and so x2 is not negative.

20.9 Let a and b be real numbers with ab = 0. Suppose, for the sake of contradiction, that neither a nor b is 0. Since b 6= 0, it has a reciprocal b−1 . Thus ab = 0



ab · b−1 = 0 · b−1



a=0

which contradicts a 6= 0.⇒⇐ Therefore a = 0 or b = 0. √ a < a; we prove each part of this inequality separately. √ √ √ Suppose, for the sake of contradiction, that a 6> 1. This means that a ≤ 1. Since a ≤ 1, √ 2 √ we have ( a) ≤ 12 which gives a ≤ 1, but a > 1.⇒⇐ Therefore a > 1. √ √ Suppose, for the sake of contradiction, that a 6< a. This means that a ≥ a. Squaring both sides gives a ≥ a2 and then dividing both sides by a gives 1 ≥ a, but a > 1.⇒⇐ Therefore √ a < a.

20.10 We must show that 1
0 : 1 + 2 + · · · + n 6= (n)(n + 1)}. 2 Since the statement is false X 6= ∅. Let x be the least element of X. Note that x 6= 1 because 1 = 12 (1)(1 + 1). Thus, x > 1. This means that x − 1 is a positive integer and x − 1 ∈ X. Therefore 1 1 1 + 2 + · · · + (x − 1) = (x − 1)[(x − 1) + 1] = (x − 1)(x). 2 2

Instructor’s Manual

81

We add x to both sides of this equation to get 1 (x − 1)(x) + 2x x2 + x 1 1 + 2 + · · · + (x − 1) + x = (x − 1)(x) + x = = = (x)(x + 1) 2 2 2 2 and so x ∈ X, contradicting the fact that x ∈ / X.⇒⇐ 21.3 Suppose, for the sake of contradiction, the statement were false. Let X = {n ∈ N : n ≥ 2n }. Since the statement is false, X 6= ∅. Let x be the smallest element of X. Note that x 6= 0 because 0 < 20 . Also note that x 6= 1 because 1 < 21 . Thus x ≥ 2. This means that x − 1 ∈ N and x − 1 ∈ / X. Hence x − 1 < 2x−1 . Now x ≥ 2 implies 2x ≥ 2 + x, and so x ≤ 2x − 2 = 2(x − 1). Therefore not dividing by zero because x − 1 > 0).

x x−1

≤ 2 (and we are

Thus We know: x − 1 < 2x−1 x ≤2 and we know: 1  x − x ⇒ (x − 1) < 2 · 2x−1 x−1 Hence x < 2x contradicting the fact that x ∈ X.⇒⇐ Therefore the result is true. 21.4 Suppose the statement were false. Let X be the set of counterexamples, i.e., X = {n > 0 : n! > nn }. Since the statement is false, X 6= ∅. Let x be the least element of X. Note that x 6= 1 because 1! ≤ 11 . Thus x > 1. Therefore, x − 1 is a positive integer and x − 1 ∈ / X. This means that (x − 1)! ≤ (x − 1)x−1 . If we multiply both sides by x we get x! ≤ x(x − 1)x−1 and since x − 1 < x we can extend this to x! ≤ x(x − 1)x−1 ≤ x · xx−1 = xx and so x ∈ / X, contradicting x ∈ X.⇒⇐

82

Mathematics: A Discrete Introduction

21.5 Suppose the statement were false and let X be the set of counterexamples, i.e.,    2x x >4 X = x∈N: x 

and let n be the smallest member of X.  0 Note that n 6= 0 because 2·0 0 = 1 = 4 . Therefore n > 0.  Since n − 1 ∈ N is not a counterexample, we have 2(n−1) ≤ 4n−1 but n−2 these gives  2n 4n n >  2(n−1) 4n−1

2n n



> 4n . Dividing

n−2

which leads to

(2n)! (n − 1)!(n − 1)! · > 4. n!n! (2n − 2)!

Simplifying the factorials gives (2n)(2n − 1) 4n − 2 = >4 n2 n which implies 4n − 2 > 4n or that −2 > 0.⇒⇐ 21.6 Suppose that Proposition 13.2 is false and let X be the set of counterexamples, i.e., X = {x ∈ Z+ : 1 · 1! + 2 · 2! + · · · + x · x! 6= (x + 1)! − 1} and let n be the smallest member of X. Note that n 6= 1 because both 1 · 1! and (1 + 1)! − 1 equal 1. Thus n > 1 and so n − 1 is a positive integer that is not a counterexample. Thus, 1 · 1! + · · · + (n − 1) · (n − 1)! = [(n − 1) + 1]! − 1. Adding n · n! to both sides gives 1 · 1! + · · · + (n − 1) · (n − 1)! + n · n! = n! − 1 + n · n! = (n + 1)n! − 1 = (n + 1)! − 1 contradicting the fact that n ∈ X. 21.7 Here is a chart of the first several values of Fn and 1.6n :

Instructor’s Manual

83 n 0 1 2 3 4 .. .

28 29 30 31 32

Fn 1 1 2 3 5 .. .

514,229 832,040 1,346,269 2,178,309 3,524,578

1.6n 1 1.6 2.56 4.096 6.5536 .. .

519229.6858534844 830767.497365575 1,329,227.99578492 2,126,764.793255873 3,402,823.669209396

Fn > 1.6n ? no no no no no .. . no YES YES YES YES

Claim: For all integers n ≥ 29, we have Fn > 1.6n . Suppose, for the sake of contradiction, that the claim were false. Let X be the set of counterexamples, i.e., X = {n ≥ 29 : Fn ≤ 1.6n } Since X 6= ∅, it contains a least element, x. Note that x 6= 29 and x 6= 30 (see the chart). Thus x ≥ 31. This means that x − 1 and x − 2 are both at least 29 and neither x − 1 nor x − 2 is in X. Thus we have Fx−2 > 1.6x−2 Fx−1 > 1.6

x−1

and .

Adding these yields Fx = Fx−2 + Fx−1 > 1.6x−2 + 1.6x−1 = 1.6x−2 (1 + 1.6) = 1.6x−2 (2.6) > 1.6x−2 (2.56) = 1.6x−2 (1.6)2 = 1.6x . Thus Fx > 1.6x contradicting x ∈ X.⇒⇐ 21.8 Notice the following pattern: F0 = 1 = F2 − 1 F0 + F1 = 2 = F3 − 1 F0 + F1 + F2 = 4 = F4 − 1 F0 + F1 + F2 + F3 = 7 = F5 − 1 F0 + F1 + F2 + F3 + F4 = 12 = F6 − 1 F0 + F1 + F2 + F3 + F4 + F5 = 20 = F7 − 1.

84

Mathematics: A Discrete Introduction So we claim, for all n ∈ N, F0 + F1 + · · · + Fn = Fn+2 − 1. Suppose, for the sake of contradiction, this claim were false. Let X be the set of all n ∈ N for which the claim is not true. Thus X 6= ∅. Let x ∈ X be the least element of X. Observe that x 6= 0. Therefore x − 1 is a natural number that is not in X. Hence we have F0 + F1 + · · · + Fx−1 = F(x−1)+2 − 1 = Fx+1 − 1. Adding Fx to both sides gives F0 + F1 + · · · + Fx−1 + Fx = Fx+1 + Fx − 1 = Fx+2 − 1 contradicting x ∈ X.⇒⇐

21.9 The number x − 3 ∈ / X is correct (because x is the smallest element of X) but we have not shown that x − 3 ∈ N. It is not enough to show that x 6= 0. We would need to show that x ≥ 3. Thus, it is incorrect to conclude that the statement is true for x − 3. 21.10 The objective is to prove that, for all n ∈ N, the nth row of Pascal’s triangle is  n n , 1 , 2 ,...

n 0

n n−1

 n , n .

Suppose this assertion were false. Let X be the set of those n ∈N for which row n of Pascal’s triangle is not equal to the binomial coefficients n0 through nn . Thus X 6= ∅. Let x be the least element of X. Note that x 6= 0 because row 0 of Pascal’s triangle contains just a single 1, and that equals 00 . Since x 6= 0, we have that x − 1 ∈ N and x − 1 ∈ / X, so row x − 1 of Pascal’s triangle must be x−1 0

 ,

x−1 1

 ,...,

x−1 x−1

 .

By the rules for generating Pascal’s triangle, row x of Pascal’s triangle is computed as follows: x−1 0



+ =

x 0



x−1 1  x−1 0 x 1



x−1 2  x−1 1 x 2



··· ··· ···

x−1 x−1 x−1 x−2 x x−1



x−1 x−1  x x



  The last step follows for two reasons. The first and last entries are 1 because x−1 = 0x = 0   x−1 x x−1 = x = 1. And the interior entries follow from Pascal’s identity (Theorem 17.10).

Instructor’s Manual

85

21.11 Suppose the assertion is false. Let X be the set of all positive integers n for which there are pairwise disjoint sets A1 , A2 , . . . , An for which |A1 ∪ A2 ∪ · · · ∪ An | 6= |A1 | + |A2 | + · · · + |An |. Thus X 6= ∅. Let x be the least element of X. Clearly x 6= 1 (since the equation reduces to the obvious |A1 | = |A1 |). Also x 6= 2 as this is the standard Addition Principle. The assertion x ∈ / X means there are pairwise disjoint finite sets A1 , A2 , . . . , Ax , but |A1 ∪ A2 ∪ · · · ∪ Ax | 6= |A1 | + |A2 | + · · · + |Ax |. However, x − 1 ∈ / X and x − 1 > 0, so we do know that |A1 ∪ A2 ∪ · · · ∪ Ax−1 | = |A1 | + |A2 | + · · · + |Ax−1 |. Let B = A1 ∪ A2 ∪ · · · ∪ Ax−1 and note that B and Ax are disjoint (otherwise some element of Ax would also be an element of Ai for i < x). By the Addition Principle, |B ∪ Ax | = |B| + |Ax |. we substitute B = A1 ∪ A2 ∪ · · · ∪ Ax−1

and

|B| = |A1 | + |A2 | + · · · + |Ax−1 |

to get |A1 ∪ A2 ∪ · · · ∪ Ax | = |A1 | + |A2 | + · · · + |Ax | a contradiction.⇒⇐

22

Induction

Please be sure to see the comments from the previous section. Proof by smallest counterexample serves as an excellent introduction to proof by induction. Be sure to illustrate how the general structure of the two methods are quite similar. I recommend you present two proofs of a simple proposition (e.g., that the sum of the first n odd natural numbers is n2 ) side by side—one by the smallest counterexample method and one by induction—so students can compare and contrast the methods. Recursion is covered in the exercises. 22.1 Getting your foot on the ladder corresponds to the induction hypothesis, and the ability to advance from one rung to the next corresponds to the induction step. 22.2 We claim that for every positive integer n, the nth domino in the line gets knocked over.

86

Mathematics: A Discrete Introduction Proof. The proof is by induction on n. For n = 1 we are given that we are able to knock over the first domino. And we are given that if domino k falls, then domino k + 1 must also fall. Therefore, by induction, we know that for all n, the nth domino must fall.

22.3 This is just boring algebra. Both sides expand to: 2k3 + 9k2 + 13k + 6 . 6 22.4

(a) Basis case n = 1. Both sides of the equation evaluate to 1, so the basis case is true. Induction hypothesis: Suppose the result is true when n = k. That is, we have k(3k − 1) (∗). 1 + 4 + 7 + · · · + (3k − 2) = 2 We want to show (k + 1)[3(k + 1) − 1] 1 + 4 + 7 + · · · + (3k − 2) + [3(k + 1) − 2] = . 2 Add 3(k + 1) − 2 = 3k + 1 to both sides of (∗) to get k(3k − 1) + (3k + 1) 2 (3k2 − k) + (6k + 2) 3k2 + 5k + 2 = = 2 2 (k + 1)(3k + 2) (k + 1)[3(k + 1) − 1] = = . 2 2 (b) Basis case n = 1. Both sides of the equation evaluate to 1, so the basis case is true. Induction hypothesis: Suppose the result is true when n = k. That is, we have k2 (k + 1)2 13 + 23 + · · · + k 3 = (∗) 4 and we want to show 1 + 4 + 7 + · · · + (3k − 2) + (3k + 1) =

13 + 23 + · · · + k3 + (k + 1)3 =

(k + 1)2 (k + 2)2 . 4

We add (k + 1)3 to both sides of (∗) to get k2 (k + 1)2 + (k + 1)3 4 (k4 + 2k3 + k2 ) + 4(k3 + 3k2 + 3k + 1) = 4 k4 + 6k3 + 13k2 + 12k + 4 (k + 1)2 (k + 2)2 = = . 4 4

13 + · · · + k3 + (k + 1)3 =

Instructor’s Manual

87

(c) Basis case: Both sides of the equation evaluate to 9, so the basis case is true. Induction hypothesis: Suppose the result is true when n = k. That is, we have 9 + 9 × 10 + 9 × 100 + · · · + 9 × 10k−1 = 10k − 1.

(∗)

We want to show that 9 + 9 × 10 + 9 × 100 + · · · + 9 × 10k−1 + 9 × 10k = 10k+1 − 1. To this end, we add 9 × 10k to both sides of (∗) to get 9 + 9 × 10 + 9 × 100 + · · · + 9 × 10k−1 + 9 × 10k = 10k − 1 + 9 × 10k   = 1 × 10k + 9 × 10k − 1 = 10 × 10k − 1 = 10k+1 − 1. (d) Basis case: Both sides of the equation evaluate to 12 , so the basis case is true. Induction hypothesis: Suppose the result is true when n = k. That is, we have 1 1 1 1 + +···+ = 1− . 1·2 2·3 k(k + 1) k+1

(∗)

We want to show that 1 1 1 1 + +···+ = 1− . 1·2 2·3 (k + 1)(k + 2) k+2 To this end, we add

1 (k+1)(k+2)

to both sides of (∗) to get

1 1 1 1 1 +···+ + = 1− + 1·2 k(k + 1) (k + 1)(k + 2) k + 1 (k + 1)(k + 2) k+2 1 = 1− + (k + 1)(k + 2) (k + 1)(k + 2) 1 k+1 = 1− . = 1− (k + 1)(k + 2) k+2 (e) Note: This exercise gives an alternative proof of Proposition 21.10. Basis case n = 1: The left-hand side is 1 + x and the right is (1 − x2 )/(1 − x). Since 1 − x2 = (1 − x)(1 + x), this reduces to 1 + x as required.

88

Mathematics: A Discrete Introduction Induction hypothesis: Assume the equation holds for n = k, i.e., 1 + x + x2 + · · · + xk =

1 − xk+1 . 1−x

Adding xk+1 to both sides gives 1 − xk+1 + xk+1 1−x (1 − xk+1 ) + (1 − x)xk+1 = 1−x k+1 1 − x + xk+1 − xk+2 1 − x(k+1)+1 = = 1−x 1−x

1 + x + x2 + · · · + xk + xk+1 =

as required. For x = 1, we have 1 + x + x2 + · · · + xn = n + 1. (f) We begin the induction at n = 0 because it is slightly easier: 1 x0 = lim x = 0. x x→∞ e x→∞ e lim

Induction hypothesis: Assume the formula holds for n = k. We calculate: xk+1 (k + 1)xk = lim x→∞ ex x→∞ ex xk = (k + 1) lim x = 0 x→∞ e lim

by l’Hˆopital’s rule by induction.

(g) We begin the induction at n = 0 because the formula is correct and the calculation is a bit easier: Z ∞ h i∞ e−x dx = −e−x = 0 − (−1) = 1 = 0!. 0

0

Induction hypothesis: We assume the formula holds for n = k and work to prove it for n = k + 1. R To this end, we use integration by parts. In the integral 0∞ xk+1 e−x dx we take u = xk+1 and dv = e−x dx. This gives du = (k + 1)xk and v = −e−x . Thus Z

xk+1 e−x dx = (k + 1)xk (−e−x ) −

Z

−e−x (k + 1)xk dx

= −(k + 1)xk e−x + (k + 1)

Z

xk e−x dx.

Instructor’s Manual

89

When integrating both sides from 0 to ∞ we note that the term −(k + 1)xk e−x yields 0 − 0 because [see part (f) of this problem] lim xk e−x = 0.

x→∞

So applying induction we have Z ∞ 0

#∞ xk+1 e−x dx = −(k + 1)xk e−x

+ (k + 1) 0

Z ∞ 0

xk e−x dx

= 0 + (k + 1)k! = (k + 1)!. (h) Basis case n = 1. The first derivative of x1 is 1, which equals 1!. Induction hypothesis: Suppose the result holds for n = k; that is, the kth derivative of xk is k!. We now calculate the (k + 1)th derivative of xk+1 and show it is equal to (k + 1)!. Note that the first derivative of xk+1 is (k + 1)xk . The kth derivative of that is, using induction, (k + 1)k! which equals (k + 1)!. 22.5 Incidentally, (b) shows that the infinite product converges to a positive value and (c) shows that the infinite sum diverges. Part (d) reprises Exercise 21.5. Inequalities (e) and (f) are trivial as the product/sum consists of n terms each of which is n or less. The point is to practice proof by induction. (a) Basis case n = 1. The left-hand side evaluates to 2 and the right hand side evaluates to 4 − 1 − 1 = 2, so the basis case is true. Induction hypothesis: Suppose the result is true when n = k, i.e., we have 2k ≤ 2k+1 − 2k−1 − 1. We want to prove

(∗)

2k+1 ≤ 2k+2 − 2k − 1.

To this end, we multiply both sides of (∗) by 2:     2 · 2k ≤ 2 2k+1 − 2k−1 − 1 = 2k+2 − 2k − 2 = 2k+2 − 2k − 1 − 1 ≤ 2k+2 − 2k − 1. (b) Basis case n = 1. The left-hand side evaluates to 12 and the right to basis case is true. Induction hypothesis: Suppose the result is true when n = k.

1 4

+ 41 = 12 , so the

90

Mathematics: A Discrete Introduction That is, we have 1 1 1 1 1 1 (1 − )(1 − )(1 − ) · · · (1 − k ) ≥ + k+1 . 2 4 8 2 4 2

(∗)

We want to prove 1 1 1 1 1 1 (1 − )(1 − ) · · · (1 − k )(1 − k+1 ) ≥ + k+2 . 2 4 2 2 4 2 1 To this end, we multiply both sides of (∗) by 1 − 2k+1 to get

1 1 1 1 1 1 1 (1 − )(1 − ) · · · (1 − k )(1 − k+1 ) ≥ ( + k+1 )(1 − k+1 ) 2 4 2 2 4 2 2 1 1 1 1 = + k+1 − k+3 − 2k+2 4 2 2 2 1 2k+1 − 2k−1 − 1 = + 4 22k+2 k 1 2 ≥ + 2k+2 by part (a) 4 2 1 1 = + k+1 . 4 2 (c) Basis case n = 1. Both sides evaluate to 23 , so the basis case is true. Induction hypothesis: Suppose the result is true when n = k, i.e., we have k 1 1 1 1+ + +···+ k ≥ 1+ . 2 3 2 2

(∗)

We seek to prove 1 1 1 1 k+1 1 + + + · · · + k + · · · + k+1 ≥ 1 + . 2 3 2 2 2 1 To this end, we add 2k1+1 + 2k1+2 + · · · + 2k+1 to both sides of (∗). Please note there are 1 k 2 additional terms and they are all greater than or equal to 2k+1 . So the additional terms 1 sum to at least 2 . Thus,

1 1 1 1 1 1 k 1 k+1 1+ + +···+ k + k + k + · · · + k+1 ≥ 1 + + = 1 + . 2 3 2 2 +1 2 +2 2 2 2 2 (d) Basis case n = 1: We have

2n n



Induction hypothesis: Suppose

=

2 1

 2k k



= 2 < 4 = 41 .

< 4k . We seek to prove

2(k+1) k+1

< 4k+1 .

Instructor’s Manual

91

We calculate:   2(k + 1) (2k + 2)! (2k)! (2k + 2)(2k + 1) = = · k+1 (k + 1)!(k + 1)! k!k! (k + 1)(k + 1)      2k 4k + 2 k 4k + 2 = 0 we have

n

∑ (−1)k Fk = (−1)n Fn−1 + 1.

(∗)

k=0

Proof. By induction on n. For n = 1, the sum equals 1 − 1 = 0 and the RHS of (∗) equals −F0 + 1 = −1 + 1 = 0. Assume that (∗) has been established for some integer n and now we prove that (∗) is correct for n + 1; that is, that the sum to n + 1 terms evaluates to (−1)n+1 Fn + 1. For this we simply calculate: " # n+1

∑ (−1)k Fk =

k=0

n

∑ (−1)k Fk

+ (−1)n+1 Fn+1

k=0

h i = (−1)n Fn−1 + 1 + (−1)n+1 Fn+1 by induction h i h i = (−1)n Fn−1 + 1 − (−1)n Fn + Fn−1 h i = (−1)n Fn−1 − Fn − Fn−1 + 1 h i = (−1)n −Fn = (−1)n+1 Fn .

92

Mathematics: A Discrete Introduction

22.7 Step 1: Prove

1 12

+ 212 + · · · + n12 >

1 1·2

1 1 + 2·3 + · · · + n(n+1) .

Basis case, n = 1: The left-hand side equals 1 and the right equals 12 , verifying the inequality. Induction hypothesis: Suppose the inequality (∗) holds for n = k; that is, 1 1 1 1 1 1 + 2 +···+ 2 > + +···+ 2 1 2 k 1·2 2·3 k(k + 1) Because (k + 1)2 < (k + 1)(k + 2), we have 1 1 > 2 (k + 1) (k + 1)(k + 2) which, when added to the previous inequality, yields 1 1 1 1 1 1 1 1 + 2 +···+ 2 + > + +···+ + 2 2 1 2 k (k + 1) 1·2 2·3 k(k + 1) (k + 1)2 completing the proof of (∗). Step 2: Prove:

1 12

1 1 1 + 2·3 + · · · + (n−1)n . + 212 + · · · + n12 ≤ 1 + 1·2

Basis case: When n = 1, this reduces to showing 1/12 ≥ 1, which is true. Induction hypothesis: Suppose that inequality (∗∗) holds for n = k; that is, 1 1 1 1 1 1 + +···+ 2 ≤ 1+ + +···+ . 12 22 k 1·2 2·3 (k − 1)k Since (k + 1)2 > k(k + 1), we have 1 1 < 2 (k + 1) k(k + 1) and when we add this to the previous inequality we have 1 1 1 1 1 1 1 1 + +···+ + + +···+ 2 + ≤ 1+ 12 22 k (k + 1)2 1·2 2·3 (k − 1)k k(k + 1) verifying (∗∗). Next we show that ζ (2) ≥ 1. Suppose for the sake of contradiction that ζ (2) < 1. But we have 1 1 1 1 ζ (2) > 2 + 2 + · · · + 2 > 1 − 1 2 n n+1

Instructor’s Manual

93

which we rearrange like this: ζ (2) > 1 −

1 n+1

1 > 1 − ζ (2) n+1 1 n+1 < 1 − ζ (2) 1 n< − 1. 1 − ζ (2) The implication is that all positive integers are less than 1/(1−ζ (2))−1, which is absurd.⇒⇐ Therefore, ζ (2) ≥ 1. Finally we show that ζ (2) ≤ 2. From (∗∗) and Exercise 22.4(d) we know that   1 1 1 1 1 1 1 + 2 + 2 +···+ 2 ≤ 1+ +···+ = 2− . 2 1 2 3 n 1·2 (n − 1)n n Suppose, for the sake of contradiction, that ζ (2) > 2. This means that for some positive integer n we would have 1 1 1 1 + 2 + 2 +···+ 2 > 2 2 1 2 3 n which contradicts the previous inequality.⇒⇐ Therefore ζ (2) ≤ 2. 22.8 Note: Students do not need to know linear algebra to work this problem; they just need to know how to multiply matrices. But for those who have studied linear algebra, the teachable n moment in this example is that the eigenvalues ofthe matrix  2  are 4 and 3 (which appear as 4 n 1 and 3 in the formula)  −1 2  and the eigenvectors are 1 and 1 , respectively. Thus, as n → ∞, we n n have A ≈ 4 −1 2 and the columns of this matrix give the eigenvector corresponding to the dominant eigenvalue, 4. Basis case n = 1. Note that for n = 1   2 · 3n − 4n 2 · 4n − 2 · 3n 3n − 4n 2 · 4n − 3n evaluates to

 6−4 8−6  3−4 8−3

=



2 2 −1 5



= A = A1 as required.

Induction hypothesis: Suppose the formula is true for n = k, i.e.,   2 · 3k − 4k 2 · 4k − 2 · 3k k A = . 3k − 4k 2 · 4k − 3k

94

Mathematics: A Discrete Introduction Multiplying both sides by A and calculating gives    2 2 2 · 3k − 4k 2 · 4k − 2 · 3k k+1 k A = A·A = −1 5 3k − 4k 2 · 4k − 3k   2(2 · 3k − 4k ) + 2(3k − 4k ) 2(2 · 4k − 2 · 3k ) + 2(2 · 4k − 3k ) = −(2 · 3k − 4k ) + 5(3k − 4k ) −(2 · 4k − 2 · 3k ) + 5(2 · 4k − 3k )   6 · 3k − 4 · 4k 8 · 4k − 6 · 3k = 3 · 3k − 4 · 4k 8 · 4k − 3 · 3k   2 · 3k+1 − 4k+1 2 · 4k+1 − 2 · 3k+1 = 3k+1 − 4k+1 2 · 4k+1 − 3k+1 as required.

22.9 Let n be the number of people on the line. The basis case is when n = 2, in which case the first person is a woman and the second (and last) person is man, so there is a woman directly in front of a man. Suppose the result is true when there are n = k people in line. Suppose we have a line with n = k + 1 people with a woman in the first and a man in the last positions. Consider the next-to-last person in line. If that person is a woman, then we have a woman directly in front of a man (the last one in the line) and we’re done. Otherwise, the next-to-last person is a man, and we can think of the first k people as a line with a woman in front and a man in back. By induction, there must be a woman directly in front of a man. 22.10 Basis case n = 3: We know from elementary geometry that the sum of the angles of a triangle is 180◦ . Induction hypothesis n = k: We assume the result is proved for convex k-gons. Let P be a convex (k + 1)-gon and label the corners of this polygon X1 , X2 , . . . , Xk+1 . Draw a diagonal joining vertices X1 and X3 . We have separated the polygon into a triangle T and a convex k-gon Q.

P

Xk+1 X1

Xk

Q

T

X3 X4

X2

Instructor’s Manual

95

The sum of the angles of P equals the sum of the angles in T plus the sum of the angles in Q. For T that sum is 180◦ and for Q it is 180(k − 2). Adding these gives 180(k − 1) which can be rewritten 180[(k + 1) − 2] which is what we wanted. 22.11 Basis case n = 0: Note that (x + y)0 = 1 and that 0

  0 ∑ k x0−k yk k=0 reduces to

0 0

 0 0 x y which is also 1.

Induction hypothesis: Suppose the result is true for n = m, i.e.,       m m 0 m m−1 1 m 0 m m (x + y) = x y + x y +···+ x y . 0 1 m Multiply both sides by (x + y) to get       m m m m+1 m+1 0 m 1 m 1 m−1 2 (x + y) = y +x y )+ y )+···+ (x (x y + x (x1 ym + x0 ym+1 ). 0 1 m Collecting like terms transforms the right-hand side to this:           m m+1 0 m m m m x y + + x m y1 + + xm−1 y2 + · · · 0 0 1 1 2       m m m 0 m+1 + + x1 ym + x y . m−1 m m   The first and last binomial coefficients, m0 and m , are both equal to 1 and so can be rewritten m      m+1 m+1 m and m+1 , respectively. The bracketed terms are of the form mk + k+1 which, by 0  m+1 Pascal’s identity (Theorem 17.10), equals k+1 . With these substitutions we have (x + y)m+1 equal to           m + 1 m+1 0 m+1 m 1 m + 1 m−1 2 m+1 1 m m+1 0 m x y + x y + x y +···+ x y + x y 0 1 2 m m+1 which is what we wanted. 22.12 Basis case: In case there is only 1 disk, the puzzle can be solved in 21 − 1 = 1 moves by simply moving the disk to the next peg. Induction hypothesis: Assume a Tower of Hanoi puzzle with k disks can be solved in 2k − 1 moves. We need to show how to solve the puzzle with k + 1 disks in 2k+1 − 1 moves.

96

Mathematics: A Discrete Introduction Here is how we solve it. First, we move the top k disks from peg #1 to peg #3. This is tantamount to solving a Tower of Hanoi puzzle with just k disks, and so we can do this in 2k − 1 moves. Next we move the biggest disk from peg #1 to peg #2. This takes 1 move. Finally, we move all the disks from peg #3 to peg #2 in an additional 2k − 1 moves. All told, we have made     k k 2 − 1 + 1 + 2 − 1 = 2 · 2k − 1 = 2k+1 − 1 moves.

22.13 Thank you to Kevin Byrnes for suggesting this problem. (a) This proof only shows that finite nonempty subsets of N have least elements. (b) Proof. Suppose for the sake of contradiction that there is a nonempty set X, a subset of N, that does not have a least element. We use strong induction to show that X (the complement of X in N). Basis case: First 0 ∈ X for otherwise 0 ∈ X and therefore X has a least element. Induction hypothesis: Now suppose 0, 1, 2, . . . , k ∈ X for some integer k. It follows that k + 1 ∈ X; otherwise k + 1 would be the least element of X. Therefore, by strong induction, X = N which implies that X = ∅, contradicting the fact that X is nonempty.⇒⇐ Therefore all nonempty subsets of N have least elements. 22.14 The basis case is when n = 2. In this case we either have A1 ⊆ A2 (in which case A1 is a subset of all the others) or A2 ⊆ A1 (in which case A2 is a subset of all the others). The induction hypothesis is: The result is true for any collection of n = k sets with the required property. Suppose A1 , . . . , Ak+1 satisfy the condition that Ai ⊆ A j or A j ⊆ Ai for all i, j. Consider just the first k of these sets. By induction one of them, say At , is a subset of all of A1 , A2 , . . . , Ak . Now either At ⊆ Ak+1 in which case At is a subset of all the As, or else Ak+1 ⊂ At , in which case Ak+1 is a subset of At and, by transitivity, all the other As. 22.15 The proof is by strong induction on the number of points in the grid. The basis case is when there is exactly one point in  the grid (so a = b = 0). In this case the “empty” path is the only 0 lattice path so there are 0 = 1 lattice path as required. So (for induction) we assume that the result has been proved for all grids with fewer than n points and consider an (a + 1) × (b + 1) grid with (a + 1)(b + 1) = n. In the special case that a = 0 or b = 0, then there is only path  one latticea+b  as the grid consists of a single horizontal or a+b a+b vertical line; in this case a = b = 0 = 1 as required. So we may assume that both a and b are greater than 1.

Instructor’s Manual

97

We now consider the number of lattice paths whose last step is an upward step and the number of lattice paths whose last step is a rightward step. The total number of lattice paths is the sum of these two values. The number of paths whose last step is upward is the same as the number offull corner-tocorner lattice paths in a grid of size a × (b + 1). By induction there are a+b−1 of those. a−1 The number of paths whose last step is rightward is the same as the number offull corner-tocorner lattice paths in a grid of size (a + 1) × b. By induction there are a+b−1 of those. a Therefore, the number of corner-to-corner lattice paths on the full grid is       a+b−1 a+b−1 a+b + = a−1 a a where the last equality follows from Pascal’s Identity (Theorem 17.10). 22.16

(a) The next three terms of the sequence are a4 = 31,

a5 = 63,

a6 = 127,

a7 = 255.

To prove: an = 2n+1 − 1. Basis case: When n = 0 we just need to notice that a0 = 1 = 20+1 −1 = 2−1 as required. Induction hypothesis: Suppose ak = 2k+1 − 1. We need to prove that ak+1 = 2(k+1)+1 − 1. Notice that ak+1 = 2ak + 1 h i = 2 2k+1 − 1 + 1

by definition by induction

= 2k+2 − 2 + 1 = 2k+2 − 1 as required. (b) b0 = 1, b1 = 2, b2 = 5, b3 = 14, b4 = 41, and b5 = 122. To prove: bn = 12 (3n + 1). Basis case: b0 = 1 and 21 (30 + 1) = 12 · 2 = 1. Induction hypothesis: We are given that bk = 12 (3k + 1). We need to prove that bk+1 = 12 (3k+1 + 1). To this end, we calculate: bk+1 = 3bk − 1 = 3 as required.



 3 · 3k + 3 − 2 3k+1 + 1 3k + 1 −1 = = 2 2 2

98

Mathematics: A Discrete Introduction (c) c0 = 3, c1 = 4, c2 = 6, c3 = 9, c4 = 13, and c5 = 18. To prove: cn = 12 (n2 + n + 6). Basis case: c0 = 3 and note that 12 (02 + 0 + 6) = 12 · 6 = 3 as required. Induction hypothesis: ck = 12 (k2 + k + 6). To prove: ck+1 = 12 [(k + 1)2 + (k + 1) + 6]. We calculate: ck+1 = ck + (k + 1) =

k2 + k + 6 k2 + 3k + 8 + (k + 1) = 2 2

(k + 1)2 + (k + 1) + 6 k2 + 3k + 8 = , 2 2 and so ck+1 = 12 [(k + 1)2 + (k + 1) + 6], as promised. (d) d0 = 2, d1 = 5, d2 = 13, d3 = 35, d4 = 97, and d5 = 275. To prove: dn = 2n + 3n . Basis cases: When n = 0, dn = 2 and 2n + 3n = 20 + 30 = 1 + 1 = 2, as required. Furthermore, when n = 1, dn = 5 and 2n + 3n = 21 + 31 = 5, as required. Induction hypothesis (strong): Suppose the formula holds for all values of n from 1 to k. To prove: dk+1 = 2k+1 + 3k+1 . We calculate, dk+1 = 5dk − 6dk−1 = 5[2k + 3k ] − 6[2k−1 + 3k−1 ] = (5 − 3)2k + (5 − 2)3k = 2k+1 + 3k+1 as required. (e) e0 = 1, e1 = 4, e2 = 12, e3 = 32, e4 = 80, and e5 = 192. To prove: en = (n + 1)2n . We prove this by strong induction. Basis case: e0 = 1 and (0 + 1)20 = 1. e1 = 4 and (1 + 1)21 = 4. Thus the result holds for n = 0, 1. Induction hypothesis: Assume the result has been shown for n = 0, 1, 2, . . . , k. We must show that ek+1 = [(k + 1) + 1]2k+1 . To this end, we calculate: h i ek+1 = 4(ek − ek−1 ) = 4 (k + 1)2k − k2k−1 = 2(k + 1)2k+1 − k2k+1 = [2(k + 1) − k]2k+1 = (k + 2)2k+1 as required.

Instructor’s Manual

99

(f) We need to prove the formula  Fn =

 √ n+1 √ n+1 1+ 5 1− 5 − 2 2 √ 5

We do this by strong induction on n. Basis cases: For n = 0 we have  √ 1  √ 1 1+ 5 − 1−2 5 2 √ = 5

1 2



− 12 + 25 + √ 5

as required. For n = 1 we have  √ 2  √ 2  √   √  3+ 5 1+ 5 − 1−2 5 − 3−2 5 2 2 √ √ = = 5 5 as required. Note that we used the calculations √ !2 √ 1+ 5 3+ 5 = and 2 2

3 2

√ 5 2

.

√ 5 = √ =1 5



− 32 + 25 + √ 5

√ 5 2

√ 5 = √ =1 5

√ !2 √ 1− 5 3− 5 = . 2 2

Induction hypothesis: For all values of n from 0 to k, the formula is correct. To prove:  √ k+2  √ k+2 1+ 5 − 1−2 5 2 √ Fk+1 = 5 This is a bit easier to express if we let √ √ 1+ 5 1− 5 A= and B= . 2 2 Then the problem can be rewritten as: Fk+1 =

Ak+2 − Bk+2 √ . 5

Now we calculate: Fk+1 = Fk + Fk−1 = =

Ak+1 − Bk+1 Ak − Bk √ + √ 5 5

Ak+1 + Ak − Bk+1 − Bk (A + 1)Ak − (B + 1)Bk √ √ = . 5 5

100

Mathematics: A Discrete Introduction Notice that A2 =

√ !2 √ 1+ 5 3+ 5 = = A+1 2 2

and B2 =

√ !2 √ 1− 5 3− 5 = = B + 1. 2 2

We continue our calculation thus: Fk+1 =

(A + 1)Ak − (B + 1)Bk (A2 )Ak − (B2 )Bk Ak+2 − Bk+2 √ √ √ = = 5 5 5

as required! 22.17 Let an be the number of ways to arrange the flags. Note that a1 = 1 (because we can only fit the one red flag) and a2 = 3 (because we can have two reds, or one blue, or one green). For n > 2 we have an = an−1 + 2an−2 because the top flag can be red (an−1 ways to do the rest), or blue (an−2 ways to do the rest), or green (an−2 ways to do the rest). We now prove that an = 32 2n + 31 (−1)n by induction. The basis cases are n = 1 and n = 2. For these we check that 2 1 1 4 1 2 + (−1)1 = − = a1 3 3 3 3

and

2 2 1 9 2 + (−1)2 = = 3 = a2 3 3 3

as required. Suppose (strong induction) the result has been proved for all ak with k < n (where n > 2). Then   2 n−1 1 2 n−2 1 n−1 n−2 an = an−1 + 2an−2 = 2 + (−1) + 2 2 + (−1) 3 3 3 3     1 4 4 n−2 1 2 2 + = 2 + − + (−1)n−2 = 2n + (−1)n 3 3 3 3 3 3 as required. 22.18 The proof is by strong induction. The basis case is that 1 can be written as the sum of distinct Fibonacci numbers, and since 1 is already a Fibonacci number, there is nothing to prove. Suppose (strong induction hypothesis) that the result is true for all positive integers less than n; we must show that n can be written as the sum of distinct Fibonacci numbers. If n is a Fibonacci number, then there is nothing to prove, so suppose n is not a Fibonacci number. Let Fk be the largest Fibonacci number less than n.

Instructor’s Manual

101

We claim that n − Fk < Fk . If not, then n − Fk ≥ Fk , so n ≥ Fk + Fk ≥ Fk + Fk−1 = Fk+1 , contradicting the fact that Fk is the largest Fibonacci number less than n. Since n − Fk < n, by induction, we can write n − Fk as the sum of distinct Fibonacci numbers, n − Fk = Fa1 + Fa2 + · · · + Fat . Since n − Fk < Fk , none of the summands equals Fk . Therefore n = Fa1 + Fa2 + · · · + Fat + Fk expresses n as the sum of distinct Fibonacci numbers. 22.19 We use induction on n = last-first. The basis case is when n = 0. In this case, first equals last, so the program returns array[first], which is the only value under consideration. Induction hypothesis: Assume the result is true for all values of last-first that are less than n. Suppose the program is called with last-first = n. Note that mid is between first and last, and we have mid < last, so, by induction, the line a = findMax(array,first,mid); sets the variable a to the largest value in the array from index first to index last. Also, mid+1 is greater than first, so, by induction, the line b = findMax(array,mid+1,last); sets b to the largest value in the array from index mid+1 to index last. Finally, the last two lines of the program return the larger of a and b, which must be the largest value in the array from index first to index last. 22.20 The proof is by strong induction on last − first. The basis case is last − first = 0. In this case first = last = mid, and by assumption, key must be at index k = mid and that is what is returned by the line if (array[mid] == key) return mid; The induction hypothesis is that this program behaves as promised whenever last−first < n. Suppose last − first = n. We know that key is somewhere in array and that mid is between first and last (inclusive). Therefore mid-1 < last and mid+1 > first. If array[mid] = key, then this value is returned. Otherwise key is either less than or greater than array[mid]. In the first case, it is found (by induction) by the line

102

Mathematics: A Discrete Introduction

if (array[mid] > key) return lookUp(array,first,mid-1,key);

and in the second case, it is found by the line

return lookUp(array,mid+1,last,key);

22.21 The point of this problem is that students will not be able to succeed; they should give up. It is easier to prove that triangulated polygons have two (or more) exterior triangles, even though the conclusion (at least two versus at least one) is more demanding. This phenomenon is called induction loading. Sometimes it is easier to prove a proposition with a stronger conclusion because the stronger conclusion enables the induction to work. 22.22 We prove both identities in a single induction argument. Basis case n = 1: When n = 1, the cosine formula reduces to the single term  and the sine term reduces to 11 sin θ = sin θ , as required.

1 0



cos θ = cos θ

Induction hypothesis: Assume the formulas are both true for n = k. We now seek to prove the formulas for cos[(k + 1)θ ] and sin[(k + 1)θ ]. cos[(k + 1)θ ] = cos θ cos kθ − sin θ sin kθ h  i   = cos θ 0k cosk θ − 2k cosk−2 θ sin2 θ + 4k cosk−4 θ sin4 θ − · · · h  i   − sin θ 1k cosk−1 θ sin θ − 3k cosk−3 θ sin3 θ + 5k cosk−5 θ sin5 θ − · · · h  i   = 0k cosk+1 θ − 2k cosk−1 sin2 θ + 4k cosk−3 sin4 θ − · · · h  i   − 1k cosk−1 θ sin2 θ − 3k cosk−3 θ sin4 θ + 5k cosk−5 θ sin6 θ − · · · h  h   i i = 0k cosk+1 θ − 1k + 2k cosk−1 θ sin2 θ + 3k + 4k cosk−3 θ sin4 θ − · · ·  k+1  k−1  k−2 = k+1 θ − k+1 θ sin2 θ + k+2 θ sin4 θ − · · · 0 cos 2 cos 4 cos as required.

Instructor’s Manual

103

The proof for sin[(k + 1)θ ] is similar: sin[(k + 1)θ ] = sin θ cos kθ + cos θ sin kθ h  i   = sin θ 0k cosk θ − 2k cosk−2 θ sin2 θ + 4k cosk−4 θ sin4 θ − · · · h  i   + cos θ 1k cosk−1 θ sin θ − 3k cosk−3 θ sin3 θ + 5k cosk−5 θ sin5 θ − · · · h  i   = 0k cosk θ sin θ − 2k cosk−2 θ sin3 θ + 4k cosk−4 θ sin5 θ − · · · h  i   + 1k cosk θ sin θ − 3k cosk−2 θ sin3 θ + 5k cosk−4 θ sin5 θ − · · · h  h  i i = 0k + 1k cosk θ sin θ − 2k + 3k cosk−2 θ sin3 θ h  i + 4k + 5k cosk−4 θ sin5 θ − · · ·  k  k−2  k−4 k+1 k+1 3 = k+1 cos θ sin θ − cos θ sin θ + θ sin5 θ − · · · 1 3 5 cos also as required. 22.23 Let A be a set of natural numbers. We are given that 0 ∈ A and for all k ∈ N, if 0, 1, . . . , k ∈ A, then k + 1 ∈ A. Suppose, for the sake of contradiction, that A 6= N. Let X = N − A, i.e., X is the set of natural numbers not in A. By supposition, X 6= ∅. Therefore, X contains a least element x. Note that x 6= 0 because 0 ∈ A (by hypothesis). Therefore 0, 1, 2, . . . , x − 1 ∈ / X (because x is the least element of X and so 0, 1, . . . , x − 1 ∈ A. Thus, by hypothesis, x ∈ A, contradicting x ∈ X.⇒⇐Thus A = N. 22.24 The basis case is 0. In this case we can write 0 as an empty sum. Let n be a positive integer and suppose the result has been shown for all natural numbers less than n. Let k be the largest natural number such that 2k ≤ n. (There are only finitely many natural numbers ≤ n and 20 ≤ n; so k exists.) Let m = n − 2k < n. By strong induction, we can write m as the sum of distinct powers of 2. Note that m < 2k because if m ≥ 2k we would have n = m + 2k ≥ 2k + 2k = 2k+1 , contradicting the choice of k. So when we write m as the sum of powers of 2, all exponents are less than k. If we add 2k to this, we have written n as the sum of distinct powers of 2.

23

Recurrence Relations

Proving that a solution to a recurrence relation is correct (see Exercise 22.16) is a natural application of proof by induction. This leads naturally to: How do we find the solution to a recurrence relation in the first place?

104

Mathematics: A Discrete Introduction

This section gives an overview of how to solve some limited classes of recurrence relations. We solve only linear equations with constant coefficients of first- and second-order. Students who have studied differential equations will be pleased by how closely these results resemble those from that course. We also introduce the difference operator ∆ and show how to use it to detect polynomial sequences and derive an explicit formulas. The main result of the subsection “Sequences generated by polynomials” is easy to apply, but the road leading up to it is difficult. It is possible to simply present this result and explain its application without working through its derivation. One interesting step along the way is the proof of Proposition 23.16. This is a proof by induction with an embedded proof by smallest counterexample. It is reasonable to present this as a double induction, especially if you wish to illustrate that proof technique. This is a long section; it is possible to streamline your presentation by omitting the proofs and simply presenting the results. No subsequent section depends on this material, so this may be omitted without peril. However, computer science students may appreciate this material. 23.1

(a) 1, 4, 10, 22, 46, 94. (b) 5, 8, 11, 14, 17, 20. (c) 0, 1, 1, 3, 5, 11. (d) 0, 0, 0, 0, 0, 0. (e) 1, 1, 3, 5, 9, 15. (f) 1, 2, 4, 7, 11, 16.

23.2

(a) an = 4( 23 )n . a9 = 211 /39 = 2048/19683. (b) an = 3 · 10n . a9 is 3,000,000,000 (or 3 × 109 or three billion). (c) an = 5 · (−1)n . a9 = −5. (d) an = 0 for all n, so a9 = 0. (e) an = (f) an =

19 1 n 2 (3) + 2 . a9 = 186989. −4 4 n 3 (−2) + 3 . a9 = 684.

(g) an = 3n. a9 = 27. (h) an = 2 · 2n − 2. a9 = 1022. (i) an = 21 · 3n + 21 · 5n . a9 = 986404. n (j) an = 58 (−2)n + 12 5 · 3 . a9 = 46420.

(k) an = 12 + 21 · 3n . a9 = 9842. (l) an = 3(−3)n − 5n(−3)n . a9 = 826686.

Instructor’s Manual

105

(m) an = 5 − 4n. a9 = −31. (n) an = 5(−1)n − 6n(−1)n . a9 = 49. √ √ (o) an = 23 (1 + 3)n + 23 (1 − 3)n . a9 = 12720.

(p) an = (1 + 4i )(1 − 2i)n + (1 − 4i )(1 + 2i)n . a9 = −2757. 23.3

(a) an = 3n2 + 2n + 1. (b) an = n2 − 2n + 6. (c) an = n3 − n + 4. (d) an = n4 + 10n + 5.

23.4 The difference operator applies to sequences, not to individual numbers. The notation (∆a)n means the nth term of the sequence ∆a; this is the intended meaning. The notation ∆(an ) is not defined since an is a number and we have not assigned a meaning to ∆ applied to a single number.    n 23.5 Let k be a positive integer and let an = nk . We know that ∆an = ∆ nk = k−1 . Repeating  this, we see that ∆ j an = k−n j . So we have   0 a0 = =0 k   0 ∆a0 = =0 k−1   0 ∆ 2 a0 = =0 k−2 .. .     0 0 k−1 ∆ a0 = = = 0, k − (k − 1) 1  but ∆k a0 = 00 = 1. 23.6 The sequence satisfies the recurrence an = an−1 + 12an−2 so we solve the quadratic equation x2 − x − 12 = 0 giving two roots: 4 and −3. So an = c1 (−3)n + c2 4n . From a0 = 6 and a5 = 4877 we have the following system of equations: a0 = 6 = c1 + c2 a5 = 4877 = (−3)5 c1 + 45 c2 we get c1 = 1 and c2 = 5. Therefore an = (−3)n + 5 · 4n . 23.7 We begin with the usual table of differences:

106

Mathematics: A Discrete Introduction

0

1 1

17 16

15

98 81

65 50

354 256

175 110

60

369 194

84 24

2275 1296

671 302

108 24

0

979 625

4676 2401

1105 434

132 24

0

We can then write             n n n n n n 6n5 + 15n4 + 10n3 − n an = 0 +1 + 15 + 50 + 60 + 24 = . 0 1 2 3 4 5 30 23.8 Let an = 1t + 2t + · · · + nt . Therefore ∆an = an+1 − an = (n + 1)t which is a polynomial of degree t. Apply ∆ another t + 1 times yields ∆t+2 an = ∆t+1 [∆an ] = ∆t+1 [(n + 1)t ] = 0. Therefore, by Theorem 23.17, an is a polynomial in n.     23.9 Let an = n0 + n1 + n2 + n3 = 16 (n3 + 5n + 6).  23.10 Rewrite an = s∆an = s(an+1 − an ) as san+1 = (s + 1)an . This is equivalent to an = s+1 an−1 . s  s+1 n From this, and the fact that a0 = 1, it follows that an = s . 23.11

(a) a5 = 80. (b) an = 2an−1 + 2n−1 because we have an−1 edges in each of the two copies of the (n − 1) cube, plus 2n−1 edges joining corresponding points in different cubes. (c) We claim that an = n2n−1 . Proof. By induction on n. Basis case n = 0 is obvious. Induction hypothesis (n = k): Suppose ak = k2k−1 . We must show that ak+1 = (k + 1)2k . To that end, we simply calculate: h i ak+1 = 2ak + 2k = 2 k2k−1 + 2k = (k + 1)2k .

23.12 Note that ∆2 an = ∆[∆an ] = ∆[an+1 − an ] = (an+2 − an + 1) − (an+1 − an ) = an+2 − 2an+1 + an . So ∆2 an = −an is equivalent to an+2 − 2an+1 + an = −an , or an+2 = 2an+1 − 2an . Rewritten in standard form, this is an = 2an−1 − 2an . We solve the quadratic equation x2 − 2x + 2 = 0 to give roots 1 ± i. Therefore an = c1 (1 + i)n + c2 (1 − i)n . Substituting a0 = a1 = 2 gives c1 = c2 = 1, so an = (1 + i)n + (1 − i)n .

Instructor’s Manual

107

23.13 Many answers are possible. For example, let a be the sequence 1,2,3,4,5,. . . and let b be the sequence 2,3,4,5,6,. . . . 23.14

(a) an = 3n − 2n + 1. (b) an = 5n + 23 (−1)n − 12 . √ √ (c) an = 25 (1 + 5)n + 25 (1 − 5)n − 1. (d) an = 5 · 2n − 2 − 5n. (e) an = − 21 3n + 2n3n − 12 . (f) an = n2 − 3n + 4.

23.15

(a) an = 2n + 2 · 3n + 5(−1)n . √ √ (b) an = 3( 2)n + 3(− 2)n + 5 · 2n . (c) an = (−2)n − 3n(−2)n + 5 · 3n . (d) an = 3 · 2n − 7n2n + 5n2 2n .

23.16 In order to calculate an , the computer makes a call to get_term(n) which in turn calls get_term(n-1) and get_term(n-2). The latter results in bn−1 + bn−2 calls to get_term. Therefore bn = bn−1 + bn−2 + 1, b0 = 1, b1 = 1. (The +1 term is for the original call get_term(n).) The solution to this recurrence is √ !n     1+ 5 1 1 bn = 1 + √ + 1− √ 2 5 5

√ !n 1− 5 − 1. 2

Thus b20 = 21891. Over twenty thousand calls to get_term are generated just to calculate a20 . Each function call requires two multiplications and one subtraction, so over sixty thousand operations are performed. If, instead, an iterative algorithm is used, the calculation of each an from previous values requires only three operations, so fewer than 60 operations are required (the values a0 and a1 do not require any computation). 23.17

(a) an = n!. n

(b) an = 2(2 ) . (c) a0 = 1 and an = 2n−1 for n > 0. (d) a0 = 1 and for n > 0,

 an =

 √ n √ n 3− 5 3+ 5 − 2 2 √ 5

.

108

Mathematics: A Discrete Introduction (e) No answer is known. The values an are the output of a chaotic discrete-time dynamical system.

23.18

(a) The sequence c0 , c1 , c2 , . . . begins 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012.  (b) cn = 2n n /(n + 1).   (c) The nth term is given by 3 n2 + n1 = 3n(n−1) + n = (3n2 − n)/2. 2 (d) These are the pentagonal numbers. (e) Elevator buttons in the United States.

Chapter 5

Functions 24

Functions

Some mathematicians define function as a triple ( f , A, B) where A and B are sets, and f ⊆ A × B so that ∀a ∈ A, (a, x), (a, y) ∈ f ⇒ x = y. In this case, we write f : A → B. I don’t like this approach for a few reasons. First, the triple definition is more complicated, and the added complication is really not necessary. The price I pay is that onto must be defined relative to a set. Second, consider the cosine function. Which of the following are correct? • cos : R → R, or • cos : R → [−1, 1]. If you think both are correct, then we are in agreement on how functions should be defined. On the other hand, if you prefer the triple definition ( f , A, B) for function, then you cannot say there is just one cosine function, but rather, there are infinitely many depending on which codomain (B) we select. Which of the two (cos : R → R or cos : R → [−1, 1]) is true depends on which cosine function we are considering. This is a lengthy section and deserves a great deal of attention. The material on counting functions is a good review of the counting methods encountered earlier. However, please note that to count the number of onto functions from an a-element set to a b-element set requires inclusion/exclusion (Section 19). 24.1

(a) f is a function, dom f = {1, 3}, and im f = {2, 4}. f is one-to-one and f −1 = {(2, 1), (4, 3)}. (b) f is a function, dom f = Z, and im f is the set of all even integers. f is one-to-one and f −1 = {(x, y) : x, y ∈ Z, 2y = x}. (c) f is a function, dom f = Z, and im f = Z. f is one-to-one and f −1 = f . (d) f is not a function (e.g., (0, 1), (0, 2) ∈ f ). (e) f is a function, dom f = Z, im f is the set of all perfect squares. f is not one-to-one because f (3) = f (−3), but 3 6= −3. (f) f is a function, dom f = im f = ∅. f is one-to-one, and f −1 = f . (g) f is not a function, e.g., (0, 1), (0, −1) ∈ f . (h) f is not a function, e.g., (3, 6), (3, 9) ∈ f . (i) f is a function (note that (x, y) ∈ f if and only if x = y), dom f = N, and im f = N. f is one-to-one, and f −1 = f .   (j) f is not a function, e.g., (5, 0), (5, 5) ∈ f because 50 = 1 and 55 = 1. 109

110

Mathematics: A Discrete Introduction

24.2 The following table gives the answer. function {(1, 4), (2, 4), (3, 4)} {(1, 4), (2, 4), (3, 5)} {(1, 4), (2, 5), (3, 4)} {(1, 4), (2, 5), (3, 5)} {(1, 5), (2, 4), (3, 4)} {(1, 5), (2, 4), (3, 5)} {(1, 5), (2, 5), (3, 4)} {(1, 5), (2, 5), (3, 5)}

one-to-one? no no no no no no no no

onto? no yes yes yes yes yes yes no

24.3 The following table gives the answer. Function {(1, 3), (2, 3)} {(1, 3), (2, 4)} {(1, 3), (2, 5)} {(1, 4), (2, 3)} {(1, 4), (2, 4)} {(1, 4), (2, 5)} {(1, 5), (2, 3)} {(1, 5), (2, 4)} {(1, 5), (2, 5)}

One-to-one? no yes yes yes no yes yes yes no

Onto? no no no no no no no no no

one-to-one? no yes yes no

onto? no yes yes no

24.4 The following table gives the answer. function {(1, 3), (2, 3)} {(1, 3), (2, 4)} {(1, 4), (2, 3)} {(1, 4), (2, 4)} 24.5 (a) −2. (b) 3. (c) 27. (d) 1. (e) 2. 24.6

(a) im f is the set of all odd integers. (b) im f = N (nonnegative integers). (c) im f = Z. (d) im f = (0, 1] = {x ∈ R : 0 < x ≤ 1}. (e) im f = [0, ∞) = {x ∈ R : x ≥ 0}.

Instructor’s Manual

111

(f) im f = [0, 1] = {x ∈ R : 0 ≤ x ≤ 1}. 24.7

(a) To show that f is not one-to-one, find two different elements of A, say a1 and a2 , for which f (a1 ) = f (a2 ). (b) To show that f is not onto, find an element b ∈ B and prove there is no a ∈ A such that f (a) = b.

24.8 (a) (3, 7) [other answers possible]. (b) (4, 5) [or (4, 6)]. (c) (4, 7). 24.9

(a) The function f is one-to-one if and only if every horizontal line intersects the graph of f at most once. Proof. (⇒) Suppose f is one-to-one and suppose, for contradiction, that some horizontal line (with equation y = b) intersects the graph of f at two (or more) distinct points, say (x1 , b) and (x2 , b). This means that f (x1 ) = b and f (x2 ) = b, but then f (x1 ) = f (x2 ) contradicting the fact that f is one-to-one.⇒⇐ Therefore every horizontal line intersects the graph of f at most once. (⇐) Suppose every horizontal line intersects the graph of f at most once. To show that f is one-to-one we use Proof Template 20. Suppose we have f (x1 ) = f (x2 ) = b, for some real number b. Then the horizontal line y = b intersects the graph at (x1 , b) and (x2 , b). Since this horizontal line intersects the graph of f in at most one point, these two points must be the same, i.e., x1 = x2 . Therefore f is one-to-one. (b) The function f is onto R if and only if every horizontal line intersects the graph of f at least once. Proof. (⇒) Suppose f is onto. Consider the horizontal line y = b. Since f is onto, there is a real number a such that f (a) = b. Therefore the line y = b intersects the graph of f at the point (a, b). (⇐) Suppose every horizontal line intersects the graph of f in at least one point. To show that f is onto we use Proof Template 21. Let b ∈ R. The line y = b intersects the graph of f ; let (a, b) be such a point of intersection. Therefore f (a) = b. Therefore f is onto.

24.10 If a 6= 0 then f is both one-to-one and onto. Proof. One-to-one. Suppose f (x) = f (y). Then ax + b = ay + b. Subtracting b from both sides gives ax = ay, and then dividing by a gives x = y. Therefore f is one-to-one. Onto. Let y be any real number. We need to find an x such that f (x) = y. Taking x = (y − b)/a we calculate f (x) = f [(y − b)/a] = a[(y − b)/a] + b = [y − b] + b = y and so f is onto.

112

Mathematics: A Discrete Introduction If a = 0, then f is neither one-to-one nor onto. To show that f is not one-to-one, we note that f (1) = b and f (2) = b. To show that f is not onto, consider any real number c 6= b. Then for any x, f (x) = b so there is no x such that f (x) = c.

24.11 If a = 0, then this problem reduces to Exercise 24.10. If a 6= 0, then we claim f is neither one-to-one nor onto R. This can be seen by applying Exercise 24.9 to the graph of f , which is a parabola. There are horizontal lines that entirely miss the graph of f (either below when a > 0 or above when a < 0), and so f is not onto. And there are horizontal lines that intersect the graph of f twice, showing that f is not onto. Now here is an algebraic argument: To show that f is not one-to-one we calculate f at the values

−b 2a

± 1:

  2   −b −b −b b2 f +1 = a +1 +b +1 +c = − +a+c 2a 2a 2a 4a    2   b2 −b −b −b f −1 = a −1 +b −1 +c = − +a+c 2a 2a 2a 4a 

and

and so f is not one-to-one. To show that f is not onto R is a bit trickier. We first consider the case a > 0. Take y = −b2 4a + c − 1. To find a real number x so that f (x) = y means we need to solve the equation ax2 + bx + c =

−b2 +c−1 4a



ax2 + bx +



 b2 +1 = 0 4a

The discriminant of this equation is b2 − 4a



 b2 + 1 = −4a 4a

which is negative. Hence there is no solution to f (x) = y and so f is not onto. 2

2 Similarly, if a < 0 then take y = −b 4a + c + 1. To solve f (x) = y means we must solve ax + 2 b bx + c − y = 0 which is equivalent to ax2 + bx + 4a − 1 = 0. This has discriminant

 b2 b − 4a − 1 = 4a 4a 2



which is negative. Hence there is no real number x so that f (x) = y, and so f is not onto R. Summarizing: If a = 0 and b 6= 0, then f is both one-to-one and onto. Otherwise f is neither.

Instructor’s Manual

113

24.12 In (a), there is no explicit set B to which the definition applies. In particular, every function f is onto if we think of B as being the image of f . In (b), the notation f : A → B establishes a context for the phrase “ f is onto.” In this context, the issue is: Does im f equal B? 24.13 The arc sine function is not really the inverse of the “full” sine function. For example, sin(10π) = 0, but sin−1 (0) = 0. However, if we restrict the domain of sine, e.g., to the interval [−π/2, π/2], then sin−1 is an inverse function for sine. 24.14

(a) First, f is one-to-one. Proof: We need to show that if f (a) = f (b), then a = b. So, suppose we have integers a, b with f (a) = f (b). By definition of f , we have 2a = 2b. Dividing both sides by 2 gives a = b. Therefore f is one-to-one. Second, f is not onto. We claim that 1 ∈ Z, but there is no x ∈ Z with f (x) = 1. Suppose, for the sake of contradiction, there is an integer x such that f (x) = 1. Then 2x = 1, and so x = 21 . However, 21 is not an integer, so there is no integer x with f (x) = 1. Therefore f is not onto. (b) First, f is one-to-one. Suppose f (a) = f (b). Then 10 + a = 10 + b. Subtracting 10 from both sides gives a = b. Therefore f is one-to-one. Second, f is onto. Let b ∈ Z. Let a = b − 10 (notice that a ∈ Z). Now f (a) = 10 + a = 10 + (b − 10) = b, and so f is onto. (c) First, f is one-to-one, and the proof is the same as that of the previous function. Second, however, f is not onto. Consider 3 ∈ N. We claim there is no b ∈ N with f (b) = 3. Otherwise, we have f (b) = b + 10 = 3 and so b = −7, but −7 ∈ / N, and so f is not onto. (d) First, f is not one-to-one. For example, f (10) =

10 =5 2

and

f (11) =

11 − 1 =5 2

but 10 6= 11. Second, f is onto. Let b be any integer. Let a = 2b. Note that a is even. Thus f (a) = a 2b 2 = 2 = b. Therefore f is onto. (e) First, f is not one-to-one. Note that f (2) = 4 and f (−2) = 4, but 2 6= −2, so f is not one-to-one. Second, f is not onto. Consider −1 ∈ Q. Note that the square of any rational number is nonnegative, so there can be no rational number a with f (a) = −1. Therefore f is not onto. 24.15 Proof of Proposition 24.14: Let f be a function.

114

Mathematics: A Discrete Introduction (⇒) Suppose f −1 is a function. We must show that f is one-to-one. To this end, suppose f (a) = f (b) and we work to show that a = b. Let c be the common value of f (a) and f (b). That is, (a, c), (b, c) ∈ f and so (c, a), (c, b) ∈ f −1 by definition of inverse relation. Now f −1 is a function, and by definition of function, since (c, a) and (c, b) are both in f −1 , we have a = b, as desired. Therefore f is one-to-one. (⇐) Suppose f is one-to-one. We must show that f −1 is a function. To prove that f −1 is a function, suppose we have (x, y), (x, z) ∈ f −1 and we work to show that y = z. Since (x, y) and (x, z) are in f −1 , then we must have (y, x) and (z, x) in f (by definition of inverse relation). In function notation, we have f (y) = f (z) = x. Furthermore, since f is one-to-one, and since f (y) = f (z), we must have y = z, as desired. Therefore f −1 is a function. Proof of Proposition 24.15: Suppose f and f −1 are both functions. The domain of f is the set of all first elements of the pairs in f . This is exactly the same as the set of all second elements of f −1 , i.e., the image of f −1 . Symbolically: x ∈ dom f ⇐⇒ (x, ?) ∈ f ⇐⇒ (?, x) ∈ f −1 ⇐⇒ x ∈ im f −1 . Therefore dom f = im f −1 . The proof that dom f −1 = im f is nearly identical.

24.16 Let f : A → B where A and B are finite sets. First, we prove if (a) f is one-to-one and (b) f is onto, then (c) |A| = |B|. This is immediate from Proposition 24.25. Second, we prove that if (a) f is one-to-one and (c) |A| = |B|, then (b) f is onto. Suppose, for the sake of contradiction, that f is not onto. This means that im f 6= B, so we know that im f is a strict subset of B. Observe that f : A → im f is one-to-one and, by definition, onto. Thus, by Proposition 24.25, we have |A| = | im f | < |B| contradicting the fact that |A| = |B|.⇒⇐Therefore f is onto.

Instructor’s Manual

115

Third, we prove that if (b) f is onto and (c) |A| = |B|, then f is one-to-one. Suppose, for the sake of contradiction, that f is not one-to-one. Then there are distinct x, y ∈ A with f (x) = f (y) = b ∈ B. Thus there are two different elements of A mapped to one element of B. This means that the remaining |A| − 2 elements map to the |A| − 1 remaining elements of B, and since |A| − 2 < |A| − 1, it is impossible for f to be onto.⇒⇐Therefore f is one-to-one. 24.17 We have already seen such examples in Exercise 24.14. 24.18 Suppose that f : A → B is a bijection. We must prove that f −1 : B → A is a bijection as well. First, f −1 is one-to-one because ( f −1 )−1 = f is a function (Theorem 24.21). Second, f −1 is onto A because (Proposition 24.15) im f −1 = dom f = A. 24.19

(a) We define f : An → Bn by f (d) = n/d. We first show that f is, indeed, a function from An to Bn . √ Let d ∈ An . This means that 1 ≤ d < n. Note that f (d) = n/d is an integer (because √ d|n) and, by Exercise 5.17, n/d > n. Furthermore, n/d is a divisor of n (multiply by d) and so we conclude that f : An → Bn . Next we show that f is one-to-one. Suppose f (d) = f (d 0 ). This means that n/d = n/d 0 from which it easily follows that d = d 0 . Therefore f is one-to-one. Finally we show that f is onto Bn . Let b ∈ Bn . Let d = n/b. Note that d is an integer √ (because b|n), that d < n (by Exercise 5.17), and d|n (because bd = b(n/d) = n). Therefore f is onto Bn . Hence f is bijection from An to Bn . (b) Note: Students will be asked to prove this again in Chapter 7’s self-test problem 16. If n is a perfect square, then the positive divisors of n are precisely the integers in An , √ the integers in Bn , and n. Since |An | = |Bn |, the number of positive divisors of n is 2|An | + 1 which is odd. Otherwise, if n is not a perfect square, its divisors lie precisely in An and Bn and since these sets have the same size, the number of positive divisors of n is 2|An | which is even.

(c) Note that a locker is closed if and only if it has been flipped an odd number of times, and the number of times locker n is flipped equals the number of positive divisors of n. Therefore, locker n is closed iff n is a perfect square.  24.20 nk . 24.21 Let’s say B = {1, 2, . . . , n}. Arrange the elements of A in some order a1 , a2 , . . . , a2n . For each such list we assume that f (a1 ) = f (a2 ) = 1, f (a3 ) = f (a4 ) = 2, and so on until f (a2n−1 ) = f (a2n ) = n. There are (2n)! lists, but two such lists can give the same function f . The number of lists that give the same function is 2n (as we can swap a2k−1 and a2k for each k between 1 and n). Therefore there are (2n)!/2n such functions.

116

Mathematics: A Discrete Introduction

24.22

n i jk

24.23

(a) f (X) = {0, 1, 2}.



or

n! i! j!k! .

(b) f (X) = [0, 1]. (c) f (X) = [ 21 , 2]. (d) f ({1}) = {2} which is not the same as f (1) which equals 2. (e) f (A) is the image of f , im f . 24.24

(a) f −1 (Y ) = {−3, −2, −1, 1, 2, 3}. √ √ (b) f −1 (Y ) = [− 2, −1] ∪ [1, 2]. (c) f −1 ({ 12 }) = {−1, 1}.

(d) f −1 ({− 21 }) = ∅.

25

The Pigeonhole Principle

This is an optional section dealing with more difficult material. You may safely omit this section without compromising your ability to cover later material. If you have the time, I highly recommend covering Cantor’s Theorem (Theorem 25.4). The fact that one infinity can be greater than another is amazing. This may be the one fact that students remember years after taking this course. It is worthwhile taking the time to show students this gem. 25.1 If N ≥ 1010 then N has 11 (or more) digits. Since there are only 10 possible digits, there must be a repeat. (The largest integer without a repeated digit is 9,876,543,210.) 25.2 At least 367 people. 25.3 At least 2 · 263 + 1 (which equals 35,153) people. 25.4 Since the number of hairs on a person’s head is about 100,000 and a large city will have many more women than that, there must be two with the same number of hairs on their heads. 25.5 In a sequence of 5 distinct integers, there are four places to fill in a < or a > sign: a1 a2 a3 a4 a5 . Therefore, there are 24 = 16 possible patterns for the s. Since we have 17 different sequences, by the Pigeonhole Principle, two of them must have the same pattern of s. 25.6 If s is a Social Security number, let Z(s) denote the set of positions of the zeros in s. For example, if s is 120-90-1109, then Z(s) = {3, 5, 8} because 120-90-1109 has zeros in positions 3, 5, and 8. Two Social Security numbers, s and t, match zeros if and only if Z(s) = Z(t). Note that Z(s) ⊆ {1, 2, ..., 9} so there are 29 = 512 different possible sets Z(s). Since we have 513 Social Security numbers, two of them must match zeros.

Instructor’s Manual

117

25.7 Consider six types of positive integer: – those whose last digit is a 1 or a 9, – those whose last digit is a 2 or a 8, – those whose last digit is a 3 or a 7, – those whose last digit is a 4 or a 6, – those whose last digit is a 5, – those whose last digit is a 0. Since the set contains 7 integers, two of these integers, and a and b, must be of the same type. If the last digits of a and b are the same, then a − b is a multiple of 10. If the last digits of a and b are different, then a + b is a multiple of 10. 25.8 Because an L-region has 5 squares, there are 25 = 32 different ways it might be colored. In an 8 × 8 chess board, there are 62 = 36 different possible L-regions: the corner of the L-region can be in any row from the third to the last (6 choices) and any column from the first to the sixth (6 choices again). Since 36 > 32, there must be two L-regions with identical colorings. 25.9 Divide the square into four square regions by cutting it in half both vertically and horizontally. Two of the five points must lie in the same 12 × 12 square, and the maximum distance between √ two points in a subsquare is 2/2. 25.10 The four points (0, 0), (0, 1), (1, 0), and (1, 1) will do. 25.11 The generalization is the following statement: Given nine distinct lattice points in three-dimensional space, at least one of the line segments determined by these points has a lattice point as its midpoint. Proof. The parities of the coordinates are either even or odd, so there are 8 possible “types” of coordinates from (even,even,even) to (odd,odd,odd). Since there are nine points, two must have the same parity type. The midpoint of these two points must be a lattice point. 25.12 Let n be a positive integer. Here is a sequence of n2 distinct integers (indeed, the integers 1 through n2 ). n (n − 1) (n − 2) · · · 2 2n (2n − 1) (2n − 2) · · · (n + 2) 3n (3n − 1) (3n − 2) · · · (2n + 2) and so on until n2 (n2 − 1) (n2 − 2) · · · [(n − 1)n + 2]

1 → (n + 1) → (2n + 1) → [(n − 1)n + 1]

118

Mathematics: A Discrete Introduction We have written this sequence in an n × n grid to illustrate the pattern of the numbers and to help with the analysis. Consider a subsequence of length n + 1. By the Pigeonhole Principle, at least two elements of the subsequence come from the same row of the above chart, and so they are in decreasing order. And, by the Pigeonhole Principle, at least two of the elements of the subsequence come from the same column of the above chart, and so they are in increasing order. Therefore the subsequence is not monotone.

25.13 We mimic the proof of the Erd˝os-Szekeres Theorem (Theorem 25.3). Suppose we are given the sequence a1 , . . . , a1001 that contains no such subsequence. Create a 1001-long list of labels (ui , di , ci ) where – ui is the length of a longest increasing subsequence starting at position i, – di is the length of a longest decreasing subsequence starting at position i, and – ci is the length of a longest constant subsequence starting at position i. By supposition, we have 1 ≤ ui , di , ci ≤ 10 for all i. Hence there are at most 103 = 1000 distinct labels. We claim that if i < j, then (ui , di , ci ) 6= (u j , d j , c j ) because – if ai < a j then ui > u j , – if ai > a j then di > d j , and – if ai = a j then ci = c j . This implies that all 1001 labels must be distinct.⇒⇐ Therefore the sequence must contain an 11-long subsequence that is increasing, decreasing, or constant. We now construct a 1000-long sequence that contains no increasing, decreasing, or constant subsequence of length 11. The construction is a modification of the sequence we developed in the solution to Exercise 25.12. Start with this 100-long sequence: 10 20 30 .. .

9 19 29

8 18 28

7 17 27

6 16 26

5 15 25

4 14 24

3 13 23

2 12 22

1 11 21

100

99

98

97

96

95

94

93

92

91

Instructor’s Manual

119

By our solution to Exercise 25.12, it does not contain an increasing or a decreasing subsequence of length 11. Now replace each number with ten copies of the same number; that is, the sequence begins with ten 10s, then ten 9s, and so on until ending with ten 91s. This gives a 1000-long sequence that does not contain an 11-long subsequence that is increasing, decreasing, or constant. 25.14 Here is a C function that performs the computation. /* Input: list is an array of *distinct* integers representing a sequence of integers. nels is the number of elements in the array. Output: The length of a longest monotone subsequence in the list. */ int monotone(int *list, int nels) { int *up; int *down; int ans; int i,j; int u,d; if (nels =0; i--) { up[i] = 1; down[i] = 1; for (j=i+1; j list[j]) { if (up[i] n2 /200 which we can rewrite |n2 | < 200(1.1)n and so n2 = O(1.1n ). (c) Once n > k, (n)k = n(n − 1)(n − 2) · · · (n − k + 1) ≤ (n)(n)(n) · · · (n) = nk and so (n)k is O(nk ). n+1 1 n+1 3 n+1 n = 1 + n so once n > 1, we have n ≤ 2 . Therefore n 3n−1 = 31 3n and 2n ≤ 3n for all n. So we can write

(d) Notice that (e) Note that

2n ≤ 3n = 3 · 3n−1 and so 2n is O(3n−1 ).

is O(1).

Instructor’s Manual

139

(f) Note that |n sin n| = |n| · | sin n| and since sin n is bounded between −1 and 1, we have |n sin n| ≤ |n| and so n sin n is O(n). 29.2 (a) True. (b) True. (c) False. (d) False. (e) True. (f) False. 29.3 Since f (n) is O(g(n)), there is a positive number A such that, with at most finitely many exceptions, | f (n)| ≤ A|g(n)|. Similarly, since g(n) is O(h(n)), there is a positive number B such that, with at most finitely many exceptions, |g(n)| ≤ B|h(n)|. Combining these two inequalities, we have, with at most finitely many exceptions, | f (n)| ≤ A|g(n)| ≤ AB|h(n)| and so f (n) is O(h(n)). 29.4 By definition, there is a number M0 so that | f (n)| ≤ M0 for all but finitely many values of n. Let M be any number that is larger than M0 and all values of | f (n)| where n is an exception to | f (n)| ≤ M0 . Then | f (n)| ≤ M for all n. 29.5 For all but finitely many values of n, f (n) is zero. 29.6 Yes, 10 f (n) is O(g(n)). We are given that f (n) is O(g(n)), which means there is a positive number M so that | f (n)| ≤ M|g(n)| with at most finitely many exceptions. Multiplying both sides by 10 gives |10 f (n)| ≤ 10M|g(n)| and so 10 f (n) is O(g(n)). 29.7 We are given that f1 (n) is O(g1 (n)) and f2 (n) is O(g2 (n)). Therefore there are positive numbers M1 and M2 such at (with at most finitely many exceptions) we have | f1 (n)| ≤ M1 |g1 (n)| and | f2 (n)| ≤ M2 |g2 (n)|. Thus for the sum we have (with finitely many exceptions) | f1 (n) + f2 (n)| ≤ | f1 (n)| + | f2 (n)|

by the Triangle inequality

≤ M1 |g1 (n)| + M2 |g2 (n)| ≤ (M1 + M2 )|g1 (n)| + (M1 + M2 )|g2 (n)| = (M1 + M2 )g1 (n) + (M1 + M2 )g2 (n) = (M1 + M2 )|g1 (n) + g2 (n)|. Therefore f1 (n) + f2 (n) is O(g1 (n) + g2 (n)).

because ∀n, g1 (n), g2 (n) are positive

140

Mathematics: A Discrete Introduction For the product, we have (with finitely many exceptions) | f1 (n) f2 (n)| = | f1 (n)| · | f2 (n)| ≤ [M1 |g1 (n)|] · [M2 |g2 (n)|] = M1 M2 |g1 (n)g2 (n)|. Therefore f1 (n) f2 (n) is O(g1 (n)g2 (n)). The result for f1 + f2 is false if we omit the requirement that the function g1 , g2 are always positive. For example, if f1 (n) = f2 (n) = n2 /2, g1 (n) = n2 , and g2 (n) = −n2 then fi (n) is O(gi (n)) for i = 1, 2, but f1 (n) + f2 (n) is not O(g1 (n) + g2 (n)). The product result does not depend on the functions gi being positive.

29.8 (⇒) Suppose f (n) is Θ(g(n)). This means that there are positive numbers A and B such that, with at most finitely many exceptions, A|g(n)| ≤ f (n) ≤ B|g(n)|. Because f (n) ≤ B|g(n)| for all but finitely many n, f (n) is O(g(n)). Because f (n) ≥ A|g(n)| for all but finitely many n, f (n) is Ω(g(n)). (⇐). Suppose f (n) is O(g(n)) and Ω(g(n)). Because f (n) is O(g(n)) there is a positive number B so that | f (n)| ≤ B|g(n)| for all but finitely many n. Because f (n) is Ω(g(n)) there is a positive number A so that | f (n)| ≥ A|g(n)| for all but finitely many n. Combining these, we have A|g(n)| ≤ | f (n)| ≤ B|g(n)| for all but finitely many n. Therefore f (n) is Θ(g(n)). 29.9 Using the identity loga n = (logb a) (loga n) we have |loga n| = |logb a| · |loga n| and since |logb a| is a constant, we have loga n = O(logb n). Likewise, logb n = O(loga n) and so loga n = Θ(logb n). 29.10 Write p(n) as

p(n) = ad nd + ad−1 nd−1 + · · · + a0

and so

|p(n)| ≤ |ad | + 1 + · · · + 1 |nd |

once n is larger than all the |ak | terms. Therefore p(n) is O(nd ). On the other hand, we can write nd =

p(n) ad−1 d−1 a0 − n −···− . ad ad ad

Instructor’s Manual

141

Therefore |nd | ≤ |

p(n) ad−1 d−1 a0 |+| n | + · · · + | |. ad ad ad

We can rearrange this to |

ad−1 d−1 a0 p(n) | ≥ |nd | − | n | − · · · − | |. ad ad ad

Dividing by nd we get |ad−1 | |a0 | |p(n)| ≥ 1− − · · · d−1 d |ad n | n n and once n is large enough, this becomes |p(n)| 1 1 ≥ 1− = d |ad n | 2 2 and so |p(n)| ≥

|ad | d 2 |n |

once n is large enough. Therefore p(n) is Ω(nd ).

We therefore may conclude that p(n) is Θ(nd ).   29.11 The correct answer is x + 21 . n . 29.12 n − 10 10 29.13 If n is an integer, then dxe + bxc − 2x evaluates to 0. Otherwise, let x = n + t where n is an integer and 0 < t < 1. Then dxe = n + 1 and bxc = n. Thus dxe + bxc − 2x = n + 1 + n − 2(n + t) = |1 − 2t|. For 0 < t ≤ And for

1 2

1 2

we have 0 < 2t ≤ 1 and so 1 > 1 − 2t ≥ 0. Therefore |1 − 2t| = 1 − 2t < 1.

< t < 1 we have 1 < 2t < 2 and so 0 < 2t − 1 < 1 and so |1 − 2t| = 2t − 1 < 1.

In all cases, |1 − 2t| < 1 completing the proof. 29.14 We must show that xk /ex → 0 as x → ∞. The proof is by induction on k. For k = 1, we have by l’Hˆopital’s rule x 1 = lim x = 0 x x→∞ e x→∞ e lim

as required. Suppose we have that xk /ex → 0 as x → ∞. Applying l’Hˆopital’s rule and the induction hypothesis we calculate xk+1 kxk xk = lim x = k lim x = 0 x x→∞ e x→∞ e x→∞ e lim

as required.

142

Mathematics: A Discrete Introduction

29.15 It is convenient to write Hn = ∑nk=1 1k . Note that ln n = as in the figure:

Rn 1

dx/x and we approximate this integral by n −1 rectangles above and below

1 0.8 0.6 0.4 0.2 1

2

3

4

5

Using rectangles above the curve, we have ln n =

Z n dx 1

x



1 1 1 1 1 1 1 + +···+ < + +···+ + = Hn . 1 2 n−1 1 2 n−1 n

(∗)

Using rectangles below the curve we have ln n =

Z n dx 1

x



1 1 1 + + · · · + = Hn − 1. 2 3 n

(∗∗)

From inequalities (∗) and (∗∗) we get 0 < Hn − ln n ≤ 1 and so |Hn − ln n| ≤ 1 for all n. Therefore Hn = ln n + O(1).

Chapter 6

Probability 30

Sample Space

This chapter gives a modest introduction to probability theory. Of course, students can spend several semesters studying probability. It is included in this book for a number of reasons. First, probability problems are often disguised counting problems, and so this is an implicit review of the counting techniques seen earlier. Second, computer science students may need probability theory later in their studies (e.g., in the analysis of randomized algorithms). Third, even if students are likely to take a full course (or multiple courses) in probability later, multiple passes through these ideas make learning easier and increase retention. Fourth, ideas from probability and statistics are prevalent in society (from weather forecasts to economic forecasts) and everyone should have at least a rudimentary understanding of this subject. Finally, probability is a fun and a beautiful mathematical topic! Only discrete probability is covered in this book. Consequently, we do not have to confront or sidestep measurability issues. Some of the problems can be cast as continuous probability problems (e.g., the Spinner), but we can convert these into discrete problems to avoid continuity. This section is necessary for all subsequent probability sections. However, no other sections of this book rely on this, or any other probability section. I think it is important in probability problems that students be able to explicitly describe the sample space for the problem they are considering. This one step often converts a vague, mushy, incorrect response into a crisp, correct answer. It is important that students understand that the elements of the sample space are “atomic events,” i.e., outcomes of an experiment that cannot be “decomposed.” Emphasize this distinction. If we roll a pair of dice, the outcome (3, 4) is an element of the sample space. The event “rolling a 7” is not an element of the sample space as there are many elements in the sample space that meet this condition. Elements of a sample space are called outcomes. Subsets of a sample space are called events. The use of P(·) notation requires a bit of discussion. I have chosen to overload my use of the P symbol. There are three types of objects to which the P operator may be applied: (1) to an element in a sample space, (2) to an event, and (3) to an implicit event. The most basic use is defined in this section. If s is an element of a sample space, P(s) is the probability of this outcome. In the next section, we extend the P(·) notation to apply to events. An alternative approach to this overloaded use of P is to define P only for events. Indeed, this is the “correct” measure-theoretic approach. However, I think it is harder for students to get started with this alternative definition. 30.1 x = 0.6. 143

144

Mathematics: A Discrete Introduction

30.2 x =

1 10 .

30.3 x = z =

1 2

and y = 0.

30.4 c = 144/205. 30.5 It is not possible to have ∀s ∈ S, P1 (s) < P2 (s). If we did, then 1 = ∑ P1 (s) < ∑ P2 (s) = 1 s∈S

s∈S

which is a contradiction. 30.6 It would be unreasonable to take all 26 letters to have the same probability as some letters (such as E) occur much more frequently than others (such as Q). A better model can be created by looking up the frequency of letters in English words. 30.7 An outcome of this experiment can be recorded as (a, b) where a is either H or T (the result of the coin flip) and b is an integer with 1 ≤ b ≤ 6 (the up-face of the die). Thus n o S = (H, 1), (H, 2), (H, 3), (H, 4), (H, 5), (H, 6), (T, 1), (T, 2), (T, 3), (T, 4), (T, 5), (T, 6) . Each of these 2 × 6 = 12 outcomes are equally likely, so P : S → R is given by P(s) = every s ∈ S. 30.8

(a) The sample space is (S, P) where S = {1, 2, 3, 4} and P(s) =

1 4

1 12

for

for all s ∈ S.

(b) The sample space is (S, P) where S = {1, 2, 3, 4}×{1, 2, 3, 4} = {(1, 1), (1, 2), . . . , (4, 4)} 1 and P(s) = 16 for all s ∈ S. 30.9

(a) The set S consists of all 5-element lists formed from the integers 1 through 20 in which no element is repeated. There are (20)5 = 20 · 19 · 18 · 17 · 16 = 1,860,480 such lists. All these are equally likely, so P(s) = 1/[(20)5 ] for all s ∈ S.  (b) The set S consists of all 5-element subsets of the set {1, 2, . . . , 20}. Thus |S| = 20 5 . All  of these outcomes are equally likely, so P(s) = 1/ 20 5 for all s ∈ S. (c) The set S consists of all 5-element lists formed from the integers 1 through 20 in which elements may be repeated. There are 205 such lists. All these are equally likely, so P(s) = 20−5 for all s ∈ S.

30.10 P(1) =

1 16 ,

P(2) =

3 16 ,

P(3) =

5 16 ,

and P(4) =

7 16 .

30.11 Let S = {1, 2, 3} and let P(1) = 1, P(2) = 0, and P(3) = 0. 30.12 Let S = {1} and let P(1) = 1.

Instructor’s Manual

145

30.13 If S = ∅, then

∑ P(s) = 0 6= 1

s∈S

by convention (empty sums are zero), violating the definition of sample space.⇒⇐Therefore S 6= ∅. 30.14

(a) Note that we require ∑k P(k) = 1. If all elements of N have the same probability, then either they are all zero, in which case ∑k P(k) is zero, or else they are positive, in which case ∑k P(k) is infinite. In neither case is the result one. (b) Since we require ∑k P(k) = 1 we have 1=





k=0

k=0

a

∑ P(k) = ∑ ark = 1 − r

and so a = 1 − r (or, equivalently, a + r = 1).

31

Events

This section is essential for the subsequent sections on probability but is not needed for sections in later chapters. It is important to explain the modeling process for probability word problems. We can think of this process as problem → sample space → event. Given the problem, have the students identify/create a sample space for the problem, and them have them figure out the event whose probability we desire. Again, stress the difference between outcome (element of a sample space) and event (subset of a sample space). Thus s ∈ S is an outcome, but {s} is an event. Both, of course, have the same probability, and from a modeling point of view, there is little difference between these. However, formally they are different objects. 31.1

(a) A = {2, 4, 6, 8, 10} and P(A) = 21 . (b) B = {1, 3, 5, 7, 9} and P(B) = 21 . (c) C = {2, 3, 5, 7} and P(C) = 25 . (c) D = ∅ and P(D) = 0.

31.2 The following chart gives the answers.

146

Mathematics: A Discrete Introduction k 2 3 4 5 6 7 8

Ak {(1, 1)} {(1, 2), (2, 1)} {(1, 3), (2, 2), (3, 1)} {(1, 4), (2, 3), (3, 2), (4, 1)} {(2, 4), (3, 3), (4, 2)} {(3, 4), (4, 3)} {(4, 4)}

P(Ak ) 1/16 1/8 3/16 1/4 3/16 1/8 1/16

31.3 (a) A = {HHTT, HTHT, HTTH, THHT, THTH, TTHH} and (b) P(A) =  10 31.4 Answer: 10 5 /2 .  31.5 nh /2n . 31.6

6 16

= 38 .

(a) A = {HTHTHTHTHT, THTHTHTHTH}. (b) P(A) = 2/210 = 2−9 = 1/512.

31.7

(a) A = {(2, 6), (3, 5), (4, 4), (5, 3), (6, 2)}. (b) P(A) =

5 36 .

31.8 There are 33 ways we can roll three even numbers out of 63 equally likely possibilities, so the probability is ( 63 )3 = ( 21 )3 = 18 . 31.9 31.10

1 2.

 (a) A = (2, 1), (3, 2), (3, 1), (4, 3), (4, 2), (4, 1), (5, 4), (5, 3), (5, 2), (5, 1), (6, 5), (6, 4), (6, 3), (6, 2), (6, 1) . (b) Since |A| = 1 + 2 + 3 + 4 + 5 = 15, we have P(A) =

31.11 31.12

1 2.

There is no advantage to going first.

(a) P(1 beats 2) = (b) P(2 beats 3) = (c) P(3 beats 1) =

31.13

21 36 21 36 25 36

≈ 58.33%. ≈ 58.33%. ≈ 69.44%.

(d) There is no “best” die.   52 88 (a) 13 · 4 · 12 2 · 4 · 4/ 5 = 4165 ≈ 2.11%.   6 (b) 13 · 4 · 12 · 42 / 52 5 = 4165 ≈ 0.14%.   3 52 352 (c) 13 · 42 · 12 3 · 4 / 5 = 833 ≈ 42.26%.  42  52 198 (d) 13 2 · 2 · 44/ 5 = 4165 ≈ 4.75%.

15 36

=

5 12 .

Instructor’s Manual (e) 4 ·

13 5

 /

147 52 5



=

33 16660

≈ 0.198%.

31.14 Note that P(∅) = 0 since an empty sum evaluates to 0 by convention. Also, P(S) = 1 by definition of sample space since P(S) = ∑s∈S P(s) = 1. If A ∩ B = ∅, then P(A ∪ B) = P(A) + P(B) − P(A ∩ B) = P(A) + P(B) − P(∅) = P(A) + P(B) For any A and B, P(A ∪ B) = P(A) + P(B) − P(A ∩ B) ≤ P(A) + P(B) since P(A ∩ B) is nonnegative. Note that P(A) + P(A) = P(A ∪ A) + P(A ∩ A) = P(S) + P(∅) = 1.  10 63 31.15 (a) 10 5 /2 = 256 ≈ 24.61%. (b) 27 /210 = 2−3 = 81 = 12.5%.  21 (c) 72 /210 = 1024 ≈ 2.05%.

(d) By Proposition 31.7, the probability is   10 7 27 359 5 2 + 10 − 10 = ≈ 35.06%. 10 2 2 2 1024 31.16 Let A be the event that we see a 1 and B be the event that we see a 2. (a) P(A) = ( 56 )3 = (b) (c)

125 216 . 91 P(A) = 1 − ( 56 )3 = 216 . 91 As in (b), P(B) = 216 .

(d) P(A ∪ B) = P(A ∪ B) = ( 46 )3 = (e) P(A ∪ B) = 1 − P(A ∪ B) =

8 27 . 1 − ( 64 )3

=

(f) P(A ∩ B) = P(A) + P(B) − P(A ∪ B) =

19 27 . 91 216

91 + 216 − 19 27 =

5 36 .

31.17 Note that (A ∩ B) ∩ (A ∩ B) = ∅. Also note that (A ∩ B) ∪ (A ∩ B) = A. Therefore,   P(A) = P (A ∩ B) ∪ (A ∩ B) = P(A ∩ B) + P(A ∩ B) − P(∅) = P(A ∩ B) + P(A ∩ B). 31.18 Recall that P(A) =

∑ P(s)

s∈A

and

P(B) =

∑ P(s).

s∈B

Since A ⊆ B, every term in the first sum is also present in the second. Since probabilities are nonnegative, this implies that the second sum is at least as large as the first; that is P(B) ≥ P(A).

148

Mathematics: A Discrete Introduction

31.19 This is false; here is a counterexample: Let (S, P) be a sample space with S = {1, 2, 3, 4, 5}, P(1) = P(2) = P(3) = 13 , and P(4) = P(5) = 0. Take A = {1, 2} and B = {1, 2, 5}. Note that A is a proper subset of B but P(A) = P(B) = 23 . 31.20 Suppose, for the sake of contradiction, P(A ∩ B) = 0. Then P(A) + P(B) >

1 1 + =1 2 2

and

P(A ∩ B) + P(A ∪ B) ≤ 0 + 1,

but P(A) + P(B) = P(A ∩ B) + P(A ∪ B).⇒⇐ 31.21 Proof by induction on n. The case n = 1 is trivial and n = 2 is from Proposition 31.8. Suppose the theorem is true when n = k. Let A1 , . . . , Ak+1 be events in a sample space. Let B = Ak ∪ Ak+1 . Then   P A1 ∪ · · · ∪ Ak−1 ∪ Ak ∪ Ak+1 = P A1 ∪ · · · ∪ Ak−1 ∪ B ≤ P(A1 ) + · · · + P(Ak−1 ) + P(B) = P(A1 ) + · · · + P(Ak−1 ) + P(Ak ∪ Ak+1 ) = P(A1 ) + · · · + P(Ak−1 ) + P(Ak ) + P(Ak+1 ). 31.22 P(A ∩ A) = P(∅) = 0. Interpretation: It is impossible for an event both to occur and not to occur. 31.23

(a) Since A = {0, 2, 4, 6, · · · } we have P(A) = P(0) + P(2) + P(4) + · · · = a + ar2 + ar4 + · · · a 1 a = = = . 1 − r2 1 − (1 − a)2 2 − a (b) In order to have P(A) = P(A), we must have P(A) = 1 1 = 2−a 2



1 2

leading to

a=0

which is impossible (for then P(0) = P(1) = · · · = 0). Therefore, there is no value of a for which P(A) = P(A). 31.24 Here is a Python program: def birthday(n): product = 1 for k in range(n): product *= (365-k)/(365.)

Instructor’s Manual

149

return 1-product for n in range(50,60): print n, birthday(n)

which produces the following output: 50 51 52 53 54 55 56 57 58 59

0.970373579578 0.974431993334 0.978004509334 0.981138113484 0.983876962759 0.986262288816 0.988332354885 0.990122459341 0.991664979389 0.992989448418

Therefore the answer is 57.

32

Conditional Probability and Independence

This section is needed by the subsequent probability sections, but not by any other section in the book. In a pinch, this section could be omitted, and then you could do portions of the sections on random variables and expectation, but I don’t recommend it. Students probably have an intuitive idea of independence—events that have “nothing to do with each other.” However, this can be confused with disjoint events. There is a nice way to simulate the Monty Hall problem in class that will help students see intuitively that switching doors is the right move. Use a standard deck of cards and have a student select a card at random. Have the student look at his/her card and explain that if s/he has the Ace of Spades then s/he wins a prize (say, a candy bar). Then ask the student if s/he want to switch his/her for all the other cards in the deck. [Of course, s/he will!] Now flip over 50 of the cards, but not the Ace of Spades. Ask again if s/he wants to switch his/her card for the one remaining hidden. Ideally, s/he will realize that you have not changed the problem at all and will switch. 32.1 (a) 35 . (b) 43 . (c) 56 . (d) 1. (e) 1. (f) 0. (g) 0. (h) Undefined. (i) 1. (j) 0.3. 32.2 Note that A = {1, 3, 5, 7, 9} and B = {2, 3, 5, 7}. (a) P(A) = 12 .

(b) P(B) = 25 . (c) P(A|B) = P(A ∩ B)/P(B) =

3 10

.

4 10

= 34 .

150

Mathematics: A Discrete Introduction

(d) P(B|A) = P(B ∩ A)/P(A) =

3 10

.

5 10

= 35 .

(e) P(B|A) = P(B ∩ A)/P(A) =

2 10

.

5 10

= 25 .

(f) P(B|A) = P(B ∩ A)/P(A) =

1 10

.

5 10

= 15 .

(g) P(B|A) = P(B ∩ A)/P(A) =

4 10

.

5 10

= 45 .

32.3 Let A be the event that neither die shows a 2, and let B be the event that they sum to 7. Note 6 4 that P(B) = 36 = 16 . Furthermore, A ∩ B = {(1, 6), (3, 4), (4, 3), (6, 1)}, so P(A ∩ B) = 36 = 19 . 1/9 6 2 Thus P(A|B) = P(A∩B) P(B) = 1/6 = 9 = 3 . 32.4 Let A and B be as for the previous problem. Now we seek P(B|A). Note that P(A) = 1/9 4 . and P(A ∩ B) = 19 . Therefore P(B|A) = P(A ∩ B)/P(A) = 25/36 = 25

 5 2 6

= 25 36

32.5 Let A be the event that the first three flips are HEADS and let B be the event that an equal number of HEADS and TAILS appear. Then  7 21 2 P(A ∩ B) = 10 = 2 1024 and



P(B) = and so P(A|B) = The unconditional P(A) is

10 5 210

1 8

=

63 256

1 P(A ∩ B) 21/1024 = = . P(B) 63/256 12

which is larger.

32.6 (1) ⇒ (3): Suppose P(A|B) = P(A). Then P(A) = P(A|B) = P(A ∩ B)/P(B) and if we multiply through by P(B) we have P(A)P(B) = P(A ∩ B). (3) ⇒ (1): Suppose P(A ∩ B) = P(A)P(B). Since P(B) 6= 0, we may divide both sides by P(B) to get P(A|B) = P(A ∩ B)/P(B) = P(A)P(B)/P(B) = P(A). Therefore (1) ⇐⇒ (3). The proof that (2) ⇐⇒ (3) is analogous. Finally (1) ⇐⇒ (2) follows from these. 32.7 Disjoint events are not, in general, independent. For example, consider the roll of a die. Let A be the event we roll an even number and let B be the event we roll an odd number. Then P(A ∩ B) = 0 6= P(A)P(B) = 41 . 32.8

(a) Events A and B are not independent: P(A) = P(A)P(B).

1 2

and P(B) = 21 , but P(A ∩ B) = 0 6=

1 4

=

Instructor’s Manual

151

(b) Events A and B are independent. Clearly P(A) = P(B) = 21 . We have P(A ∩ B) = 41 because there are precisely 16 squares that are simultaneously in even numbered rows and columns (4 in each row/column). Thus P(A ∩ B) = P(A)P(B). (c) Events A and B are independent. As before, we have P(A) = P(B) = 21 . Each of the four even numbered columns have four white squares, and so P(A ∩ B) = 16/64 = 14 = P(A)P(B). 32.9 Since P(A ∩ B) 6= 0, we know P(A) > 0 and P(B) > 0. Observe that P(A|B) = P(B|A) if and only if P(A ∩ B) P(B ∩ A) = P(B) P(A) which, since A ∩ B = B ∩ A is equivalent to P(A) = P(B). 32.10 Note that P(A|B) = P(A ∩ B)/P(B) = 0/P(B) = 0. Likewise, P(B|A) = 0, so these are equal. Here is an example where P(A) 6= P(B). Let S = {a, b, c, d} with P(a) = 0.1, P(b) = 0.2, P(c) = 0.3, and P(d) = 0.4. Let A = {a, b} and B = {c, d}. Then P(A) = 0.3 6= P(B) = 0.7 and P(A|B) = P(B|A). 32.11 Note that P(A|B)P(B) = P(A ∩ B) and P(A|B)P(B) = P(A ∩ B). Note that A ∩ B and A ∩ B are disjoint events; therefore P(A ∩ B) + P(A ∩ B) = P[(A ∩ B) ∪ (A ∩ B)] = P[A ∩ (B ∪ B)] = P(A ∩ S) = P(A). 32.12 The answer to both questions is yes. The condition P(A|B) > P(A) means P(A ∩ B)/P(B) > P(A) which implies that P(A ∩ B) > P(A)P(B). Dividing through by P(A) gives P(B|A) = P(A ∩ B)/P(A) > P(B). The implication P(A|B) < P(A) =⇒ P(B|A) < P(B) is proved in an analogous fashion. 32.13 Yes. Suppose P(A|B) > 0. This says that P(A∩B)/P(B) > 0 so P(A∩B) > 0. Since A∩B ⊆ A, we have (see Exercise 31.18) P(A) ≥ P(A ∩ B) > 0. 32.14

(a) Proof. We are given that ∀x ∈ S, P(x) 6= 0. (⇒) Suppose P(A|B) = 1. This means P(A ∩ B)/P(B) = 1 whence P(A ∩ B) = P(B). Note that A ∩ B ⊆ B (true for any sets A and B) but we must have equality because if there were some element x in B but not in A ∩ B, then we would have P(B) = P(A ∩ B) + P(x) + other terms > P(A ∩ B) contradicting P(B) = P(A ∩ B). Thus A ∩ B = B which implies that any b ∈ B must also be in A, and so B ⊆ A.

152

Mathematics: A Discrete Introduction (⇐) Suppose that B ⊆ A. Then A ∩ B = B which implies P(A ∩ B) = P(B) and so P(A|B) = P(A ∩ B)/P(B) = 1. (b) Let S = {1, 2, 3, 4, 5, 6} and take P(x) = 51 for 1 ≤ x ≤ 5 and P(6) = 0. For the sample space (S, P) we let A = {1, 2, 3} and B = {1, 2, 6}. Then we have P(A ∩ B) P({1, 2}) 2/5 P(A|B) = = = =1 P(B) P({1, 2, 6}) 2/5 and yet B 6⊆ A.

32.15 Note, by Exercise 31.18, that P(A) ≥ P(A ∩ B) > 0, so P(B|A) is defined. We have    P(B ∩ A) P[C ∩ (A ∩ B)] P(A)P(B|A)P(C|A ∩ B) = P(A) P(A) P(A ∩ B)    P(A ∩ B) P(A ∩ B ∩C) = P(A) = P(A). P(A) P(A ∩ B) 32.16

(a) We calculate P(Ak ) = P(k) + P(k + 1) + P(k + 2) + · · · = ark + ark+1 + ark+2 + · · · =

ark a(1 − a)k = = (1 − a)k . 1−r a

(b) Using the result from part (a) we have P(Ak+ j |A j ) =

P(Ak+ j ∩ A j ) P(Ak+ j ) (1 − a)k+ j = (1 − a)k . = = P(A j ) P(A j ) (1 − a) j

(c) Let a = P(0). We claim that P(Ak ) = (1 − a)k for all k ∈ N. The proof is by induction: Proof. For k = 0 (the basis case) we have P(A0 ) = (1 − a)0 = 1. Furthermore, P(A1 ) = 1 − P(0) = 1 − a = (1 − a)1 . Suppose (induction hypothesis) that P(Ak ) = (1 − a)k . We know that P(Ak+1 |Ak ) = P(A1 ) which gives P(Ak+1 ) P(Ak+1 ) = P(A1 ) ⇒ = (1 − a) P(Ak ) (1 − a)k which gives P(Ak+1 ) = (1 − a)k+1 as claimed. We now complete the problem. Observe that P(k) = P(Ak ) − P(Ak+1 ) = (1 − a)k − (1 − a)k+1 = (1 − a)k [1 − (1 − a)] = a(1 − a)k as required.

Instructor’s Manual 32.17

(a) P(A) = (b) P(B) =

153 13 52 4 52

= 41 . =

(c) P(A ∩ B) =

1 13 .

1 52 .

(d) Yes, because P(A ∩ B) = P(A)P(B). 32.18 The probabilities are 52 · 3 1 = 52 · 51 17 1 4 · 51 = P(B) = 52 · 51 13 4·3 1 1 1 P(A ∩ B) = = = · = P(A)P(B) 52 · 51 221 17 13 P(A) =

so the events are independent. 32.19 Note that P(A) 6= 0 and P(B) 6= 0, but P(A ∩ B) = 0 (because we cannot draw the same card twice). Therefore the events are not independent. 13 = 14 and P(B) = 14 . However, P(A ∩ B) = 32.20 Note that P(A) = 52 Therefore, A and B are not independent.

13·12 52·51

=

1 17

6=

1 16

= P(A)P(B).

32.21 Events A and ∅ are independent because P(A ∩ ∅) = P(∅) = 0 = P(A)P(∅). Events A and S are independent because P(A)P(S) = P(A) · 1 = P(A) = P(A ∩ S). 32.22 For the first sample space, take A = {1, 3, 5} and B = {1, 4} and note that P(A∩B) = P({1}) = 1 3 2 6 1 6 and that P(A)P(B) = 6 · 6 = 36 = 6 , and therefore A and B are independent. For the second sample space, suppose A and B are independent with 0 < P(A), P(B) < 1. So we must have P(A) = a5 and P(B) = b5 where a, b ∈ {1, 2, 3, 4}. Likewise P(A ∩ B) = 5c where c ∈ {1, 2, 3, 4}. By independence ab c = P(A)P(B) = P(A ∩ B) = 25 5 c giving ab 25 = 5 . But when we examine all the possible values of ab (where a, b ∈ {1, 2, 3, 4}) we find that in no case does the fraction reduce to the form 5c .⇒⇐ Therefore no such independent events can be found.

32.23

(a) This is true. Suppose A and B are independent. Then P(A)P(B) = P(A ∩ B). Note that

154

Mathematics: A Discrete Introduction by Exercise 31.17   P(A) = P (A ∩ B) ∪ (A ∩ B) = P(A ∩ B) + P(A ∩ B) = P(A)P(B) + P(A ∩ B). Thus,

P(A ∩ B) = P(A) − P(A)P(B) = P(A)[1 − P(B)] = P(A)P(B).

Therefore A and B are independent. (b) This is also true. Suppose A and B are independent. From (a), we know that A and B are independent. Since B and A are independent, we know (by (a) again) that B and A are independent. 32.24 Both statements are true. Here are the proofs. (a) If P(A) = 0, since P(A ∩ B) ≤ P(A), we have P(A ∩ B) = 0 = P(A)P(B). Therefore A and B are independent. (b) If P(A) = 1, then P(A ∩ B) = P(A) + P(B) − P(A ∪ B) and since 1 = P(A) ≤ P(A ∪ B) we have P(A ∩ B) = 1 + P(B) − 1 = P(B) = P(A)P(B). Alternative proof. Since A has zero probability, by part (a) A and B are independent. By the previous problem, A and B are independent. 32.25 All three statements are false. Here are counterexamples. (a) Suppose the sample space is the pair-of-dice sample space of Example 30.4. Let the three events be as follows: ∗ A, the dice sum to 2; i.e., A = {(1, 1)}, ∗ B, the dice sum to 17; i.e., B = ∅, and ∗ C, the dice sum to 12; i.e., C = {(6, 6)}. Note that A and B are independent (because P(B) = 0—see Exercise 32.24) and B and C are independent (again, because P(B) = 0). However, A and C are not independent because 1 P(A ∩C) = 0 6= 2 = P(A)P(C). 36 (b) The same counterexample from (a) works here. Note that P(A ∩ B ∩C) = 0 and P(B) = 0, so P(A ∩ B ∩C) = P(A)P(B)P(C), but A and C are not independent. (c) For this counterexample we use the same sample space, but different events. Let the three events be: ∗ A: The first die comes up 1.

Instructor’s Manual

155

∗ B: The second die comes up 1. ∗ C: The two dice show different numbers. Note P(A) = 16 , P(B) = 61 , and P(C) = 65 . Events A and B are independent because P(A ∩ B) = Events A and C are independent because P(A ∩C) = Likewise, B and C are independent. However, A ∩ B ∩C = ∅ and so P(A ∩ B ∩C) = 0 6=

1 36 5 36

= 16 · 16 = P(A)P(B).

= 16 · 56 = P(A)P(C).

5 = P(A)P(B)P(C). 63

32.26 S2 = {(1,1), (1,2), (1,3), (1,4), (2,1), (2,2), (2,3), (2,4), (3,1), (3,2), (3,3), (3,4), (4,1), (4,2), (4,3), (4,4)}. Their probabilities are as follows: P[(1, 1)] = P[(1, 3)] = P[(2, 1)] = P[(2, 3)] = P[(3, 1)] = P[(3, 3)] = P[(4, 1)] = P[(4, 3)] =

1 4 1 16 1 8 1 32 1 16 1 64 1 16 1 64

P[(1, 2)] = P[(1, 4)] = P[(2, 2)] = P[(2, 4)] = P[(3, 2)] = P[(3, 4)] = P[(4, 2)] = P[(4, 4)] =

1 8 1 16 1 16 1 32 1 32 1 64 1 32 1 64

32.27 Let A be the event that the two spins sum to 6. As a set, A = {(2, 4), (3, 3), (4, 2)}. Therefore P(A) =

1 1 1 1 1 1 5 · + · + · = . 4 8 8 8 8 4 64

32.28

 7 5 8

32.29

(a) A = {HHTTT, HTHTT,HTTHT, HTTTH, THHTT, THTHT, THTTH, TTHHT, TTHTH, TTTHH }.

which is about 51%.

156

Mathematics: A Discrete Introduction

(b) P(A) = 10p2 (1 − p)3 .  32.30 P(A) = nh ph (1 − p)n−h . 32.31

(a) p(1 − p). (b) (1 − p)p. [Same as (a).] (c) P(A|A ∪ B) =

P[A∩(A∪B)] P(A∪B)

=

P(A) P(A∪B)

=

p(1−p) 2p(1−p)

= 12 .

(d) Also 21 . (e) Flip the coin twice. If it comes up HH or TT, reject the result and try again. If it comes up HT select alternative 1 and if it comes up TH select alternative 2. 32.32 Olivia is correct. We can model this situation with a sample space S = {1, 2, 3, 4, 5, 6, 7, 8, o, p} 1 where each s ∈ S represents the winner of the contest. For all s ∈ S, we have P(s) = 10 . Let A be the event that none of contestants 1 through 8 has won, i.e., A = {o, p} and let B be the event that Olivia has won, i.e., B = {o}. Then P(B|A) = P(A ∩ B)/P(A) = P({o})/P({o, p}) = 32.33 We find ak = c1 + c2



1−p p

k

1 2 10 / 10

= 21 .

. Substituting a0 = 0 and a2n = 1 and let q = 1 − p gives

c1 =

−1 (q/p)2n − 1

and

c2 =

1 (q/p)2n − 1

Substituting k = n into the formula for ak gives an =

33

pn . pn + qn

Random Variables

This section is necessary for the next section (on expectation) but is not used by any other section in the book. Random variables are used in a host of applications (from electrical engineering to genetics) and are a central topic in probability theory. If your students are likely to have a subsequent, full course in probability, then it is reasonable to skip this section. (It is also reasonable to cover this material so the students’ second pass through this material will be easier.) We do not cover topics such as distribution functions, Poisson random variables, normal random variables, etc. These ideas are better suited for students with a calculus background that we do not presuppose. Also, this chapter on discrete probability is only meant to be a gentle introduction to the subject.

Instructor’s Manual 33.1

(a) (b) (c) (d) (e)

157

“X > 3” is the set {c, d} and P(X > 3) = 0.7. “Y is odd” is the set {a, b} and P(Y is odd) = 0.3. “X > Y ” is the set {a} and P(X > Y ) = 0.1. “X = Y ” is the set {b} and P(X = Y ) = 0.2. We have P(X = 1 ∧Y = −1) = 0.1

P(X = 5 ∧Y = 6) = 0.3

P(X = 3 ∧Y = 3) = 0.2

P(X = 8 ∧Y = 10) = 0.4

and for all other values of m and n, P(X = m ∧Y = n) = 0. (f) X and Y are not independent; for example, P(X = 3 ∧Y = 6) = 0 6= 0.2 × 0.3 = P(X = 3)P(Y = 6). (g) We have P(Z = 0) = 0.1, P(Z = 6) = 0.2, P(Z = 11) = 0.3, and P(Z = 18) = 0.4. 33.2

4 = (a) The values of s such that X(s) = 2s < 10 are 1, 2, 3, and 4. Therefore P(X < 10) = 10 2 . 5 3 (b) The values of s such that Y (s) = s2 < 10 are P(Y < 10) = 10 . 2 (c) (X +Y )(s) = X(s) +Y (s) = 2s + s . 2 = (d) The values of s such that (X +Y )(s) < 10 are 1 and 2. Therefore P(X +Y < 10) = 10 1 5. 1 (e) The only values of s such that X(s) > Y (s) is 1. Therefore P(X > Y ) = 10 . 1 (f) The only value of s such that X(s) = Y (s) is 2. Therefore P(X = Y ) = 10 . 1 1 (g) X and Y are not independent. For example, P(X = 2) = 10 , P(Y = 1) = 10 , but P(X = 2 ∧Y = 1) = 0 6= P(X = 2)P(Y = 1).

33.3

(a) Let (S, P) be the sample space for the spinner, so S = {1, 2, 3, 4}. Then X : S → Z is defined by X(1) = 10,

X(2) = 20,

X(3) = 10,

and

X(4) = 20.

(b) The event “X = 10” is the set {1, 3}. (c) P(X = 10) = 12 + 18 = 58 and P(X = 20) = 38 . For all other integers a (i.e., a 6= 10 and a 6= 20), we have P(X = a) = 0. 33.4

(a) X : {HHH, . . . , TTT} → Z by X(HHH) = 0

X(HHT) = 1

X(HTH) = 1

X(HTT) = 2

X(THH) = 1

X(THT) = 2

X(TTH) = 2

X(TTT) = 3

158

Mathematics: A Discrete Introduction (b) X = {HHT, HTH, THH, TTT}. (c) P(X is odd) =

33.5

4 8

= 12 .

(a) X[(2, 5)] = 3. 6 5 8 2 6 1 (b) P(X = 0) = 36 = 16 , P(X = 1) = 10 36 = 18 , P(X = 2) = 36 = 9 , P(X = 3) = 36 = 6 , 4 2 1 P(X = 4) = 36 = 91 , P(X = 5) = 36 = 18 , and P(X = a) = 0 for all other integers a.

33.6 P(X = 0) = (1 − p1 )(1 − p2 ), P(X = 1) = p1 (1 − p2 ) + p2 (1 − p1 ), and P(X = 2) = p1 p2 .  1 a 5 10−a 33.7 If a < 0 or a > 10, then P(X = a) = 0. Otherwise P(X = a) = 10 . a 6 6 33.8 No. Note that P(XH = 1) = P(XT = 1) > 0, but P(XT = 1 ∧ XH = 1) = 0 6= P(XH = 1)P(XH = 1). 33.9 No. Note that P(X1 = 5) = P(X2 = 5) = 2−10 but P(X1 = 5 and X2 = 5) = 0.  1 5 1 5 252 63 33.10 P(X = 5) = 10 = 1024 = 256 ≈ 0.246. 5 2 2 33.11 Here is a bar chart showing the P(X = a) for 0 ≤ a ≤ 10.

33.12 Here is a Python program that includes a method to simulate a B(n, p) random variable and that outputs one million B(100, 12 ) values. from random import * def coin_flip(p): if random() < p: return 1 else: return 0

Instructor’s Manual

159

def B(n,p): count = 0 for k in xrange(n): if coin_flip(p) == 1: count += 1 return count for k in xrange(1000000): print B(100, 0.5)

This is a histogram of the result. 4

8

x 10

7 6

Count

5 4 3 2 1 0 25

30

35

40

45

50 Value of B(100,0.5)

55

60

65

70

33.13 For the first question,    a  9−a    9−a  a 9 1 1 1 9 1 P(X = a) = = = P(X = 9 − a). a 2 2 2 2 9−a Or more simply, if we flip a fair coin 9 times, the probability we see heads a times equals the probability we see tails 9 − a times. Note that the probability X is even is P(X = 0) + P(X = 2) + P(X = 4) + · · · + P(X = 8). However, notice that P(X = 0) = P(X = 9), P(X = 2) = P(X = 7), and so forth. Thus P(X = 0) + P(X = 2) + · · · + P(X = 8) = P(X = 9) + P(X = 7) + · · · + P(X = 1) which implies P(X is even) = P(X is odd) which implies P(X is even) = 21 . 33.14 We calculate the probability that X is odd as follows: P(X is odd) = P(X = 1) + P(X = 3) + P(X = 5)    1  4    3  2    5  0 5 1 2 5 1 2 5 1 2 121 + + = ≈ 0.4979. = 1 3 3 3 3 3 5 3 3 243

75

160

Mathematics: A Discrete Introduction

33.15 X +Y is a B(2n, p) random variable because X and Y represent the number of heads in n flips of a coin with head probability p and X + Y is the number of heads in 2n flips of the same coin. Here is a much more difficult argument: P(X +Y = a) =

a

∑ P(X = k ∧Y = a − k)

k=0 a

=

∑ P(X = k)P(Y = a − k)

because X and Y are independent

k=0 a 

   n k n n−k =∑ p (1 − p) pa−k (1 − p)n−(a−k) k a − k k=0  a   n n =∑ pa (1 − p)2n−a k a − k k=0 "     # a n n 2n a a 2n−a p (1 − p)2n−a = ∑ = p (1 − p) k a − k a k=0 which is exactly the probability a B(2n, p) random variable takes the value a.  n   = 2n The last equality above is based on the combinatorial identity ∑k nk a−k a which can be argued by considering the number of ways  to choose a students from a group of n girls and n boys. On the one hand, the answer is 2n all ways of a . On the other hand, we can  nconsider  n choosing k girls (and therefore k − a boys); that enumeration is ∑k k a−k . 33.16 Yes. Let a be any value in the set {2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A} and let b be any value in 1 and P(Y = b) = 14 . Finally, P(X = a ∧ Y = the set {♣, ♦, ♥, ♠}. Note that P(X = a) = 13 1 1 b) = 52 = 13 × 41 = P(X = a)P(Y = b). Therefore X and Y are independent random variables. 33.17 No. P(X = 2) = 2)P(Y = 2).

1 13

and P(Y = 2) =

1 13 ,

but P(X = Y = 2) =

4×3 52×51

=

1 13·17

6=

1 13

1 · 13 = P(X =

33.18 This is a sneaky one. The answer is yes. If X is a constant random variable, then X is independent of itself. For example, suppose X(s) = 3 for all s ∈ S. Then P(X = 3∩X = 3) = 1 = P(X = 3)P(X = 3) and P(X = a ∩ X = b) = 0 = P(X = a)P(X = b) provided a and b are not both 3. So in all cases, P(X = a)(X = b) = P(X = a ∩ X = b). Therefore X is independent of itself.

34

Expectation

This section focuses on the mean of a (real-valued) random variable and (to a lesser extent) its variance.

Instructor’s Manual

161

The material in this section is more difficult than that in the previous probability sections. No other section of the book depends on this section, so it may be omitted. However, if you have taken the trouble to discuss random variables, some time should be devoted to discussing the concept of expectation; so consider covering this section at least lightly. This is also a particularly lengthy section and, done in its entirety, cannot be covered in one lecture. 34.1 E(X) = 5.4, E(Y ) = 6.3, and E(Z) = 11.7. 34.2 E(X) =

13 3,

E(Y ) = 0, and E(Z) =

13 3.

34.3 Let X1 be the value on the first die and X2 the value on the second. Note that E(X1 ) = E(X2 ) = 5 1+2+3+4 = 10 4 4 = 2 . Therefore E(X) = E(X1 + X2 ) = E(X1 ) + E(X2 ) = 5. Since X1 and X2 are independent, E(Y ) = E(X1 X2 ) = E(X1 )E(X2 ) = ( 52 )2 =

25 4.

34.4 Let X be the payout from this game. Then E(X) =

1 + 4 + 9 + 16 + 25 + 36 91 = . 6 6

We expect to win (on average) approximately $15.17 per play. 34.5 101. 34.6

(a) Z(s) = 100 for all s, i.e., Z is a constant random variable. (b) E(Z) = 100. (c) No. For example, if s is the element of the sample space in which HEADS is tossed 100 times, we have XH (s) = 100 but XT (s) = 0. Therefore XH 6= XT . (d) By symmetry, yes. (e) Since 100 = E(Z) = E(XH + XT ) = E(XH ) + E(XT ) and since E(XH ) = E(XT ), we clearly have E(XH ) = E(XT ) = 50. (f) Let Xi equal 1 if the ith flip is HEADS. Then XH = X1 + X2 + · · · + X100 . Notice that E(Xi ) = 12 for all i. Therefore E(X) = 100 × 21 = 50.

34.7 The target has five regions that we model with a sample space (S, P) with S = {1, 2, 3, 4, 5} corresponding to the 10-, 20-, 30-, 40-, and 50-point sections. We may assume the 30-, 40-, and 50-point regions are circles of radius 1. Then the 20-point region is a circle of radius 3 (less the 30 and 40 point targets) and the 10-point region is a semicircle of radius 5 joined to a 10 × 5 rectangle (less the enclosed other targets). The area of the entire target region is

162

Mathematics: A Discrete Introduction A = 12 · 52 π + 10 · 5 = 25 2 π + 50. The probability of a ball landing in a given region is the area of that region divided by A. We therefore calculate each of the areas: A3 = A4 = A5 = π A2 = π · 32 − A3 − A4 = 7π 5 A1 = A − π · 32 − π · 12 = π + 50. 2 From this we now have that P(k) = Ak /A for k = 1, 2, 3, 4, 5. Let X denote the number of points the player receives when the ball lands in a given region. We therefore have E[X] = 10 · P(1) + 20 · P(2) + 30 · P(3) + 40 · P(4) + 50 · P(5)  10 · 52 π + 50 + 20 · 7π + 30 · π + 40 · π + 50 · π = 25 2 π + 50 285π + 500 114π + 200 = 25 = ≈ 15.63. 5π + 20 2 π + 50

34.8

(a) Define X by P(X = 0) = P(X = 2) = 12 . Then E(X) = 1 but P(X = 1) = 0. (b) Define X by P(X = 1) = 0.99 and P(X = −100) = 0.01. Then E(X) = 0.99(1) + 0.01(−100) = −0.01. So the probability that X is positive is 99% and yet the expected value is negative.

34.9 Let X be a zero-one random variable. Then E(X) = 0 · P(X = 0) + 1 · P(X = 1) = P(X = 1). 34.10 Note that 12 = 1 and 02 = 0. So for any s in the sample space, X(s) = [X(s)]2 . Therefore X = X 2 . Therefore E(X) = E(X 2 ). 34.11 Let X = X1 + X2 + · · · + Xn where X j = 1 if the jth flip is HEADS and 0 if it is TAILS. Note that E(X j ) = p (by Exercise 34.10). Therefore E(X) = E(X1 + · · · + Xn ) = E(X1 ) + · · · + E(Xn ) = p + · · · + p = np. 34.12 You may be able to spike your students curiosity by pointing out that the solution to part (c) of this problem is the same as the solution to part (c) of Exercise 23.11. (a) There are 2n−1 binary numbers in which the ith bit of N is a 0 and 2n−1 in which it is a 1. Thus the probability Xi = 0 is 21 and likewise for P[Xi = 1]. Thus E(X) = 12 . (b) Since X = X1 + X2 + · · · + Xn we have E(X) = E(X1 ) + E(X2 ) + · · · + E(Xn ) = n/2. (c) Let M be the total number of 1s in all binary numbers from 0 to 2n−1 . Thus E(X) = M/2n . Therefore we have E(X) =

M n = 2n 2

=⇒

M = n2n−1 .

Instructor’s Manual

163

34.13 This is false. For example, suppose that X equals either 1 or 2, each with probability 12 . Then E(X) = 21 · 1 + 12 · 2 = 32 . However,   1 1 1 1 3 2 1 E = · 1 + · = 6= = . X 2 2 2 4 3 E(X) 34.14 Parts (a) and (b) are true and follow immediately from Theorem 34.10 (without any need for the independence assumption). Identity (c) is false. For a counterexample, let X be the random variable that is always equal to 1 and let Y be the random variable from Exercise 34.13 (Y = 1 or Y = 2 each with probability 1 3 2 2 ). We have E(X/Y ) = 4 but E(X)/E(Y ) = 3 . Identity (d) is also false. Let X be the random variable that is always equal to 2 and, again, let Y be the random variable from Exercise 34.13. We have E(X Y ) =

1 1 1 2 ·2 + ·2 = 3 2 2

but

E(X)E(Y ) = 23/2

which are clearly unequal. 34.15 By definition, E(X) = ∑ X(s)P(s) ≤ ∑ Y (s)P(s) = E(Y ). s∈S

s∈S

34.16 By Proposition 34.4, E(IA ) =

∑ aP(IA = a) = 0 × P(IA = 0) + 1 × P(IA = 1)

a∈R

= P(IA = 1) = P(A). 34.17 Define a new random variable Y whose value at s is given as follows: ( a if X(s) ≥ a, and Y (s) = 0 otherwise. Notice that Y (s) ≥ X(s) for all s (because X(s) ≥ 0 for all s), so E(Y ) ≤ E(X). By Proposition 34.4, E(Y ) = aP(Y = a) = aP(X ≥ a). Thus aP(X ≥ a) = E(Y ) ≤ E(X) and the result follows upon dividing by a.

164

Mathematics: A Discrete Introduction Here is an alternative way to express the previous proof, but without the auxiliary random variable Y . E(X) =

∑ xP(X = x) = ∑

0≤x 0. So we may apply Theorem 35.1 to find integers Q and R so that A = QB + R and 0 ≤ R < B. We can rewrite these as −a = −Qb + R

and

0 ≤ R < |b|.

We can multiply through by −1 to get a = Qb + (−R)

(∗)

168

Mathematics: A Discrete Introduction but note the remainder may be negative. If the remainder (−R) is zero, there is nothing more to prove. So suppose the remainder is negative, i.e., b < (−R) < 0. Adding −b = |b| to this we have 0 < −R − b < |b| so we can rewrite (∗) to give a = Qb + (−R) + (−b + b) = (Q + 1)b + (−R − b) so if we let q = Q + 1 and r = −R − b we have a = qb + r

and

0 < r < |b|

as required. The proof of uniqueness is virtually identical with that of the proof for Theorem 35.1. 35.7 The operations div and mod are only defined when the second argument is a positive integer. The cases b = 0 and b < 0 are not defined. The case b = 0 is hopeless as it does not make sense to divide by zero. However, these operations can be extended to negative b. Examine the Theorem presented in the previous solution. For a, b ∈ Z with b 6= 0 we may know there exist integers q and r with a = qb + r

and

0 ≤ r < |b|.

Define a div b = q and a mod b = r. Now we are ready to prove (a) and (b). (a) (⇒) Suppose b|a. Then there is an integer q with a = qb, and we can rewrite this as a = qb + 0. Therefore a div b = q. Since a = qb and b 6= 0 we have that q = ab . (⇐) Suppose a div b = ab . Since the result of div is an integer, we have that ab = q for some integer q. Thus we have a = qb, so b|a. (b) (⇒) Suppose b|a. Then there is an integer q with a = qb, and we can rewrite this as a = qb + 0. Therefore a mod b = 0. (⇐) Suppose a mod b = 0. This means that a = qb + 0 for some integer q. This can be more simply written as a = qb and so b|a. 35.8 We are given a, b, n ∈ Z with n > 0.

Instructor’s Manual

169

(⇒) Suppose a ≡ b (n). This means that n|(a − b), or, equivalently, a − b = kn for some integer k. If we divide a and b by n, we get a = qn + r

and

b = q0 n + r 0

with 0 ≤ r, r0 < n. Note that r = a mod n and r0 = b mod n. If we subtract these equations, we get a − b = (q − q0 )n + (r − r0 ) and since a − b = kn, we can rewrite this as kn = (q − q0 )n + (r − r0 )



r − r0 = (k − q + q0 )n

so r − r0 is a multiple of n. But r and r0 are between 0 and n − 1 so their difference is no more that n − 1. Thus we must have r − r0 = 0; i.e., r = r0 . Since r = a mod n and r0 = b mod n, we have a mod n = b mod n. (⇐). Suppose a mod n = b mod n. This means that we can write a = qn + r

and

b = q0 n + r

where (this is not a typo) the two rs are the same. Subtracting these equations we get a − b = (q − q0 )n and so a − b is a multiple of n. Therefore a ≡ b (n). 35.9 Suppose the three consecutive integers are a, a + 1, and a + 2. Then a + (a + 1) + (a + 2) = 3a + 6 = 3(a + 2) which is clearly a multiple of 3. 35.10 Here is a computer program to investigate how div and mod work in C. #include

void divide(int a, int b) { printf("%d MOD %d = %d\n", a, b, a%b); printf("%d DIV %d = %d\n", a, b, a/b); printf("\n"); } void main() { divide(10,3); divide(-10,3); divide(10,-3); divide(-10,-3); }

170

Mathematics: A Discrete Introduction The output of this program is as follows: 10 MOD 3 = 1 10 DIV 3 = 3 -10 MOD 3 = -1 -10 DIV 3 = -3 10 MOD -3 = 1 10 DIV -3 = -3 -10 MOD -3 = -1 -10 DIV -3 = 3

Notice that the results for a = −10 and b = 3 are wrong (disagrees with our definition). Furthermore, the results for a = 10 and b = −3 also disagree with the extension developed in Exercise 35.6. 35.11 See previous solution. 35.12

(a) Let p and q be polynomials. We say that p divides q (and we write p|q) provided there is a polynomial r such that q = pr. (b) Let p = x + 1 and q = 2x + 2. Then p|q because q = (2)p and q|p because p = ( 21 )q. (c) p|q and q|p iff there is a nonzero rational number r such that p = rq. (d) Let a and b polynomials with b 6= 0. Let A be the set of all polynomials of the form A = {a − kb : k is a polynomial}. Among all the polynomials in A, let r be one of least degree, i.e., r = a − qb for some polynomial q, and no polynomial in A has smaller degree than r. We need to prove: deg r < deg b. Suppose, for the sake of contradiction, that deg r ≥ deg b. We can therefore multiply b by a term of the form cxn such that r and cxn b have the same degree and the same leading coefficient. Now, if we subtract cxn b from r we have r0 = r − cxn b = a − qb − cxn b = a − (q + cxn )b ∈ A and since r and cxn b have the same first term, we have deg r0 < deg r, contradicting the fact that r ∈ A has least degree.⇒⇐Therefore, deg r < deg b. (e) Yes; q and r must be unique. Suppose we have a = qb + r = q0 b + r0

Instructor’s Manual

171

with deg r < deg b and deg r0 < deg b. If we subtract the two expressions for a we get 0 = (q − q0 )b + (r − r0 )



r − r0 = (q − q0 )b.

Now if r 6= r0 , then the degree of r − r0 is clearly less than the degree of b, but the degree of (q − q0 )b must be greater than or equal to that of b.⇒⇐Therefore r = r0 . If follows that qb = q0 b and since b 6= 0 we must have q = q0 .

36

Greatest Common Divisor

This section is needed by all subsequent number theory sections. There are two gems in this section. First, there is Euclid’s Algorithm for calculating the greatest common divisor of two integers. We do a careful analysis of this algorithm proving that it is correct and showing that it is efficient. (The material on running speed can be glossed over if you are short on time; just be sure to inform students that the Euclidean Algorithm is efficient.) Second, we present the theorem that shows that gcd(a, b) is an integer linear combination of a and b, and we extend Euclid’s Algorithm to find the coefficients. We need this fact in order to calculate reciprocals in modular arithmetic. 36.1

(a) gcd(20, 25) = 5. (b) gcd(0, 10) = 10. (c) gcd(123, −123) = 123. (d) gcd(−89, −98) = 1. (e) gcd(54321, 50) = 1. (f) gcd(1739, 29341) = 37.

36.2

(a) 20(−1) + 25(1) = 5. (b) 0(1) + 10(1) = 10. (c) 123(1) + (−123)(0) = 123. (d) (−89)(11) + (−98)(−10) = 1. (e) 54321(−19) + 50(20642) = 1. (f) 1739(135) + 29341(−8) = 37.

36.3 Here is a Python program to calculate gcd that keeps track of the number of times it is invoked: def gcd(a,b,count=0): """ gcd(a,b) returns the tuple (d,count) where d is the greatest common divisor of a and b, and count is the

172

Mathematics: A Discrete Introduction

number of steps taken by this algorithm. """ if (b>> from gcd import * >>> gcd(20,25) (5, 3) >>> gcd(0,10) (10, 1) >>> gcd(123,-123) (123, 1) >>> gcd(-89,-98) (1, 4) >>> gcd(54321,50) (1, 7) >>> gcd(1739,29341) (37, 6) >>>

36.4 If a = b = 0, then the common divisors of a and b are all integers. Therefore, they do not have a greatest common divisor. However, a nonzero integer can have at most finitely many divisors, and that finite list must contain the integer 1. So as long as a and b are not both zero, they have at least one, but only finitely many common divisors. Therefore, they have a greatest common divisor. 36.5 Let a and b be positive integers. Notice that d is a common divisor of a and b if and only if −d is also a common divisor of a and b. Therefore the sum of the common divisors of a and b must be zero since each common divisor can be paired with its negative. 36.6 Suppose a and b have two different greatest common divisors, say d and e. Since d is a common divisor, and e is a greatest common divisor, d ≤ e. Similarly, e ≤ d. Therefore d = e. 36.7 Yes, they are still correct. In case c = 0 we have gcd(a, b) = b. Also, gcd(b, 0) = b because all integers divide 0 and b is the greatest divisor of b.

Instructor’s Manual

173

36.8 It is enough to prove that if a ≥ b > 0, then b ≥ a mod b. Recall that a mod b is remainder after we divide a by b. By Theorem 35.1, we have a = qb + r

0 ≤ r < b.

Of course, r = a mod b and so b > a mod b. 36.9 We need to do 2 × 101000 divisions at a rate of 109 divisions per second. This takes 2 × 10991 seconds, which is about 3 × 10980 millennia. 36.10

(a) Let a, b, c be integers. A common divisor of a, b, and c, is an integer d so that d|a, d|b, and d|c. The greatest common divisor of a, b, and c, is an integer d that satisfies two properties: First, d is a common divisor of a, b, and c. Second, if e is any common divisor of a, b, and c, then e ≤ d. (b) This is false. Consider gcd(10, 15, 12). The divisors of these numbers are: Number 10 15 12

Divisors ±10, ±5, ±2, ±1 ±15, ±5, ±3, ±1 ±12, ±6, ±4, ±3, ±2, ±1

Notice that the greatest common divisor of 10, 15, and 12 is 1, but the numbers are not pairwise relatively prime since gcd(10, 15) = 5,

gcd(15, 12) = 3,

and

gcd(10, 12) = 2.

(c) To prove:  gcd(a, b, c) = gcd a, gcd(b, c) .  Let d = gcd(a, b, c) and let e = gcd a, gcd(b, c) . Since d is a common divisor of b and c, by Proposition 36.10, d| gcd(b, c). Therefore, d is a common divisor of a and of gcd(b, c) and so d ≤ e. Since e is a common divisor of a and of gcd(b, c), we know that e|a and e| gcd(b, c). Since e| gcd(b, c), e divides the greatest common divisor of b and c, and therefore e|b and e|c (by Proposition 5.3). Since e divides a, b, and c, we have e ≤ gcd(a, b, c) = d.  Since d ≤ e and e ≤ d, we have d = e, i.e., gcd(a, b, c) = gcd a, gcd(b, c) .  (d) By part (c) write d = gcd a, gcd(b, c) . Thus we can find (Proposition 36.6) x and T so that d = ax + gcd(b, c)T. (∗) And we can also find P and Q so that gcd(b, c) = bP + cQ

(∗∗)

174

Mathematics: A Discrete Introduction (again, by Proposition 36.6). Substituting (∗∗) into (∗) we get gcd(a, b, c) = gcd(a, gcd(b, c)) = ax + gcd(b, c)T = ax + [bP + cQ]T = ax + bPT + cQT = ax + by + cz where y = PT and z = QT . (e) 6(1) + 10(1) + 15(−1) = 1. (f) No. If one (or more) of x, y, or z is zero in 6x + 10y + 15z = 1, then we would have one of 10y + 15z = 1 or 6x + 15z = 1 or 6x + 10y = 1 all of which are impossible because none of gcd(10, 15), gcd(6, 15), or gcd(6, 10) is 1.

36.11 Let n and n + 1 be consecutive integers. Notice that n(−1) + (n + 1)(1) = 1 and so, by Corollary 36.9, we have n and n + 1 are relatively prime. 36.12 Observe that

(2a2 − a + 1)(2a + 1) − a(4a2 + 1) = 1.

Therefore 2a + 1 and 4a2 + 1 are relatively prime. 36.13 We consider two cases: a ≤ b and a > b. – Case a ≤ b: Take X = 2b−a and Y = −1. Then 2a X + (2b − 1)Y = 2a · 2b−a − (2b − 1) = 1 which proves that 2a and 2b + 1 are relatively prime. – Case a > b: This is trickier. Notice that (2b − 1)(2b + 1) = 22b − 1. In general, k

k+1 b

(2b − 1)(2b + 1)(22b + 1)(24b + 1) · · · (22 b + 1) = 22

− 1.

Pick a k large enough so that 2k+1 b > a. We then take k+1 b−a

X = 22

and

k

Y = −(2b + 1)(22b + 1) · · · (22 b + 1)

and using (∗) find that k+1 b−a

2a X + (2b − 1)Y = 2a · 22

k

− (2b − 1)(2b + 1)(22b + 1) · · · (22 b + 1)   k+1 k+1 = 22 b − 22 b − 1 = 1.

(∗)

Instructor’s Manual

175

36.14 We are given that n and m are relatively prime. Suppose, for the sake of contradiction, that n and m0 = m + jn are not relatively prime. Let d = gcd(n, m0 ), so d > 1. Write m = m0 − jn and since d divides both n and m0 , we see that d|m. Also, d|n and so d is a common divisor of n and m, but d > 1 which contradicts the fact that n and m are relatively prime.⇒⇐ Therefore n and m0 are relatively prime. Finally, suppose n and m are relatively prime, and m0 = m mod n. Since m0 = m − qn, we have that n and m0 are relatively prime. 36.15 We can find integers x, y, s,t so that ax + by = 1,

as = c,

and bt = c.

So c = c(ax + by) = cax + cby = (bt)ax + (as)by = (ab)(xt + sy) and so ab|c. 36.16 Suppose ab ≡ 1 (mod n). This means that ab − 1 is a multiple of n, i.e., ab − 1 = kn which we can rewrite as ab − kn = 1. By Corollary 36.9 we have a and n are relatively prime (think of x = b and y = −k). Likewise, again by Corollary 36.9, b and n are relatively prime. 36.17 Suppose a and n are relatively prime. By Corollary 36.9 we can find integers x and y so that ax + ny = 1 which we can rewrite as ax = 1 − ny. So if we take b = x, we have ab = 1 − ny ≡ 1 (n). 36.18 This is a direct application of Corollary 36.9. We are given that ax + by = 1. We can write this as xa + yb = 1, reversing the roles of a, b with x, y. Therefore, by Corollary 36.9, x and y are relatively prime. 36.19 Notice that if x = ba , we may choose b > 0 (if b < 0, replace a and b by −a and −b respectively). Of the various ways to write x as a fraction ba choose a and b so that b > 0 but otherwise is as small as possible. We claim that a and b are relatively prime. If not, then d = gcd(a, b) > 1. Let a0 = a/d and 0 b0 = b/d. Notice that b0 < b and furthermore ab0 = ba = x, contradicting the fact that b was the smallest positive denominator.⇒⇐Therefore a and b are relatively prime.

176

Mathematics: A Discrete Introduction

36.20 Number the children from 0 to n − 1 and imagine the teacher starts by patting child 0’s head. At time t = 0, the teacher pats child 0’s head. At the next time, the teacher advances to child k, and then to 2k, etc. However, once the teacher “wraps” to the beginning of the circle, the correct way to express this is that at time t, the teacher pats child number kt mod n. Claim: Every child receives a pat if and only if n and k are relatively prime. Suppose first that n and k are relatively prime. Then we can write nx + ky = 1. If y is positive, this means that by time y, the teacher has “advanced” from child 0 to child 1. After another y pats, the teacher will advance from child 1 to child 2, etc. In this way, every child is sure to eventually receive a pat. If y is negative, we can rewrite nx + ky = 1 as n(−x) + k(−y) = −1 where −y is positive. Now, after −y pats, the teacher has moved from the initial child (0) to the previous child (n − 1). After another −y pats, the teacher will pat child n − 2’s head. In this way, the teacher moves backwards through the circle and eventually pats every child’s head. On the other had, suppose that n and k are not relatively prime, but gcd(n, k) = d > 0. This means that only children in positions divisible by d will be patted on the head and (in particular) child 1 will never receive a pat. 36.21 For (a), note that 5 × 13 − 8 × 8 = 1. Thus we should fill the 13-ounce cup five times, for a total of 65 ounces in the big bowl. Then we should scoop out using the 8-ounce cup eight times, thereby removing 64 ounces. The result is that 1 ounce is left in the bowl. In general (b), if a and b are relatively prime, we may write ax + by = 1. If x > 0 and y < 0, we fill the bowl x times with the a-ounce cup, and then scoop −y times with the b-ounce cup. The procedure when x < 0 and y > 0 is similar. 36.22

(a) Let p and q be nonzero polynomials. A polynomial d is called a common divisor of p and q provided d|p and d|q (see Exercise 35.12 for the definition of | in the context of polynomials). We call d a greatest common divisor of p and q provided d is a common divisor of p and q, and if e is any other common divisor of p and q, then deg e ≤ deg d. (b) Let p = x2 − 1 and q = x2 + 2x + 1. Then x + 1 and 2x + 2 are both greatest common divisors of p and q. (c) Let d be a greatest common divisor of nonzero polynomials p and q. Let A = {ap + bq : a and b are polynomials}. Let e be a nonzero polynomial in A of smallest degree (e must exist by the Well-Ordering Principle). Notice that d|p and d|q imply that d|(ap + bq) and so d|e.

Instructor’s Manual

177

Now we claim that e|p. Divide p by e to get p = Qe + r with deg r < deg e. If r 6= 0, then, since r = p − Qe = p − Q(ap + bq) = Ap + Bq we have r ∈ A with deg r < deg e, a contradiction. Therefore r = 0 and so e|p. Likewise e|q. Therefore e is a common divisor of p and q, and so deg e ≤ deg d. But d|e, so e and d have the same degree. Therefore, e and d are simply rational multiples of each other, and we may conclude that d = se = (sa)p + (sb)q for some rational number s. (d) Two nonzero polynomials p and q are relatively prime provided their only common divisors are rational numbers. (e) (⇒) Suppose p and q are relatively prime. Then gcd(p, q) = s where s is a (nonzero) rational number. By (c) we can write s = ap + bq and if we multiply through by 1/s we have 1 = a0 p + b0 q. (⇐) Suppose ap + bq = 1. Let d be a common divisor of p and q. Then d|(ap + bq), i.e., d|1, so d must not have positive degree. Therefore d is rational.   (f) For p = x4 − 3x2 − 1 and q = x2 + 1 we have 31 p + − 13 x2 + 43 q = 1. So the polynomials a and b may be taken to be a = 13 and b = − 31 x2 + 43 .

37

Modular Arithmetic

This section is needed for the material on the Chinese Remainder Theorem and cryptography. It is also used in our study of Algebra; in particular we use (Z∗n , ⊗) in our study of groups. However, this material is not needed for Section 39 on Factoring. Of the various operations introduced here, the most challenging is modular division. It is important that students are comfortable with the extended Euclidean Algorithm before they can do the calculations in this section. Modular exponentiation is introduced in the exercises (see Exercise 37.14). The important thing for students to realize is that this is an efficiently computable operation. The calculation of ab mod c does not require Ω(b) operations; rather, using successive squaring, this can be brought down to a tolerable O(log b) modular multiplications. We use the fact that ab mod c can be efficiently computed in the cryptography sections. Mathematica includes the PowerMod function to calculate ab mod c. To find 313 mod 43 give the command PowerMod[3,13,43] and the computer gives the answer, 12. The PowerMod function can also be used to find reciprocals; to calculate 3−1 in Z∗43 type PowerMod[3,-1,43] and the computer gives 29 as the answer. Likewise, the GP/PARI number theory system (available for free) allows user to represent elements of Zn with the Mod function. Here’s how we calculate 313 mod 43 and 3−1 mod 43 in GP:

178

gp %1 gp %2 gp %3

> = > = > =

Mathematics: A Discrete Introduction

a = Mod(3,43) Mod(3, 43) a^13 Mod(12, 43) 1/a Mod(29, 43)

37.1 (a) 6. (b) 2. (c) 0. (d) 7, (e) undefined (because 12 ∈ / Z10 ). (f) 9. (g) 6. (h) 1. (i) 0. (j) 6. (k) 4. (l) 4. (m) undefined. (n) 7. (o) 3. (p) 4. (q) 5. 37.2 (a) 5. (b) 7. (c) 1. (d) 518. A complete solution to (d) is as follows (all work is in Z1003 ). From 342 ⊗ x ⊕ 448 = 73 we subtract ( ) 448 from both sides to get 342 ⊗ x = 628

(∗)

(because 73 − 448 = −375 ≡ 1003 − 375 = 628. We now need to calculate 342−1 . We do this by performing the (extended) GCD algorithm on 342 and 1003 and we should get 342 × 349 + 1003 × (−119) = 1 and so 342−1 = 349. We multiply both sides of (∗) by 349 to get 349 ⊗ (342 ⊗ x) = 349 ⊗ 628



x = 518

because 349 × 628 = 219172 ≡ 518. 37.3 (a) 2 and 7. (b) no solutions. (c) no solutions. (d) 2, 6, and 10. 37.4 (a) 1 and 11. (b) no solutions. (c) 5 and 8. (d) 2, 7, 8, and 13. (e) 5 and 10. (f) no solutions. 37.5 Here is a C program to solve this problem. #include is_prime(int n) { int k; for(k=2; k*k n× n = n contradicting the fact that ab = n.⇒⇐ 39.2

(a) 25 = 5 · 5. (b) 4200 = 23 · 3 · 52 · 7. (c) 19 = 19. (d) 1 equals the empty product.

39.3 We prove: Let p and q be unequal primes. Then p|x and q|x if and only if (pq)|x. (⇒) Suppose p|x and q|x. Therefore, the prime factorization of x is of the form x = p × q × further prime factors. Therefore x is a multiple of pq. (⇐) Suppose (pq)|x. Therefore x = pqn for some integer n. Therefore p|x (because x = p(qn)) and q|x (because x = q(pn)). 39.4 (⇒) Suppose p|a. Then ap is also a positive integer, say b. Let the prime factorization of b be b = q1 q2 · · · . Therefore pq1 q2 · · · is the (one and only) prime factorization of a and it contains p. (⇐) Suppose p appears in the prime factorization of a. Therefore a equals p times additional primes, so clearly a is a multiple of p.

Instructor’s Manual

187

39.5 Suppose a, b, p are integers with p prime, and suppose p|ab. Therefore (see previous problem) p is in the (unique) prime factorization of ab. Now we can form the prime factorization of ab by combining the individual (unique) prime factorizations of a and b. In order for p to show up in the final list, it must be a prime factor of a or b (or both). 39.6 Proof by induction on t. The basis case t = 1 is trivial since if p|q1 then (since q1 and p are prime) we must have p = q1 . The case t = 2 is also easy: If p|q1 q2 , then by Lemma 39.2 either p|q1 (and so p = q1 ) or p|q2 (and so p = q2 ). Induction hypothesis: The Lemma has been proved for t = k. Now we must prove the result in case t = k + 1. Suppose p and q1 ,. . . ,qk+1 are primes with p|(q1 q2 · · · qk qk+1 ). By Lemma 39.2 either p|(q1 · · · qk ) or else p|qk+1 . In the first case, by induction p = qi for some i between 1 and k. In the second case p = qk+1 . In either case p equals one of the qs as required. √ 39.7 Factoring a 1000-digit number by trial division can use 101000 = 10500 divisions. On the other hand, Euclid’s Algorithm takes at most 2 log2 101000 divisions and 2 log2 101000 ≈ 7000. 39.8 (⇒) Suppose that a and b are relatively prime. This means that gcd(a, b) = 1. Let p be any prime. If, for the sake of contradiction, p|a and p|b, then p is a common divisor of a and b and, since p > 1, this contradicts the fact that 1 is the greatest common divisor of a and b.⇒⇐ Therefore there is no prime that divides both a and b. (⇐) Suppose that there is no prime p such that p|a and p|b. Suppose, for contradiction, that a and b are not relatively prime. Let d = gcd(a, b) > 1 and let p be a prime divisor of d. Since p|d, we have that p|a and p|b (by Proposition 5.3).⇒⇐ Therefore a and b are relatively prime. 39.9 Note: This problem revisits Exercise 36.13. Note that the only prime that divides 2a is 2 and, because 2b − 1 is odd, 2 does not divide 2b − 1. Therefore there is no prime p that divides both 2a and 2b − 1. By Exercise 39.8, 2a and 2b − 1 are relatively prime. 39.10

(a) Suppose the factorization of positive integers a and b are a = 2e2 3e3 5e5 · · · Then

and

b = 2 f2 3 f3 5 f5 · · · .

lcm(a, b) = 2max[e2 , f2 ] 3max[e3 , f3 ] 5max[e5 , f5 ] · · · .

188

Mathematics: A Discrete Introduction (b) Note that for any two numbers s and t we have s + t = min[s,t] + max[s,t]. Therefore  ab = (2e2 3e3 · · · ) × 2 f2 3 f3 · · · = 2e2 + f2 3e3 + f3 · · · = 2max[e2 , f2 ]+min[e2 , f2 ] 3max[e3 , f3 ]+min[e3 , f3 ] · · ·     = 2min[e2 , f2 ] 3min[e3 , f3 ] · · · × 2max[e2 , f2 ] 3max[e3 , f3 ] · · · = gcd(a, b) lcm(a, b).

39.11 Suppose a2 is even, but, for the sake of contradiction, a is not even. Then 2 is not a prime factor of a. Since the prime divisors of a2 are the same as the prime divisors of a (but are twice as numerous) we know that 2 is not a factor of a2 , contradicting the fact that a2 is even.⇒⇐ 39.12 Suppose p is a factor of a2 , but not a factor of a. Then p is not in the prime factorization of a, and therefore not in the prime factorization of a2 (since a2 has the same prime divisors as a). Therefore p does not divide a.⇒⇐ 39.13 Let a be an integer so a2 and (a + 1)2 are consecutive perfect squares. Suppose, for the sake of contradiction, that a2 and (a + 1)2 are not relatively prime. Then they have a common divisor d > 1. Let p be a prime factor of d, and so p is a common divisor of a2 and (a + 1)2 . From the previous problem, we see that p|a and p|(a + 1), contradicting Exercise 36.11. 39.14 When

n = pe11 pe22 · · · ptet

the number of positive divisors of n is (e1 + 1)(e2 + 1) · · · (et + 1). Notice that every divisor of n is of the form pa11 pa22 · · · ptat where 0 ≤ a j ≤ e j . There are e j + 1 choices for a j , so the result follows. 39.15 Let p = 2a − 1 be prime. The proper, positive divisors of n = p2a−1 are 2k (for 0 ≤ k ≤ a − 1) and p2k (for 0 ≤ k < a − 1). Summing these we have 1 + 2 + 4 + · · · + 2a−1 = 2a − 1 = p p + 2p + 4p + · · · + 2a−2 p = (2a−1 − 1)p grand total = 2a−1 p = n as required.

Instructor’s Manual 39.16

189

(a) ϕ(14) = 6. (b) ϕ(15) = 8. (c) ϕ(16) = 8. (d) ϕ(17) = 16. (e) ϕ(25) = 20. (f) ϕ(5041) = 4970. (g) ϕ(210 ) = 512 = 29 .

39.17

(a) Since p is prime, all numbers from 1 to p − 1 are relatively prime to p. Of course, p is not relatively prime to itself. Therefore ϕ(p) = p − 1. (b) The only numbers between 1 and p2 that are not relatively prime to p2 are the multiples of p. There are precisely p multiples of p between 1 and p2 . Therefore, ϕ(p2 ) = p2 − p. (c) The only numbers between 1 and pn that are not relatively prime to pn are the multiples of p. There are pn /p = pn−1 multiples of p between 1 and pn . Therefore, ϕ(pn ) = pn − pn−1 . (d) The only numbers between 1 and pq that are not relatively prime to pq are the multiples of p and the multiples of q. There are q multiples of p between 1 and pq and there are p multiples of q between 1 and pq. However, we counted the number pq itself twice on these two lists (we are using simple inclusion-exclusion), so there are p + q − 1 integers between 1 and pq that are not relatively prime to pq. Thus, ϕ(pq) = pq − (p + q − 1) = pq − p − q + 1 = (p − 1)(q − 1).

39.18 Let Ai denote the set of multiples of pi between 1 and n. Then ϕ(n) = n − |A1 ∪ A2 ∪ · · · At |. We can expand |A1 ∪ A2 ∪ · · · At | using inclusion exclusion. This requires computing the sizes of the various intersections, such as A1 ∩ A2 ∩ A3 . This set contains those numbers between 1 and n that are multiples of p1 , p2 , and p3 . In other words, all multiples of p1 p2 p3 . There are n/(p1 p2 p3 ) such numbers. In general, we have n pi n |Ai ∩ A j | = pi p j .. . |Ai | =

|A1 ∩ · · · ∩ At | =

n p1 p2 · · · pt

190

Mathematics: A Discrete Introduction and the first formula follows by Theorem 19.1. If we multiply out the formula      1 1 1 n 1− 1− ··· 1− p1 p2 pt we get the same expression.

39.19 As in the previous problem, let Ai be the set of integers between 1 and n that are multiples of pi . The rest of the argument is exactly the same. √ √ √ 39.20 Suppose n is not an integer but, for the sake of contradiction n is rational. Write n = ab where a and b are relatively prime integers. Thus n = a2 /b2 which can be rewritten b2 n = a2 . Since n is not a perfect square, there is a prime p that appears an odd number of times in n’s prime factorization. Since p|n and a2 = b2 n, we have that p|a2 and so, p|a. Since a and b are relatively prime, p does not divide b. Thus p appears an even number of times in a2 , but an √ odd number of times in b2 n, a contradiction.⇒⇐Therefore n is not rational. 39.21 If x is a square root of 2, so is −x; thus we may assume that x is positive. Further, if x = ab , then clearly neither a nor b is zero. We can’t have just one of a and b negative, for then x would be negative. Finally, if both a and b are negative, we can replace them with −a and −b respectively, both of which are positive. 39.22 Suppose, for the sake of contradiction, that log2 3 = ba where a and b are (wolog) positive integers. Then 2a/b = 3. Raising this to the b power gives 2a = 3b , contradicting Theorem 39.1. 39.23

(a) Note that when a number is crossed off, it is a multiple of a smaller number and so is not prime. Thus all prime numbers will survive. However, if n is composite, and if p is the smallest prime factor of n, then n will be crossed off when we cross off all the multiples of p. Thus a number is not crossed off if and only if it is prime. (b,c) Here is a C program. #include #define N 1000000 void main() int long long

{ mark[N+1]; i,j; count;

/* mark all numbers to start*/ for (i=0; i 1. Now consider the following sequence of k positive integers: (d1 − 1), d2 , d3 , . . . , dk

(∗)

(the first is positive because d1 > 1). By induction, there is a tree T0 whose vertices have degrees as in (∗). Extend T0 by adding a new vertex of degree 1 adjacent to the vertex of degree d1 − 1. This creates a tree T whose vertices have degrees (d1 − 1) + 1, d2 , d3 , . . . , dk , 1 which is exactly what we want. 50.5 (⇒) Suppose e is not a cut edge of G. This means that G − e has the same components as G. Let x, y be the end points of e. Since x, y are in the same component of G, they are in the same component of G − e. Thus there is an (x, y)-path P in G − e. If we add the edges e to P we form a cycle. Therefore e is in a cycle of G. (⇐) Suppose e is in a cycle C of G. Let the end points of e be x, y. We claim that e is not a cut edge of G. If it were, then G − e would have more components than G. In this case, there would be vertices a, b so that (1) there is an (a, b)-path P in G, but (2) there is no (a, b)-path in G − e. Hence P must contain the edge e. Without loss of generality, as we traverse P from a to b, we encounter first x, and then y. Now, we claim that in G − e there is an (a, b)-walk. We follow P from a to x, we follow the portion of C that does not include e from x to y, and we follow P again from y to b. Hence there is an (a, b)-path in G − e.⇒⇐ Therefore e is a cut edge of G.

238

Mathematics: A Discrete Introduction

50.6 Let G be a graph in which every pair of vertices is joined by a unique path. We want to show that G is a tree. By Definition 50.3, we must show that G is connected and acyclic. – Claim: G is connected. Let a, b be any two vertices of G. By hypothesis, there is a path from a to b. Therefore G is connected. – Claim: G is acyclic. Suppose G contains a cycle C. Let xy be an edge of this cycle. Note that x ∼ y is an (x, y)-path. Furthermore, there is another (x, y)-path consisting of all the edges on C other than xy. This contradicts the fact that in G there can be only one (x, y)-path.⇒⇐ Therefore G is acyclic. Therefore G is a tree. 50.7 Suppose v is not a leaf. Therefore d(v) 6= 1. Since T has at least two vertices and is connected, d(v) 6= 0. Thus d(v) ≥ 2. Let a, b ∈ V (T ) be neighbors of T . Note that a ∼ v ∼ b is an (a, b)path in T . Furthermore, it is the only (a, b)-path (Theorem 50.4). Thus, in T − v, there is no (a, b)-path, and so T − v is not connected. Therefore T − v is not a tree. 50.8

(a) We need to show that d(n) = 1. Suppose, for the sake of contradiction, that d(n) > 1. This means that n has at least two different neighbors: x and y. Consider the unique path from 1 to n. It cannot contain both x and y since only one neighbor of n can be on the path. Without loss of generality, it contains x, i.e., the path is 1 ∼ · · · ∼ x ∼ n and this path doesn’t contain y. Therefore 1 ∼ · · · ∼ x ∼ n ∼ y is a path that starts from 1, but since n > y, this is a contradiction.⇒⇐ Therefore d(n) = 1. (b) By Proposition 50.8, T − n is a tree. Now any path P that starts from vertex 1 in T − n is also a path in T , and so the vertices on P appear in increasing order. Therefore T − n is a recursive tree. (c) Let T be a recursive tree on n vertices. Adding vertex n + 1 as a new vertex via a single edge to, say, vertex v of T yields T 0 . Clearly T 0 is connected and acyclic, and so T 0 is a tree. Now consider any path P starting at vertex 1 of T 0 . If it ends at any vertex other than n + 1, it must be an increasing path since this path is wholly contained in T . If it ends at vertex n + 1, then it is also an increasing path since the portion from 1 to v is increasing, and v < n + 1. Therefore T 0 is a recursive tree. (d) We claim there are (n − 1)! We prove this by induction on n. The basis case is when there is only n = 1 vertex. In this case, there is only 1 possible tree, and it is a recursive tree. The induction hypothesis is that the result is true for recursive trees with n vertices. For every recursive tree on n vertices, we can form n different recursive trees on n + 1 vertices by attaching a new vertex n + 1 to any of the first n vertices. By parts (b) and

Instructor’s Manual

239

(c), all recursive trees can be formed that way, and they are all different. Hence there are n × (n − 1)! = n! different recursive trees on n + 1 vertices, as required. 50.9 The graph has n − c edges. Suppose the components of G have n1 , n2 , . . . , nc vertices. These components have n1 − 1, n2 − 1, . . . , nc − 1 edges respectively. Summing these we have a total of (n1 − 1) + · · · + (nc − 1) = (n1 + · · · + nc ) − (1 + · · · + 1) = n − c edges. 50.10 Let G be a graph. (⇒) Suppose G is a forest. By Exercise 50.5, an edge is a cut edge if and only if it is not contained in a cycle. Since G has no cycles, all of its edges must be cut edges. (⇐) Suppose all of G’s edges are cut edges. By Exercise 50.5, none of G’s edges are in cycles. Hence, G has no cycles. Therefore G is a forest. 50.11

(a) Claim. Let T be a tree with n vertices; then T has n − 1 edges. Proof is by (strong) induction on n. The basis case is n = 1; trees with 1 vertex clearly have 0 edges. Suppose (strong induction hypothesis) the result is true for all trees with fewer than n vertices. Let T be a tree with n vertices. Let e be any edge of T . Since e is a cut edge (Theorem 50.5), then T − e has exactly two components (Theorem 49.12), T1 and T2 . Since T1 and T2 are connected and acyclic, they are trees, both with fewer than n vertices. Let n1 , n2 be the number of vertices in T1 , T2 , respectively. Then T1 has n1 − 1 edges and T2 has n2 − 1 edges. Therefore T has (n1 − 1) + (n2 − 1) + 1 = n − 1 edges (the +1 term is for the edge e). This proves the claim. (b) The average degree of a vertex in a tree with n vertices is avg degree =

1 2(n − 1) 2 d(v) = = 2 − < 2. ∑ n v∈V (T ) n n

(c) Let T be a tree with at least two vertices. The minimum degree of T cannot be larger than the average degree of T , so δ (T ) ≤ avg degree < 2. Therefore δ (T ) = 0 or 1. However, since T is connected and has at least 2 vertices, it cannot have a vertex of degree 0. Therefore δ (T ) = 1, and so T has a leaf. 50.12 Let T , u, and v be as described in the statement of the problem. By Theorem 50.4, there is a unique (u, v)-path in T . If we add the edge uv to T , this creates exactly one cycle. 50.13 Suppose G is a connected graph with n = |V (G)| = |E(G)|. By Theorem 50.11, G has a spanning tree T . Since T has n − 1 edges (Theorem 50.9), there is exactly one edge e = uv of G that is not in T . By the previous problem, adding e to T (giving G) creates a unique cycle.

240 50.14

Mathematics: A Discrete Introduction (a) Every cycle is connected. By definition, a cycle is a path P = v1 ∼ v2 ∼ · · · ∼ vn plus another edge v1 ∼ vn . Choose any two vertices, vi and v j and the (vi , v j ) section of P is the path connecting them. Therefore the cycle is connected. (b) By definition, a cycle is a path P = v1 ∼ v2 ∼ · · · ∼ vn plus another edge v1 ∼ vn . For 1 < i < n, vertex vi is adjacent to exactly vi−1 and vi+1 . Vertex v1 is adjacent to v2 and vn , and vertex vn is adjacent to vn−1 and v1 . Thus, every vertex has degree equal to 2, i.e., a cycle is 2-regular. (c) Let G be a connected, 2-regular graph with n vertices. By Exercise 47.17, G has n edges as well. Therefore G has exactly one cycle (by Exercise 50.13), C. If all vertices of G lie on C, then we’re done. Otherwise, suppose, for the sake of contradiction, that there is some vertex or edge of G not on C. If there is some vertex x not on C, consider a path P from x to a vertex on C. Consider the first vertex a of C encountered as we traverse P from x. The degree of a must be at least 3 since a has two neighbors on C and one neighbor on P that is not on C. This contradicts the fact that G is 2-regular. So we may suppose that all vertices of G are on C, but yet G is not a cycle. This means there is some edge e = ab of G that is not part of the cycle. But then, as before, a (and b) must have degree at least 3, a contradiction.⇒⇐ Therefore G is a cycle.

50.15 (⇒) Let e = xy be a cut edge of G. Suppose, for contradiction, e is contained in a cycle C. Since e is a cut edge of G, there must be vertices a and b that are connected in G but not connected in G − e. Let P be an (a, b)-path in G. Necessarily, P contains the edge e. Without loss of generality, there vertex x precedes vertex y as we traverse P from a to b. Notice that in G − e there is an (a, b)-walk: Start at a, traverse P up to x, traverse C − e to b, and then traverse P to y. By Lemma 49.7, there must be an (a, b)-path in G−e.⇒⇐ Therefore e is not contained in any cycle of G. (⇐) Let e = xy be an edge that is not contained in any cycle of G. Suppose, for contradiction, that e is not a cut edge. This means that e’s endpoints (x and y) are in the same component of G − e (since they were in the same component of G). Therefore, there is an (x, y)-path P in G − e. Observe that P + e is a cycle of G.⇒⇐ Therefore e is contained in a cycle. 50.16

(a) Let n ≥ 5 and let the vertices of Cn be named 1, 2, . . . , n in that order along the cycle. If n is odd, we can form a Hamiltonian cycle as follows: 1 ∼ 3 ∼ 5 ∼ · · · ∼ n ∼ 2 ∼ 4 ∼ · · · ∼ n − 1 ∼ 1. If n is even, we can form a Hamiltonian cycle as follows: 1 ∼ 3 ∼ 5 ∼ · · · ∼ n − 1 ∼ 2 ∼ n ∼ n − 2 ∼ · · · ∼ 4 ∼ 1.

Instructor’s Manual

241

(b) Black/white color the vertices in this graph in a checkerboard fashion. Notice that there are 13 vertices of one color and only 12 of the other. However, if this graph had a Hamiltonian cycle, it would necessarily alternate colors and so have an equal number of black and white vertices.⇒⇐ Hence G does not have a Hamiltonian cycle. 50.17 We claim that at step (4), the graph T is acyclic and connected. Since T has the same vertices as the input graph, G, this implies that T is a spanning tree of G. Claim: T is acyclic. This is obvious; since we check, at step (3a), that no edge we add forms a cycle, the output graph T is acyclic. Claim: T is connected. Suppose, for contradiction, T is not connected. Let x and y be vertices in separate components of T . Let P be an (x, y)-path in G. This path must include an edge e j of G that has one end in x’s component, and its other end not in x’s component. Such an edge is not an edge of T ; only of G. Why was e j not added by the algorithm? At step (3a) it must be the case that T + e j contains a cycle. Now the final T has more edges the T when we skipped edge e j , so it is also true that for the final T we have T + e j contains a cycle. This implies that the endpoints of e j are in the same component of T .⇒⇐ Therefore T is connected. Therefore T is a spanning tree of G. 50.18 Please note: This problem depends on Exercise 50.15. We claim that at step (4), the graph T is acyclic and connected. Since T has the same vertices as the input graph, G, this implies that T is a spanning tree of G. Claim: T is acyclic. Suppose, for contradiction, there were a cycle C in T . Let e j be the edge of C with lowest subscript. When we considered edge e j (at step (3a)) we did not delete it from T ; we must have made the determination that e j is a cut edge. However, e j is in a cycle contrary to Exercise 50.15.⇒⇐ Therefore T is acyclic. Claim: T is connected. Since the initial T is connected (G is connected and T is a copy) and since at each step we never delete a cut edge, the final T must also be connected. Therefore T is a spanning tree of G. 50.19

(a) Let v be the vertex of Sn that is adjacent to all the other vertices, and let us name those vertices u1 , u2 , . . . , un−1 . Then n−1

  n−1 W (Sn ) = ∑ d(v, ui ) + ∑ d(ui , u j ) = (n − 1) · 1 + · 2 = (n − 1)2 . 2 i=1 1≤i< j 2 contradicts the fact that all pairs of nonadjacent vertices are distance 2 from each other.⇒⇐ Therefore T is a star.

51

Eulerian Graphs

This section is fun and solves a classical problem in graph theory; that makes it worthwhile. However, if you are pressed for time, none of the material in this section is needed in the sequel. Here is an outline for an alternative proof of the fact that every connected, even-degreed graph G is Eulerian. First, note that G must have a cycle C (otherwise, it’s a tree and has a vertex of degree 1). Note that in G − C, all vertices have even degree (they either have the same degree as before or have dropped by 2). Now apply strong induction to each component of G − C. Finally stitch together the various tours in the components of G −C using the cycle C. This gives an Euler tour in G. To make this rigorous, you just need to be careful about “stitch together.” This can be tedious. It may, however, be worth mentioning this alternative proof in this sketchy form as a supplement to the proof we give in the text. 51.1 Kn is Eulerian iff n is odd. 51.2 They don’t exist. A graph must have an even number of vertices of odd degree.  51.3 An equivalent question is: For which values of n does Kn have an Eulerian tour? The n2 dominoes correspond exactly to the n2 edges of Kn . The domino with spots i and j represents the edge i j. One domino can be placed after another if they have a matching spot. Now Kn is a connected graph in which all vertices have degree n − 1. Thus Kn has an Euler tour if and only if n − 1 is even, that is, iff n is odd. Thus the answer to the question is: A domino ring is possible if and only if n is odd.

Instructor’s Manual

243

51.4 Let G be a connected, non-Eulerian graph. Let v be a “new” vertex (i.e., one not found in G). Form a new graph H by adding to G the vertex v and edges between v and all the vertices of odd degree in G. Since the number of vertices of odd degree in G must be even, v has even degree. Furthermore, the degree of the odd-degree vertices in G are increased by 1 when we consider their degrees in H. Hence, their degrees are all even. All vertices of even degree in G have the same degree in H. Therefore, all vertices in H have even degree. Furthermore, H is connected. Let x, y be any two vertices in H. If neither x nor y is v, then there is an (x, y)-path already in G and, since G is a subgraph of H, they are connected in H. If, say x = v and y 6= v, then we can find a (v, y)-path as follows. If y has odd degree in G, then there is an edge directly from v to y. Otherwise, there is an edge from v to some odd degree vertex w and, in G, a path from w to y. Concatenating these gives a (v, y)-path. And, finally, if x = y = v then, of course, v is connected to itself. Therefore H is connected. Thus H is Eulerian. 51.5 This is a sneaky, rotten question. The answer is: no. The resulting structure is not necessarily a graph because some of the edges ai bi might already be in the graph. However, this will produce an Eulerian multigraph. 51.6 We prove this by strong induction. The basis case is when the graph has no edges. In that case, the empty partition suffices. Now suppose the result has been shown for all Eulerian graphs with fewer than m edges. Let G be an Eulerian graph with m edges. Let e be any edge of G. By Lemma 51.4, e is not a cut edge. Thus by Exercise 50.5, e is contained in a cycle C. Let H be the subgraph of G formed by deleting all edges in C. Note that the degrees of the vertices in H are either equal to, or 2 less than, their degrees in G. Hence, all vertices in H have even degree. Every component of H (it may be disconnected) has fewer than m edges. Therefore, by induction, we can partition the edges of H into cycles. If we combine these partitions, and add C, we construct a partition of E(G) into cycles. 51.7 We may arrange a series of moves for the rook so that it traverses all 448 possible pairs of joinable squares exactly once each. Form a graph G whose vertices are the 64 squares of the chess board. Two vertices in G are adjacent provided they are in the same row or the same column of the chess board. Note that this graph is connected (by a series of moves, a rook may move from any square to any other square) and every vertex has degree 14 (seven horizontal plus seven vertical moves). Therefore G is Eulerian and an Eulerian tour in G is precisely what this problem requires. 51.8 Yes. 51.9

(a) True: Suppose G is Eulerian, and let e1 , e2 , . . . , em be a traversal of the edges in an Eulerian tour (beginning and ending at some vertex v). Then in L(G) we clearly have

244

Mathematics: A Discrete Introduction e1 ∼ e2 ∼ · · · ∼ em . Furthermore, e1 and em share vertex v and so em ∼ e1 in L(G). This is a Hamiltonian cycle of L(G). (b) False: The graph G in the figure for this exercise has a Hamiltonian cycle, but its line graph has four odd-degree vertices. (c) False: Let G be the graph K1,3 (a tree with one vertex of degree 3 and three leaves). Note that L(G) is a complete graph on three vertices and is therefore Eulerian. However, G is not Eulerian. (d) False: The same counterexample from (c) works here. Note that L(G) is Eulerian, but G does not have a Hamiltonian cycle.

52

Coloring

Graph coloring is an important topic that students are likely to see in more advanced computer science and discrete mathematics courses. This section introduces graph coloring, the chromatic number of a graph, and characterizes bipartite graphs. We include a brief, informal discussion of computational complexity. 52.1 χ(G) = 2 and χ(H) = 4. 52.2 The chromatic number of the M¨obius ladder is ( 2 if n is odd and χ(M2n ) = 3 otherwise. When n is odd, we can color the vertices alternately around the cycle with two colors. Because t and t + n are of opposite parity, the additional edges join vertices of different colors. Hence M2n is 2-colorable. When n is even notice that 1 ∼ 2 ∼ 3 ∼ · · · ∼ n ∼ 1 is an odd cycle in M2n and so M2n is not 2-colorable. Here is a proper 3-coloring of M2n : Vertex Color

1 A

2 B

3 A

··· ···

n B

n+1 C

n+2 A

n+3 B

··· ···

2n − 2 A

2n − 1 B

2n C

There are only two vertices with color C; otherwise, the colors alternate A and B around the cycle. Every diagonal edge joins an A to a B, except that edge {1, n + 1} joins A to C and edge {n, 2n} joins a B to a C. This is a proper 3-coloring of M2n and so χ(M2n ) = 3. 52.3 Let k = χ(G) and let f be a proper k-coloring of G. Restricting f just to the vertices of G − v gives a proper k-coloring of G − v. Therefore χ(G − v) ≤ χ(G). Let j = χ(G − v) and let f be a proper j-coloring of G − v. Extend f by defining f (v) to be a new color (that is, f (v) = j + 1). One sees that this extended f is a proper ( j + 1)-coloring of G and so χ(G) ≤ j + 1 = χ(G − v) + 1.

Instructor’s Manual

245

52.4 The chromatic number of Ta,b depends on the parity of a and b. We claim: ( 2 χ(Ta,b ) = 3

if a and b are both even, and otherwise.

In case a and b are both even, then we can color vertex (x, y) with one color when x + y is even and another color when x + y is odd. In other words, we color odd rows like this ABAB. . . AB and even rows like this BABA. . . BA. See the top-left portion of the figure below. If a and b are not both even, then Ta,b must have an odd cycle (either an a-cycle or a b-cycle), and so χ(Ta,b ) > 2. To see that Ta,b is 3-colorable, we consider two cases: exactly one of a or b is odd, or both a and b are odd. If exactly one of a or b is odd (say, b is odd) then we color even “rows” of the graph with colors A and B like this ABAB. . . ABC, and odd rows like this BABA. . . BCA. See the topright portion of the figure below. Finally, if both a and b are odd, then (except for the last two rows) we color the even rows ABAB. . . ABC and the odd rows BABA. . . BCA. The penultimate row is colored BCBC. . . BCA and the last row is CACA. . . CAB. See the lower figure. A

B

A

B

A

B

A

B

A

B

A

B

C

B

A

B

A

B

A

B

A

B

A

B

C

A

A

B

A

B

A

B

A

B

A

B

A

B

C

B

A

B

A

B

A

B

A

B

A

B

C

A

A

B

A

B

A

B

C

B

A

B

A

B

C

A

A

B

A

B

A

B

C

B

C

B

C

B

C

A

C

A

C

A

C

A

B

52.5 The condition that G is 3-colorable means that G can be properly colored using at most three colors. We are not required to use all three. 52.6 The set of all vertices of a given color is an independent set in G. Please note that graph coloring can also be viewed as partitioning V (G) into independent sets. The objective is to find such a partition with the fewest number of parts.

246

Mathematics: A Discrete Introduction

52.7 Since G is not complete, it must contain two vertices, a and b, that are not adjacent. Give a and b the same color, and give the remaining n − 2 vertices each their own color. This is a proper coloring of G with (n − 2) + 1 = n − 1 < n colors, so χ(G) < n. 52.8 Let S be a largest clique in G. Since any two vertices in S are adjacent, they must receive different colors. Thus we need at least |S| = ω(G) different colors, i.e., χ(G) ≥ ω(G). For the second inequality, let t = χ(G) and let Xi be the set of vertices with color i (for i = 1, 2, . . . ,t). Each Xi is an independent set (Exercise 52.6), and so |Xi | ≤ α(G). Therefore n = |V | = |X1 | + · · · + |Xt | ≤ tα(G) = χ(G)α(G). The result follows by dividing by α(G). 52.9 Kn,m has n + m vertices and nm edges. 52.10 Let a = χ(G) and b = χ(G). Properly color G with a colors and G with b colors. Let v be any vertex of G (or G—they have the same vertex set). Suppose v has color i in the coloring of G and color j in the coloring of G; we express this by saying that v has the color pair (i, j). Note that if v and w are distinct vertices of G, then they must have distinct color pairs (because they are either adjacent in G or adjacent in G). Since there are at most ab distinct color pairs, we must have ab ≥ n, i.e., χ(G)χ(G) ≥ n. 52.11 Here is a proper 4-coloring of G. 4

7

5

3

2

6

1

v f (v)

1 1

2 2

3 3

4 1

5 2

6 3

7 4

Therefore, χ(G) ≤ 4. Suppose, for contradiction, that χ(G) < 4. Then we can properly color G with 3 colors, say a, b, and c. Without loss of generality, vertex 1 has color a. Then 2 and 3 must be different colors that are also different from a—so one is b and the other is c. Then, since 4 is adjacent to both 2 and 3, it must be color a. By the same reasoning, 5 and 6 must be (one each) colors b and c, and so 7 is color a. However, 4 ∼ 7 and they are both color a.⇒⇐ Therefore χ(G) ≥ 4, and we conclude that χ(G) = 4 52.12 Let v be any vertex on the unique cycle of G. Note that G − v is therefore acyclic, and so is bipartite. Properly 2-color G − v. Finally, give v a third color; this is a proper 3-coloring of G. Therefore χ(G) ≤ 3.

Instructor’s Manual 52.13

(a) The edges of Q2 are

247

00 ∼ 01 ∼ 11 ∼ 10 ∼ 00

forming a 4-cycle. There are no other edges. (b) Here is a picture of Q3 . 010

011

110

111

100

101

000

001

Notice that the vertices and edges of Q3 correspond to the corners and edges of a solid cube. (c) Notice that every vertex in Qn has degree n. Thus the sum of the degrees is n2n , which is twice the number of edges. Therefore |E(Qn )| = n2n−1 . (d) Let X be the set of vertices whose lists have an even number of 1s and let Y be those vertices whose lists have an odd number of 1s. Note that every edge has one end point with an even number of 1s and the other end point with an odd number of 1s because we change exactly one element across the edge. Therefore V (Qn ) = X ∪ Y is a bipartition of Qn . (e) Because K2,3 has five vertices, it clearly cannot be a subgraph of Q1 or Q2 , so suppose for the sake of contradiction that K2,3 is a subgraph of Qn for some n ≥ 3. Let a be one of the vertices of degree three in K2,3 and let (a1 , a2 , . . . , an ) be the list of 0s and 1s associated with this vertex. The three vertices p, q, r adjacent to a differ in their lists in exactly one position, say, in positions i, j, and k where 1 ≤ i < j < k ≤ n. That is, p’s list (p1 , p2 , . . . , pn ) is identical to a’s list, except pi = 1 − ai . Likewise for q and r. In summary: a → (. . . , ai , . . . , a j , . . . , ak , . . .) p → (. . . , ai , . . . , a j , . . . , ak , . . .) q → (. . . , ai , . . . , a j , . . . , ak , . . .) r → (. . . , ai , . . . , a j , . . . , ak , . . .) where x denotes 1 − x. Now let b be the other vertex of degree three in K2,3 and let (b1 , b2 , . . . , bn ) be its list of 0s and 1s. Now b’s list and p’s list must be exactly the same, except that they differ

248

Mathematics: A Discrete Introduction in exactly one position. That position cannot be i for otherwise b and a would have the same list. That position cannot be j for otherwise b and r differ in two positions. And that position cannot be k for then b and q differ in two positions. It follows that b and p differ in some position ` where ` 6= i, j, k. [Note: This is already a contradiction in case n = 3.] Schematically, we have this: a → (. . . , ai , . . . , a j , . . . , ak , . . . , a` , . . .) p → (. . . , ai , . . . , a j , . . . , ak , . . . , a` , . . .) q → (. . . , ai , . . . , a j , . . . , ak , . . . , a` , . . .) r → (. . . , ai , . . . , a j , . . . , ak , . . . , a` , . . .) b → (. . . , ai , . . . , a j , . . . , ak , . . . , a` , . . .). But then notice that b and q differ in two positions (likewise for b and r) despite being adjacent.⇒⇐ Therefore K2,3 is not a subgraph of Qn for any n.

52.14 Let v be the unique vertex of maximum degree. If we color v first using the procedure in the proof of Proposition 52.5, then ∆ colors suffice. We color v with any color. Then, as we proceed, we always have a color available from the palette for all subsequent vertices because they all have degree less than ∆.

52.15 Proof by induction on the number of vertices in G. Basis case: If G has only 1 vertex, then δ (G) = 0 and G is 1-colorable. Induction hypothesis: Suppose the result is true for all graphs with k vertices. Let G be a graph with k + 1 vertices. Let v be a vertex of minimum degree (so the degree of v is at most d). Note that G − v is an induced subgraph of G with k vertices. Furthermore, any induced subgraph of G − v is also an induced subgraph of G, so they all have δ ≤ d. By induction G − v is (d + 1)-colorable. Properly color G − v with d + 1 colors. Since the degree of v is at most d, there must be some color not present on v’s neighbors. Give that color to v. This gives a proper (d + 1)-coloring of G, and so χ(G) ≤ d + 1.

52.16 For (a) and (c), refer to the following diagrams:

Instructor’s Manual

249

The first diagram shows a proper 4-coloring of the graph. The other three diagrams show proper 3-coloring of the graph with an edge removed. By symmetry, these three cases cover all the possibilities. Part (b) is difficult. Call the vertex in the center of the picture u. Call its five neighbors a1 through a5 , and the corresponding five vertices on the outer rim of the picture b1 through b5 . Suppose, for sake of contradiction, that this graph can be properly colored with three colors. Fix a proper coloring f : V (G) → [3]. Without loss of generality, f (u) = 3, and so vertices a1 , . . . , a5 only use colors 1 and 2. Form a new coloring g just for vertices b1 , . . . , b5 defined by ( f (bi ) if f (bi ) 6= 3 g(bi ) = f (ai ) if f (bi ) = 3. Notice that g : {b1 , . . . , b5 } → [2]. Now consider a pair of consecutive outer rim vertices bi , bi+1 (subscript arithmetic modulo 5). We claim that g(bi ) 6= g(bi+1 ). – Case: Neither f (bi ) nor f (bi+1 ) is 3. In this case g(bi ) = f (bi ) 6= f (bi+1 ) = g(bi+1 ) (because bi ∼ bi+1 ). – Case: Exactly one of f (bi ) and f (bi+1 ) is 3. Without loss of generality, f (bi ) 6= 3 but f (bi+1 ) = 3. In this case g(bi+1 ) = f (ai+1 ) 6= f (bi ) = g(bi ) (because ai+1 ∼ bi ). – Case: Both of f (bi ) and f (bi+1 ) are 3. This is impossible because f is a proper coloring bi ∼ bi+1 .

250

Mathematics: A Discrete Introduction Thus, in all possible cases, g(bi ) 6= g(bi+1 ). Thus g is a proper 2-coloring of the induced subgraph of G on vertices {b1 , . . . , b5 }, but that is impossible because these vertices induce a 5-cycle which is not two-colorable.⇒⇐ Therefore, G is not 3-colorable.

52.17 The time would be 3100 /106 seconds, or around 1034 years. 52.18

(a) We can color the vertical edges colors 1 and 2 alternately in each column and colors 3 and 4 alternately in each row. This gives a proper 4-edge coloring. Four colors are needed because there are vertices of degree 4, and the edges incident thereon must have different colors. (b) Note that for any graph χ 0 ≥ ∆, so we work to show that equality holds. The proof is by induction on the number of vertices. For the basis case n = 1, the tree has no edges and so can be colored with 0 colors and so χ 0 = ∆. [If that basis case is too vacuous, the n = 2 case can serve as well.] Assuming we have proved that χ 0 = ∆ for all trees with fewer than n vertices, let T be a tree with n vertices. Let v be a leaf of T , let e be the edge incident with v, and let w be v’s neighbor in T . By induction χ 0 (T − v) = ∆(T − v). Properly edge color T − v with χ 0 (T − v) colors. If ∆(T ) > ∆(T − v), we can simply give e a new color to give a proper coloring of T with ∆ colors. Otherwise (∆(T ) = ∆(T − v)) it must be the case that w’s degree in T − v is less than ∆(T ), and so not all colors are present among the edges incident with w. Thus there is a leftover color we can give to e and this gives a ∆(T )-edge coloring of T . (c) Let G be the 5-cycle C5 . Note that ∆(G) = 2, but we cannot properly 2-edge color G as the colors on the edges on the cycle would need to alternate (and that’s impossible because 5 is odd).

53

Planar Graphs

This is the final section on graph theory. Unfortunately, to do this section rigorously requires considerable machinery from topology (e.g., the Jordan Curve Theorem). However, the ideas in this section are beautiful and compensate for the relaxed rigor. 53.1 A figure 8. 53.2 Here are crossing-free drawings of the graphs.

Instructor’s Manual

251

53.3 Let G be a planar graph with n vertices, m edges, and c components. Let f be the number of faces in a crossing-free drawing of G. If we add c − 1 additional edges we can convert G into a connected planar graph (we draw these edges between the various components of G). In the extended graph, we must have n − (m + c − 1) + f = 2 which rearranges to n − m + f − c = 1 as required. 53.4 Let G be a K3 -free graph with at least 2 edges. Without loss of generality, we may assume G is connected (otherwise, add edges between components). Since G does not contain K3 as a subgraph, every face must have degree at least 4. The sum of degrees of the faces is exactly 2|E(G)| and at least 4 f : 2|E(G)| ≥ 4 f



1 f ≤ |E(G)|. 2

Substituting into Euler’s formula we have 1 2 − |V (G)| + |E(G)| = f ≤ |E(G)| 2 which rearranges to 2 − |V (G)| + 12 |E(G)| ≤ 0 which yields |E(G)| ≤ 2|V (G)| − 4. 53.5 Suppose both G and G were planar. Then each would have  at most 3 × 11 − 6 = 27 edges, for a total of 54 edges between them. However, K11 has 11 2 = 55 edges.⇒⇐ 53.6 Let G be a 5-regular graph with 10 vertices. Then G has 25 edges (half the sum of the degrees). However, if G were planar, G would have at most 3 × 10 − 6 = 24 edges.⇒⇐ Therefore G is not planar. 53.7 For n ≤ 3 the n-cube Qn is planar. (See the drawing of Q3 in the solution to Exercise 52.13.) For n ≥ 4, the n-cube is nonplanar. It is enough to show that Q4 is nonplanar as all larger cubes contain Q4 as a subgraph. If Q4 were planar, we would have (since Q4 is bipartite and contains no K3 subgraph) |E(Q4 )| ≤ 2|V (Q4 )| − 4. However, 32 = |E(Q4 )| ≤ 2|V (Q4 )| − 4 = 2 × 16 − 4 = 28 is a contradiction. Therefore Q4 is nonplanar.

252

Mathematics: A Discrete Introduction

53.8 The figure shows a subdivision of K3,3 as a subgraph of Petersen’s graph.

This proves that Petersen’s graph is nonplanar (by Kuratowski’s Theorem 53.9). 53.9 Let G be a planar graph. Let H be an induced subgraph of G. By Corollary 53.6, δ (H) ≤ 5. Therefore, by Exercise 52.15, χ(G) ≤ 5 + 1 = 6. 53.10

(a) Let G = (V, E) be a planar graph embedded in the plane. Consider the sum of the degrees of the faces, this equals 2|E|. On the other hand, every face has degree at least 8, so 2|E| ≥ 8 f By Euler’s formula,



1 f ≤ |E|. 4

1 2 ≤ |V | − |E| + f ≤ |V | − |E| + |E| 4

so 8 ≤ 4|V | − 3|E|



4 8 |E| ≤ |V | − . 3 3

(b) If G has at least one cycle, then from part (a) we find that the average degree of the vertices in G is 8 16 8 ∑ d(v) 2|E| 3 |V | − 3 = ≤ < d. 54.2

(a) The height is 4; {b, d, f , i}. (b) The width is 4; {c, d, e, g}. (c) {a, e, h}. (d) {g, j}. (e) {h, i, j}.

54.3 The Hasse diagrams for these posets are as follows. (a)

6

2

10

(b) 3

2

5

1 (d)

16 8 4 2 1

1

6

4

3 2

18

(e)

12

(c)

1 6

9

2 3 1

256

Instructor’s Manual 54.4

257

(a) Chain: {1, 2, 6} or {1, 3, 6} Antichain: {2, 3} Height: 3 Width: 2 (b) Chain: {1, 2, 10} or {1, 5, 10} Antichain: {2, 5} Height: 3 Width: 2 (c) Chain: {1, 2, 4, 12} (other answers possible) Antichain: {2, 3} (other answers possible) Height: 4 Width: 2 (d) Chain: {1, 2, 4, 8, 16} Antichain: {1} (or any other singleton set) Height: 5 Width: 1 (e) Chain: {1, 3, 9, 18} (other answers possible) Antichain: {2, 9} (other answers possible) Height: 4 Width: 2

54.5 To prove that Pˆ = (X, R−1 ) is a poset, we need to show that. . . – . . . R−1 is reflexive: Let x ∈ X. Then x R x, i.e., (x, x) ∈ R, so (x, x) ∈ R−1 . Therefore R−1 is reflexive. – . . . R−1 is antisymmetric: Suppose (x, y), (y, x) ∈ R−1 . This is tantamount to (y, x), (x, y) ∈ R. Since R is antisymmetric, we have x = y as required. Therefore, R−1 is antisymmetric. – . . . R−1 is transitive: Suppose (x, y), (y, z) ∈ R−1 . This implies that z R y and y R x, and so (since R is transitive) z R x, which gives (x, y) ∈ R−1 . Therefore, R−1 is transitive. Therefore (X, R−1 ) is a poset. A better way to write ≤−1 is just ≥. 54.6 Let ≤ denote the refines relation on the set of all partitions of A. We need to show that . . .

258

Mathematics: A Discrete Introduction – . . . ≤ is reflexive: Let P be any partition of A and let P ∈ P be any part of P. Since P ⊆ P, we see that every part of P is a subset of a part of P. Therefore, P ≤ P. – . . . ≤ is antisymmetric: Let P and Q be two partitions of A with P ≤ Q and Q ≤ P. We need to prove that P = Q. To show that these two sets are equal, we need to show they contain the same elements. Let P ∈ P. Since P ≤ Q, we know there is a Q ∈ Q so that P ⊆ Q. Since Q ≤ P, we know there is a P0 ∈ P so that Q ⊆ P0 . These imply that P ⊆ P0 . Since parts of a partition are pairwise disjoint and nonempty, we cannot have one part be a proper subset of another. Therefore, P = P0 and since P ⊆ Q ⊆ P0 = P, we have P = Q. Since Q ∈ Q, we have P ∈ Q. Likewise, if Q ∈ Q, then it follows by an analogous argument that Q ∈ P. Thus P = Q, proving that ≤ is antisymmetric. – . . . ≤ is transitive: Suppose P, Q, R are partitions of A, and suppose that P ≤ Q and Q ≤ R. We need to prove that P ≤ R. To this end, let P ∈ P. We know (since P ≤ Q) there is a Q ∈ Q with P ⊆ Q. Since Q ≤ R, there is an R ∈ R so that Q ⊆ R. From P ⊆ Q and Q ⊆ R we have P ⊆ R. Thus P ≤ Q. Therefore refines is a partial order relation.

54.7 The height of this poset is n; here is a maximum chain: 1/2/3/4/ . . . /n < 12/3/4/ . . . /n < 123/4/ . . . /n < · · · < 123 . . . n. The number of chains of length n is             n n−1 n−2 2 n(n − 1) (n − 1)(n − 2) (n − 2)(n − 3) 2·1 ··· = ··· 2 2 2 2 2 2 2 2 2 n[(n − 1)!] = . 2n−1 54.8 Suppose, for the sake of contradiction, that there are two elements x and y with x < y and x > y. Unraveling these definitions, we have (1) x ≤ y, (2) y ≤ x, and (3) x 6= y. However, x ≤ y and y ≤ x imply (by antisymmetry) that x = y, contradicting (3).⇒⇐ Therefore we cannot have both x < y and x > y. 54.9

(a) FALSE. Consider elements 2 and 3 in the poset from Example 54.2. None of the following are true: 2 < 3, 2 = 3, 2 > 3.

Instructor’s Manual

259

(b) TRUE. If x and y are together in a chain, then they are comparable. This means that x ≤ y or y ≤ x. If both are true, we have x = y. If x 6= y, then we have x < y or x > y. We cannot have both x < y and x > y. (c) FALSE. Consider the poset from Example 54.2. In this example we have chains {1, 2} and {3, 4}, but {1, 2} ∪ {3, 4} = {1, 2, 3, 4} is not a chain. (d) TRUE. Let C and D be chains. Let x, y ∈ C ∩ D. Certainly x and y are both in C, so they are comparable. Therefore any two elements of C ∩ D are comparable, and so C ∩ D is a chain. (e) FALSE. Consider the poset from Example 54.2. Both {2, 3} and {2, 4} are antichains, but {2, 3} ∪ {2, 4} = {2, 3, 4} is not. (f) TRUE. [Proof is analogous to part (d).] Let A and B be antichains. Let x, y ∈ A ∩ B (with x 6= y). Certainly x and y are both in A, so they are incomparable. Therefore any two distinct elements of A ∩ B are incomparable, and so A ∩ B is an antichain. (g) FALSE. For the poset in Example 54.2, note that {1, 2} is a chain and {2, 3} is an antichain, but {1, 2} ∩ {2, 3} = {2} 6= ∅. (h) TRUE. We must never place two comparable elements of a poset on the same horizontal line of the Hasse diagram. If we did, there would be no way to ascertain which element is above which. (i) FALSE. Consider elements 1 and 4 in the poset from Example 54.2. There is no line joining them, but {1, 4} is not an antichain. (j) TRUE. If A is an antichain, then we do not draw lines (curves) between any two elements in A. 54.10 The is-comparable-relation is. . . – . . . reflexive. Any element of a poset is ≤ to itself, and so is comparable to itself. – . . . not irreflexive. Let x be any element of a poset, then x ≤ x, so x is comparable to itself. – . . . symmetric. If x is comparable to y, then either x ≤ y or y ≤ x. In either case, y is comparable to x. – . . . not antisymmetric. Consider elements 1 and 2 from the poset in Example 54.2. Note that 1 is comparable to 2, and 2 is comparable to 1, but 1 6= 2. – . . . not transitive. Consider elements 2, 1, and 3 from the poset in Example 54.2. Note that 2 is comparable to 1, and 1 is comparable to 3, but 2 is not comparable to 3. 54.11 The is-incomparable-relation is. . .

260

Mathematics: A Discrete Introduction – . . . not reflexive. It is never the case that x is incomparable to x because x ≤ x. – . . . irreflexive. Since x ≤ x, we never have x incomparable to x. – . . . symmetric. If x is incomparable to y, then we have neither x ≤ y nor y ≤ x. Since we have neither y ≤ x nor x ≤ y, we see that y is incomparable to x. – . . . not antisymmetric. Consider elements 2 and 3 in Example 54.2. Note that 2 is incomparable to 3 and 3 is incomparable to 2, but 2 6= 3. – . . . not transitive. Consider elements 4, 2, and 3 in Example 54.2. Note that 4 is incomparable to 2, and 2 is incomparable to 3, but 4 is not incomparable to 3 (because 3 ≤ 4).

54.12 Here is a good definition for P − x. Let P = (X, ≤). Let P − x be the poset with ground set X − {x} and relation ≤0 where a ≤0 b if and only if a ≤ b for all a, b ∈ X − {x}. Here is the diagram for P − x.

55

Max and Min

Mathematicians use the words maximal, maximum, minimum, and minimal in a rather special way; this section clearly delineates their usage for posets. It should be mentioned that these words have a broader meaning beyond describing elements of posets. As we have already seen (see Section 48), maximum means “largest size” and maximal means “unextendable.” This is a short section that is not particularly challenging; it is also necessary for the subsequent material except for Section 59. 55.1 There are no maximum or minimum elements. The maximal elements are h, i, and j. The minimal elements are a, b and g. 55.2

(a) 1 is minimum and minimal. 5 is maximum and maximal. (b) 1 is minimum and minimal. 3, 4, and 5 are maximal. There is no maximum. (c) ∅ is minimum and minimal. {1, 2, 3} is maximum and maximal.

Instructor’s Manual

261

(d) The minimal elements are exactly the primes. There are no minimum, maximum, or maximal elements. (e) The minimal elements are all people who do not have any living descendants. The maximal elements are all people who do not have any living ancestors. There are no maximum or minimum elements 55.3 The poset (N, |) has a minimum element 1 because 1|a for all a ∈ N. It also has a maximum element 0 because a|0 for all a ∈ N. 55.4 Let P be a 2-element antichain. It has no maximum and no minimum element. A more complicated example: Consider the integers ordered by ordinary ≤. This poset has no maximum and no minimum. 55.5

(a) The maximum element is {1, 2, . . . , n} and the minimum element is ∅.

55.6

(b) The maximals are all subsets of {1, 2, . . . , n} that have exactly n − 1 elements and the minimals are all subsets that have exactly 1 element.   (a) The maximum element is {1, 2, 3, . . . , n} and the minimum is {1}, {2}, {3}, . . . , {n} . (b) The maximal elements are those partitions of {1, 2, . . . , n} that have exactly two parts. That is, let A and B be nonempty, disjoint subsets of {1, 2, . . . , n}. The partition {A, B} is maximal, and all maximal partitions are of this form. The minimal elements are all those partitions that have n − 1 parts. These partitions have one part that has exactly two members of {1, 2, . . . , n} and the remaining parts are all singletons.

55.7

(a) This is true. Proof: Suppose a and b are maximum elements. Then a ≤ b (because b is maximum) and b ≤ a (because a is maximum). Therefore, by antisymmetry, a = b. (b) This is true. Suppose the poset contains exactly one element. This element is both maximum and minimum. (c) This is true. Consider the poset  {a, b, c}, {(a, a), (b, b), (c, c), (b, c)} . In other words, we have three elements a, b, and c, and the only strict relation is b < c. Then element a is both maximal and minimal, but neither maximum nor minimum. (d) This is false. Let P be the poset whose ground set consists of all the integers Z and an extra element x. In this poset we have the integers in their natural ≤ order, but element x is incomparable with all integers. Then x is maximal, but not maximum. (e) This is false. The simplest counterexample is a 2-element antichain, {x, y}. Note that x is minimal, y is maximal, but we do not have x ≤ y.

262

Mathematics: A Discrete Introduction (f) This is true. Suppose x and y are incomparable. If x is a maximum, then y < x, contradicting the fact that they are incomparable. Likewise, y is not maximum. (g) This is true. Suppose x and y are distinct maximal elements. Suppose, for the sake of contradiction, that they are not incomparable. Then either x < y or y < x. If x < y, then x is not maximal and if y < x, then y is not maximal.⇒⇐ Therefore x and y are incomparable.

55.8 Let P be a finite, nonempty poset. We know by Proposition 55.3 that P contains a minimal element x. Let U(x) denote the set of all elements above x, i.e., U(x) = {a : x ≤ a}. Notice that x ∈ U(x), so U(x) is nonempty. Among all elements in U(x) choose y with smallest possible up degree. Because y ∈ U(x) we know that x ≤ y. We claim that y is a maximal element of P. Suppose, for the sake of contradiction, that y is not maximal in P. Then there exists z with y < z. Since x ≤ y < z, we have x < z, so z ∈ U(x). As in the proof of Proposition 55.3, we have that u(y) ≥ u(z) + 1, contradicting the fact that, among all element of U(x), y has smallest up degree.⇒⇐ Therefore y is maximal.

56

Linear Orders

This section introduces linear orders and poset isomorphism. The concept of a linear (or total) order is not particularly challenging. The main purpose of this section is to characterize finite linear orders; we show that a finite linear order is isomorphic to the integers {1, 2, . . . , n} (for some n) with the ordinary < ordering. If time is pressing, you can omit the proof of this reasonably intuitive fact. It is interesting to note that infinite linear orders (even of the same cardinality) need not be isomorphic. See Exercise 56.6. This section is needed by the subsequent poset sections except for Section 59. 56.1 The width must be 1. If a total order contained an antichain on 2 (or more) elements, then there would be incomparable elements in the order, contradicting the definition of total order. 56.2 (a) n!. (b) 1. 56.3 Let a be a minimal element of a total order, P. Let x be any other element of P. By trichotomy, we have a < x, or a = x, or a > x. The second is impossible because x is any other element of P and the third is impossible because a is minimal. Therefore a < x, and so a is a minimum element of P. The proof of the corresponding statement for maximal/maximum is completely analogous.

Instructor’s Manual

263

56.4 (⇒) Suppose x and y are incomparable in P. Suppose, for the sake of contradiction f (x) and f (y) were not incomparable in Q. Then we would have either f (x) ≤ f (y) or f (y) ≤ f (x). But f (x) ≤ f (y) ⇒ x ≤ y and f (y) ≤ f (x) ⇒ y ≤ x (since f is order preserving), contradicting the fact that x and y are incomparable.⇒⇐ Therefore, f (x) and f (y) are incomparable. (⇐) Suppose f (x) and f (y) are incomparable in Q. Suppose, for the sake of contradiction, that x and y were not incomparable in P. Then we would either have x ≤ y (which gives f (x) ≤ f (y)) or else y ≤ x (which gives f (y) ≤ f (x)). In either case we have a contradiction, and so x and y must be incomparable. 56.5

(a) (⇒) Suppose x is minimum in P. To show that f (x) is minimum in Q, we need to show that if b is any element of Q, then f (x) ≤ b in Q. Since f is onto, there is an a in P with f (a) = b. Since x is minimum in P, a ≥ x. Thus b = f (a) ≥ f (x) (since f is order-preserving). Therefore f (x) is minimum in Q. (⇐) Suppose f (x) is minimum in Q. To show that x is minimum in P we consider any element a of P and prove that x ≤ a. Since f (x) is minimum in Q, we know that f (a) ≥ f (x). Since f is order preserving, a ≥ x, as required. Thus x is minimum in Q. (b) Completely analogous to (a). (c) (⇒) Suppose x is minimal in P. To show that f (x) is minimal in Q we need to show that there is no element of Q strictly below f (x). Suppose, for the sake of contradiction, that there is a b in Q with b < f (x). Since f is a bijection, there is an a in P with f (a) = b, so f (a) < f (x). Since f is order preserving, we have a < x, contradicting the fact that x is minimal.⇒⇐ Therefore f (x) is minimal. (⇐) Suppose f (x) is minimal in Q. To show that x is minimal in P we must show there is no a with a < x. Suppose, for the sake of contradiction, there were such an element a. Since f is a bijection and order preserving, f (a) < f (x), contradicting the fact that f (x) is minimal.⇒⇐ Therefore, x is minimal. (d) Completely analogous to (c).

56.6 Suppose, for the sake of contradiction, that (N, ≤) and (Z, ≤) were isomorphic, and let f : N → Z be an isomorphism. Note that 0 ∈ N is a minimum element of (N, ≤), but f (0) ∈ Z cannot be a minimum element because (Z, ≤) does not have a minimum element. This contradicts part (a) of the previous problem. Therefore (N, ≤) and (Z, ≤) are not isomorphic. 56.7 We must show that  is reflexive, antisymmetric, transitive, and total. – Reflexive. Let (x, y) ∈ X × X. Then (x, y)  (x, y) because x = x and y ≤ y [part (b) of definition]. – Antisymmetric. Suppose (x1 , y1 )  (x2 , y2 ) and (x2 , y2 )  (x1 , y1 ). We cannot have x1 < x2 (because then (x2 , y2 ) 6 (x1 , y1 )). Likewise we cannot have x2 < x1 . Since ≤ is a total order, we must have x1 = x2 . It now follows that y1 ≤ y2 and y2 ≤ y1 . Therefore (since ≤ is antisymmetric) y1 = y2 .

264

Mathematics: A Discrete Introduction Therefore (x1 , y1 ) = (x2 , y2 ) as required. – Transitive. Suppose we have (x1 , y1 )  (x2 , y2 ) and (x2 , y2 )  (x3 , y3 ). We must show that (x1 , y1 )  (x3 , y3 ). The proof depends on whether x1 < x2 or x1 = x2 , and likewise for x2 and x3 . ∗ ∗ ∗ ∗

If x1 < x2 and x2 < x3 : Then x1 < x3 and so (x1 , y1 )  (x3 , y3 ). If x1 < x2 and x2 = x3 : Then x1 < x3 and so (x1 , y1 )  (x3 , y3 ). If x1 = x2 and x2 < x3 : Then x1 < x3 and so (x1 , y1 )  (x3 , y3 ). If x1 = x2 and x2 = x3 : Then x1 = x3 . In this case we must also have y1 ≤ y2 and y2 ≤ y3 . Therefore y1 ≤ y3 and so (x1 , y1 )  (x3 , y3 ).

– Total. Let (x1 , y1 ) and (x2 , y2 ) be any two elements of X × X. Since ≤ is a total order, we must have exactly one of x1 < x2 , x1 = x2 , or x2 < x1 . ∗ If x1 < x2 : Then (x1 , y1 )  (x2 , y2 ). ∗ If x1 = x2 : Then we have either y1 ≤ y2 [in which case (x1 , y1 )  (x2 , y2 )] or else y2 ≤ y1 [in which case (x2 , y2 )  (x1 , y1 )]. ∗ If x2 < x1 : Then (x2 , y2 )  (x1 , y1 ). In all cases we have either (x1 , y1 )  (x2 , y2 ) or (x2 , y2 )  (x1 , y1 ). Therefore  is a total order on X × X. 56.8 (Z, ≤) is not dense because there is no integer between, say 2 and 3. However, both (Q, ≤) and (R, ≤) are dense. Given a and b in Q [respectively, R], then (a + b)/2 is also in Q [resp. R] and is between a and b.

57

Linear Extensions

This is a section about linear extensions of posets and sorting. There are two ways to think about partially ordered sets. First, for some posets elements are incomparable because there is no reasonable way of calling one “greater” than the other. For example, the sets {1, 2, 3} and {4, 5, 6} are incomparable (with respect to ⊆). Second, we can think of elements as being incomparable simply because we have not ascertained their relationship. For example, if the elements represent athletes who are part way through a tournament, it may be impossible to rank two players who have yet to compete. In this latter setting, a linear extension is a “plausible” linear ordering for the elements—it is not contradicted by our partial information of the “true” order. In this section we also discuss sorting—a topic of interest to computer scientists. We can think of a poset as a computer’s partial state of knowledge about some data items prior to the completion of a sorting algorithm. This section is required by the next section, but not by Section 59.

Instructor’s Manual

265

57.1 (a) and (b) are linear extensions; (c) and (d) are not. 57.2

(a) There are five linear extensions: 1 < 3 < 2 < 4, 1 < 3 < 4 < 2, 3 < 1 < 2 < 4, 3 < 1 < 4 < 2, and 3 < 4 < 1 < 2. (b) There are (5!)2 = 14,400 linear extensions. Elements 1 through 5 must be below element 6, but may appear in any order (first factor of 5!). Elements 6 through 11 must be above element 6, but may appear in any order (another factor of 5!).  (c) There are 10 5 = 252 linear extensions. Elements 1 through 5 must appear in their natural order in the linear extension. Imagine there are 10 “slots” for these elements to occupy. We can select which of these 10 slots will be taken by these 5 elements in 10 5 ways. The remaining elements (6 through 10) fill in the remaining positions in their natural order.

57.3 Let ≤0 be defined as above and let s be any element of the poset. Then s ≤ s, so s ≤0 s (because ≤0 is an extension of ≤). Therefore ≤0 is reflexive. Now suppose s ≤0 t and t ≤0 s. Note that x ≤0 y but y 6≤0 x, so {s,t} 6= {x, y}. Therefore s ≤0 t means s ≤ t and t ≤0 s means t ≤ s. Since ≤ is antisymmetric, we have s = t. Therefore ≤0 is antisymmetric. Let P = (X, ≤) be the poset in figure (a) of Exercise 57.2. Notice that 1 and 4 are incomparable. Let ≤0 = ≤ ∪ {(4, 1)} is not a partial order relation because we have 4 ≤0 1 and 1 ≤0 2, but we do not have 4 ≤0 2. 57.4 Let P = (X, ≤) be a finite poset that is not a total order. Let u(a) denote the number of elements strictly above a and `(a) denote the number of elements strictly below a. Since P is not a total order, it contains incomparable pairs. Choose an incomparable pair (x, y) so that `(x) + u(y) is as small as possible. We claim that (x, y) is a critical pair, i.e., ≤0 = ≤ ∪ {(x, y)} is a partial order. If (for the sake of contradiction) not, then ≤0 is not transitive. So we can find a, b, c with a