Top Banner
1.2 Exercises 1. Let X be the set of all students at a university. Let A be the set of students who are first-year students, B the set of students who are second-year students, C the set of students who are in a discrete mathematics course, D the set of students who are international relations majors, E the set of students who went to a concert on Monday night, and F the set of students who studied until 2 A.M. on Tuesday. Express in set theoretic notation the following sets of students: (a) All second-year students in the discrete mathematics course. Sample Solution. {x X : x B and x C }. (b) All first-year students who studied until 2 AM on Tuesday. (c) All students who are international relations majors and went to the concert on Monday night. (d) All students who studied until 2 AM on Tuesday, are second-year students, and are not international relations majors. (e) All first- and second-year students who did not go to the concert on Monday night but are international relations majors. (f) All students who are first-year international relations majors or who studied until 2 AM on Tuesday. (g) All students who are first- or second-year students who went to a concert on Monday night. (h) All first-year students who are international relations majors or went to a concert on Monday night. 1. (a) {x : x X and x B and x C } 1. (b) {x : x X and x A and x F } 1. (c) {x : x X and x D and x E} 1. (d) {x : x X and x F and x B and x 6D} 1. (e) {x : x X and (x A or x B) and x 6E and x D} 1. (f) {x X :(x A and x D) or x F } 1. (g) {x X :(x A or x B) and x E} 1. (h) {x X : x A and (x D or x E)} 3. Write three descriptions of the elements of the set {2, 5, 8, 11, 14}. 3. {2, 5, 8, 11, 14}; {n N : n =3k - 1 for some k N such that 1 k 5}; or {n Z; n =3k + 2 for some k Z such that - 1 <k< 5}.
46
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 1

1.2 Exercises

1. LetX be the set of all students at a university. Let A be the set of studentswho are first-year students, B the set of students who are second-yearstudents, C the set of students who are in a discrete mathematics course,D the set of students who are international relations majors, E the setof students who went to a concert on Monday night, and F the set ofstudents who studied until 2 A.M. on Tuesday. Express in set theoreticnotation the following sets of students:

(a) All second-year students in the discrete mathematics course.

Sample Solution. {x ∈ X : x ∈ B and x ∈ C}.(b) All first-year students who studied until 2 AM on Tuesday.

(c) All students who are international relations majors and went to theconcert on Monday night.

(d) All students who studied until 2 AM on Tuesday, are second-yearstudents, and are not international relations majors.

(e) All first- and second-year students who did not go to the concert onMonday night but are international relations majors.

(f) All students who are first-year international relations majors or whostudied until 2 AM on Tuesday.

(g) All students who are first- or second-year students who went to aconcert on Monday night.

(h) All first-year students who are international relations majors or wentto a concert on Monday night.

1. (a) {x : x ∈ X and x ∈ B and x ∈ C}1. (b) {x : x ∈ X and x ∈ A and x ∈ F}1. (c) {x : x ∈ X and x ∈ D and x ∈ E}1. (d) {x : x ∈ X and x ∈ F and x ∈ B and x 6∈ D}1. (e) {x : x ∈ X and (x ∈ A or x ∈ B) and x 6∈ E and x ∈ D}1. (f) {x ∈ X : (x ∈ A and x ∈ D) or x ∈ F}1. (g) {x ∈ X : (x ∈ A or x ∈ B) and x ∈ E}1. (h) {x ∈ X : x ∈ A and (x ∈ D or x ∈ E)}

3. Write three descriptions of the elements of the set {2, 5, 8, 11, 14}.3. {2, 5, 8, 11, 14}; {n ∈ N : n = 3k − 1 for some k ∈ N such that 1 ≤ k ≤5}; or {n ∈ Z;n = 3k + 2 for some k ∈ Z such that − 1 < k < 5}.

Page 2: Chapter 1

5. Which of the following pairs of sets are equal? For each pair that isunequal, find an element that is in one but is not in the other.

(a) {0, 1, 2} and {0, 0, 1, 2, 2, 1}(b) {0, 1, 3, {1, 2}} and {0, 1, 2, {2, 3}}(c) {{1, 3, 5}, {2, 4, 6}, {5, 5, 1, 3}} and {{3, 5, 1}, {6, 4, 4, 4, 2}, {2, 4,4, 2, 6}}(d) {{5, 3, 5, 1, 5}, {2, 4, 6}, {5, 1, 3, 3}} and {{1, 3, 5, 1}, {6, 4, 2}, {6,6, 4, 4, 6}}(e) ∅ and {x ∈ N : x > 1 and x2 = x}(f) ∅ and {∅}5. (a) equal

5. (b) not equal; 3 is an element of the first but not the second; 2 is anelement of the second but not the first.

5. (c) equal

5. (d) not equal; {6,4} is an element of the second but not the first.

5. (e) equal

5. (f) not equal; ∅ is an element of the second but not the first.

7. Let A = {n : n ∈ N and n = 2k + 1 for some k ∈ N}, B = {n : n ∈N and n = 4k+1 for some k ∈ N}, and C = {m ∈ N : m = 2k−1 and k ∈N and k ≥ 1}. Prove the following:

(a) 35 ∈ A

(b) 35 ∈ C

(c) 35 6∈ B

(d) A = C

(e) B ⊆ A

(f) B ⊆ C

(g) B ⊂ A

(h) B ⊂ C

7. (a) Solve 35 = 2k + 1 and verify k ≥ 0.

7. (b) Solve 35 = 2k − 1 and verify k ≥ 1.

7. (c) Show that there is no solution for 35 = 4k + 1 with k ∈ N.

7. (d) (⊆) Let 2k0 +1 ∈ A for some k0 ∈ N. Then 2k0 +1 = 2(k0 +1)− 1.Since k0 ∈ N, we have k0 + 1 ∈ N − {0}. Therefore, A ⊆ C.

(⊇) Let 2k0 − 1 ∈ C for some k0 ∈ N−{0}. Then 2k0 − 1 = 2(k0 − 1) + 1.Since k0 ∈ N − {0}, we have k0 − 1 ∈ N. Therefore, C ⊆ A.

Since A ⊆ C and C ⊆ A, we have proven that A = C.

7. (e) Let 4k0 + 1 ∈ B for some k0 ∈ N. 4k0 + 1 = 2(2k0) + 1. Sincek0 ∈ N, we have 2k0 ∈ N. Therefore, B ⊆ A.

7. (f) Let 4k0 + 1 ∈ B for some k0 ∈ N. 4k0 + 1 = 2(2k0 + 1) − 1. Sincek0 ∈ N, we have 2k0 + 1 ∈ N − {0}. Therefore, B ⊆ C.

7. (g) Use (e), (c), and (a).

7. (h) Use (f), (c), and (b).

Page 3: Chapter 1

9. Describe in words the difference between ∅ and {∅}.9. The set ∅ has no elements. The set {∅} is a one-element set – itselement is ∅.

1.4 Exercises

1. Let A = {1, 2, 3, . . . , 10}, B = {2, 3, 6, 8}, and C = {3, 5, 4, 8, 2}. Find thefollowing:

(a) B ∪ C(b) B ∩ C(c) B − C

(d) A−B

(e) A− C

1. (a) {2, 3, 4, 5, 6, 8}1. (b) {2, 3, 8}1. (c) {6}1. (d) {1, 4, 5, 7, 9, 10}1. (e) {1, 6, 7, 9, 10}

3. Let A = {0, 3} and B = {x, y, z}. Find the following:

(a) A×B

(b) A×A×B

(c) B ×A

(d) B ×A×B

3. (a) {(0, x), (0, y), (0, z), (3, x), (3, y), (3, z)}3. (b) {(0, 0, x), (0, 0, y), (0, 0, z), (0, 3, x), (0, 3, y), (0, 3, z), (3, 0, x), (3, 0, y),(3, 0, z), (3, 3, x), (3, 3, y), (3, 3, z)}3. (c) {(x, 0), (x, 3), (y, 0), (y, 3), (z, 0), (z, 3)}3. (d) {(x, 0, x), (x, 3, x), (y, 0, x), (y, 3, x), (z, 0, x), (z, 3, x), (x, 0, y), (x, 3, y),(y, 0, y), (y, 3, y), (z, 0, y), (z, 3, y), (x, 0, z), (x, 3, z), (y, 0, z), (y, 3, z), (z, 0, z),(z, 3, z)}

5. Prove Theorem 1(d).

5. We must prove (i) A ∪ (B ∪ C) ⊆ (A ∪ B) ∪ C and (ii) (A ∪ B) ∪ C ⊆A ∪ (B ∪ C).

(i) Let x ∈ A ∪ (B ∪ C). Then either x ∈ A or x ∈ B ∪ C. In the firstcase x ∈ A∪B (Theorem 1 (b)). Therefore, x ∈ (A∪B)∪C by Theorem1(b). In the second case, either x ∈ B or x ∈ C. When x ∈ B, we havex ∈ A ∪ B by Theorem 1 (b). Again by Theorem 1(b), x ∈ (A ∪ B) ∪ C.When x ∈ C, x ∈ (A ∪ B) ∪ C by Theorem 1 (b). In any case, wheneverx ∈ A ∪ (B ∪ C), it follows that x ∈ (A ∪ B) ∪ C.Part (ii) is analogous and is left to the reader.

Page 4: Chapter 1

7. (a) Draw Venn diagrams to illustrate Theorems 3(a) and 3(b).

(b) Prove Theorem 3(a).

(c) Prove Theorem 3(b).

7. (a)

A (B C) A B A C

U

U

U

A

B C

A

B C

A

B C

A A A

B B BC C C

=

UU

U

U

=

A (B C) A B A C

UU

U

7. (b) (⊆) Show that

A ∩ (B ∪ C) ⊆ (A ∩B) ∪ (A ∩ C)Suppose x ∈ A∩(B∪C). It is necessary to show that x ∈ (A∩B)∪(A∩C).Since x ∈ A ∩ (B ∪ C), x ∈ A and x ∈ B ∪ C. From x ∈ B ∪ C it followsthat x ∈ B or x ∈ C.

Case I, x ∈ B. Then, since x ∈ A and x ∈ B, x ∈ A ∩ B. By Theorem 2(b),

A ∩ B ⊆ (A ∩ B) ∪ (A ∩ C).

Hence, x ∈ (A ∩ B) ∪ (A ∩ C).

Case II, x ∈ B. The proof that x ∈ (A ∩ B) ∪ (A ∩ C) is analogous toCase I.

(⊇) Show that(A ∩ B) ∪ (A ∩ C) ⊆ A ∩ (B ∪ C)

So, suppose x ∈ (A ∩ B) ∪ (A ∩ C). It is necessary to show that x ∈A ∩ (B ∪ C).

Since x ∈ (A ∩ B) ∪ (A ∩ C), x ∈ (A ∩ B) or x ∈ (A ∩ C).

Case I, x ∈ (A∩B). Then x ∈ A and x ∈ B. Since x ∈ B and B ⊆ B ∪C(Theorem 2(b)), x ∈ B ∪ C. Hence x ∈ A ∩ (B ∪ C).

Case II, x ∈ (A ∩ C). Analogous to Case I.

7. (c) Analogous to (b).

9. Find three sets A, B, and C where A ⊆ B ∪ C but A 6⊆ B and A 6⊆ C.

9. A = {2, 3, 4}. B = {1, 2, 3}. C = {3, 4, 5}.

Page 5: Chapter 1

11. Prove Theorem 7(c).

11. (⇒) Let A = B. If x ∈ A, then x 6∈ A. Since A = B, we conclude thatx 6∈ B. The proof in the other direction is analogous.

(⇐) Let A = B. If x ∈ A, then x 6∈ A. But A = B so x 6∈ B. But x 6∈ Bimplies x ∈ B. Therefore, A ⊆ B. The proof in the other direction isanalogous.

13. Let A = {1, 2, {{1, 2}}}.(a) How many elements does A have? How many elements does P(A)have? How many elements does P(P(A)) have?

In parts (b)-(m) determine, whether each of the following is true, and ifnot, explain why not.

(b) 1 ∈ A (c) {1, 2} ∈ A (d) {{1, 2}} ∈ A (e) ∅ ∈ A (f) 1 ∈ P(A) (g){1, 2} ∈ P(A) (h) {{1, 2}} ∈ P(A) (i) ∅ ∈ P(A) (j) 1 ∈ P(P(A)) (k){1, 2} ∈ P(P(A)) (l) {{1, 2}} ∈ P(P(A)) (m) ∅ ∈ P(P(A))

13. (a) 3, 8, 256

13. (b) T

13. (c) {{1, 2}} ∈ A not {1, 2}13. (d) ∅ ⊆ A but ∅ 6∈ A

13. (e) {1} ∈ P(A) not 1

13. (f) T

13. (g) see (f)

13. (h) T

13. (i) T

13. (j) 1 ∈ A, {1} ∈ P(A) and {{1}} ∈ P(P(A))

13. (k) {{1, 2}} ∈ P(P(A))

13. (l) T

13. (m) T

15. Which of the following statements are correct? Prove each correct state-ment. Disprove each incorrect statement by finding a counterexample.

(a) A and B are disjoint if and only if B and A are disjoint. (Read thestatement carefully – the order in which the sets are listed might matter!)

(b) A∪B and C are disjoint if and only if both the following are true: (i)A and C are disjoint and (ii) B and C are disjoint.

(c) A∩B and C are disjoint if and only if both the following are true: (i)A and C are disjoint and (ii) B and C are disjoint.

(d) A∪B and C are disjoint if and only if one of the following is true: (i)A and C are disjoint or (ii) B and C are disjoint.

(e) A∩B and C are disjoint if and only if one of the following is true: (i)A and C are disjoint or (ii) B and C are disjoint.

(f) Let U be a universal set with A,B ⊆ U. A and B are disjoint if andonly if A and B are disjoint.

Page 6: Chapter 1

15. (a) True because intersection is commutative.

15. (b) Since (A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C), the conclusion follows.

15. (c) A = {1, 2};B = {3, 4};C = {1, 3}15. (d) A = {1, 2};B = {2, 3, 4};C = {4}15. (e) (A∩B)∩C) = ∅, but A∩C = {1} and B∩C = {3} are not empty.

15. (f) U = {1, 2, 3}A = {1};B = {2}

17. Given any four integers x1, x2, x3, and x4, none of which is even and noneof which is a multiple of 5, prove that some consecutive product of theseintegers ends in the digit 1. A consecutive product is one term, two termsin a row, three terms in a row, or all four terms using the order in whichthe integers appear in the list x1, x2, x3, x4. (Hint. Use a proof by cases.)

17. We do a proof by contradiction. Suppose the statement is false. Thenif any of the integers ends in the digit 1, the consecutive product consistingof just that one integer ends in the digit 1, as required. So from now on,suppose none of the integers ends in the digit 1.

Suppose an integer ends in the digit 3. Then no integer ends in the digit7, because 3 · 7 ends in the digit 1. Thus each of the other integers endsin the digit 3 or 9. It is not possible that each of the four integers endsin the digit 3. It is also not possible that three integers end in the digit3, since the remaining integer would have to end in 9, and 3 · 3 · 9 ends in1. If two integers end in 3, then the remaining two must end in 9, whichis not possible. If exactly one integer ends in 3, then the others must endin 9, which is not possible. Therefore, no integer ends in 3.

Now we know that each integer ends in 7 or 9. Suppose that an integerends in 9. Then the others must end in 7, but this is impossible because7 · 7 · 9 ends in 1. Thus all integers must end in 7, but this also is notpossible.

Thus assuming that no consecutive product ends in 1 has lead to an im-possible situation in every case. Therefore, the statement is true.

19. Prove by contradiction that√

2 is not a rational number.

19. Suppose it is true that√

2 is a rational number. Without loss ofgenerality, we can assume there are integers m and n without commonfactors such that √

2 =m

n.

Then

2 =m2

n2.

Since m and n have no common factors, 2 must divide m. Therefore,m = 2 · j for some integer j. This tells us that 2n2 = 4j2 and we can nowconclude that 2 divides n. Therefore, m and n have a common factor,which is a contradiction. We conclude that assuming that

√2 is a ratio-

nal number leads to a contradiction. Consequently,√

2 is not a rationalnumber.

Page 7: Chapter 1

21. Complete the proof of Example 12.

21. x ∨ y = y ∨ x: The operation x ∨ y is to find the maximum of thesetwo elements. The operation y ∨ x asks to find the maximum of the sametwo elements. Therefore, x ∨ y = y ∨ x.x∨ (x∧ y) = x: The operation x∧ y finds the minimum of x and y. If theanswer is x, you then find x ∨ x which is x. If the answer is y, then x isless than y and the minimum of x and y is x.

x∧ (y ∧ z) = (x∧ y)∧ z): The min{x, min{y, z}} is either x or min{y, z}.If x, then

min{min{x, y}, z} = x

as x ≤ y and x ≤ z. If min{y, z} is the minimum, then min{min{x, y}, z} =min{y, z} as y ≤ x.

x∨ (y ∨ z) = (x∨y)∨ z: max{x, max{y, z}} is either x or max{y, z}. If x,then max{max{x, y}, z} = max{x, z} = x. If max{y, z} is the maximum,then max{max{x, y}, z} = max{y, z}.x∨(x∧y) = x: the minimum is min{x, max{x, y}} is either x or max{x, y}.If x, then the result holds. If max{x, y}, then we still get x as x must begreater than y so max{x, y} = x.

23. Let U be any set and let X = P(U). Prove that X with the operations ∪for meet and ∩ for join is a complemented lattice.

23. Use Example 13 with the interpretation of meet and join inter-changed. For > use ∅ and for ⊥ use X .

25. Prove that in a boolean algebra

a ∨ (b ∧ c) = (a ∨ b) ∧ c

if and only ifa ∨ (b ∧ (a ∨ c)) = (a ∨ b) ∧ (a ∨ c)

anda ∧ (b ∨ (a ∧ c)) = (a ∧ b) ∨ (a ∧ c)

This property of a boolean algebra is called modularity.

25. (⇐)

(a ∨ b) ∧ (a ∨ c) = ((a ∨ b) ∧ a) ∨ ((a ∨ b) ∧ c)= (a ∨ (b ∧ a)) ∨ (a ∨ (b ∧ c))= a ∨ ((b ∧ a) ∨ (b ∧ c))= a ∨ (b ∧ (a ∨ c))

Page 8: Chapter 1

The proof ofa ∧ (b ∨ (a ∧ c)) = (a ∧ b) ∨ (a ∧ c)

follows by substituting ∧ for ∨.

(⇒)

(a ∨ b) ∧ c = (a ∧ c) ∨ (b ∧ c)= c ∧ (a ∨ (c ∧ b))= c ∧ (a ∨ c) ∧ (a ∨ b)= (c ∧ (a ∨ c)) ∧ (a ∨ b)= c ∨ (a ∧ b)

27. Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} be a universal set. Let A,B,C ⊆ Usuch that A = {1, 3, 4, 8}, B = {2, 3, 4, 5, 9, 10}, and C = {3, 5, 7, 9, 10}.Use bit representations for A, B, and C together with UNION, INTER,DIFF , and COMP to find the bit representation for the following:

(a) A ∪ B(b) A ∩B ∩ C(c) (A ∪ C) ∩ B(d) (A−B) ∪ C(e) A ∩ (B − (C ∩ B))

(f) A− (B − C)

(g) (A ∪ B) ∪ (C −B)

27. (a) 1111100111

27. (b) 0010000000

27. (c) 0011100011

27. (d) 1010101111

27. (e) 0001000000

27. (f) 1010000100

27. (g) 1111101111

1.6 Exercises

1. In a class of 35 students who are either biology majors or have blonde hair,there are 27 biology majors and 21 blondes. How many biology majorsmust be blonde?

1. Let A = {students who are biology majors}. B = {students who areblondes}.

|A ∪ B | = |A | + |B | − |A ∩ B |35 = 27 + 21− | {biology majors who are blonde} || {biology majors who are blonde} | = 13

Page 9: Chapter 1

3. A tennis camp has 39 players. There are 25 left handed players and 22players have a two-handed back stroke. How many left-handed playershave a two-handed back stroke if every player is represented in these twocounts?

3. Let A = {left handed players} and B = {players with a two-handedback stroke}.

|A ∪ B | = |A | + |B | − |A ∩ B |39 = 25 + 22 − |A ∩ B |

|A ∩ B| = 25 + 22 − 39

= 8

5. A marketing class did a survey of the number of fast food outlets nearcampus. The results of the survey showed the following:

Type of Food Sold No. of Outlets

Hamburgers 15Tacos 25Pizza 21Hamburgers and tacos 11Hamburgers and pizza 10Tacos and pizza 14Hamburgers and tacos and pizza 9Served none of these items 5

How many fast food outlets are there near campus?

5. Let A = {Outlets serving hamburgers}; B = {Outlets serving tacos};and C = {Outlets serving pizza}. We will find |A∪B ∪C | and then add5 since there are five restaurants that do not fit in any of these categories.

|A ∪ B ∪ C | = |A | + |B | + |C | − |A ∩ B | − |A ∩ C |−|B ∩ C | + |A ∩ B ∩ C |

= 15 + 25 + 21− 11 − 10− 14 + 9

= 35

The final answer is 40.

Page 10: Chapter 1

7. A marketing class did a sample survey to find out how many of a classof 125 people owned CD’s of the Beatles, Alabama, or Bob Marley. Theresults of the survey showed the following:

Recording Artist No. of Students Owning CD’s

Beatles 65Alabama 46Bob Marley 29Beatles & Alabama 18Beatles & Bob Marley 21Bob Marley & Alabama 12Beatles, Bob Marley, & Alabama 9

How many of the students owned no CD featuring these performers?

7. Let A = {Students who owned CD’s featuring the Beatles}; B ={Students who owned CD’s featuring Alabama}; and C = {Students who

owned CD’s featuring Bob Marley}. We will first find |A ∪ B ∪ C |.

|A ∪ B ∪ C | = |A | + |B | + |C |− |A ∩ B | − |A ∩ C | − |B ∩ C |+ |A ∩ B ∩ C |

= 65 + 46 + 29− 18 − 21− 12 + 9

= 98

The answer we want is:

|A ∪ B ∪ C| = Total no. of Students − |A ∪ B ∪ C|= 125− 98

= 27

9. How many integers between 1 and 250 are divisible by 3 or 5?

9. Let D3 = {Integers in this range divisible by 3}; D5 = {Integers in thisrange divisible by 5}; and D15 = {Integers in this range divisible by 15}.|D3 | = 83. |D5 | = 50. |D3 ∩D5 | = |D15 | = 16. The answer we want isthe number of distinct integers in this range that are divisible by either 3or 5.

|D3 ∪D5 | = |D3 | + |D5 | − |D15 | = 117

Page 11: Chapter 1

11. There are 76 students enrolled in Anth229, Intermediate Anthropology.Each of these students is also required to enroll in either one or both ofBiol113, Physiology and Engl218, Victorian Poets. Of these 76 studentsthere are 35 in Biol313 and 49 in Engl218. How many students are enrolledin all three classes?

11. Let A = {Anth229 students in Biol113} and B = {Anth229 studentsin Engl218}.

|A ∪ B | = |A | + |B | − |A ∩ B |76 = 35 + 49− |A ∩ B || {Anth229 students taking Biol113 and Engl218} | = 8

13. How many numbers between 1 and 1000 are not divisible by 3, 7, or 9?

13. Let D3 = {Integers in this range divisible by 3}; D7 = {Integersin this range divisible by 7}; D9 = {Integers in this range divisible by9}; D21 = {Integers in this range divisible by 21}; and D63 = {Integersin this range divisible by 63}. |D3 | = 333. |D7 | = 142. |D9 | = 111.|D3∩D7 | = |D21 | = 47. |D3∩D9 | = |D9 | = 111. |D7 ∩ D9 | = |D63 | =15. |D3 ∩ D7 ∩ D9 | = |D63 | = 15. We want to find |D3 ∪D7 ∪D9 |.This will be: Total number of integers − |D3 ∪D7 ∪D9 |.

|D3 ∪D7 ∪D9 | = 1000− (|D3 | + |D7 | + |D9 |− |D21 | − |D9 | − |D63 | + |D63 |)

= 1000− (333 + 142 + 111− 47− 111− 15 + 15)

= 572

Easier: since D9 ⊆ D3, we can just compute |D3 ∪D7| = 1000 − 333 −142 + 47 = 572.

15. (a) How many numbers between 1 and 70,000,000, including 1 and70,000,000, are divisible by 2, 5, or 7?

(b) How many numbers between 1 and 6,000,000, including 1 and 6,000,000,are divisible by 4, 5, or 6?

15. (a) Let D2 = {Integers in this range divisible by 2}; D5 = {Integersin this range divisible by 5}; D7 = {Integers in this range divisible by7}; D10 = {Integers in this range divisible by 10}; D14 = {Integers inthis range divisible by 14}; and D35 = {Integers in this range divisibleby 35}. |D2 | = 35, 000, 000. |D5 | = 14, 000, 000. |D7 | = 10, 000, 000.|D2 ∩ D5 | = |D10 | = 7, 000, 000. |D2 ∩ D7 | = |D14 | = 5, 000, 000.|D5 ∩D7 | = |D35 | = 2, 000, 000. |D2 ∩D5 ∩D7 | = |D70 | = 1, 000, 000.The number of integers in this range that are divisible by 2, 5, or 7 is:

|D2 ∪D5 ∪D7 | = |D2 | + |D5 | + |D7 | − |D10 |− |D14 | − |D35 | + |D70 |

Page 12: Chapter 1

15. (b) Let D4 = {Integers in this range divisible by 4}; D5 = {Integersin this range divisible by 5}; D6 = {Integers in this range divisible by6}; D20 = {Integers in this range divisible by 20}; D12 = {Integers inthis range divisible by 12}; D30 = {Integers in this range divisible by 30};and D60 = {Integers in this range divisible by 60}. |D4 | = 1, 500, 000.|D5 | = 1, 200, 000. |D6 | = 1, 000, 000. |D4 ∩ D5 | = |D20 | = 300, 000.|D4 ∩D6 | = |D12 | = 500, 000. |D5∩D6 | = |D30 | = 200, 000. |D4 ∩D5 ∩D6 | = |D60 | = 100, 000. The number of integers in this range divisible by4, 5, or 6 is:

|D4 ∪D5 ∪D6 | = |D4 |+ |D5 |+ |D6 | − |D20 | − |D12 | − |D30 |+ |D60 |.

17. How many numbers between 1 and 21,000,000, including 1 and 21,000,000,are divisible by 2, 3, or 5 but not by 7?

17. Let D2 = {Integers in this range divisible by 2}; D3 = {Integers inthis range divisible by 3}; D5 = {Integers in this range divisible by 5};and D7 = {Integers in this range divisible by 7}. The solution will be tofind the number of numbers divisible by 2, 3, or 5 that are not at the sametime multiples of 7.

|D2 ∪D3 ∪D5| − (|D2 ∩D7| + |D3 ∩D7| + |D5 ∩D7|− |D2 ∩D3 ∩D7| − |D2 ∩D5 ∩D7| − |D3 ∩D5 ∩D7|)+ |D2 ∩D3 ∩D5 ∩D7|= 15366667− 1500000− 1000000− 600000

+500000 + 300000 + 200000− 100000

= 13266667

19. Find the number of integers between 1 and 1000, including 1 and 1000,that are not divisible by any of 4, 5, or 6.

19. Let D4 = {Integers in this range divisible by 4}; D5 = {Integers inthis range divisible by 5}; D6 = {Integers in this range divisible by 6};D20 = {Integers in this range divisible by 20}; D12 = {Integers in thisrange divisible by 12}; D30 = {Integers in this range divisible by 30};and D60 = {Integers in this range divisible by 60}. |D4 | = 250. |D5 | =200. |D6 | = 166. |D4 ∩ D5 | = |D20 | = 50. |D4 ∩ D6 | = |D12 | = 83.|D5 ∩D6 | = |D30 | = 33. |D4 ∩D5 ∩D6 | = |D60 | = 16. In this case wedo not want to find |D4 ∪D5 ∪D6 | but the difference between this valueand the total number of integers in the range.

|D4 ∪D5 ∪D6 | = 1000− (|D4 | + |D5 | + |D6 |− |D20 | − |D12 | − |D30 | + |D60 |)

= 1000− (250 + 200 + 166− 50− 83 − 33 + 16)

= 534

Page 13: Chapter 1

21. (a) Extend Example 9 to cover four Victorian gentlemen and four tophats. With four gentlemen there are 4 × 3 × 2 × 1 = 24 ways to give thehats back.

(b) Modify part (a) to ask the number of ways, with four gentlemen andfour hats, that at least two gentlemen can get their own hats back.

(c) Solve Example 9 using an alternate proof that counts the number ofways no gentleman gets his own hat back and subtracts that value fromthe total number of ways for the hats to be given back.

(d) Challenge: Solve part (b) using the same method as for part (c).

21. (a) Let H1 be the number of times person 1 receives the right hat; H2

be the number of times person 2 receives the right hat; H3 be the numberof times person 3 receives the right hat; and H4 be the number of timesperson 4 receives the right hat.

The answer is:

|H1 ∪H2 ∪H3 ∪H4| = |H1| + |H2| + |H3| + |H4|− |H1 ∩H2| − |H1 ∩H3| − |H1 ∩H4|

− |H2 ∩H3| − |H2 ∩H4| − |H3 ∩H4|+ |H1 ∩H2 ∩H3| + |H1 ∩H2 ∩H4|

+ |H2 ∩H3 ∩H4| − |H1 ∩H2 ∩H3 ∩H4|= 6 + 6 + 6 + 6 − 2 − 2 − 2 − 2 − 2 − 2

+ 1 + 1 + 1 + 1 − 1

= 15

21. (b) Calculate the number of ways at least one gentleman gets the righthat back and subtract the number of ways exactly one gentleman gets theright hat back. The answer is 7.

21. (c) Suppose the gentlemen and their respective hats are numbered 1,2, 3, and 4. Each way of returning the hats gives rise to an ordered 4-tuple,where the number in position i for 1 ≤ i ≤ 4 tells which hat was returnedto gentleman i. We will count the number of 4-tuples such that the numberof position i is not equal to i for any i such that 1 ≤ i ≤ 4. There are threechoices for the first position. If the first position is filled with 2, then thereare three choices for position 2. Whatever choice is made for position 2,there is only one way to fill the remaining two positions because at leastone of the remaining hats belongs to either 3 or 4. Therefore there arethree possibilities if the first position receives 2.

Page 14: Chapter 1

If the first position receives either 3 or 4, there are two possibilities forposition 2 cannot be put in position 2 but either one 1 or x can be chosenfor position 2 where x is either 3 or 4 depending on which hat was put inposition 2. In the case 3 or 4 is put in the first two positions there are twopossibilities for position 3 since either hat 1 or 2 can be put in position3. This leaves a single remaining possibility for position 4. If one of 3or 4 is not put in position 1 or 2, there is only one way to fill positions3 and 4. Altogether there are three ways to distribute the hats so thatno owner received the right hat if the first gentleman received hat 3. Thesame statement is true if the first gentleman received hat 4. Since puttinghat 3 in the first position is a different case from putting hat 4 in the firstposition, this reasoning leads to six possibilities for passing out the hatsso that no one receives the right one.

Therefore, there are 9 ways to pass out the hats so that no gentlemanreceives the right one. Since there are 24 ways to pass out the hats, thereare 15 ways to pass out the hats so that at least one owner receives theright hat.

21. (d) The solution comes in two parts. The first part is to count thenumber of ways no one receives the right hat. This is 9 from (c). Thesecond part is to count the number of ways only one person receives theright hat.

The number of assignments for which exactly one hat is given to the rightperson can be counted as follows. Since one hat is given to the rightperson, the idea is to solve a new problem and count how many waysthree hats can be assigned so that each hat goes to someone other thanthe owner.

For the new problem, suppose there are three hats numbered 1, 2, and3 that must be put in positions 1, 2, and 3 so that no hat is put in theposition of its number. Suppose 2 is put in position 1. There is only oneway to complete the assignment so that 1 and 3 are put in positions 2 and3 and 3 is not put in position 3. There is also one possibility if 3 is putin position 1. Thus for each assignment with exactly one hat in the rightplace there are two ways to complete the assignment. Therefore there are8 ways to assign four hats so that exactly one hat is given to its owner.

There are 9 ways to assign hats so that no one gets the right hat and 8ways to assign hats so that only one person gets the right hat. Thereforethere are 17 ways to assign the hats so that at most one person gets theright hat. The answer is 24 - 17 = 7.

Page 15: Chapter 1

1.9 Exercises

Assume all variables not given an explicit domain are elements of N.

1. Show that for n = 0, 1, 2 the following is true

12 + 22 + 32 + · · · + n2 = n(n+ 1)(2n+ 1)/6

1. When n = 0, a sum of the form F (1) + f(2) + · · ·+ f(n) is understoodto consist of just the f(n) term, which is f(0).

lhs rhs0: 0 01: 1 1 = 1(2)(3)/62: 5 5 = 2 (3) (5) / 6

3. Write out the information that describes what the inductive step assumesand what the step must prove for proving

12 + 22 + 32 + · · · + n2 = n(n+ 1)(2n+ 1)/6

with n0 given.

3. The inductive hypothesis is that n ∈ T , that is: n ≥ n0 and

12 + 22 + 32 + · · · + n2 = n(n+ 1)(2n+ 1)/6

What must be proven is that n+ 1 ∈ T , that is, n+ 1 ≥ n0 and that

12 + 22 + 32 + · · · + n2 + (n+ 1)2 = (n+ 1)((n+ 1) + 1)(2(n+ 1) + 1)/6

5. Write out the information that describes what the inductive step assumesand what the step must prove for proving that 6 divides n3 + 5n with n0

given.

5. The inductive hypothesis is that n ∈ T , that is: n ≥ n0 and thatn ∈ T , that is, 6 | (n3 + 5n). What must now be proven is that n+ 1 ∈ T ,that is: n+ 1 ≥ n0 and 6 | ((n+ 1)3 + 5(n+ 1)).

7. Show for n = 0, 1, 2 that

(n+ 1)(2n+ 1)(2n+ 3)/3 + (2n+ 3)2 = (n+ 2)(2n+ 3)(2n+ 5)/3

7.

n (n+ 1)(2n+ 1)(2n+ 3)/3 + (2n+ 3)2 (n+ 2)(2n+ 3)(2n+ 5)/30 10 101 35 352 84 84

Page 16: Chapter 1

9. Show thatn2 + n+ 2(n+ 1) = (n+ 1)2 + (n+ 1)

9.

n2 + n+ 2(n+ 1) = n2 + n+ 2n+ 2

= n2 + 3n+ 2

= n2 + 2n+ 1 + (n+ 1)

= (n+ 1)2 + (n+ 1)

11. For which elements n ∈ {0, 1, 2, 3, 4, 5} does 6 divide n3 + 5n?

11.

n n3 + 5n0 01 62 183 424 845 150

13. Find the smallest n ∈ N such that 2n2 + 3n+ 1 < n3.

13.

n 2n2 + 3n+ 1 n3

0 1 01 6 12 15 83 28 274 45 64

The answer is 4.

15. Prove by induction:

(a) 12 + 22 + 32 + · · · + n2 = n (n+ 1) (2n+ 1)/6 for n ≥ 0

(b) 13 + 23 + 33 + · · · + n3 = (1 + 2 + 3 + · · · + n)2 for n ≥ 0

(c) 14 + 24 + 34 + · · ·+ n4 = n(n+ 1)(2n+ 1)(3n2 + 3n− 1)/30 for n ≥ 0

(d) 15 + 25 + 35 + · · · + n5 = 16n

6 + 12n

5 + 512n

4 − 112n

2 for n ≥ 0

15. (a) Let n0 = 0. Let T = {n ∈ N : 12 + 22 + 32 + · · · + n2 = n (n +1) (2n+ 1)/6}. Note that 02 + 12 + · · · + n2 = 12 + 22 + · · · + n2.

(Base step) For n = 0 the left-hand side and the right-hand side bothequal 0, so n0 ∈ T .

Page 17: Chapter 1

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

12 + 22 + 32 + · · · + n2 =n(n+ 1)(2n+ 1)

6

is true and show that

12 + 22 + 32 + · · · + n2 + (n+ 1)2 =(n+ 1)(n+ 2)(2n+ 3)

6

and that n+ 1 ≥ n0 are true.

12 + 22 + · · · + n2 + (n+ 1)2 = (12 + 22 + · · · + n2) + (n+ 1)2

=n(n+ 1)(2n+ 1)

6+ (n+ 1)2 (by ind. hyp.)

=(n+ 1)

6(n(2n+ 1) + 6n+ 6)

=n+ 1

6(2n2 + 7n+ 6)

=n+ 1

6(n+ 2)(2n+ 3)

=(n+ 1)((n+ 1) + 1)(2(n+ 1) + 1)

6

Since n+ 1 > n, it follows that n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .

By the Principle of Mathematical Induction, T = N.

15. (b) Let n0 = 0. Let T = {n ∈ N : 13 + 23 + 33 + · · · + n3 =(1 + 2 + 3 + · · · + n)2}.

(Base step) For n = 0 the left-hand side and the right-hand side bothequal 0, so n0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

13 + 23 + 33 + · · · + n3 = (1 + 2 + 3 + · · · + n)2

are true and prove that

13 + 23 + 33 + · · · + n3 + (n+ 1)3 = (1 + 2 + 3 + · · · + n+ (n+ 1))2

and that n+ 1 ≥ n0 are true.

Page 18: Chapter 1

13 + 23 + · · ·n3 + (n+ 1)3 = (13 + 23 + · · ·n3) + (n+ 1)3

= (1 + 2 + · · · + n)2 + (n+ 1)3 (by ind. hyp.)

=

(

n(n+ 1)

2

)2

+ (n+ 1)3 (by Th. 1)

=n2(n+ 1)2

4+ (n+ 1)3

=(n+ 1)2

4

(

n2 + 4(n+ 1))

=(n+ 1)2

4(n+ 2)2

=

(

(n+ 1)(n+ 2)

2

)2

= (1 + 2 + · · · + n+ (n+ 1))2 (by Th. 1)

Since n+ 1 > n, it follows that n+ 1 ≥ n+ 0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

15. (c) Let n0 = 0. Let

T = {n ∈ N : 14 +24 +34 + · · ·+n4 = n(n+1)(2n+1)(3n2 +3n− 1)/30}

(Base step) For n = 0 the left-hand side and the right-hand side bothequal 0, so 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

14 + 24 + 34 + · · · + n4 = n(n+ 1)(2n+ 1)(3n2 + 3n− 1)/30

are true and prove that

14+24+34+· · ·+n4+(n+1)4 = (n+1)(n+2)(2n+3)(3n+1)2+3(n+1)−1)/30

is true.

14 + 24 + 34 + · · · + n4 + (n+ 1)4 = (14 + 24 + 34 + · · · + n4) + (n+ 1)4

= n(n+ 1)(2n+ 1)(3n2 + 3n− 1)/30 + (n+ 1)4 (by ind. hyp.)

= (n+ 1)(6n4 + 39n3 + 91n2 + 89n+ 30)/30

= (n+ 1)(n+ 2)(2n+ 3)(3(n+ 1)2 + 3(n+ 1) − 1)/30

Of course, n+ 1 > n ≥ n0. Therefore, n+ 1 ∈ T .

Page 19: Chapter 1

By the Principle of Mathematical Induction, T = N.

15. (d) Let n0 = 0. Let

T = {n ∈ N : 15 + 25 + 35 + · · · + n5 =1

6n6 +

1

2n5 +

5

12n4 − 1

12n2}

(Base step) For n = 0 the left-hand side and the right-hand side bothequal 0, so 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

15 + 25 + 35 + · · · + n5 =1

6n6 +

1

2n5 +

5

12n4 − 1

12n2

are true and prove that

15+25+35+· · ·+n5+(n+1)5 =1

6(n+1)6+

1

2(n+1)5+

5

12(n+1)4− 1

12(n+1)2

and n+ 1 ≥ n0 are true.

15 + 25 + 35 + · · · + n5 + (n+ 1)5 = (15 + 25 + 35 + · · · + n5) + (n+ 1)

5

=1

6n6 +

1

2n5 +

5

12n4 − 1

12n2 + (n+ 1)5 (by ind. hyp.)

= (2n6 + 18n5 + 65n4 + 120n3 + 119n2 + 60n+ 12)/12

=1

6(n+ 1)6 +

1

2(n+ 1)5 +

5

12(n+ 1)4 − 1

12(n+ 1)2

Of course n+ 1 > n ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

17.

Prove by induction:

(a)1

1 · 2 +1

2 · 3 + · · · + 1

n (n+ 1)=

n

n+ 1

for n ≥ 1

(b)1

2+

2

22+

3

23+ · · · + n

2n= 2 − n+ 2

2n

for n ≥ 1

Page 20: Chapter 1

17. (a) Let n0 = 1. Let

T = {n ∈ N :1

1 · 2 +1

2 · 3 + · · · + 1

n(n+ 1)=

n

n+ 1}

(Base step) For n = 1 the left-hand side and the right-hand side bothequal 1/2, so 1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 = 1 and that

1

1 · 2 +1

2 · 3 + · · · + 1

n(n+ 1)=

n

n+ 1

are true and prove that

1

1 · 2 +1

2 · 3 + · · · + 1

n(n+ 1)+

1

(n+ 1)(n+ 2)=n+ 1

n+ 2

and n+ 1 ≥ n0 = 1 are true.

1

1 · 2 +1

2 · 3 + · · · +1

n · (n+ 1)+

1

(n+ 1) · (n+ 2)

=

(

1

1 · 2 +1

2 · 3 + · · · + 1

n · (n+ 1)

)

+1

(n+ 1) · (n+ 2)

=n

n+ 1+

1

(n+ 1) · (n+ 2)(by ind. hyp.)

=1

n+ 1

(

n+1

n+ 2

)

=1

n+ 1

(

n2 + 2n+ 1

n+ 2

)

=1

n+ 1

(

(n+ 1)2

n+ 2

)

=n+ 1

n+ 2

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.

17. (b) Let n0 = 0. Let

T = {n ∈ N :1

2+

2

22+

3

23+ · · · + n

2n= 2 − n+ 2

2n}

(Base step) For n = 1 the left-hand side and the right-hand side bothequal 1/2, so 1 ∈ T .

Page 21: Chapter 1

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

1

2+

2

22+

3

23+ · · · + n

2n= 2 − n+ 2

2n

are true and prove that

1

2+

2

22+

23

3+ · · · + n

2n+n+ 1

2n+1= 2 − (n+ 1) + 2

2n+1

and n+ 1 ≥ n0 are true.

1

2+

2

22+

23

3+ · · · + n

2n+n+ 1

2n+1

=

(

1

2+

2

22+

23

3+ · · · + n

2n

)

+n+ 1

2n+1

= 2 − n+ 2

2n+n+ 1

2n+1(by ind. hyp.)

= 2 − 2n+ 2 − n− 1

2n+1

= 2 − (n+ 1) + 2

2n+1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

19. Prove by induction for all n ≥ 0:

(a) 3 divides n3 + 2n

(b) 5 divides n5 − n

(c) 6 divides n3 − n

(d) 6 divides n3 + 5n

19. (a) Let n0 = 0. Let T = {n ∈ N : 3 | (n3 + 2n)}.(Base step) Since 3|0, we have 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove n+ 1 ∈ T . That is, assumethat n ≥ n0 and that 3 | (n3 + 2n) is true and prove that 3 | ((n + 1)3 +2(n+ 1)) and n+ 1 ≥ n0 are true.

(n+ 1)3 + 2(n+ 1) = n3 + 3n2 + 3n+ 1 + 2n+ 2

= n3 + 3n2 + 5n+ 3

= (n3 + 2n) + (3n2 + 3n+ 3)

Page 22: Chapter 1

By the inductive hypothesis 3|(n3 + 2n). Clearly, 3|(3(n2 + n+ 1)). Since3 divides both terms of the sum, 3 divides the sum. Of course, n+1 ≥ n0.Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

19. (b) Let n0 = 0. Let T = {n ∈ N : 5 | (n5 − n)}.(Base step) Since 5|0, we have 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove n+ 1 ∈ T . That is, assumethat n ≥ n0 and that 5 | (n5 − n) are true and prove that 5 | ((n + 1)5 −(n+ 1)) and n+ 1 ≥ n0 are true.

(n+ 1)5 − (n+ 1) = n5 + 5n4 + 10n3 + 10n2 + 5n+ 1 − n− 1

= n5 + 5n4 + 10n3 + 10n2 + 4n

= (n5 − n) + (5n4 + 10n3 + 10n2 + 5n)

By the inductive hypothesis 5|(n5−n). Clearly, 5|(5n4+10n3+10n2+5n),so 5 divides the sum. Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .

By the Principle of Mathematical Induction, T = N.

19. (c) Let n0 = 0. Let T = {n ∈ N : 6 | (n3 − n)}.(Base step) Since 6|0, we have 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove n+ 1 ∈ T . That is, assumethat n ≥ n0 and that 6 | (n3 − n) are true and prove that 6 | ((n + 1)3 −(n+ 1)) and n+ 1 ≥ n0 are true.

(n+ 1)3 − (n+ 1) = n3 + 3n2 + 3n− n− 1

= (n3 − n) + (3n2 + 3n)

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

19. (d) Let n0 = 0. Let T = {n ∈ N : 6 | (n3 + 5n)}.(Base step) Since 6|0, we have 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove n+ 1 ∈ T . That is, assumethat n ≥ n0 and that 6 | (n3 + 5n) are true and prove that 6 | ((n+ 1)3 +5(n+ 1)) and n+ 1 ≥ n0 are true.

(n+ 1)3 + 5(n+ 1) = n3 + 3n2 + 3n+ 1 + 5n+ 5

= (n3 + 5n) + 3n(n+ 1) + 6

By the inductive hypothesis 6 | (n3 + 5n). Since 2 |n(n+ 1) we have that6 | 3n(n+1), and clearly 6 | 6. Of course, n+1 ≥ n0. Therefore, n+1 ∈ T .By the Principle of Mathematical Induction, T = N.

Page 23: Chapter 1

21. Prove by induction. The sum of the cubes of any three consecutive naturalnumbers is divisible by 9.

21. Let n0 = 0. Let T = {n ∈ N : 9 | (n3 + (n+ 1)3 + (n+ 2)3)}.(Base step) For n = 0, (03 + 13 + 23) = 9. Clearly, 9|9 so 0 ∈ T .(Inductive step) Assume n ∈ T . Now prove n+ 1 ∈ T . That is, assumethat n ≥ n0 and that 9 | (n3 + (n+ 1)3 +(n+2)3) are true and prove that9 | ((n+ 1)3 + (n+ 2)3 + (n+ 3)3) and n+ 1 ≥ n0 are true.

(n+ 1)3 + (n+ 2)3 + (n+ 3)3

= n3 + 3n2 + 3n+ 1 + n3 + 6n2 + 12n+ 8 + n3 + 9n2 + 27n+ 9

= 3n3 + 18n2 + 42n+ 18

= (3n3 + 9n2 + 15n+ 9) + (9n2 + 27n+ 9)

= (n3 + (n+ 1)3 + (n+ 2)3) + (9n2 + 27n+ 9)

By the inductive hypothesis 9|(n3 +(n+1)3 +(n+2)3). Clearly, 9|(9(n2 +3n+1)). Therefore, 9|((n+1)3+(n+2)3+(n+3)3). Of course, n+1 ≥ n0,Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

23. Prove by induction that the following identities are true for the Fibonaccinumbers.

(a)∑n

i=0 F2i+1 = F2n+2 − 1 for n ≥ 0

(b)∑ni=1 F

2i = Fn · Fn+1 − 1 for n ≥ 1

(c)∑ni=0 Fi = Fn+2 − 1 for n ≥ 0

23. (a) Let n0 = 0. Let T = {n ∈ N :∑ni=0 F2i+1 = F2n+2 − 1}.

(Base step) For n = 0 we have F1 = 1 and F2 − 1 = 1. Therefore, 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and that

∑ni=0 F2i+1 = F2n+2 − 1 are true and prove

that n+ 1 ≥ n0 and∑n+1

i=0 F2i+1 = F2n+4 − 1 are true.

n+1∑

i=0

F2i+1 =

n∑

i=0

F2i+1 + F2n+3

= F2n+2 − 1 + F2n+3 (by ind. hyp.)

= F2n+4 − 1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .

By the Principle of Mathematical Induction, T = N.

Page 24: Chapter 1

23. (b) Let n0 = 1. Let T = {n ∈ N : n ≥ 1 and∑n

i=1 F2i = Fn ·Fn+1−1}.

(Base step) For n = 1 we have F 21 = 1 and F1 · F2 − 1 = 1 · 2− 1 = 1, so

1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

∑ni=1 F

2i = Fn ·Fn+1 − 1 are true and prove that

∑n+1i=1 F

2i = Fn+1 · Fn+2 − 1 and n+ 1 ≥ n0 are true.

n+1∑

i=1

F 2i =

(

n∑

i=1

F 2i

)

+ F 2n+1

= Fn · Fn+1 − 1 + F 2n+1 (by ind. hyp.)

= Fn+1(Fn + Fn+1) − 1

= Fn+1 · Fn+2 − 1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N − {0}.23. (c) Let n0 = 0. Let T = {n ∈ N :

∑ni=0 Fi = Fn+2 − 1}.

(Base step) For n = 0 we have F0 = 1 and F2 − 1 = 1, so 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

∑ni=0 Fi = Fn+2 − 1 are true and prove that

∑n+1i=0 Fi = Fn+3 − 1 and n+ 1 ≥ n0 are true.

n+1∑

i=0

Fi =

n∑

i=0

Fi + Fn+1

= Fn+2 − 1 + Fn+1 (by ind. hyp.)

= Fn+3 − 1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

25. The Lucas numbers are defined as L0 = 2, L1 = 1, and Ln = Ln−1+Ln−2

for n ≥ 2. Prove the following identities for Lucas numbers.

(a) L1 + L2 + · · · + Ln = Ln+2 − 3 for n ≥ 1

(b) L21 + L2

2 + L23 + · · · + L2

n = Ln · Ln+1 − 2 for n ≥ 2

(c) L2 + L4 + · · · + L2n = L2n+1 − 1 for n ≥ 2

25. (a) Let n0 = 1. Let

T = {n ∈ N : n ≥ 1 and L1 + L2 + · · · + Ln = Ln+2 − 3}

(Base step) For n = 1 both the left-hand side and the right-hand sideequal 1, so 1 ∈ T .

Page 25: Chapter 1

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

L1 + L2 + · · · + Ln = Ln+2 − 3

are true and prove that

L1 + L2 + · · · + Ln + Ln+1 = Ln+3 − 3

and n+ 1 ≥ n0 are true.

L1 + L2 + · · · + Ln + Ln+1 = (L1 + L2 + · · · + Ln) + Ln+1

= Ln+2 − 3 + Ln+1 (by ind. hyp.)

= Ln+3 − 3

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.25. (b) Let n0 = 2. Let

T = {n ∈ N : n ≥ 2 and L21 + L2

2 + L23 + · · · + L2

n = Ln · Ln+1 − 2}

(Base step) For n = 2 both the left-hand side and the right-hand sideequal 10. Therefore, 2 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and L2

1 +L22 +L2

3 + · · ·+L2n = Ln ·Ln+1 − 2 are true

and prove that L21 + L2

2 + L23 + · · · + L2

n + L2n+1 = Ln+1 · Ln+2 − 2 and

n+ 1 ≥ n0 are true.

L21 + L2

2 + L23 + · · · + L2

n + L2n+1 = (L2

1 + L22 + L2

3 + · · · + L2n) + L2

n+1

= Ln · Ln+1 − 2 + L2n+1 (by ind. hyp.)

= Ln+1(Ln + Ln+1) − 2

= Ln+1 · Ln+2 − 2

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 2}.25. (c) Let n0 = 1. Let

T = {n ∈ N : n ≥ 1 and L2 + L4 + · · · + L2·n = L2·n+1 − 1}.

(Base step) For n = 1 both the left-hand side and the right-hand sideequal 3.

Page 26: Chapter 1

(Inductive step) Choose n such that n ≥ n0 and assume n ∈ T . Nowprove that n+1 ∈ T . That is, assume that L2+L4+ · · ·+L2n = L2n+1−1and prove that L2 + L4 + · · · + L2n + L2(n+1) = L2n+3 − 1.

L2 + L4 + · · · + L2n + L2(n+1) = (L2 + L4 + · · · + L2n) + L2(n+1)

= L2n+1 − 1 + L2(n+1)

= L2n+1 − 1 + L2n+2

= L2n+3 − 1

Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.

27. Find a rational number representing each of the following repeating deci-mals.

(a) 0.537537537537537537537537537.. .

(b) 31.25469696969696969696969.. .

27. (a)537

999

27. (b)3094215

99000

29. (a) Prove by induction that 2n > n for n ≥ 0.

(b) Prove that 2n > n directly from Theorem 2 in Section 1.7.4 withoutexplicit use of induction. (That is, Theorem 2 in Section 1.7.4 itself wasproved using induction, but you should not have to do any additionalinduction.)

(c) Prove by induction that 2n > n3 for n ≥ 10.

29. (a) Let n0 = 0. Let T = {n ∈ N : 2n > n}.(Base step) 20 = 1 > 0 so 0 ∈ T .(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume n ≥ n0 and 2n > n are true and prove that 2n+1 > n + 1 andn+ 1 ≥ n0 are true.

2n+1 = 2n + 2n

≥ 2n + 1 for n ≥ 0

> n+ 1 (by ind. hyp.)

Page 27: Chapter 1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

29. (b) Theorem 2 says that for any n ∈ N there are 2n subsets in thepower set of a set with n elements. Since each element of the set canbe considered as a singleton subset and consequently one of the subsets,the number of singleton subsets is less than the number of subsets. (Theempty set is a subset, but does not arise as a singleton subset.)Therefore,n < 2n.

29. (c) Let n0 = 10. Let

T = {n ∈ N : n ≥ 10 and 2n > n3}.

(Base step) Let n0 = 10. Clearly 1024 > 1000. Hence, 10 ∈ T .

(Inductive step) Assume n ∈ T . We assume that n ≥ n0 and 2n > n3

are true and we must prove 2n+1 > (n+ 1)3 or n+ 1 ∈ T and n+ 1 ≥ n0

are true.

2n+1 = 2 · 2n> (1 + 1/10)3 · 2n≥ (1 + 1/n)3 · 2n> ((n+ 1)/n)3 · n3

= (n+ 1)3

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 10}.

31. Let T = {n ∈ N : sin (n · π) = 0}. Prove that T = N. (Hint: sin(a+ b) =sin(a) · cos(b) + cos(a) · sin(b).)

31. Let n0 = 0. Let T = {n ∈ N : sin(n · π) = 0}.(Base step) sin( 0 · π) = 0. Therefore, 0 ∈ T .(Inductive step) Assume that n ∈ T . That is, assume that n ≥ n0 andsin(n · π) = 0 are true and prove that sin((n+ 1) · π) = 0 and n+ 1 ≥ n0

are true.

sin ((n+ 1)π) = sin(nπ + π) = sin(nπ)cos(π) + cos(nπ)sin(π) = 0

Of course, n+ 1 ≥ n0. Therefore n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

Page 28: Chapter 1

33. (a) Suppose you take out a mortgage for A dollars at a monthly interestrate I and a monthly payment P. (To calculate I : if the annual interestrate is 12%, divide by 12 to get a monthly rate of 1%, then replace thepercentage with the decimal fraction 0.01.) Let An denote the amountyou have left to pay off after n months. So, A0 = A by definition. At theend of each month, you are first charged interest on all the money youowed during the month and then your payment is subtracted. So,

An+1 = An(1 + I) − P

Prove by induction that

An =

(

A− P

I

)

(1 + I)n +P

I

(b) Use this to calculate the monthly payment on a 30-year loan of $100,000at 12% interest per year. (Note that the formula is inexact, since moneyis always rounded off to a whole number of cents. The derivation heredoes not do that. We use 12% to make the arithmetic easier. You shouldconsult a local bank to find a current value.)

33. (a) Let n0 = 0. Let

T = {n ∈ N : n ≥ n0 and An = (A− P

I)(1 + I)n +

P

I}

(Base step) For n = 0 the left-hand side and the right-hand side bothequal A0. Therefore, 0 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

An = (A− P

I)(1 + I)n +

P

I

are true and prove that

An+1 = (A− P

I)(1 + I)n+1 +

P

I

and n+ 1 ≥ n0 are true.

An+1 = An(1 + I) − P

= ((A− P

I)(1 + I)n +

P

I)(1 + I) − P

= (A− P

I)(1 + I)n+1 +

P

I+ P − P

= (A− P

I)(1 + I)n+1 +

P

I

Page 29: Chapter 1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = N.

33. (b) The key for part (b) is that after the last payment the amountdue is 0. In this case A360 = 0. The answer will be found by solving for Pin the following expression:

0 = (100000− P/0.01)(0.01)360 + P/0.01

35. Prove Theorem 4 of Section 1.5.4, in full generality. You may use The-orem 3 of Section 1.5.3, because it has already been proven. (Hint: Useinduction on the number of sets.)

35. The proof will be by induction on n the number of sets. Let n0 = 2,and let

T = {n ∈ N : n ≥ 2 and the Principle of Inclusion-Exclusion holds for n sets}

(Base step) The result is true for n = 1, 2, 3 by Theorem 3 of Section1.5.3, so 2 ∈ T .

(Inductive step) Assume n ∈ T and prove that n + 1 ∈ T . That is,assume that n ≥ 2 and that the Principle of Inclusion-Exclusion holds forn sets are true and prove that the Principle of Inclusion-Exclusion holdsfor n+ 1 sets and n+ 1 ≥ n0 are true.

A1 ∪ A2 ∪ · · · ∪ An ∪ An+1 = (A1 ∪ · · · ∪ An) ∪ An+1

Using the result for n = 2 gives

|A1 ∪A2 ∪ · · · ∪ An ∪ An+1 |= |(A1 ∪ A2 ∪ · · · ∪ An ) + An+1

= |A1 ∪ A2 ∪ · · · ∪ An | + |An+1 |− | (A1 ∪ A2 ∪ · · · ∪ An) ∩ An+1 |

but

| (A1 ∪ A2 ∪ · · · ∪ An) ∩ An+1 | =

| (A1 ∩ An+1) ∪ (A2 ∩ An+1) ∪ · · · ∪ (An ∩ An+1) |

Therefore,

|A1 ∪A2 ∪ · · · ∪ An ∪ An+1 | = |A1 ∪ A2 ∪ · · · ∪ An | + |An+1 |− | (A1 ∩ An+1) ∪ (A2 ∩ An+1) ∪ · · · ∪ (An ∩ An+1) |

Page 30: Chapter 1

Two of the three expressions involve the union of n sets so the inductivehypothesis can be applied to each of them. The subscripts shown and

always distinct between or among themselves.

|A1 ∪ A2 ∪ · · · ∪ An | =n∑

i=1

|Ai| −∑

i,j≤n

|Ai ∩ Aj |

+∑

i,j,k≤n

|Ai ∩ Aj ∩ Ak | + · · ·

+ (−1)n−1|A1 ∩ A2 ∩ · · · ∩ An |

and

| (A1 ∩ An+1) ∪ (A2 ∩ An+1) ∪ · · · ∪ (An ∩ An+1) | =n∑

i=1

|Ai ∩ An+1 | −∑

i,j≤n

| (Ai ∩ An+1) ∩ (Aj ∩ An+1) |

+∑

i,j,k≤n

| (Ai ∩ An+1) ∩ (Aj ∩ An+1) ∩ (Ak ∩ An+1) | + · · ·

+ (−1)n−1| (A1 ∩ An+1) ∩ (A2 ∩ An+1) ∩ · · · ∩ (An ∩ An+1) |

Two simplifications. The first is that only one copy of An+1 need appearin the intersections of pairs of sets as generated in the right-hand sideof the second equation above. The second simplification is to recognizethat when only one copy of An+1 appears, two terms combine to form asubsum that can be simplified as follows:

i,j≤n

|Ai ∩ Aj | +n∑

i=1

|Ai ∩ An+1 |

=∑

i,j≤n+1

|Ai ∩ Aj |

Similarly, we have

i,j,k≤n

|Ai ∩ Aj ∩ Ak | +∑

i,j≤n

Ai ∩ Aj ∩ An+1| =∑

i,j,k≤n+1

|Ai ∩ Aj ∩Ak|

and so on. Carrying out the details of these simplifications yields theresult.

Page 31: Chapter 1

37. A common use of induction is to prove various facts that seem to befairly obvious but are otherwise awkward or impossible to prove. Thesefrequently involve expressions with ellipses. Use induction to show that

(a) X ∪ (X1 ∩X2 ∩X3 ∩ · · · ∩Xn) = (X ∪X1)∩ (X ∪X2)∩ · · · ∩ (X ∪Xn).

(b) X ∩ (X1 ∪X2 ∪X3 ∪ · · ·∪Xn) = (X ∩X1)∪ (X ∩X2)∪ · · · ∪ (X ∩Xn).

(c) (X1 ∩X2 ∩ · · · ∩Xn) = X1 ∪X2 ∪ · · · ∪Xn.

(d) (X1 ∪X2 ∪ · · · ∪Xn) = X1 ∩X2 ∩ · · · ∩Xn.

37. (a) Let n0 = 1. Let T = {n ∈ N : n ≥ 1 and X ∪ (X1 ∩X2 ∩X3 · · · ∩Xn) = (X ∪X1) ∩ (X ∪X2) ∩ · · · ∩ (X ∪Xn)}(Base step) For n = 1 the result is obvious, so 1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and X ∪ (X1 ∩X2 ∩X3 · · · ∩Xk) = (X ∪X1) ∩ (X ∪X2) ∩ · · · ∩ (X ∪Xn) are true and prove that

X ∪ (X1 ∩X2 ∩X3 · · · ∩Xn · · · ∩Xn+1) =

(X ∪X1) ∩ (X ∪X2) ∩ · · · ∩ (X ∪Xn) ∩ (X ∪Xn+1)

and n+ 1 ≥ n0 are true.

X ∪ (X1 ∩X2 ∩ · · · ∩Xn ∩Xn+1) =

X ∪ ((X1 ∩X2 ∩ · · · ∩Xn) ∩Xn+1) =

(X ∪ (X1 ∩X2 ∩ · · · ∩Xn)) ∩ (X ∪Xn+1) =

((X ∪X1) ∩ (X ∪X2) ∩ · · · ∩ (X ∪Xn)) ∩ (X ∪Xn+1)

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.

37. (b) Let n0 = 1. Let T = {n ∈ N : n ≥ 1 and X ∩ (X1 ∪X2 ∪X3 ∪ · · · ∪Xn) = (X ∩X1) ∪ (X ∩X2) ∪ · · · ∪ (X ∩Xn)}.

(Base step) The case n = 1 is obvious. Therefore, 1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 andX∩(X1∪X2∪X3∪· · ·∪Xn) = (X∩X1)∪(X∩X2)∪· · ·∪(X∩Xn) are true and prove thatX∩(X1∪X2∪X3∪· · ·∪Xn∪Xn+1) =(X ∩X1) ∪ (X ∩X2) ∪ · · · ∪ (X ∩Xn) ∪ (X ∩Xn+1) and n+ 1 > n0 aretrue.

X ∩ (X1 ∪X2 ∪ · · · ∪Xn ∪Xn+1) =

X ∩ ((X1 ∪X2 ∪ · · · ∪Xn) ∪Xn+1) =

(X ∩ (X1 ∪X2 ∪ · · · ∪Xn)) ∪ (X ∩Xn+1) =

((X ∩X1) ∪ (X ∩X2) ∪ · · · ∪ (X ∩Xn)) ∪ (X ∩Xn+1)

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.

Page 32: Chapter 1

37. (c) Let n0 = 1. Let

T = {n ∈ N : (X1 ∩X2 ∩ · · · ∩Xn) = X1 ∪X2 ∪ · · · ∪Xn}

(Base step) Let n = 1. The proof is obvious. Therefore, 1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

(X1 ∩X2 ∩ · · · ∩Xn) = X1 ∪X2 ∪ · · · ∪Xn

are true and prove that

(X1 ∩X2 ∩ · · · ∩Xn ∩Xn+1) = X1 ∪X2 ∪ · · · ∪Xn ∪Xn+1

and n+ 1 ≥ n0 are true.

X1 ∩X2 ∩ · · · ∩Xn ∩Xn+1 =

(X1 ∩X2 ∩ · · · ∩Xn) ∩Xn+1 =

(X1 ∩X2 ∩ · · · ∩Xn) ∪Xn+1 =

X1 ∪X2 ∪ · · · ∪Xn ∪Xn+1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n ∈ N : n ≥ 1}.

37. (d) Let n0 = 1. Let

T = {n ∈ N : (X1 ∪X2 ∪ · · · ∪Xn) = X1 ∩X2 ∩ · · · ∩Xn}

(Base step) The case n = 1 is obvious. Therefore, 1 ∈ T .

(Inductive step) Assume n ∈ T . Now prove that n + 1 ∈ T . That is,assume that n ≥ n0 and

(X1 ∪X2 ∪ · · · ∪Xn) = X1 ∩X2 ∩ · · · ∩Xn

are true and prove that

(X1 ∪X2 ∪ · · · ∪Xn ∪Xn+1) = X1 ∩X2 ∩ · · · ∩Xn ∩Xn+1

and n+ 1 ≥ n0 are true.

X1 ∪X2 ∪ · · · ∪Xn ∪Xn+1 =

(X1 ∪X2 ∪ · · · ∪Xn) ∪Xn+1 =

(X1 ∪X2 ∪ · · · ∪Xn) ∩Xn+1 =

X1 ∩X2 ∩ · · · ∩Xn ∩Xn+1

Of course, n+ 1 ≥ n0. Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction, T = {n : n ≥ 1}.

Page 33: Chapter 1

39. Refer to the Square Root II algorithm.

(a) Complete the proof of Theorem 5.

(b) Show that εn+1 = −ε2n/(2Rn). (Hint: Simplify√

17−(Rn+(17/Rn))/2.)

(c) How close do you think the value printed is to the actual value of√

17?Approximately how many decimal digits accuracy is that?

39. (a) Solution Required

39. (b)

εn+1 =√

17 −Rn+1

=√

17 −Rn + 17

Rn

2

=√

17 − R2n + 17

2Rn

=2√

17Rn −R2n − 17

2Rn

= − (Rn − 17)2

2Rn

= − ε2n2Rn

39. (c) The problem is asking for an upper bound on | ε8 |. By part (b),

| ε8 | < (1

2)6·2

8−3 = (1

2)1533

Thus log10(| ε8 |) is approximately −461.5. So, the approximation is cor-rect to at least 461 decimal places past the decimal point. (Of course, ifyou calculate this on the computer, you probably won’t get 461 decimalplaces of accuracy. The problem is round-off error. Normally, a com-puter rounds off each real number, producing round-off errors. So, thereis a programming-language induced limit on the accuracy of your answer.Also, as calculations are made with rounded-off numbers, the round-offerrors may increase.) Note that this does not mean that if you printout the number, the first 461 decimal places are accurate. For example,0.99999, as an approximation to 1.00000, is accurate to 4 decimal places,but the actual digits in all those decimal places are different from those of1.0000. . . .

As before, let Rn denote the value of Root after the loop has been executedn times. Let εn =

√17 −Rn, the error in the calculation.

Page 34: Chapter 1

41. Using the Principle of Mathematical Induction, prove the following formsof the Principle of Mathematical Induction:

(a) Induction with a possibly negative starting point: Suppose that S ⊆ Z,that some integer n0 ∈ S, and that, for every n ∈ Z, if n ∈ S and n ≥ n0,then n+ 1 ∈ S. Then, every integer n ≥ n0 is in S.

(b) Induction downward: Suppose that S ⊆ Z, that some integer n0 ∈ S,and that, for every n ∈ Z, if n ∈ S and n ≤ n0, then n− 1 ∈ S. Then, forevery integer n ≤ n0, we have n ∈ S.

(c) Finite induction upward: Let n0, n1 ∈ Z, n0 ≤ n1. Suppose thatS ⊆ Z, that n0 ∈ S, and that for every n ∈ Z, if n ∈ S and n0 ≤ n ≤ n1,then n+ 1 ∈ S. Then, every integer n where n0 ≤ n ≤ n1 is in S.

(d) Suppose S ⊆ N is infinite, and suppose that for every n ∈ N, ifn+ 1 ∈ S, then n ∈ S. Prove that S = N.

41. (a) et S′ = {n ∈ N : n0 + n ∈ S}. First prove by induction on thatS′ = N.

(Base step) Since n0 ∈ S, 0 ∈ S′. Suppose k ∈ S′. So n0 + k ∈ S.

(Inductive step) By the assumption of the problem, n0 + k + 1 ∈ S.Hence, k+1 ∈ S′. So, by the principle of mathematical induction, S ′ = N.

Now prove that every integer n ≥ n0 is in S. Pick any such n. Sincen ≥ n0, n− n0 ∈ N. Hence, by the paragraph above, n− n0 ∈ S′. So, bydefinition of S′, n ∈ S.

41. (b) Let S′ = {n ∈ N : n0 − n ∈ S}. The proof is now analogous tothat in part (a).

41. (c) Let S′ = {n ∈ N : n0 + n ∈ S or n0 + n > n1}. The proof isnow analogous to that of part (a), with separate cases depending uponwhether n0 + n ≤ n1 or n0 + n > n1.

41. (d) Let n ∈ N. Then some n′ ≥ n ∈ S, for otherwise S ⊆ {0, 1, . . . , n−1}, and S would be finite. Let k = n′ − n.

Now letS′ = {m ∈ N : m > n′ or n′ −m ∈ S}

Prove, analogously to part (a), that S ′ = N. Then k ∈ S′, so n ∈ S.

Page 35: Chapter 1

1.11 Exercises

Assume all variables not given an explicit domain are elements of N.

1. The terms of a sequence are given recursively as a0 = 2, a1 = 6, andan = 2 an−1 +3 an−2 for n ≥ 2. Find the first eight terms of this sequence.

1.

n an

0 21 62 183 544 1625 4866 14587 4374

3. The terms of a sequence are given recursively as a0 = 0, a1 = 4, andan = 8 an−1−16 an−2 for n ≥ 2. Find the first eight terms of this sequence.

3.

n an0 01 42 323 1924 10245 51206 24,5767 114,688

5. The terms of a sequence are given recursively as p0 = 1, p1 = 2, andpn = 2 pn−1−pn−2 for n ≥ 2. Write out the information that the inductivestep assumes and what the step must prove in proving bn = 2 · 3n is aclosed form for the sequence. Suppose n0 = 0 is given and the base casesare 0 and 1.

5. There are two base cases. Let n > n0 + 1 so that n is not a base caseand assume that for all k such that n0 ≤ k < n that k ∈ T . That is, foreach such k, bk = 2 · 3k is a closed form for pk. Now prove that n ∈ T .That is, bn = 2 · 3n is a closed form for pn = 2pn−1 − pn−2.

7. The terms of a sequence are given recursively as a0 = 0, a1 = 4, andan = 8 an−1 − 16 an−2 for n ≥ 2. Write out the information that theinductive step assumes and what the step must prove in proving bn = n 4n

is a closed form for the sequence. Suppose n0 = 0 and the base cases are0 and 1.

7. There are two base cases. Let n > n0+1 so that n is not a base case andassume that for all k such that n0 ≤ k < n that k ∈ T . That is, for eachsuch k, bk = k · 4k is a closed form for ak = 8ak−1 − 16ak−2. Now provethat n ∈ T . That is, bn = n · 4n is a closed form for an = 8an−1 − 16an−2.

Page 36: Chapter 1

9. Given that bn−1 = 2n+1 − 1 and bn−2 = 2n − 1, prove that if bn =3bn−1 − 2bn−2, then bn = 2n+2 − 1 provided n ≥ 2.

9.

bn = 3bn−1 − 2bn−2

= 3(2n+1 − 1) − 2(2n − 1) (by ind. hyp.)

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

= 2 · 2n+1 − 1

= 2n+2 − 1

11. The terms of a sequence are given recursively as a0 = 2, a1 = 6, andan = 2an−1 + 3an−2 for n ≥ 2. Prove by induction that bn = 2 · 3n is aclosed form for the sequence.

11. Let n0 = 0. Let T = {n ∈ N : an = 2 · 3n gives the nth term of thesequence}.(Base step) b0 = 2 and b1 = 6. Since a0 = b0 and a1 = b1, we have0, 1 ∈ T .(Inductive step) Now let n > n0 + 1 so that n is not a base case andassume for all k such that n0 ≤ k < n we have k ∈ T . Prove n ∈ T .

an = 2 an−1 + 3 an−2

= 2 (2 · 3n−1) + 3 (2 · 3n−2) (by ind. hyp.)

= 4 · 3n−1 + 2 · 3n−1

= 6 · 3n−1 = 2 · 3n

Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T = N.

13. The terms of a sequence are given recursively as a0 = 0, a1 = 4, andan = 8an−1 − 16an−2 for n ≥ 2. Prove by induction that bn = n 4n is aclosed form for the sequence.

13. Let n0 = 0. There are two base cases. Let T = {n ∈ N : an = n 4n

gives the nth term of the sequence}.(Base step) b0 = 0 and b1 = 4. Since a0 = b0 and a1 = b1, we have0, 1 ∈ T .(Inductive step) Now, let n > n0 + 1 so that n is not a base case andassume for all k such that 1 ≤ k < n that k ∈ T . Prove n ∈ T .

an = 8 an−1 − 16 an−2

= 8 ((n− 1) 4n−1) − 16 ((n− 2) 4n−2) (by ind. hyp.)

= 8n 4n−1 − 16n 4n−2 − 8 4n−1 + 32 4n−2

= 2n 4n − n 4n − 2 4n + 2 4n

= n 4n

Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T = N.

Page 37: Chapter 1

15. (a) Prove that with just 3-cent and 5-cent stamps, you can make anyamount of postage (any natural number of cents) except 1 cent, 2 cents, 4cents, and 7 cents. (Hint: That you can make 0-cent postage is obvious.You need to prove two things: (i) that you can assemble any amountof postage except 1 cent, 2 cents, 4 cents, and 7 cents, and (ii) that youcannot assemble these four amounts. Be careful about whether you use the

Principle of Mathematical Induction or the Strong Form of MathematicalInduction.)

(b) What amounts of postage can be assembled with 4-cent and 7-centstamps only?

(c) What amounts of postage can be assembled with 8-cent and 10-centstamps only?

(d) What amounts of postage can be assembled with 7-cent, 8-cent, and10-cent stamps only?

(e) What amounts of postage can be assembled with 2-cent and 5-centstamps only?

15. (a) It is obvious that no sum of 3’s and 5’s can equal 1, 2, 4, or 7. Itis obvious that 8, 9, 10, 11, and 12 are possible. Let n0 = 8. There arethree base cases. Let T = {n ∈ N : you can make any amount of postagegreater than or equal 8 cents with only 3 and 5 cent stamps.}(Base step) It is clear that 8, 9, 10 ∈ T .(Inductive step) Choose n such that n > n0 + 2 = 10 so that it is not abase case and assume for all k such that 7 ≤ k < n that k ∈ T . We mustnow prove that n ∈ T . Use the inductive hypothesis for n−3 and add onemore 3 cent stamp. Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T ⊇ {n ∈ N : n ≥8}. Adding the other known initial cases gives T = {n ∈ N : n =3, 5, 6, or n ≥ 8}.

15. (b) It is obvious that no sum of 4’s and 7’s can equal 1, 2, 3, 5, 6, 9,10, 13, 17. It is obvious that 18, 19, 20, and 21 are possible. Let n0 = 18.Let T = {n : you can make any amount of postage greater than or equal18 cents with only 4 and 7 cent stamps.}(Base step) It is clear that 18, 19, 20, and 21 ∈ T .(Inductive step) Choose n such that 21 = n0 + 3 < n so that n is not abase case and assume for all k such that n0 ≤ k < n that k ∈ T . We mustnow prove that n ∈ T . Use the inductive hypothesis for n − 4 cents andadd one more 4 cent stamp. Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T ⊇ {n ∈ N : n ≥ 18}.Adding the other initial cases gives

T = {n ∈ N : n = 4, 7, 8, 11, 12, 14, 15, 16, or n ≥ 18}

15. (c) It is clear that no odd amount of postage can be made with 8 and10. It is easy to show that the even numbers 2, 4, 6, 12, 14, and 22 cannotbe formed as a sum of 8’s and 10’s.

Page 38: Chapter 1

Let n0 = 12. Let T = {n ∈ N : n ≥ 12 and 2 · n can be formed as a sumof 8’s and 10’s}.(Base step) Clearly, 12, 13, 14, 15 ∈ T .

(Inductive step) Choose n such that n ≥ 12 and 15 = n0 +3 < n so thatn is not a base case and assume for all integers k such that n0 ≤ k < nthat k ∈ T . We must now prove that n ∈ T . Consider 2 · n − 4. Since24 ≤ 2 ·n−8 < 2 ·n since 2 ·n−8 is even and (n−4) ≥ n0, by the inductivehypothesis there is a solution for 2(n− 4). Use this solution together withan additional 8 cent stamp to find a solution for 2 · n. Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T = {n ∈ N : n ≥ 12}.Combining this with some small cases T = {n : n ≥ 12} ∪ {4, 5, 8, 9, 10}.15. (d) It is obvious that no sum of 7’s, 8’s, and 10’s can equal 1, 2, 3, 4,5, 6, 9, 11, 12, 13, or 19. It obvious that 7, 8, 10, 14, 15, 16, 17, 18, 20,21, 22, 23, 24, 25, 26, and 27 are possible. Let n0 = 20. There are 7 basecases. Let T = {n ∈ N : n and n ≥ 20 and n can be formed as a sum of7’s, 8’s and 10’s}.(Base step) Clearly, 20, 21, 22, 23, 24, 25, and 26 ∈ T .(Inductive step) Choose n such that 26 = n0 + 6 ≤ n so that n is not abase case and assume for all integers k such that n0 ≤ k < n that k ∈ T .We must now prove that n ∈ T . Consider n − 7. Since 20 ≤ n − 7 < n,by the inductive hypothesis there is a solution for n− 7. Use this solutiontogether with an additional 7 cent stamp to find a solution for n. Therefore,n ∈ T .By the Strong Form of Mathematical Induction, T = {n ∈ N : n ≥20}. Combining this with the other initial cases T = {n ∈ N : n =7, 8, 10, 14, 15, 16, 17, 18 or n ≥ 20}.15. (e) It is obvious that no sum of 2’s and 5’s can equal 1 or 3. It obviousthat 2, 4, 5, and 6 are possible. Let n0 = 4. There are two base cases.Let T = {n ∈ N : n ≥ 4 and n can be formed as a sum of 2’s and 5’s}.(Base step) Clearly, 4, 5 ∈ T .(Inductive step) Choose n such that 5 = n0 + 1 < n so that n is not abase case and assume for all integers k such that n0 ≤ k < n that k ∈ T .We must now prove that n ∈ T . Consider n−2. Since 4 ≤ n−2 < n, by theinductive hypothesis there is a solution for n−2. Use this solution togetherwith an additional 2 cent stamp to find a solution for n. Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T = {n ∈ N : n ≥ 4}.Combining this with some small case gives T = {n ∈ N : n = 2 or n ≥ 4}.

17. Prove that Fn+m = Fn · Fm + Fm−1 · Fn−1 for m ≥ 1. Prove thefollowing corollaries:

(a) Fn−1 |F2n−1

(b) Fn−1 |F3n−1

Page 39: Chapter 1

(c) F 2n + F 2

n+1 is a Fibonacci number

17. Fix n. Let n0 = 1. There are two base cases. Let T = {m ∈ N :Fn+m = Fn · Fm + Fn−1 · Fm−1 and m ≥ 1}.(Base step) m = 1. The lhs is Fn+1. The rhs is Fn ·F1+Fn−1 ·F0 = Fn+1.For m = 2 the lhs is Fn+2. For the rhs

Fn · F2 + Fn−1 · F1 = 2Fn + Fn−1 = Fn + Fn+1 = Fn+2

Therefore, 1, 2 ∈ T .

(Inductive step) Choose m such that 2 = n0 + 1 < m so that n is nota base case and assume for all k such that n0 ≤ k < m that k ∈ T . Nowprove that m ∈ T .

Fn+m = Fn+m−1 + Fn+m−2

= FnFm−1 + Fn−1Fm−2 + FnFm−2 + Fn−1Fm−3 (ind. hyp.)

= Fn(Fm−1 + Fm−2) + Fn−1(Fm−2 + Fm−3) collecting terms)

= FnFm + Fn−1Fm−1 (using Fibonacci relation)

Therefore, m ∈ T .By the Strong Form of Mathematical Induction, T = N − {0}.17. (a) F2n−1 = Fn−1(Fn + Fn−2)

17. (b) F3n−1 = F2n−1Fn+F2n−2Fn−1. By part (a) the conclusion follows.

17. (c) Fn+n = F 2n + F 2

n−1

19. The Lucas numbers are defined as L0 = 2, L1 = 1, and Ln = Ln−1 +Ln−2

for n ≥ 2. Prove that Ln+1 = Fn−1 + Fn+1 for n ≥ 2.

19. Let n = 2. There are two base cases. Let T = {n : n ≥ 2 and Ln =Fn−1 + Fn+1}.(Base step) For n = 2 we have the lhs and the rhs equaling three. Forn = 3 we have

L3 = L2 + L1 = F1 + F3 + 1 = 4

Therefore, 2, 3 ∈ T .

(Inductive step) Choose n such that 3 = n0 + 1 < n so that n is nota base case and assume for all k such that n0 ≤ k < n that k ∈ T . Nowprove that n ∈ T . That is, prove that Ln = Fn−1 + Fn+1 is true.

Ln+1 = Ln + Ln−1

= Fn−1 + Fn+1 + Fn−2 + Fn (ind. hyp.)

= Fn + Fn+2

Therefore, n ∈ T .By the Strong Form of Mathematical Induction, T = {n ∈ N : n ≥ 2}.

Page 40: Chapter 1

21. What exactly is wrong with the following “proof” that for every real num-ber x ≥ 0, x = 2x.

Suppose the result is true for all real numbers y where 0 ≤ y < x.

Case 1: x = 0. Then, 2x = 2 · 0 = 0 = x.

Case 2: x > 0. Then, 0 < x/2 < x. So, by hypothesis, x/2 = 2(x/2) = x.Doubling both sides, deduce that x = 2x. So, the result holds for everyreal number x ≥ 0 by the Strong Form of Mathematical Induction.

21. Both forms of the Principle of Mathematical Induction refer to sets ofintegers, not sets of reals. This exercise demonstrates that the analogousprinciple for real numbers is false.

23. The Binary Search of Phone Directory algorithm in Section 1.10.4 looks forany page (if any) containing a Name in a telephone book City. The portionof the algorithm used in searching for the page is called BinarySearch.Prove that the algorithm works correctly.

23 See the discussion in Chapter 9.

1.12 End of Chapter Materials

Starting to Review

1. Which of the following set descriptions gives the set {2, 8, 14, 20, 26, 32}?(a) {n ∈ N : n = 2x+ 6 for some integer x such that 1 ≤ x ≤ 6}(b) {n ∈ N : n = 6x+ 2 for some integer x such that 1 ≤ x ≤ 6}(c) {n ∈ N : n = 6x+ 2 for some integer x such that 0 ≤ x < 6}(d) None of the above

1. c

3. What is the contrapositive of the statement “If the sun is shining, then itis time to go outside.”

(a) If the sun is shining, then it is not time to go outside.

(b) If it is time to go outside, then the sun is shining.

(c) If it is not time to go outside, then the sun is not shining.

(d) None of the above

3. c

Page 41: Chapter 1

5. Describe each of the following sets in the format {x : property of x}.(a) A = {0, 2, 4, 6, 8, . . . }(b) B = { 1, 2, 5, 10, 17, 26, 37, 50 , . . . }(c) C = {1, 5, 9, 13, 17, 21, . . . }(d) D ={ 1, 1/2, 1/3, 1/4, 1/5, . . . }(e) E = {lemon, lime, 1, 3, 5, 7, . . . }5. (a) {2j : j ∈ N}5. (b) a1 = 1 and an = an−1 + 2n− 1 for n ≥ 1 and n ∈ N

5. (c) {1 + 4i : i ∈ N}5. (d) {1/i : i ∈ N and i ≥ 1}5. (e) {lemon, lime} ∪{j ∈ N : j = 1 + 2(i− 1), where i ∈ N}

7. List the subsets of each of the following sets:

(a) A = {1, 2, 3}(b) B = {1, {2, 3}}(c) C = {{1, 2, 3}}7. (a) {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}, ∅7. (b) {1}, {{2, 3}}, {1, {2, 3}}, ∅7. (c) ∅, {{1, 2, 3}}

9. List the first eight terms of the sequence defined as c0 = 1, c1 = 3, and cn =cn−1 + 2cn−2 for n ≥ 2.

9. 1, 3, 5, 11, 21, 43, 85, 171

Review Questions

1. Let A = {1, 2, 4, 7, 8}, B = {1, 4, 5, 7, 9}, and C = {3, 7, 8, 9}. LetU = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find set expressions using these setsand the operations of union, intersection, absolute difference, and relativedifference to represent the following sets:

(a) {2, 7, 9}(b) {3, 5, 6, 7, 9, 10}1. (a) (A ∩ B ∩ C) ∪ (A ∩ B ∩ C) ∪ (B ∩ C)

1. (b) A ∪ (B ∩ C)

Page 42: Chapter 1

3. For sets A and B, prove that A ∪ (B −A) = A ∪ B.3.

x ∈ A ∪ (B −A) ⇔ x ∈ A or x ∈ (B −A)

⇔ x ∈ A or (x ∈ B and x 6∈ A)

⇔ (x ∈ A or x ∈ B) and (x ∈ A or x 6∈ A)

⇔ (x ∈ A or x ∈ B) and x ∈ U

⇔ x ∈ A or x ∈ B

⇔ x ∈ A ∪ B

5. Prove by induction that 3 + 11 + · · · + (8n− 5) = 4n2 − n for n ∈ N andn ≥ 1.

5. Let n0 = 1. Let

T = {n : n ≥ 1 and 3 + 11 + · · · + (8n− 5) = 4n2 − n}

(Base step) For n = 1, we have 4n2 − n = 4− 1 = 3. Therefore, 1 ∈ T .

(Inductive step) Assume n ∈ T and prove that n+ 1 ∈ T .

3 + 11 + · · · + 8n− 5 + 8(n+ 1) − 5 = 3 + 11 + · · · + 8n− 5) + 8(n+ 1) − 5

= 4n2 − n+ 8n+ 3

= 4n2 + 8n+ 4

= 4(n2 + 2n+ 1) = (n+ 1)

= 4(n+ 1)2 − (n+ 1)

Therefore, n+ 1 ∈ T .

By the Principle of Mathematical Induction, T = N − {0}.

7. Prove that for every n ∈ N that n3 + n is even.

7. Let n0 = 0. Let T = {n : n ∈ N and n3 + n is even}.(Base step) For n = 0 we have n3 + n = 0, which is even. Therefore,0 ∈ T .

(Inductive step) Assume n ∈ T and prove that n+ 1 ∈ T .

(n+ 1)3 + (n+ 1) = n3 + 3n2 + 3n+ 1 + n+ 1

= (n3 + n) + (3n2 + 3n+ 2)

= (n3 + n) + 3n(n+ 1) + 2

Since the first term is even by the induction hypothesis and the last termis even, it remains to prove that 3n(n+1) is even. This is obvious as withany two consecutive integers one of them is even. Also the product ofan even number and an odd number is an even number so the conclusionholds. Therefore, n+ 1 ∈ T .

By the Principle of Mathematical Induction, T = N.

Page 43: Chapter 1

9. Prove that bn = 5 · 2n + 1 is a closed form for the recursive relationa0 = 6, a1 = 11, and an = 3an−1 − 2an−2 for n ≥ 2.

9. Let n0 = 0. Let T = {n : n ∈ N and 5 · 2n + 1 is a closed form for bn}.(Base step) For n = 0, 1 the condition holds, so 0, 1 ∈ T .(Inductive step) Choose n such that n is not a base case and n ≥ n0.Assume that n0, n0 + 1, . . . , n− 1 ∈ T and prove that n ∈ T .

an = 3an−1 − 2an− 2 def. of An)

= 15 · 2n + 3 − 10 · 2n−1 + −2 ind. hyp.)

= 20 · 2n−1 + 1 (simplifying the algebra)

= 5 · 2n+1 + 1

Therefore, n ∈ T .

By the Strong Form of Mathematical Induction, T = N.

11. The country of Xabob uses currency consisting of coins with values of 3zabots and 5 zabots. If you cannot combine some number of these coinsto pay a bill, the item is free. For what number of zabots are items free?Prove your answer.

11. Find a sum of 3 zabot and 5 zabot coins to total n zabots. Prove byinduction that for all n such that n ≥ 10 that you can make change forn zabots. In addition show that you can make change using just 3 and 5zabot coins for {3, 5, 6, 7}. Show you cannot make change for n = 1, 2, 4,and 7.

13. How many students are in Math 347? From the survey of all the studentsin the course it was found that 43 had taken Econ103, 55 had takenSoci213, 30 had taken Musi111, 8 had taken both Econ103 and Soci213, 13had taken both Econ103 and Musi111, 15 had taken Soci213 and Musi111,and 8 had taken none of the courses. No one had taken all three courses.

13. ECON103 SOCI213

MUSI111

22 328

013

15

2

Page 44: Chapter 1

Using Discrete Mathematics in Computer Science

1. Prove that the Largest Odd Divisor algorithm outputs the largest odddivisor of N for all integers N > 0.

1. If N is odd, the while loop is not entered and N is printed as required.If N is even, N = 2 · l. The first time through the while loop N is replacedby l. Now since l < N the algorithm works correctly for l. Since the largestodd divisor of l is the largest odd divisor of N the algorithm is correct.

3. Consider the Binary Search of Phone Directory algorithm. This algorithmlooks for the page (if any) containing a name Name in a telephone bookCity. The portion of the algorithm used in searching for the page is calledBinarySearch. Prove that the algorithm works correctly.

3. The answer will be found by an induction on the number of pages in adirectory.

Base step If FirstPage = LastPage = 1 then the while loop willbe executed once during which code the Name will be found or oneof FirstPage and LastPage will be decremented so that the conditionFirstPage ≤ LastPage will become false or the Name will be found inwhich case PageFound become TRUE and the loop terminates.

Inductive step Now suppose the algorithm works for all directories with1 < k < N pages. The while loop will be entered with FirstPage ≤LastPage and PageFound = FALSE. If Name is found on MiddlePagethe value of PageFound is changed to TRUE and the loop will terminatewith the correct answer. If Name is not found on MiddlePage, the whileloop adjusts one of the parameters FirstPage and LastPage. Now whenthe while loop condition is tested, the directory to be searched has fewerthan N pages so that the while loop either finds the Name or makes thecondition FirstPage ≤ LastPage FALSE. Once the loop terminates, theremainder of the code prints the correct message.

5. Show by induction on n that for b ∈ N, b ≥ 2,

(b− 1) ·n∑

i=0

bi = bn+1 − 1

Interpret this identity in the context of number representation in the baseb using the standard positional notation. Start by seeing what this meansfor b = 10 and n = 4.

5. This is simply the sum of the geometric series 1 + 10 + 102 + · · ·+ 10n.The answer gives the largest number in base b that can be represented byn digits in that base. For b = 10 and n = 4 we get

9(1 + 10 + 102 + 103 + 104) = 99, 999

This is the largest value for that number of digits as all coefficients in anexpansion are less than or equal to b− 1 = 9.

Page 45: Chapter 1

7. Let X and Y be two lists sorted in nondecreasing order. Suppose that forsome positive integer n, there is a combined total of n numbers in the twolists. Prove that X and Y can be merged into a single list of n numbersin nondecreasing order using at most n− 1 comparisons.

7. The proof will be by induction on n. Let Z be the merged list. LetT = {n : two sorted lists of n elements can be sorted into a sorted mergedlist using at most n− 1 comparisons}.(Base step) If n = 1, then either X or Y must be an empty list. Butthen the list Z, is obtained by making 0 = n−1 comparisons. This provesthe case n = 1. Therefore, 1 ∈ T .

(Inductive step) Now suppose that the conclusion of the theorem holdsfor some positive integer n > 1. Let X and Y consist of n elements andshow n ∈ T . Compare x and y, the first elements of X and Y , respectively.

CASE 1: x ≤ y : Let X ′ be the list obtained by deleting x from X. ThenX ′ and Y are sorted lists containing a total of n elements. So by theinduction hypothesis, X ′ and Y can be merged into a single sorted list Z ′

using at most n − 1 comparisons. Form the list Z by adjoining x to Z ′

as the first element. Then Z is in nondecreasing order because Z ′ is innondecreasing order and x preceded all the other numbers in X and Y .Moreover, Z was formed using 1 comparison to find that x ≤ y and atmost n− 1 comparisons to form list Z ′. Therefore, Z was formed using atmost n comparisons.

Case 2: x > y Delete y from Y to form a list Y ′. Then use the inductionhypothesis as in case 1 to sort X and Y ′ into a list Z ′ using at most k− 1comparisons. The list Z is then obtained by adjoining y to Z ′ as the firstelement. As in case 1, Z is in nondecreasing order and was formed usingat most n comparisons.

Therefore, by the Principle of Mathematical Induction the result is proven.

9. Prove that, at most, n + 1 comparisons are required to determine if aparticular number is in a list of 2n numbers sorted in nondecreasing order.

9. The proof will be by induction on n. Let n0 = 0. Let T = {n : at mostn + 1 comparisons are required to determine if a particular number is ina list of 2n numbers sorted in nondecreasing or order}(Base step) For n = 0, we need to show that at most n0 + 1 = 1 com-parison is required to see if a particular number m is in a list containing20 = 1 number. Since the list contains only one number, clearly only onecomparison is needed to determine if this number is m.

(Inductive step) Choose n such that n ≥ n0 and assume that n ∈ T .That is, assume that at most n+ 1 comparisons are needed to determineif a particular number is present in a sorted list of 2n numbers. Nowprove that n + 1 ∈ T . Suppose that we have a list of 2n+1 numbers in

Page 46: Chapter 1

nondecreasing order. We must show that it is possible to determine if aparticular number m is present in this list using at most (n+1)+1 = n+2comparisons. To do so, we will compare m to the number p in position 2n

of the list.

Case 1: m = p : In this case we need only one comparison to find that mis in the list. Since 1 ≤ n+ 2, the result is true in this case.

Case 2: m < p : Since the list is in nondecreasing order, for m to bepresent in the list it must lie in positions 1 through 2n. But the numbersin positions 1 through 2n are a list of 2n numbers in nondecreasing order.Hence, by the induction hypothesis we can determine if m is present in thislist by using at most n+ 1 comparisons. Therefore, at most 1 + (n+ 1) =n+ 2 comparisons are needed to determine if m is present in the originallist.

Case 3: m > p : Since the list is in nondecreasing order, for m to bepresent in the list it must lie in positions 2n+1 through 2n+1. In this caseat most n+ 2 comparisons are needed to determine if m is in the list.

Therefore, n+ 1 ∈ T .By the Principle of Mathematical Induction T = N.