Download presentation
Presentation is loading. Please wait.
Published byBrent Freeman Modified over 9 years ago
1
1 Lecture 3 (part 2) Functions – Pigeonhole Principle Reading: Epp Chp 7.4
2
2 Outline 1.Pigeonhole principle (PHP) 2.Generalized PHP
3
3 1. Pigeonhole Principle Pigeonhole principle n If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons. …or if you want to be more technical… n A function from one finite set to a smaller finite set cannot be one-to-one: there must be at least two elements in the domain that have the same image in the co-domain.
4
4 1. Pigeonhole Principle f Finite set n elements m elements > Pigeonhole principle
5
5 1. Pigeonhole Principle n The PHP may seem innocuous (harmless) and common-sensical. You may even think that teaching you such a simple thing is an insult to your intelligence. n But such an attitude of pride toward the PHP is a sure step to failure. n Do not underestimate the difficulty of it. n “What’s so difficult?” you may ask. n The difficulty is NOT the PHP. n The difficulty is that YOU CAN’T SEE WHAT ARE THE PIGEONS AND WHAT ARE THE HOLES. It’s a problem with your observation powers…and hence the application of the principle.
6
6 The obvious ones…
7
7 1. Pigeonhole Principle: Example 1 n Prove that in any group of eight people, at least two have birthdays which fall on the same day of the week in any given year. Mon Tue Wed Thur Fri Sat Sun Y X p1 p2 p3 p4 p5 p6 p7 p8 f Let X be the set of people. |X| = 8. Let Y be the set of days in the week. |Y| = 7. Define f : X Y, such that f maps the person to the day of week in which he was born. By PHP, at least two people will have birthdays which fall on the same day of the week.
8
8 1. Pigeonhole Principle: Example 2 n Given any set of four integers, there must be at least two that have the same remainder when divided by three. X a b c d 0 1 2 Y f Let X be the set of any four integers selected. |X| = 4. Let Y be the set of possible remainders when divided by 3. |Y| = 3. Define f : X Y, such that f(x) = y if x leaves a remainder of y when divided by 3. By PHP ( |X|>|Y| ), at least two integers will have the same remainder when divided by 3.
9
9 The not so obvious ones… (“I can’t see the pigeons or holes or both…”)
10
10 1. Pigeonhole Principle: Example 3 Let A = {1,2,3,4,5,6,7,8}. Prove that if 5 distinct integers are selected from A, at least one pair of integers have a sum of 9. n Try some examples: –select 1,3,4,6,7. Then we can find at least a pair: 3+6 = 9 –select 2,3,5,6,7. Then we can find at least a pair: 2+7 = 9 (Of course, we can also find another: 3+6 = 9 but it’s ok… the claim is that you can find at least one pair). n So can you see the pigeons? And the holes?
11
11 1. Pigeonhole Principle: Example 3 Let A = {1,2,3,4,5,6,7,8}. Prove that if 5 distinct integers are selected from A, at least one pair of integers have a sum of 9. Y {1,8} {2,7} {3,6} {4,5} f X a b c d e Let X be the set of any five distinct integers selected from 1 to 8. |X| = 5. Let Y = { {1,8}, {2,7}, {3,6}, {4,5} }. |Y| = 4. Define f : X Y, such that f(x) = y if x y. By PHP ( |X|>|Y| ), at least two elements (say a and b ) in X will map to one element {i,j} in Y. Meaning that a {i,j} and b {i,j}. Since a b, then either a=i and b=j or vice versa. In any case, a + b = 9.
12
12 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try an example: –Day 1: 1Day 7: 1Day 13: 2Day 19: 2Day 25: 1 –Day 2: 2Day 8: 2Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:1Day 21: 1Day 27: 1 –Day 4: 2Day 10: 3Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 3Day 17: 1Day 23: 1Day 29: 1 –Day 6: 2Day 12: 1Day 18: 2Day 24: 1Day 30: 1 n Total = 43 games Hmmm… 13 games (or 15 if extend to day 10)
13
13 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try an example: –Day 1: 1Day 7: 1Day 13: 2Day 19: 2Day 25: 1 –Day 2: 2Day 8: 2Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:1Day 21: 1Day 27: 1 –Day 4: 2Day 10: 3Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 3Day 17: 1Day 23: 1Day 29: 1 –Day 6: 2Day 12: 1Day 18: 2Day 24: 1Day 30: 1 n Total = 43 games Hmmm… 12 games (or 15 if extend to day 10)
14
14 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try an example: –Day 1: 1Day 7: 1Day 13: 2Day 19: 2Day 25: 1 –Day 2: 2Day 8: 2Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:1Day 21: 1Day 27: 1 –Day 4: 2Day 10: 3Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 3Day 17: 1Day 23: 1Day 29: 1 –Day 6: 2Day 12: 1Day 18: 2Day 24: 1Day 30: 1 n Total = 43 games Hmmm… 13 games (or 16 if extend to day 11)
15
15 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try an example: –Day 1: 1Day 7: 1Day 13: 2Day 19: 2Day 25: 1 –Day 2: 2Day 8: 2Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:1Day 21: 1Day 27: 1 –Day 4: 2Day 10: 3Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 3Day 17: 1Day 23: 1Day 29: 1 –Day 6: 2Day 12: 1Day 18: 2Day 24: 1Day 30: 1 n Total = 43 games Hmmm… 12 games (or 16 if extend to day 11)
16
16 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try an example: –Day 1: 1Day 7: 1Day 13: 2Day 19: 2Day 25: 1 –Day 2: 2Day 8: 2Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:1Day 21: 1Day 27: 1 –Day 4: 2Day 10: 3Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 3Day 17: 1Day 23: 1Day 29: 1 –Day 6: 2Day 12: 1Day 18: 2Day 24: 1Day 30: 1 n Total = 43 games Found it! Day 8 – Day 14: Exactly 14 games.
17
17 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n Try ANOTHER example –Day 1: 1Day 7: 1Day 13: 3Day 19: 1Day 25: 1 –Day 2: 1Day 8: 1Day 14:2Day 20: 1Day 26: 1 –Day 3: 1Day 9: 1Day 15:3Day 21: 1Day 27: 1 –Day 4: 1Day 10: 1Day 16: 2Day 22: 1Day 28: 1 –Day 5: 1Day 11: 1Day 17: 3Day 23: 1Day 29: 1 –Day 6: 1Day 12: 2Day 18: 4Day 24: 1Day 30: 1 n Total = 42 games Day 3 – Day 13: Exactly 14 games. n So can you see the pigeons? And the holes? (Not obvious right?)
18
18 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n We will have to ‘extract out’ the pigeons and the holes. Let the number of games played on the i -th day by a i. Let b i be the total number of games played from the first day to the i -th day. –Meaning that… b 1 = a 1 b 2 = a 1 + a 2 b 3 = a 1 + a 2 + a 3 … b 30 = a 1 + a 2 + … + a 30 So we know that (1) b 1 < b 2 < b 3 < …< b 30 ; (2) 1 b i 45
19
19 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. n We therefore form another increasing sequence: b 1 + 14 b 2 + 14 b 3 + 14 … b 30 + 14 And this will also have the property that –(1) b 1 + 14 < b 2 + 14 < b 3 + 14 < … < b 30 + 14; –(2) 15 b i +14 59 (Since 1 b i 45 )
20
20 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. Let X be the set { b 1, …, b 30, b 1 +14, …, b 30 +14}. |X| = 60. Let Y be the set of {1,2,…,59}. |Y| = 59. Define f : X Y, s.t. f(x) = y iff x = y X b1b1 b2b2 b3b3 b 30 b 1 +14 b 2 +14 b 3 +14 b 30 +14 f Y 1 2 3 4 59 By PHP ( |X|>|Y| ), at least two elements in X will map to the the same element in Y. Q: Which two elements? Both of the elements cannot be of the form of b i and b j since the sequence of b i ’s are strictly increasing ( b i b j ). Similarly, both of the elements cannot be of the form of b i +14 and b j +14.
21
21 1. Pigeonhole Principle: Example 4 n During a month with 30 days, a baseball team plays at least 1 game a day, but no more that 45 games in total for that month. Show that there must be a period of some number of consecutive days, during which the team must play exactly 14 games. Y X f b1b1 b2b2 b3b3 b 30 b 1 +14 b 2 +14 b 3 +14 b 30 +14 1 2 3 4 59 Therefore one of the elements is of the form b i and the other is of the form b j +14. So b i = b j +14 Which means that b i - b j = 14 So the 14 games are played from day j+1 to day i.
22
22 1. Pigeonhole Principle: Example 5 n Consider a 2D cartesian plane (N x N). You are given 5 distinct points on the plane. Prove that at least one of the line segments determined by these points has a midpoint which falls nicely in N x N. n Try some examples:
23
23 1. Pigeonhole Principle: Example 5 n Consider a 2D cartesian plane (N x N). You are given 5 distinct points on the plane. Prove that at least one of the line segments determined by these points has a midpoint which falls nicely in N x N. n Are you able to see the pigeons and the holes? n Not obvious right? n This is what makes the APPLICATION of the PHP difficult – note: the difficulty does not lie in understanding PHP… It’s the APPLICATION of the principle that’s difficult. n It requires keen observation skills, through examples.
24
24 1. Pigeonhole Principle: Example 5 n Consider a 2D cartesian plane (N x N). You are given 5 distinct points on the plane. Prove that at least one of the line segments determined by these points has a midpoint which falls nicely in N x N. n First, a question: How do you calculate the midpoint of a line from (a,b) to (c,d)? n Ans: ((a+c)/2, (b+d)/2) n Still… –What are the pigeons? –What are the holes?
25
25 1. Pigeonhole Principle: Example 5 n Consider a 2D cartesian plane (N x N). You are given 5 distinct points on the plane. Prove that at least one of the line segments determined by these points has a midpoint which falls nicely in N x N. Y holes are the ‘parity’ of the x,y number (odd,odd) (odd,even) (even,odd) (even,even) f X pigeons are the 5 points (x 1,y 1 ) (x 2,y 2 ) (x 3,y 3 ) (x 4,y 4 ) (x 5,y 5 )
26
26 1. Pigeonhole Principle: Example 5 n Consider a 2D cartesian plane (N x N). You are given 5 distinct points on the plane. Prove that at least one of the line segments determined by these points has a midpoint which falls nicely in N x N. Let X be the set of any 5 points on the plane. |X| = 5. Let Y be the set {(odd,odd), (odd,even), (even,odd), (even,even)}. |Y| = 4. Define f : X Y, such that f(a,b) = (i,j) where i = ‘odd’ if a is odd and i = ‘even’ if a is even; j = ‘odd’ if b is odd and j = ‘even’ if b is even. By PHP ( |X|>|Y| ), at least two (of the five points) say (a,b) and (c,d), will map to the same element in Y. Either a and c are (1) both odd or (2) both even. In either case, (a+c) is even. And so (a+c)/2 is an integer. Either b and d are (1) both odd or (2) both even. In either case, (b+d) is even. And so (b+d)/2 is an integer. So ((a+c)/2, (b+d)/2) lie on the N x N plane.
27
27 2. Generalized Pigeonhole Principle GENERALIZED Pigeonhole principle n If n pigeons fly into m pigeonholes and n > km, (where k is some positive integer) then at least one hole must contain k+1 or more pigeons. …or if you want to be more technical… n For any function f from a finite set X to a finite set Y such that |X| > k.|Y|, then there is some y in Y such that y is the image of at least k+1 (or ceiling of |X| / |Y|) distinct elements of X. (Contrapositive form) For any function f from a finite set X to a finite set Y, if for each y in Y, f -1 (y) has at most k elements, then X has at most k.|Y| elements.
28
28 2. Generalized Pigeonhole Principle GENERALIZED Pigeonhole principle n If n pigeons fly into m pigeonholes and n > km, (where k is some positive integer) then at least one hole must contain k+1 or more pigeons. n Example: –If 32 pigeons fly into 10 pigeonholes, then at least one hole must contain 4 or more pigeons (4 = 32/10 and take the ceiling). –(contrapositive form) If each pigeonhole has at most 7 pigeons, then 10 pigeonholes have at most 70 pigeons.
29
29 The obvious ones…
30
30 2. Generalized Pigeonhole Principle n (Eg. 1) There are 44 chairs in a room and five tables. Prove that some table must have at least 9 chairs around it. Let X be the set of 44 chairs. |X| = 44. Let Y be the set of tables. |Y| = 5. Define f : X Y, such that f(x) = (y) if chair x is placed at table y. f Y holes are the 5 tables X pigeons are the 44 chairs By Generalized PHP ( |X|> 8|Y| ), there is a y Y (some table) such that y is the image of at least 9 distinct points in X … meaning that there is a table with at least 9 chairs around it.
31
31 2. Generalized Pigeonhole Principle n (Eg. 2) In a group of 85 people, at least 4 must have the same last initial. Let X be the set of people. |X| = 85. Let Y be the set of alphabets. |Y| = 26. Define f : X Y, such that f(x) = (y) if the last initial of person x is y. f X pigeons are the 85 people By Generalized PHP ( |X|> 3|Y| ), there is a y Y (some alphabet) such that y is the image of at least 4 distinct points in X … meaning that there is a group of at least 4 people who have the same last initial. Y holes are the 26 alphabets
32
32 The not so obvious ones… (“I can’t see the pigeons or holes or both…”)
33
33 2. Generalized Pigeonhole Principle n (Eg. 3) There are 42 students who are to share 12 computers. Each student uses exactly 1 computer, and no computer is used by more that 6 students. Show that at least 5 computers are used by 3 or more students. Let X be the set of 42 students. |X| = 42. Let Y be the set of 12 computers. |Y| = 12. Define f : X Y, such that f(x) = y if x uses computer y. f We can divide the computers in Y into those which are used by 3 or more students ( k ), and those used by 2 or less ( 12-k ). k computers serve at most 6k students. 12-k computers serve at most 2(12-k) students. By Generalized PHP (Contrapositive form), 6k + 2(12-k) |X|. (Now, |X|=42 ) So k 4.5 … And since k is an integer, k 5. X pigeons are the 42 students Y holes are the 12 computers k
34
34 2. Generalized Pigeonhole Principle n (Eg. 4) Assume that in a group of 6 people, each pair of individuals consists of two friends or two enemies. Show that there are either 3 mutual friends or 3 mutual enemies Let X be the set of the other 5 people. |X| = 5. Let Y be the set of {0,1}. |Y| = 2. Define f : X Y, such that f(x) = 1 if x is a friend of A ; otherwise f(x) = 0. f By Generalized PHP ( |X|> 2|Y| ), there is a y Y such that y is the image of at least 3 distinct points in X … meaning that A has either at least 3 friends or at least 3 enemies. (We’re not done yet… ) Let A be one of the 6 people. X pigeons are the other 5 people B C D E F Y 2 holes – friend or enemy with A A’s friend A’s enemy
35
35 2. Generalized Pigeonhole Principle n (Eg. 4) Assume that in a group of 6 people, each pair of individuals consists of two friends or two enemies. Show that there are either 3 mutual friends or 3 mutual enemies Ok, we know that A has either at least 3 friends or at least 3 enemies. But are these who are friends with A, also friends with each other? (keyword ‘mutual’)… still some more to prove… Case 1: ( A has at least 3 friends) –Without loss of generality, say these 3 friends are B, C, D. –Either there is or there is not a friendship between two persons in the group B, C, D. If there is a friendship between two persons in the group B, C, D, then those two persons, together with A, form the 3 mutual friends. If there is NO friendship between two persons in the group B, C, D, then B, C, D, form the 3 mutual enemies. Case 2: ( A has at least 3 enemies) –…for you to fill in…reasoning similar with case 1… n In either case, we have shown that there are either 3 mutual friends or 3 mutual enemies.
36
36 n End of Lecture
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.