Docsity

discrete mathematics and computing, Exercises of Computer Science

Toggle sidebar
bg1
1. A Taste of Discrete Mathematics 1.6. Problems
1.6 Problems
Problem 1.1. The parity of an integer is 0 if it is even and 1 if it is odd. Which op erations preserve parity:
(a) Multiplying by an even. (b) Multiplying by an odd. (c) Raising to a positive integer power.
Problem 1.2. What’s wrong with this comparison: Google’s nett worth in 2017, about $700 billion, exceeds the
GDP of many countries, e.g. Argentina’s 2016-GDP was about $550 billion. (Look up nett worth and GDP.)
Problem 1.3. Consider 2-contact ebola on a grid. You have one immunization vaccine.
We show two different immunization scenarios, where you immunize the green square. Show
the final infection in each case and determine which person you prefer to immunize?
How many vaccines are needed to ensure that nobody else gets infected?
Problem 1.4. For the speed-dating problem with 16 people, A,B,...,P and four tables, arrange the rounds so that:
(a) In two rounds, everyone meets 6 people.
(b) In three rounds, everyone meets 9 people.
(c) In four rounds, everyone meets 12 people.
(d) In five rounds, everyone meets 15 people?
Problem 1.5(So cial Golfer Problem). 32 golfers form 8 groups of 4 each week. Each group plays a round of
golf. No two golfers can be in the same group more than once. For how many weeks can this golfing activity go on?
(a) “Prove” that this golfing activity cannot go on for more than 10 weeks.
(b) Try to create a scheduling of players for as many weeks as you can. (10 is possible.)
(c) How is this problem related to the speed-dating problem?
In general you must schedule ggroups of golfers each of size sfor wweeks so that no two golfers meet more than once
in the same group. Given (g, s, w), can it can be done and what is the schedule? This is a hard problem.
Problem 1.6. Students A,...,H form a friendship network (right). To advertise a new smartphone,
you plan to give some students free samples. Here are two models for the spread of phone-adoption.
Model 1 (Weak Majority): People buy a phone if at least as many friends have the phone as don’t.
Model 2 (Strong Majority): People buy a phone if more friends have the phone than don’t
C
A
D
B
E
F
G
H
(a) Use your intuition and determine the most “central” of the people in this friend-network.
(b) If you give a phone only to this central node, who ultimately has a phone in: (i) Model 1 (ii) Model 2?
(c) How many phones must you distribute, and to whom, so that everyone switches to your phone in Model 2?
(d) Repeat part (c), but now you cannot give a phone to the central node.
(A slight change to a model can have a drastic impact on the conclusions. A good model is important.)
Problem 1.7. Five radio stations (red stars) broadcast to different regions, as shown. The FCC
assigns radio-frequencies to stations. Two radio stations with overlapping broadcast regions must
use different radio-frequencies so that the common listners do not hear garbled nonsense.
What is the minimum number of radio-frequencies the government needs?
Discrete math problems are like childhood puzzles. Parity, symmetry and invariance often yield simple solutions.
Problem 1.8. Two players take turns placing identical circular quarters on a circular table. Coins cannot overlap and
must remain on the table. The last person to play wins. Do you want to go first or second? [Hint: symmetry.]
Problem 1.9. A chocolate-bar has 50 squares (5 ×10). How many breaks are necessary to break the bar into its 50
individual squares? You may only break a piece along a straight line from one side to the other. No stacking allowed.
[Hint: Define the invariant ∆ = #pieces −#breaks. What happens to ∆with each break?]
Problem 1.10. A single-elimination tournament has 57 players. Players may receive byes in some rounds. How many
matches are played before a winner is declared? Does it depend on how the tournament is configured? [Hint: Define
the invariant ∆ = #players remaining + #matches played. What happ ens to ∆after a match?]
Problem 1.11. Five pirates must share 100 gold coins. The most senior pirate proposes a division of coins and all
pirates vote. If at least half the pirates agree, the coins are divided as proposed. If not, the proposer is killed and the
process continues with the next most senior pirate. A pirates priority is to stay alive, and then to get as much gold as
possible. What should the senior pirate propose? [Hint: Sometimes it is better to start with a smaller problem.]
11
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download discrete mathematics and computing and more Exercises Computer Science in PDF only on Docsity!

  1. A Taste of Discrete Mathematics 1.6. Problems

1.6 Problems

Problem 1.1. The parity of an integer is 0 if it is even and 1 if it is odd. Which operations preserve parity:

(a) Multiplying by an even. (b) Multiplying by an odd. (c) Raising to a positive integer power.

Problem 1.2. What’s wrong with this comparison: Google’s nett worth in 2017, about $700 billion, exceeds the

GDP of many countries, e.g. Argentina’s 2016-GDP was about $550 billion. (Look up nett worth and GDP.)

Problem 1.3. Consider 2-contact ebola on a grid. You have one immunization vaccine.

We show two different immunization scenarios, where you immunize the green square. Show the final infection in each case and determine which person you prefer to immunize? How many vaccines are needed to ensure that nobody else gets infected?

Problem 1.4. For the speed-dating problem with 16 people, A, B,... , P and four tables, arrange the rounds so that:

(a) In two rounds, everyone meets 6 people. (b) In three rounds, everyone meets 9 people.

(c) In four rounds, everyone meets 12 people. (d) In five rounds, everyone meets 15 people?

Problem 1.5 (Social Golfer Problem). 32 golfers form 8 groups of 4 each week. Each group plays a round of

golf. No two golfers can be in the same group more than once. For how many weeks can this golfing activity go on? (a) “Prove” that this golfing activity cannot go on for more than 10 weeks. (b) Try to create a scheduling of players for as many weeks as you can. (10 is possible.) (c) How is this problem related to the speed-dating problem? In general you must schedule g groups of golfers each of size s for w weeks so that no two golfers meet more than once in the same group. Given (g, s, w), can it can be done and what is the schedule? This is a hard problem.

Problem 1.6. Students A,... , H form a friendship network (right). To advertise a new smartphone,

you plan to give some students free samples. Here are two models for the spread of phone-adoption. Model 1 (Weak Majority): People buy a phone if at least as many friends have the phone as don’t. Model 2 (Strong Majority): People buy a phone if more friends have the phone than don’t

C

A D

B E

F H^ G (a) Use your intuition and determine the most “central” of the people in this friend-network. (b) If you give a phone only to this central node, who ultimately has a phone in: (i) Model 1 (ii) Model 2? (c) How many phones must you distribute, and to whom, so that everyone switches to your phone in Model 2? (d) Repeat part (c), but now you cannot give a phone to the central node. (A slight change to a model can have a drastic impact on the conclusions. A good model is important.)

Problem 1.7. Five radio stations (red stars) broadcast to different regions, as shown. The FCC

assigns radio-frequencies to stations. Two radio stations with overlapping broadcast regions must use different radio-frequencies so that the common listners do not hear garbled nonsense. What is the minimum number of radio-frequencies the government needs?

Discrete math problems are like childhood puzzles. Parity, symmetry and invariance often yield simple solutions.

Problem 1.8. Two players take turns placing identical circular quarters on a circular table. Coins cannot overlap and

must remain on the table. The last person to play wins. Do you want to go first or second? [Hint: symmetry.]

Problem 1.9. A chocolate-bar has 50 squares (5 × 10). How many breaks are necessary to break the bar into its 50

individual squares? You may only break a piece along a straight line from one side to the other. No stacking allowed. [Hint: Define the invariant ∆ = #pieces − #breaks. What happens to ∆ with each break?]

Problem 1.10. A single-elimination tournament has 57 players. Players may receive byes in some rounds. How many

matches are played before a winner is declared? Does it depend on how the tournament is configured? [Hint: Define the invariant ∆ = #players remaining + #matches played. What happens to ∆ after a match?]

Problem 1.11. Five pirates must share 100 gold coins. The most senior pirate proposes a division of coins and all

pirates vote. If at least half the pirates agree, the coins are divided as proposed. If not, the proposer is killed and the process continues with the next most senior pirate. A pirates priority is to stay alive, and then to get as much gold as possible. What should the senior pirate propose? [Hint: Sometimes it is better to start with a smaller problem.]

  1. A Taste of Discrete Mathematics 1.6. Problems

Problem 1.12. Can you color squares of a 9 × 9 grid blue or red so that every square has one opposite color neighbor

(neighbors are left, right, up or down).

Problem 1.13. 57 security guards are positioned so that no two pairs of guards are the same distance apart. Every

guard watches the guard closest to him. Is there an arrangement of the guards so that every guard is being watched?

Problem 1.14. 10 trucks each have 100 gallons of fuel and use 1 gallon of fuel per mile. How far can you deliver a

chest that fits in one truck? (You can transfer the chest and/or fuel from truck to truck.)

Problem 1.15. A camel owner wants to sell his 300 bananas at a market 100 miles away. The camel can carry at

most 100 bananas, but eats a banana for every mile travelled. How many bananas can be sold at the market?

Problem 1.16. Show that fewer than n initial infections cannot infect the whole n × n grid in 2-contact ebola.

[Hint: For a square, define 4-outgoing links (N,S,E,W) to its 4 neighbors. Pretend boundary-squares have neighbors. For an infected square, remove all outgoing links to infected neighbors. Let ∆, the “wavefront” of the infected area, be all remaining outgoing links for infected squares. Can ∆ increase? What is ∆ when all squares are infected?]

Problem 1.17 (Chomp). In the grid of chocolate, if you eat the top-left square, you lose.

Each player takes turns to eat a square plus all the chocolate below it and to the right. We show a possible first move and the chocolate that removed in blue. Do you want to go first or second? [Hint: Either eating the bottom right piece wins or not. If not, what should you do?]

Problem 1.18. A man has a boat which can carry him and one other thing. How can the man get a fox, a chicken

and a bag of corn across the river, if, when unattended, the fox eats the chicken and the chicken eats the corn.

Problem 1.19. Tasks involving covering an area using different shaped tiles are a treasure trove of interesting puzzles.

(a) Remove the top left and bottom right squares on an 8 × 8 chess board. Can you tile the remaining 62 squares with 31 dominos? [Hint: Show that #black squares − #white squares is an invariant when you place a domino?] (b) On an 8 × 8 chess board, show that if you remove any two squares of different colors, you can tile the remainder of the board with dominos. [Hint: See illustration on the right. We show a path starting from the top-left. You can tile the board by placing dominos along this path. You may assume that the first square removed is white (why?). Show that you can still tile the remaining board along the path.]. (c) On a 8 × 8 chess board, show that if you remove any corner square, you cannot tile the remainder of the board with straight triominos ( ). It is possible to tile the board with triominos after removing one square. Can you identify which squares can be removed (there are 4)? [Hint: See illustration on the right. We have colored the squares on the chess board so that a triomino must cover one square of each color.]. (d) Can you cover a 10 × 10 chessboard with 25 straight tetrominos ( ). If yes, how?

Problem 1.20. There are 13 purple, 15 red and 17 green chameleons. When chameleons of different colors meet they

both transform to the third color. Will all 45 chameleons ever be the same color? [Hint: Consider ∆ = #purple−#red.]

Problem 1.21. A building has 1000 floors. You wish to determine the highest floor from which you can drop an

egg without the egg breaking. If you had 1000 identical eggs, you could drop one from each floor and see which eggs survive. How many egg drop trials do you need if you have: (a) One egg. (b) Two identical eggs.

Problem 1.22. Four boys take 1min, 2min, 7min and 10min to cross a bridge. The bridge only holds two boys at

a time. It is dark and there is only one flashlight, which is needed to cross the bridge. Two boys cross at the speed of the slower boy who holds the flashlight. All four boys must get across the bridge. If the fastest boy acts as chauffeur for the other three, all four can cross in 21 min. Can all four get across the bridge faster?

Problem 1.23. Two consecutive positive numbers n and n + 1 are given to you and a friend. One player gets n

and the other gets n + 1, at random. You look at your number and shout out your opponents number if you know it, otherwise you pass the turn to your opponent. Will this game ever stop?

Problem 1.24. You have a gold chain with 63 links. You would like to cut some links to obtain a set of links of

different sizes. You goal is to be able to represent any number of links from 1 to 63 as a collection of some of your pieces in order to trade. What is the minimum number of links you need to cut to be able to do so?

Problem 1.25. Three ants a, b, c are on the vertices A, B, C of a triangle. Each ant randomly picks one of the other

vertices and walks to it. What are the chances that no ants colide on an edge or at a destination vertex)? What if there are four ants a, b, c, d on the vertices A, B, C, D of a tetrahedron?

  1. A Taste of Discrete Mathematics 1.6. Problems

Problem 1.38. Pick any six kids. Show that either 3 of them know each other or 3 of them do not know each other.

Problem 1.39. Fifteen houses are in a row. A thief robs a house. On each subsequent night, the thief robs a

neighbor of the house robbed the previous night. The thief may backtrack and rob the same house. A policeman can watch any one house per night. Is there a strategy for the policeman to guarantee catching the thief?

Problem 1.40. 5 of 10 coins are showing heads. You can move coins to form two sets, and you can flip over any

coins you wish. How will you guarantee that both sets have the same number of heads showing, blindfolded?

Problem 1.41. Baniaz and her twin kids pass a gumball machine with 2 red, 3 blue and 4 green gumballs. Gumballs

cost 1¢ each and come out randomly. Baniaz buys gumballs until she can give each of her kids one gumball of the same color. In the worst case, how much must Baniaz be willing to spend? What if she had quadruplets instead?

Problem 1.42. Two 1 meter fuses (strings) each burn non-uniformly in 60 sec. How can you measure 45 sec?

Here come hard problems that take you to the boundaries of mathematics and computing.

Problem 1.43 (Collatz/ 3 n + 1 Problem). Given an integer n > 1 , repeat as follows until you reach 1:

n −→

n/ 2 if n is even; 3 n + 1 if n is odd; Example: 6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1. Do you reach 1 for every n? This “simple” problem is unsolved!

Problem 1.44 (Subset Sum). Find two different subsets of this set of one hundred 27-digit numbers, with the

requirement that the numbers in each subset must have the same sum. 1: 5719825393567961346558155629 35: 8794353172213177612939776215 69: 7549684656732941456945632221 2: 5487945882843158696672157984 36: 2989694245827479769152313629 70: 2397876675349971994958579984 3: 4767766531754254874224257763 37: 6117454427987751131467589412 71: 4675844257857378792991889317 4: 1855924359757732125866239784 38: 2761854485919763568442339436 72: 2832515241382937498614676246 5: 4289776424589197647513647977 39: 6884214746997985976433695787 73: 8755442772953263299368382378 6: 7967131961768854889594217186 40: 8671829218381757417536862814 74: 9833662825734624455736638328 7: 2572967277666133789225764888 41: 9431156837244768326468938597 75: 5298671253425423454611152788 8: 1294587141921952639693619381 42: 4788448664674885883585184169 76: 9857512879181186421823417538 9: 4764413635323911361699183586 43: 3624757247737414772711372622 77: 1471226144331341144787865593 10: 1474343641823476922667154474 44: 9361819764286243182121963365 78: 3545439374321661651385735599 11: 2578649763684913163429325833 45: 9893315516156422581529354454 79: 6735367616915626462272211264 12: 5161596985226568681977938754 46: 5913625989853975289562158982 80: 2141665754145475249654938214 13: 2242632698981685551523361879 47: 8313891548569672814692858479 81: 8481747257332513758286947416 14: 7474189614567412367516833398 48: 2265865138518379114874613969 82: 9961217236253576952797397966 15: 6211855673345949471748161445 49: 3477184288963424358211752214 83: 9941237996445827218665222824 16: 4942716233498772219251848674 50: 6321349612522496241515883378 84: 6242177493463484861915865966 17: 5516264359672753836539861178 51: 1796439694824213266958886393 85: 4344843511782912875843632652 18: 5854762719618549417768925747 52: 6366252531759955676944496585 86: 7568842562748136518615117797 19: 5313691171963952518124735471 53: 8545458545636898974365938274 87: 2776621559882146125114473423 20: 6737691754241231469753717635 54: 3362291186211522318566852576 88: 6174299197447843873145457215 21: 4292388614454146728246198812 55: 8464473866375474967347772855 89: 5387584131525787615617563371 22: 4468463715866746258976552344 56: 2892857564355262219965984217 90: 5317693353372572284588242963 23: 2638621731822362373162811879 57: 4296693937661266715382241936 91: 6612142515552593663955966562 24: 1258922263729296589785418839 58: 8634764617265724716389775433 92: 1314928587713292493616625427 25: 4482279727264797827654899397 59: 8415234243182787534123894858 93: 2446827667287451685939173534 26: 8749855322285371162986411895 60: 2267353254454872616182242154 94: 9786693878731984534924558138 27: 1116599457961971796683936952 61: 4689911847578741473186337883 95: 2926718838742634774778713813 28: 3879213273596322735993329751 62: 4428766787964834371794565542 96: 3791426274497596641969142899 29: 9212359131574159657168196759 63: 7146295186764167268433238125 97: 2831727715176299968774951996 30: 3351223183818712673691977472 64: 2273823813572968577469388278 98: 3281287353463725292271916883 31: 8855835322812512868896449976 65: 6686132721336864457635223349 99: 9954744594922386766735519674 32: 4332859486871255922555418653 66: 3161518296576488158997146221 100: 3414339143545324298853248718 33: 2428751582371964453381751663 67: 1917611425739928285147758625 34: 6738481866868951787884276161 68: 3516431537343387135357237754

Problem 1.45 (Verifier for “Hello World”). Write a program in your pet language to solve the this problem.

Input: Any C++^ program F.cpp (an ASCII text file). Output: Yes if: when you compile and run F.cpp, it prints “Hello World”, and eventually stops. No if: when you compile and run F.cpp, the program loops forever or stops without printing “Hello World”. Would you have guessed that a solver for the domino puzzle (Section 1.4) can be used to build a Hello-World-verifier?

  1. Discrete Objects 2.5. Problems

2.5 Problems

Problem 2.1. What is the difference between a Theorem, a Conjecture and an Axiom?

Problem 2.2. List the elements in the following sets (E is the set of even numbers).

(a) A = {n | − 4 ≤ n ≤ 15; n ∈ E}. (b) B = {x | x^2 = 9; x ∈ Z}.

(c) C = {x | x^2 = 6; x ∈ Z}. (d) D = {x | x = x^2 − 1; x ∈ R}.

Problem 2.3. Give formal definitions of these sets using a variable.

(a) A = { 0 , 1 , 4 , 9 , 16 , 25 , 36 ,.. .}. (b) B = { 0 , 4 , 16 , 36 , 64 , 100 ,.. .}.

(c) C = { 1 , 2 , 4 , 7 , 11 , 16 , 22 ,.. .}. (d) D = {... , 18 , 14 , 12 , 1 , 2 , 4 , 8 ,.. .}.

Problem 2.4. On the x–y plane, sketch the points in the sets:

(a) A = {(x, y) | x ∈ [0, 1], y ∈ [0, 1]}. (b) B = {(x, y) | x, y ∈ R, x^2 + y^2 = 1}. (c) C = {(x, y) | x, y ∈ R, x^2 + y^2 ≤ 1 }.

(d) D = {(x, y) | x ≥ 1 , y ∈ R}. (e) E = {(x, x^2 ) | x ∈ R}. (f) F = {(x, x + y) | x ∈ R, y ∈ Z}.

Problem 2.5. Express the shaded region using unions, intersections and complements.

(a) A B

C (b) A B

C (c) A B

C (d) A B

C (e) A B

C (f) A B

C

Problem 2.6. Give two sets A, B for which A 6 ⊆ B and B 6 ⊆ A.

Problem 2.7. Complement depends on the universal set U. Let X = {a, e}. What is X when:

(a) U = {lower case vowels}. (b) U = {lower case letters}

Problem 2.8. True or False: (a) N ⊆ Z (b) N ⊂ Z (c) Z ⊆ Q (d) Z ⊂ Q

Problem 2.9. For each case, find

∞ ∪ i= Ai = A 1 ∪ A 2 ∪ A 3 ∪ · · · and ∞ ∩ i= Ai = A 1 ∩ A 2 ∩ A 3 ∩ · · ·. (a) Ai = {n|n ∈ N, n ≥ i}. (b) Ai = { 0 , i}. (c) Ai = {x|x ∈ R, 0 < x < i}.

Problem 2.10. Let Ai = {(x, y) | x ∈ [0, 1], y ∈ [1/(i + 1), 1 /i]}. On the x–y plane, sketch:

(a) A 1 and A 2. (b) A 1 ∪ A 2. (c) A 1 ∪ A 5. (d) A 1 ∪ A 2 ∪ · · · ∪ An =

n i^ ∪=1 Ai.^ (e)^ A^1 ∪^ A^2 ∪ · · ·^ =^

∞ i=1^ ∪ Ai.

Problem 2.11. Let B = {{a, b}, a, b, c}. List the power set P(B) (it has 16 elements)?

Problem 2.12. List all subsets of {a, b, c, d} that contain c but not d.

Problem 2.13. (a) What are |M ∩ V | and |P(M ∩ V )| for M = {m, a, l, i, k}, V = {a, e, i, o, u}? (b) What is

| N |?

Problem 2.14. |A| = 7 and |B| = 4. What are the possible values for |A ∩ B| and |A ∪ B|?

Problem 2.15. What is the set Z ∩ N ∩ S, where S = {z^2 | z ∈ Z} is the set perfect squares.

Problem 2.16 (Cartesian Product). Let A = { 1 , 2 , 3 } and B = {a, b, c, d}. The Cartesian product A × B is

the set of pairs formed from elements of A and elements of B, A × B = {(a, b) | a ∈ A, b ∈ B}. (a) List the elements in A × B. What is |A × B|? (|X| is the number of elements in X.) (b) List the elements in B × A. What is |B × A|? (c) List the elements in A × A = A^2. What is |A × A|? (d) List the elements in B × B = B^2. What is |B × B|? Generalize the definition of A × B to a Cartesian product of three sets A × B × C.

Problem 2.17. Sketch the Cartesian products R × R = R^2 , R × N, N × R, N × N = N^2. (See Problem 2.16.)

Problem 2.18. List as a set all the 4-bit binary sequences. How many did you get? Now, list all the 4-bit binary

sequences in which 00 does not occur. How many did you get?

  1. Making Precise Statements 3.5. Problems

3.5 Problems

Problem 3.1. Determine t/f. If you think a statement is not a valid proposition, explain why.

(a) “2+7=10.” (b) “There are no wild killer bees in Alaska.” (c) “Miami is not in Florida.” (d) “Where is the train station?”

(e) “ 2 x > 5 .” (f) “ 2 n^ < 100 .” (g) “There is a lot of pollution in Mumbai.” (h) “The answer to this question is f.”

Problem 3.2. True or False: “The function f equals 5?” Explain.

Problem 3.3. True or False: “if God exists, then the square of any real number is non-negative.”. Explain

Problem 3.4. Define the propositions p = “Kilam is a CS major” and q = “Kilam is a hockey player”. Use the

connectors ∧, ∨, ¬ to formulate these claims. (a) Kilam is a hockey player and CS major. (b) Kilam either plays hockey or is a CS major. (c) Kilam plays hockey, but he is not a CS major.

(d) Kilam is neither plays hockey nor is a CS major. (e) Kilam is a CS major or a hockey player, not both. (f) Kilam is not a hockey player, but is a CS major.

Problem 3.5. What is the negation of these statements?

(a) Jan is rich and happy. (b) If Kilam was born yesterday, then pigs fly. (c) Niaz was born yesterday and pigs can’t fly. (d) Kilam’s phone has at least 8GB of RAM.

(e) If Kilam is in pajamas, then all lights are off. (f) Every student is a friend of another student. (g) Some student is a friend of another student. (h) All Kilam’s friends are big and strong.

Problem 3.6. Kilam’s has 2GB of RAM Liamsi has 4GB of RAM. Which propositions are true?

(a) if Kilam has more RAM than Liamsi then pigs fly. (b) if Liamsi has more RAM than Kilam then pigs fly. (c) Kilam has more RAM than Liamsi and pigs fly.

(d) Kilam has more RAM than Liamsi or pigs fly. (e) Liamsi has more RAM than Kilam and pigs fly. (f) Liamsi has more RAM than Kilam or pigs fly.

Problem 3.7. There are 3 spoons, 4 forks and 4 knives. How many utensils are:

(a) Forks or knives. (b) Forks and knives. (c) Neither Forks nor knives.

Problem 3.8. Rewrite each sentence in “if... , then... ” form.

(a) You pass the FOCS-final exam only if you studied this book for at least one week. (b) Attending class is necessary for passing the course. (c) For a quadrilateral to be square, it is sufficient that it have four equal angles. (d) For a quadrilateral to be square, it is necessary that it have four equal sides. (e) A natural number can’t be an odd prime unless it is greater than 2. (f) The giant flies come out whenever it is hot. (g) All roads lead to Rome.

Problem 3.9. If the blind-spot indicator on the wing-mirror of a car lights up, there is car in your blind spot and it’s

not safe to switch lanes. The blind-spot indicator is not lit. Does it mean you can switch lanes or should you look first?

Problem 3.10. Ifar’s parents always told him: “If you don’t eat your peas, you can’t have ice-cream.”

Naturally, Ifar always ate his peas and eagerly expected his ice-cream to come. Are Ifar’s parents obliged to give him ice-cream? What statement did Ifar think he heard, and is that logically equivalent to what his parents actually said.

Problem 3.11. What’s the difference between these marketing slogans? Which is the more impressive claim?

“If you didn’t buy your car from FOCS-Auto, then you paid too much.” “If you bought you car from FOCS-Auto, then you didn’t pay too much.”

Problem 3.12. Trolls are knights who are honest or knaves who are liars. Troll 1 says: “If we are brothers, then we

are knaves.” Troll 2 says: “We are brothers or knaves.” (a) Can both trolls be knights? (b) Can both trolls be knaves?

Problem 3.13. If it rains on a day, it rains the next day. Today it didn’t rain. On which days must there be no rain?

(a) Tommorrow. (b) All future days. (c) Yesterday. (d) All previous days.

  1. Making Precise Statements 3.5. Problems

Problem 3.14. For p = “You’re sick”, q = “You miss the final”, r = “You pass FOCS”. Translate into English:

(a) q → ¬r. (b) (p → ¬r) ∨ (q → ¬r). (c) (p ∧ q) ∨ (¬q ∧ r).

Problem 3.15. Here is a logic puzzle from a pshchology experiment studying how humans perform deductive analysis.

You have before you the cards (only the top is visible). Each card has a number on one side and a letter on the other.

S 5 P T 3 4

Rule: If a card has a P on it, then the other side must be a 5. To verify that the rule is not been broken, which are the fewest cards that you need to turn over, and why?

Problem 3.16. Here is a logic puzzle from a bar setting.

Law: If you are drinking beer, then you must be 21 or older. The bouncer sees 4 people A, B, C, D shown on the right. Which of the following must the bouncer check to ensure the bar abides by the law. (a) A’s age. (b) B’s age. (c) C’s drink. (d) D’s drink.

A is drinking a beer; B is drinking a coke; C is drinking something and looks under 21; D is drinking something and looks over 50.

Problem 3.17. Here’s what we know about Kilam.

1: Kilam eats Italian or French each night. 2: He eats French or wears dress shoes. 3: Whenever he eats Italian and wears a coat, he does not wear a bow tie. 4: He never eats French unless he also wears a coat or dress shoes. 5: If he wears dress shoes, he wears a coat.

(a) Will Kilam ever be without a coat? (b) Today, Kilam was wearing a bow tie. What else did he wear? What did he eat?

Problem 3.18 (Converse, Contrapositive). The converse of an implication p → q is q → p; the contrapositive

is ¬q → ¬p. For each implication, give the converse and contrapositive. (a) If a b and b c are in Z, then a c ∈ Z. (b) x^2 = 1 → x = 1. (c) If x^2 = x + 1, then x = 12 (1 ±

(d) If p > 2 is prime, then p is odd. (e) ab = 0 → a = 0 or b = 0. (f) If n ∈ N ends in 3, then 3 divides n.

(g) For n ∈ Z, 3 n = 9 → n^2 = 9. (h) For n ∈ Z, n^2 > 9 → n > 3. (i) For n ∈ N, n^2 > 9 → n > 3. (j) If n ∈ N is odd then n^2 + n − 2 is even. (k) Every connected graph G has 32 vertices. (l) Honk if you love FOCS. In each case, if you can, determine true or false for the converse and contrapositive (both can be true or false).

Problem 3.19. Mathematically formulate the usual meaning of each sentence using p, q, r.

(a) p : “you will succeed at this job”; q : “you know Java”; r : “you know Python”. Sentence: if you know Java or Python, you will succeed at this job.” (b) p : “you buy a lunch entree”; q : “you can have soup”; r : “you can have salad”. Sentence: if you buy a lunch entree, you can have soup or salad.” (c) p : “you may enter the US”; q : “you have a job”; r : “you have a green-card”. Sentence: if you have a job or green-card, you may enter the US.”

Problem 3.20 (DNF). Use ¬, ∧, ∨ to give compound propositions with these truth-tables. [Hints: Consider only

rows which are t and use or of and’s.] (a) q r t t f t f t f t f f f f

(b) q r t t f t f t f t f f f t

(c) p q r t t t f t t f f t f t f t f f f f t t f f t f t f f t f f f f f

(d) p q r t t t f t t f t t f t f t f f f f t t t f t f t f f t f f f f f (and-or-not formulas use only ¬, ∧, ∨. Any truth-table can be realized by an and-or-not formula. Even more, one can construct an or of and’s, the disjunctive normal form (DNF).)

  1. Making Precise Statements 3.5. Problems

Problem 3.31. Use truth tables to determine logical equivalence of compound statements.

(a) Are (p → q) → r and p → (q → r) (b) (p ∧ ¬q) ∨ q and p ∨ q.

Problem 3.32. Use truth-tables to verify the rules for derivations in Figure 3.1 on page 29. Now use the rules in

Figure 3.1 to show logical equivalence ¬((p ∧ q) ∨ r) eqv ≡ (¬p ∧ ¬r) ∨ (¬q ∧ ¬r).

Problem 3.33. Show that (p → q) ∨ (q → p) is always true for arbitrary statements p, q.

Problem 3.34 (Satisfiability). We list four clauses using the propositions p, q, r, s.

(p ∨ q) (q ∨ r) (r ∨ s) (s ∨ q) Give a truth assignment (t/f) to each of p, q, r, s so that every clause is true, i.e. satisfied.

Problem 3.35. Assign t/f to p, q, r, s to make the compound proposition true (if possible).

(a) (p → q) ∧ (q ↔ ¬p). (b) (p ∨ ¬r) ∧ (r ∧ s) ∧ (¬s ∧ ¬p) ∧ (p ∧ (q → r)). (c) (p ↔ q) → ¬(p → q).

Problem 3.36. Using statements p, q, r, s, we list eight clauses. Each clause is an or of 3 terms, where a term is a

statement or its negation. A proposition appears at most once in a clause. (p ∨ q ∨ r) (q ∨ r ∨ s) (p ∨ q ∨ s) (p ∨ q ∨ r) (p ∨ r ∨ s) (p ∨ q ∨ s) (p ∨ r ∨ s) (p ∨ q ∨ s) (a) Give a truth assignment (t or f) to each of p, q, r, s so that every clause is true (satisfied). (b) Construct eight clauses for which no truth assignment to p, q, r, s can satisfy all eight clauses. (c) Show that it is always possible to satisfy at least 7 of the 8 clauses, no matter how many variables there are, as long as there are exactly three terms in each clause.

Problem 3.37. For the domain of all students, use the predicates S(x) = “x is a student”, I(x) = “x is a smart”

and F (x, y) = “x is a friend of y” to formulate the following statements. (a) Kilam is a student. (b) All students are smart. (c) No student is a friend of Kilam.

(d) Every student is a friend of some other student. (e) There is a student who is a friend of every other student. (f) All smart students have a friend.

Problem 3.38. What is the negation of each statement. You are being asked to “translate” a negation like it is

not the case that(Kilam is a student) into “normal” English. (a) Kilam is a student. (b) All students are smart. (c) No student is a friend of Kilam.

(d) Every student is a friend of some other student. (e) There is a student who is a friend of every other student. (f) All smart students have a friend.

Problem 3.39. Use predicates and connectors to precisely state each interpretation of “Every American has a dream.”

(a) There is a single dream, the “American dream,” and every American has that same special dream. (b) Every American has their own personal dream (possibly a different one for each person). (c) Every American has one (and only one) personal dream (possibly a different one for each person).

Problem 3.40. Give the negation of each claim in sensible English. Start with it is not the case that(·) and

then take the negation inside the quantifiers. (a) There is a constant C for which n^3 ≤ Cn^2 for all n ∈ N. (b) For some x > 0 , there is a constant C for which, for all n ∈ N, n2+x^ ≤ Cn^2.

Problem 3.41. Give the negation of each claim. Simplify your statement so that the negation, ¬, is not to the left

of any quantifier. Determine which of the original statement or the negation is t. (Can both be t? Can neither be t?) (a) ∀x ∈ Z : (∃y ∈ Z : x+2y = 3). (b) ∃x > 0 : (∀y > 0 : xy < x). (c) ∃(x, y) ∈ Z^2 : (x+y = 13)∧(xy = 36).

Problem 3.42. On the Isle-of-FOCS are Saints who always tell the truth and Sinners who always lie.

(a) Two people, A and B, made these statements. Which (if any) of them must be Saints? A: “Exactly one of us is lying.” B: “At least one of us is telling the truth.” (b) Three people, A, B, C, made these statements. Which (if any) of them must be Saints? A: “Exactly one of us speaks the truth.” B: “We are all lying.” C: “The other two are lying.”

Problem 3.43. For x ∈ { 1 , 2 , 3 , 4 , 5 } and y ∈ { 1 , 2 , 3 }, determine t/f with short justifications.

(a) ∃x : x+3 = 10 (b) ∀x : y +3 ≤ 7 (c) ∃x : (∀y : x^2 < y +1) (d) ∀x : (∃y : x^2 +y^2 < 12)

Problem 3.44. For x, y ∈ Z, determine t/f with short justifications.

(a) ∀x : (∃y : x = 5/y) (b) ∀x : (∃y : y^4 − x < 16) (c) ∀x : (∀y : log 2 x 6 = y^3 )

  1. Making Precise Statements 3.5. Problems

Problem 3.45. Let P (x, h) = “Person x has hair h” and M (h) = “Hair h is grey”. Formulate:

(a) Kilam has some grey hair. (b) Someone has all grey hair.

(c) Nobody is bald. (d) Kilam does not have all grey hair.

Problem 3.46. Formulate the appropriate predicates, identify the domain of the predicate and give the “mathematical”

version of the following statements. (a) Every person has at most one job. (b) Kilam has some grey hair. (c) Everyone has some grey hair. (d) Everyone is a friend of someone. (e) All professors consider their students as a friend. (f) No matter what integer you choose, there is always an integer that is larger. (g) Every natural number has a prime factorization. (h) Two courses which have the same student cannot have exam times that overlap. (i) No student has won a TV game-show. (j) There is a soul-mate for everyone. (k) 15 is a multiple of 3. (In your predicate you must define what a multiple is.) (l) 15 is not a multiple of 4. (m) 16 is a perfect square. (In your predicate you must define what a perfect square is.) (n) Every student in FOCS has taken a course in calculus and a course in programming. (o) Every CS-major who graduates has taken FOCS. (p) Between any two rational numbers there is another rational number. (q) Between any rational number and larger irrational number is another irrational number. (r) Between any rational number and larger irrational number is another rational number.

Problem 3.47. Use quantifiers to precisely formulate the associative laws for multiplication and addition and the

distributive law for multiplication over addition.

Problem 3.48. For the predicates F (x)=“x is a freshman” and M (x)=“x is a math major’, translate into English:

(a) ∃x : M (x) (b) ¬∃x : F (x) (c) ∀x : (M (x) → ¬F (x)) (d) ¬∃x : (M (x) ∧ ¬F (x))

Problem 3.49. What is the difference between ∀x : (¬∃y : P (x) → Q(y)) and ¬∃y : (∀x : P (x) → Q(y))?

Problem 3.50. P and Q are predicates. Are these pairs of statements equivalent. Explain.

(a) ∀x : (¬∃y : P (x) → Q(y)) and ¬∃x : (∃y : P (x) → Q(y)). (b) ∀x : (¬∃y : P (x) → Q(y)) and ¬∃y : (∀x : P (x) → Q(y)).

Problem 3.51. Let P (x) and Q(y) be predicates. Verify that these quantified compound propositions are equivalent.

(To show that quantified predicates are equivalent, show that when one is true, the other is true and vice versa.) ∀x : (¬∃y : P (x) → Q(y)) and ¬∃x : (∃y : P (x) → Q(y)).

Problem 3.52. Let P (x) and Q(x) be arbitrary predicates. Prove or disprove:

(a) ∀x : (P (x) ∧ Q(x)) eqv ≡ (∀x : P (x)) ∧ (∀x : Q(x)) (b) ∀x : (P (x) ∨ Q(x)) eqv ≡ (∀x : P (x)) ∨ (∀x : Q(x))

Problem 3.53. Suppose P and Q are predicates taking an input whose domain is D which happens to be an empty

domain. If you can, determine the truth values of: (a) ∀x : P (x) (b) ∃y : P (y) (c) (∀x : P (x)) ∨ (∃y : P (y)) (d) (∀x : P (x)) ∨ P (y)

Problem 3.54. Determine if each quantified compound statement is always true. If no, give a counterexample (specify

the predicate and domain). If yes, explain why. (a) (∃x : P (x)) → (∀x : P (x)) (b) (∀x : P (x)) → (∃x : P (x)).

Problem 3.55. x and y are integers. Answer true or false, explaining your reasoning.

(a) ∀x : (∃y : 2x − y = 0) (b) ∀y : (∃x : 2x − y = 0)

(c) ∃x : (∀y : 2x − y = 0) (d) ∃y : (∀x : 2x − y = 0)

(e) ∃x : (∀y : x 2 y^ = 0) (f) ∃y : (∀x : x 2 y^ = 0)

Problem 3.56. In which (if any) of the domains N, Z, Q, R are these claims t. (x and y can have different domains.)

(a) ∃x : x^2 = 4 (b) ∃x : x^2 = 2 (c) ∀x : (∃y : x^2 = y) (d) ∀y : (∃x : x^2 = y)

  1. Proofs 4.6. Problems

4.6 Problems

Problem 4.1. The six (or seven) “C’s” of a good proof. Explain why each is important.

(a) Correct. (b) Clear.

(c) Complete. (d) Concise.

(e) Continuous (moving forward). (f) Coordinated (well organized). The seventh “C”, which many mathematicians value dearly is Clever (elegant or beautiful).

Problem 4.2. What’s wrong with this proof of “If n is even, then n^2 is even”? What is proved?

1: Suppose n^2 is even. 2: Let n have a prime factorization n = pq 11 pq 22 · · · pq kk. 3: Then, n^2 = p^21 q 1 p^22 q 2 · · · p^2 kq k(each prime appears an even number of times). 4: Since n^2 is even, 2 is a prime factor of (p 1 = 2), so n^2 = 2^2 q^1 p^22 q 2 · · · p^2 kq k, with q 1 > 0. 5: So, n = 2q^1 pq 22 · · · pq kk , with q 1 > 0. 6: That means 2 is a factor of n and, so n is even as claimed.

Problem 4.3. Usinig 0 = 0 and standard algebra, we prove 7 = 7. Which proofs are valid? Why or why not?

(a) 1. 7 = 7

  1. 7 − 7 = 7 − 7
  2. 0 = 0 → 7 = 7 ✓

(b) 1. Assume 7 6 = 7

  1. 7 − 7 6 = 7 − 7
  2. 0 6 = 0 !FISHY → 7 = 7 ✓

(c) 1. 0 = 0

  1. 0 + 7 = 0 + 7
  2. 7 = 7 → 7 = 7 ✓

Problem 4.4. What is wrong with this bad proof that 4 = 7? You know that 0=0.

1: 4 = 7 (what we are trying to prove) 2: 7 = 4 (a = b implies b = a) 3: 4 + 7 = 7 + 4 (a = b and c = d implies a + c = b + d) 4: 4 + 7 − 11 = 7 + 4 − 11 (subtract 11 from both sides) 5: 0 = 0 ✓ (we derived a known fact, hence our first step can’t be wrong)

Problem 4.5. Here are two proofs that 2 = 1. In each case, what went wrong?

(a) Let a = 1 and b = 1. Then, 1: We know a = b. 2: So, 2 a^2 = a^2 + a^2 = a^2 + ab. 3: So, 2 a^2 − 2 ab = a^2 − ab. 4: Or, 2 · (a^2 − ab) = 1 · (a^2 − ab). 5: Dividing by a^2 − ab gives 2 = 1

(b) We use the fact that −2 = − 2. 1: Hence, 4 − 6 = 1 − 3 , 2: So, 4 − 6 + 9/4 = 1 − 3 + 9/ 4. 3: That is, (2 − 3 /2)^2 = (1 − 3 /2)^2. 4: So, 2 − 3 /2 = 1 − 3 / 2. 5: Which means 2 = 1.

Problem 4.6. Determine the true implications. If true, prove it. If false, give a counterexample. H is a set of horses.

[Hint: Consider separately the cases where H has fewer than 11 horses and H has at least 11 horses separately.] (a) if all 10-horse subsets of H have only gray horses, then all 11-horse subsets of H have only gray horses. (b) if some 10-horse subset of H has a black horse, then some 11-horse subset of H has a black horse.

Problem 4.7. Give direct proofs:

(a) x, y ∈ Q → xy ∈ Q. (b) n ∈ Z → n^2 + n is even.

(c) For x, y ∈ Z, x^2 + y^2 is even → x + y is even. (d) For a, b, c ∈ Z, (a divides b and b divides c) → a divides c.

Problem 4.8. Give the contrapositive of each statement.

(a) If p is prime, then p is odd. (b) For n ∈ Z, n/(n + 1) 6 ∈ Z.

(c) If n ∈ N has remainder 2 or 3 when divided by 4, then n is not square. (d) If n ∈ N is composite, then n has a prime divisor that is at most

n.

Problem 4.9. You may assume n is an integer. Give direct and contraposition proofs of:

(a) (n^3 + 5 is odd) → (n is even). (b) (3 does not divide n) → (3 divides n^2 + 2).

Problem 4.10. You may assume n is an integer. Prove by contraposition (explicitly state the contrapositive).

(a) x is irrational →

x is irrational. (b) n^2 + 4n + 2 is even → n is even. (c) 2 n^ − 1 is prime → n is prime. (d) n^3 is odd → n is odd. (e) n^2 is not divisible by 4 → n is odd. (f) If p > 2 is prime, then p is odd. (g) If 2 n^ − n is prime, then n is odd.

(h) For x, y > 0 , y^3 + x^2 y ≤ x^3 + xy^2 → y ≤ x. (i) d doesn’t divide mn → d doesn’t divide m or n. (j) x^5 + 7x^3 + 5x ≥ x^4 + x^2 + 8 → x ≥ 0. (k) 3 divides n − 2 → n is not a perfect square. (l) If p > 2 is prime, then p^2 + 1 is composite. (m) For x, y ∈ Z, x^2 + y^2 is even → x + y is even. (n) If xy is even, then x is even or y is even.

  1. Proofs 4.6. Problems

Problem 4.11. For x, y ∈ N, which statements below are contradictions (cannot possibly be true). Explain.

(a) x^2 < y (b) x^2 = 12 y (c) x^2 − y^2 ≤ 1 (d) x^2 + y^2 ≤ 1 (e) 2 x + 1 = y^2 + 5y (f) x^2 − 12 y^2 = 1 (g) x^2 − y^2 = 1.

Problem 4.12. Prove by contradiction:

(a) 3

2 is irrational. (b)

6 is irrational. (c) log 2 9 is irrational. (d) ∀(x, y) ∈ Z^2 : 9x − 15 y 6 = 2. (e) 3 + 5

2 is irrational. (f) sin x + cos x ≥ 1 , where x ∈ [0, π/2]. (g) There is no q ∈ Q for which q − 1 = 1/q.

(h) (x, y) ∈ Z^2 → x^2 − 4 y − 3 6 = 0. (i) For all real, positive x, y: x + y ≥ 2

xy. (j) ∀(a, b, c) ∈ Z^3 : (a^2 + b^2 = c^2 ) → (a or b is even). (k) For k ∈ N,

k +

k + 1 <

4 k + 2. (l) There are no x, y ∈ Q for which x^2 + y^2 = 3. (m) If 4 kids share 29 toys, someone gets at least 8 toys. (n) Every prime number p ≥ 5 is of the form 6 k ± 1 , where k ∈ N.

Problem 4.13. Prove by contradiction:

(a) For real numbers a and b,

a + b

a

b

, where the floor

rounds down. (b) In a right triangle with integer sides, the two shorter sides cannot both be odd. (c) Given $1, $10, $100 and $1,000 bills, you can’t get a value of 2 n+1^ using 2 n^ bills, for n ∈ N. (d) Let x, y, a be positive with x ≤ y. Then, (x + a)/(y + a) ≥ x/y. (e) Let a 1 , a 2 ,... , a 10 be integers with 1 /a 1 + 1/a 2 + · · · + 1/a 10 = 1. Then, at least one of the ai is even. (f) If all points in the plane are red or blue, then between points of one color, all positive real distances are realized. (g) Suppose, for n > 3 , a 1 + a 2 + · · · + an ≥ n and a^21 + a^22 + · · · + a^2 n ≥ n^2. Then, max(a 1 , a 2 ,... , an) ≥ 2. (h) The fraction (21n + 4)/(14n + 3) is irreducible. (i) If you cover an 8 × 8 chessboard with 32 dominos, some pair of adjacent dominos must form a 2 × 2 square.

Problem 4.14. Prove: If a, b, c ∈ Z are odd, then for all x ∈ Q, ax^2 + bx + c 6 = 0. (Contradiction in a direct proof.)

Problem 4.15. Prove these if and only if claims. You must prove two implications. (Break the proof into cases.)

(a) Prove: 4 divides n ∈ Z if and only if n = 1 + (−1)k^ (2k − 1) for k ∈ N. (Try n < 0 , n = 0, n > 0; k even/odd.) (b) Let w, x, y, z ∈ N satisfy z^2 = w^2 + x^2 + y^2. Prove that z is even if and only if w, x, y are all even. (Try w, x, y being even/odd.)

Problem 4.16. Determine the type of proof and prove. Tinker, tinker, tinker.

(a) The product of any two odd integers is odd. (b)

  1. (No calculators allowed!) (c) If 3 n + 2 is odd then n is odd. Here, n ∈ Z. (d) For real numbers a, b with a 6 = b, a^2 + b^2 > 2 ab. (e) For n ∈ Z, n^2 + 3n + 4 is even. (Try cases). (f) If xy is odd, then both x and y are odd. Here, x, y ∈ Z. (g) There is no fixed constant C for which n^3 ≤ Cn^2 for all n ∈ N. (h) For any positive rational x, there is another positive rational y < x. (i) If n^2 − 4 n + 5 is even then n is odd. Here, n ∈ Z. (j) If x − y is divisible by d, then x^2 − y^2 is divisible by d. Here, x, y, d ∈ Z. (k) If n is odd, then n^2 − 1 is divisible by 8. (l) If 2 n^ − 1 is prime, then n is prime. Here, n ∈ N. (m) If n ∈ Z, then n^2 − 3 is not divisible by 4. Here, n ∈ N. (n) Every nonzero rational number is a product of two irrational numbers. (o) There exist integers m and n for which 2 m + 3n = 13. (p) If m is divisible by d and m + n is divisible by d then n is divisible by d. Here, m, n, d ∈ N. (q) When dividing n by d, the quotient q and remainder 0 ≤ r < d are unique. Here, n, d, q, r ∈ Z. (r) For n ≥ 2 , prove that none of n! + 2, n! + 3,... , n! + n are prime. Here, n ∈ N. (s) If

3 is irrational, then

3 k^ is irrational for any positive odd number k. (t) Every odd number is the difference of two squares. (u) A perfect square number has remainder 0 or 1 when divided by 4. (v) The numbers a = 3^2017 + 25 and b = 3^2017 + 26 cannot both be perfect squares. (w) If a and b are positive real numbers with ab < 10 , 000 , then min(a, b) < 100. (x) For all positive real x, x^2 + x−^2 ≥ 2. (y) A right triangle with integer sides can’t be isoceles. [Hint: Pythagoras and

2 is irrational.] (z) For n ∈ N,

n(n + 1) ≤ n + 1/ 2.

  1. Proofs 4.6. Problems

Problem 4.24. A comparison scale can only compare weights.

(a) You have 3 balls, one is heavier. Can you can determine which ball is heavier in one weighing? Prove it. Repeat for 9 balls and two weighings. (b) You have 4 balls, one is heavier. Can you can determine which ball is heavier in one weighing? Prove it. Repeat for 10 balls and two weighings.

Problem 4.25. The points in the plane are colored red, blue or green. Prove by contradiction.

(a) If there are no green points, then there is an equilateral triangle of side 1 or

3 with monochromatic vertices. (b) There are two points of the same color a distance 1 apart. (c) Fix any 16 × 9 rectangular grid. One can form a rectangle using monochromatic points on the grid.

Problem 4.26. A 5 × 5 board is missing a square (black). Cover the remaining squares with L-shaped

tiles,. You may rotate tiles, but tiles cannot overlap or hang off the board. Don’t be upset if you fail. Prove there is no L-tiling of this deficient board. As a hint, we have shaded in some squares gray.

Problem 4.27. Explain how to prove and disprove the following statements.

(a) ¬P (n) → Q(n) (b) ¬(P (n) → Q(n))

(c) ∀n : (P (n) → Q(n)) (d) ∀x : ((∀n : P (n)) → Q(x))

(e) ∃n : (P (n) → Q(n)) (f) ∃x : ((∃n : P (n)) → Q(x))

Problem 4.28. For (a, b) ∈ R^2 , which mathematical claim below do you think is true?

(a) If (∀(a, b) : ax + b = 0), then x = 0. (b) ∀(a, b) : (if ax + b = 0, then x = 0).

Problem 4.29. Let D = {n | P (n) is t}. Prove (∀n ∈ D : Q(n)) ↔ (P (n) → Q(n)).

(a) (∀n ∈ D : Q(n)) → (P (n) → Q(n)). (b) (P (n) → Q(n)) → (∀n ∈ D : Q(n)).

Problem 4.30. Suppose p → q is true. Show (p ∧ r) → q is true, the stronger assumption p and r also implies q.

Problem 4.31. Recall p ↔ q

eqv ≡ (p → q) ∧ (q → p). Show that p ↔ q eqv ≡ (p ∧ q) ∨ (¬p ∧ ¬q): (a) Use truth-tables. (b) Use the rules in Figure 3.1 on page 29. [Hints: p ∧ ¬p

eqv ≡ f and x ∨ f

eqv ≡ x.]

Problem 4.32. In 1637, Pierre de Fermat made a claim (Fermat’s Last Theorem) that was only proved 357 years

later by Andrew Wiles. You may assume Fermat’s Last Theorem: If a, b, c, n are natural numbers with n > 2 , then an^ + bn^6 = cn. Use contradiction to show that 21 /p, p-th root of 2 is irrational for integer p > 2.

Problem 4.33. Prove p → p is true for any statement p.

Problem 4.34. “q is necessary and sufficient for p” is another way to say p ↔ q.

(a) For p to be true, it is necessary that q be true. Which of the statements below must be true: p → q; q → p; p ↔ q. (b) For p to be true, it is sufficient that q be true. Now, which statements must be true.

Problem 4.35. Given that every natural number is either prime or divisible by a prime, prove by contradiction that

there are infinitely many primes. [Hint: For x 1 , x 2 ,... , xn ≥ 2 , x 1 x 2 · · · xn + 1 is not divisible by any of x 1 , x 2 ,... , xn.]

Problem 4.36. Prove A ∩ B ∩ C = A∪B∪C. (a) Using Venn diagrams. (b) Show: x ∈ A ∩ B ∩ C ↔ x ∈ A∪B∪C.

(c) Derive A ∪ B ∪ C from A ∩ B ∩ C using the rules in Figure 2.1 on page 17.

Problem 4.37. Give “proof” by pictures using Venn diagrams for each set relationship:

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

(f) A ∩ A = ∅. (g) A ∩ B ⊆ A. (h) (A ∪ B) ∩ A = ∅. (i) (A ∩ B) ∩ A = A ∩ B. (j) |A| + |B| = |A ∪ B| + |A ∩ B|.

Problem 4.38. Give formal proofs for each equality in Problem 4.37.

Problem 4.39. The set difference A − B contains the elements in A that are not in B.

(a) Give A−B and B −A for (i) A = { 1 , 2 , 3 , 4 }, B = { 2 , 4 , 6 , 8 , 10 }. (ii) A = { 3 k | k ∈ N}, B = {p|p ∈ N is prime}. (b) Give an expression for A − B in terms of A and B using only intersection, union and complements. (c) Use Venn diagrams to prove or disprove: A ∪ (B − C) = (A ∪ B) − C.

  1. Proofs 4.6. Problems

Problem 4.40. Prove that A = B, where A and B are the sets defined below.

(a) A = {x | x = 2k + 1, k ∈ Z} B = {x | x = 2m − 17 , m ∈ Z} (b) A = {(i, j) | 1 ≤ i ≤ n and 1 ≤ j ≤ i} B = {(i, j) | j ≤ i ≤ n and 1 ≤ j ≤ n}

Problem 4.41. A = {(x, y) ∈ R^2 | y = x^2 }; B = {(x, y) ∈ R^2 | y = 2 − x}. What is A ∩ B?

Problem 4.42. In each case, prove (or disprove) a relationship between the sets.

(a) A = { 2 k, k ∈ N}, B = { 3 k, k ∈ N}, and C = { 6 k, k ∈ N}. Prove A ∩ B = C. (b) A = { 7 k, k ∈ N} and B = { 3 k, k ∈ N}. Prove A ∩ B 6 = ∅. (c) A = { 4 k − 3 , k ∈ N} and B = { 4 k + 1, k ∈ N}. Prove or disprove A = B. (d) A = { 4 k + 1, k ∈ Z} and B = { 4 k + 5, k ∈ Z}. Prove or disprove A = B. (e) A = { 12 m + 21n, m, n ∈ Z}. Prove or disprove A = Z. (f) A = { 12 m + 25n, m, n ∈ Z}. Prove or disprove A = Z.

Problem 4.43. Prove the following facts about the power set of A and B.

(a) P(A) ∪ P(B) ⊆ P(A ∪ B). (b) P(A) ⊆ P(B) ↔ A ⊆ B.

Problem 4.44. Prove that there exists a unique set A for which A ∪ B = B for all sets B.

Problem 4.45 (Closure). A set system is a collection of sets, C = {A 1 , A 2 ,.. .}, where Ai are sets of elements

from a universal set U. The set system C is closed under a set-operation if performing the operation on sets in C produces only sets in C. Here are examples of closure:

  • Closed under finite union. If A 1 , A 2 ∈ C, then A 1 ∪ A 2 ∈ C.
  • Closed under finite intersection. If A 1 , A 2 ∈ C, then A 1 ∩ A 2 ∈ C.
  • Closed under complement. If A 1 ∈ C, then A 2 ∈ C. (a) Let C = {A} have one set A. Show that C is closed under union and intersection. What about complement? (b) Let C = {∅, A, A, U}. Show that C is closed under union, intersection and complement. (c) Prove that if C is closed under union and complement, then C is closed under intersection. (d) Give a set system C containing at least 4 sets that is closed under union and intersection, but not closed under complement. (Make sure to specify the universal set.)

Problem 4.46. Study these definitions of convergence and prove or disprove the claims. (In all cases, n ∈ N.)

Definition. f (n) → ∞ if for every C > 0 , there is nC such that for all n ≥ nC , f (n) ≥ C. Definition. f (n) → a if for every ε > 0 , there is nε such that for all n ≥ nε, |f (n) − a| ≤ ε. (a) f (n) = (2n^2 + 3)/(n + 1). (i) f (n) → ∞. (ii) f (n) → 1. (iii) f (n) → 2. (b) f (n) = (n + 3)/(n + 1). (i) f (n) → ∞. (ii) f (n) → 1. (iii) f (n) → 2. (c) f (n) = n sin^2 ( 12 nπ). (i) f (n) → ∞. (ii) f (n) → 1. (iii) f (n) → 2.

Problem 4.47 (Without Loss Of Generality (wlog)). Consider the following claim.

If x and y have opposite parity (one is odd and one is even), then x + y is odd. Explain why, in a direct proof, we may assume that x is odd and y is even? Prove the claim. (Such a proof starts “Without loss of generality, assume x is odd and y is even. Then,... ”)

Problem 4.48. Use the concept of “without loss of generality” to prove these claims.

(a) If d does not divide mn, then d does not divide m or n. (Use contraposition.) (b) For integers x, y, if xy is not divisible by 5 then x and y are both not divisible by 5. (c) For any nonzero real number x, x^2 + 1/x^2 ≥ 2. (d) For non-negative x, y, max(x, y) ≤ x + y. (e) Triangle Inequality. For all x, y ∈ R, |x + y| ≤ |x| + |y|. (f) Schur’s Inequality. For a, b, c ≥ 0 and r > 0 , ar^ (a − b)(a − c) + br^ (b − a)(b − c) + cr^ (c − a)(c − b) ≥ 0. (g) Points in R^2 are colored red or blue. Prove there are two points of the same color a distance d apart, for d > 0. (h) No right triangle has sides which are Fibonacci numbers ( 1 , 1 , 2 , 3 , 5 , 8 , 13 ,.. ., each number being the sum of the previous two). [Hint: Triangle inequality; contradiction.]

  1. Induction: Proving “for all... ” 5.3. Problems

Problem 5.13. Determine for which n the claim is true and prove it by induction.

(a) k is odd implies kn^ is odd. (b) n

n ≤ 2 − (^1) n. (c) 21 /^2 n is not rational.

(d) 5 divides (x − 2) implies 5 divides xn^ − 2 n. (e) For x > 0 , (i) (1 + x)n^ ≤ 1 + nx + n^2 x^2 (ii) (1 − x)n^ ≤ 1 − nx + 12 n^2 x^2. (f) [Challenging!] Re[(cos x + i sin x)n] = cos nx.

Problem 5.14. Prove that the last digit of 34 n^ is 1, for n ≥ 0.

Problem 5.15. Prove: 9 divides 10 n^ − 1 for n ≥ 0. Hence, show: 9 divides x if and only if 9 divides x’s digit-sum.

Problem 5.16. Prove that (3^2

n − 1)/ 2 n+2^ is an odd integer for n ≥ 1.

Problem 5.17. Prove that 1+ 12 + 13 +· · ·+ 21 k ≥ 1+ 12 k, for k ≥ 0. Hence prove that 1+ 12 + 13 +· · ·+ 1 n ≥ 12 (1+log 2 n).

Problem 5.18. The nth Harmonic number is Hn = 1 + 12 + 13 + · · · + n^1 , for n ≥ 1. Prove:

(a) H 1 + H 2 + · · · + Hn = (n + 1)Hn − n. (b) 1 + 12 ln n ≤ Hn ≤ 1 + ln n. [Hint: For 0 ≤ x ≤ 12 , − 2 x ≤ ln(1 − x) ≤ −x.]

Problem 5.19. Let x 1 ,... , xn be positive and sum to 12 , x 1 + x 2 + · · · + xn = 12. Prove:

1 − x 1 1 + x 1

×

1 − x 2 1 + x 2

×

1 − x 3 1 + x 3

× · · · ×

1 − xn 1 + xn

Problem 5.20. Prove, by induction, that every n ≥ 1 is a sum of distinct powers of 2.

Problem 5.21. Let A be a finite set of size n ≥ 1 , prove by induction that |P(A)| = 2n.

Problem 5.22. Prove each case by induction. Then, guess the general pattern and prove your guess by induction.

(a)

∑n i=1 i^ = 1 + 2 +^ · · ·^ +^ n^ =^

1 2 n(n^ + 1) (b)

∑n i=1 i(i^ + 1) = 1^ ·^ 2 + 2^ ·^ 3 +^ · · ·^ +^ n^ ·^ (n^ + 1) =^

1 3 n(n^ + 1)(n^ + 2) (c)

∑n i=1 i(i^ + 1)(i^ + 2) = 1^ ·^2 ·^ 3 + 2^ ·^3 ·^ 4 +^ · · ·^ +^ n^ ·^ (n^ + 1)^ ·^ (n^ + 2) =^

1 4 n(n^ + 1)(n^ + 2)(n^ + 3)

Problem 5.23. After determining for which n the claim holds, prove it by induction:

(a)

1 − √^12

1 − √^13

1 − √^14

1 − √^1 n

≤ (^) n^22. (b)

1 − (^21) n

≥ 14 + (^2) n^1 +.

(c) 1 − (^) n^1 +1 < 1 + 14 + 19 + · · · + (^) n^12 ≤ 2 − (^) n^1. (d) (^) n^1 +1 + (^) n+2^1 + · · · + (^21) n > 1118.

Problem 5.24. Prove by induction on n: A 1 ∪ A 2 ∪ A 3 ∪ · · · ∪ An = A 1 ∩ A 2 ∩ A 3 ∩ · · · ∩ An.

Problem 5.25. Use the method of differences to guess a formula for S(n). Prove your guess.

(a) S(n) = 1 + 4 + 7 + · · · + (3n − 2) (b) S(n) = ∑n i=1 i(i^ + 1)

(^2) (c) S(n) = ∑ 2 n i=1(−1)

ii (^2).

Problem 5.26. In each problem, compute a formula for the quantity of interest. Use the following strategy: (i) Tinker

with small values of n, for example n = 1, 2 , 3 , 4 , 5. (ii) Guess a solution. (iii) Prove your guess by induction. (a) The product Π(n) =

1 − (^) n^1 +

, for n ≥ 1. (b) The product Π(n) =

1 − (^) n^12

, for n ≥ 2. (c) The sum S(n) =

∑ 2 n i=1(−1) ii, for n ≥ 1. (d) The sum S(n) = 1 · 3 + 3 · 5 + 5 · 7 + · · · + (2n − 1)(2n + 1), for n ≥ 1. (e) The sum S(n) = (^11) · 2 + (^21) · 3 + (^31) · 4 + · · · + (^) n(n^1 +1) , for n ≥ 1. (f) The sum S(n) = (^) 2!^1 + (^) 3!^2 + (^) 4!^3 + · · · + (^) (n+1)!n , for n ≥ 1. (g) The sum S(n) = 12 + 23 + 34 + · · · (^) nn+. (h) The product Π(n) = cos θ × cos(2θ) × cos(4θ) × · · · × cos(2nθ), for n ≥ 0. [Hint: Multiply by sin θ; sin 2A =?.] (i) The product Π(n) =

1 + 321 n

, for n ≥ 0. [Hint: (1 − 13 ) × Π(n).] (j) The nth derivative of x^2 ex, that is d n dxn^ (x

(^2) ex), for n ≥ 1. (k) The integral Γ(n) =

0 dx x

n− (^1) e−x, for n ≥ 1. (l) The sum S(n) =

A⊆[n] A6=∅

x∈A

1 x , for^ n^ ≥^1. (The index^ A^ is over the non-empty subsets of^ [n] =^ {^1 ,... , n}.)

Problem 5.27. Place n circles on the plane, dividing the plane into regions. Prove that you can color the regions

red and blue so that no two regions which share a boundary at a circle have the same color.

  1. Induction: Proving “for all... ” 5.3. Problems

Problem 5.28. Prove each claim by induction for n ≥ 3.

(a) There is a set with n numbers x 1 ,... , xn such that each xi divides the sum s = x 1 + · · · + xm. (b) There is a convex polygon with at least 3 acute internal angles. (c) There are n distinct positive numbers whose reciprocals sum to 1.

Problem 5.29. Prove by induction that the derivative of xn^ is nxn−^1 , for n ≥ 1. [Hint: (f g)′^ = f ′g + f g′.]

Problem 5.30. Prove that the nth derivative of xn^ is n!, for n ≥ 1.

Problem 5.31 (Nested Roots). Let x 1 =

1 , x 2 =

1 , x 3 =

1 , and so on. We can get xn+1 from xn using xn+1 =

1 + xn. Prove that: (a) xn ≤ 2. (b) xn is monotonically increasing. By monotone convergence (calculus), xn converges. Make a conjecture for limn→∞ xn.

Problem 5.32 (A Formula of Ramanujan). The math prodigy Ramanujan derived the remarkable formula:

(a) Numerically verify (5.1) by computing the RHS to a high accuracy using many terms. (b) Assume Ramanujan’s formula is valid. Generalize the formula by proving, for all n ≥ 1 :

n + 1 =

1 + n

1 + (n + 1)

1 + (n + 2)

1 + (n + 3)

Problem 5.33. Prove, for n ≥ 3 , that every convex n-gon has n(n − 3)/ 2 diagonals (that are not sides).

Problem 5.34. Prove that the sum of interior angles of a convex polygon with n sides is (n − 2)π.

You may assume the result is true for triangles (n = 3), and that one can cut a convex n-gon into a convex (n − 1)-gon and a triangle as shown. (A convex polygon has all interior angles smaller than π.)

Problem 5.35. Suppose a, b ≥ 0 (non-negative reals). Prove by induction:

(a) (a + b)n^ ≥ an^ + bn, for n ≥ 1. (b) (a + b)n^ ≥ an^ + bn^ + 2ab(a + b)n−^2 , for n ≥ 2. (c) (a + b)n^ ≥ an^ + bn^ + nab(an−^2 + bn−^2 ), for n ≥ 2.

Problem 5.36. Suppose |xi|, |yi| ≤ M. Prove:

∣∏ni=1 xi − ∏ni=1 yi

∣ (^) ≤ M n−^1 ∑ni=1 |xi − yi|.

Problem 5.37. Prove that n lines through the origin create 2 n regions in the plane.

Problem 5.38. M (n) is the maximum number of regions into which n lines can divide a plane.

(a) Tinker. Three lines are shown on the right, creating regions R 1 ,... , R 6. What is the maximum number of regions possible with three lines? (b) Continue to tinker. Compute M (n) for small values of n. (c) Make a conjecture for M (n). (d) Prove your conjecture using induction.

R 1 R^2

R 3

R 4 R^5

R 6

Problem 5.39. Prove you can make any postage greater than 12¢ using only 4¢ and 5¢ stamps. (The USPS can

set any postage above 12¢ and you don’t have to by any new stamps.)

Problem 5.40. A cap of a disk is a region subtended by a cord. We show three caps, which do not

cover the disk. Suppose n caps do cover the entire disk. Prove by induction on n that one can cover the disk using at most 3 of the caps. [Hint: Consider the complements of the caps and show that if every 3 cap-complements have nonempty intersection then all n complements have nonempty intersection which contradicts the caps covering the disk. (A special case of Helly’s Theorem.)]

Problem 5.41 (Binomial Theorem). For integers 0 ≤ k ≤ n, the binomial coefficient

( (^) n k

is given by the formula

( (^) n k

= n!/k!(n − k)! (recall the empty product 0! = 1). (a) Show that

( (^) n+ k

( (^) n k

( (^) n k− 1

, for 1 ≤ k ≤ n. Hence prove that

( (^) n k

is an integer for n ≥ 0 and 0 ≤ k ≤ n. (b) Prove, for n ≥ 1 , (1 + x)n^ =

∑n i=

( (^) n i

xi^ =

( (^) n 0

x^0 +

( (^) n 1

x^1 + · · · +

( (^) n n

xn. (c) Use (b) to give the expansions of (1 + x)^2 , (1 + x)^3 , (1 + x)^4. (d) Show that (x + y)n^ =

∑n i=

( (^) n i

xiyn−i.