1 Lecture 3 (part 2) Functions – Pigeonhole Principle Reading: Epp Chp 7.4.
-
Upload
brent-freeman -
Category
Documents
-
view
220 -
download
0
Transcript of 1 Lecture 3 (part 2) Functions – Pigeonhole Principle Reading: Epp Chp 7.4.
1
Lecture 3 (part 2)
Functions – Pigeonhole PrincipleReading: Epp Chp 7.4
2
Outline
1. Pigeonhole principle (PHP)
2. Generalized PHP
3
1. Pigeonhole Principle
Pigeonhole principle 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…
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
1. Pigeonhole Principle
f
Finite set Finite setn
elementsm
elements>
Pigeonhole principle
5
1. Pigeonhole Principle
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.
But such an attitude of pride toward the PHP is a sure step to failure.
Do not underestimate the difficulty of it. “What’s so difficult?” you may ask. The difficulty is NOT the PHP. 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
The obvious ones…
7
1. Pigeonhole Principle: Example 1
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
YX
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
1. Pigeonhole Principle: Example 2
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
The not so obvious ones…(“I can’t see the pigeons or holes or both…”)
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.
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).
So can you see the pigeons? And the holes?
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
1. Pigeonhole Principle: Example 4 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.
Try an example:
– Day 1: 1 Day 7: 1 Day 13: 2 Day 19: 2 Day 25: 1– Day 2: 2 Day 8: 2 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 1 Day 21: 1 Day 27: 1– Day 4: 2 Day 10: 3 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 3 Day 17: 1 Day 23: 1 Day 29: 1– Day 6: 2 Day 12: 1 Day 18: 2 Day 24: 1 Day 30: 1
Total = 43 games
Hmmm… 13 games (or 15 if extend to day 10)
13
1. Pigeonhole Principle: Example 4 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.
Try an example:
– Day 1: 1 Day 7: 1 Day 13: 2 Day 19: 2 Day 25: 1– Day 2: 2 Day 8: 2 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 1 Day 21: 1 Day 27: 1– Day 4: 2 Day 10: 3 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 3 Day 17: 1 Day 23: 1 Day 29: 1– Day 6: 2 Day 12: 1 Day 18: 2 Day 24: 1 Day 30: 1
Total = 43 games
Hmmm… 12 games (or 15 if extend to day 10)
14
1. Pigeonhole Principle: Example 4 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.
Try an example:
– Day 1: 1 Day 7: 1 Day 13: 2 Day 19: 2 Day 25: 1– Day 2: 2 Day 8: 2 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 1 Day 21: 1 Day 27: 1– Day 4: 2 Day 10: 3 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 3 Day 17: 1 Day 23: 1 Day 29: 1– Day 6: 2 Day 12: 1 Day 18: 2 Day 24: 1 Day 30: 1
Total = 43 games
Hmmm… 13 games (or 16 if extend to day 11)
15
1. Pigeonhole Principle: Example 4 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.
Try an example:
– Day 1: 1 Day 7: 1 Day 13: 2 Day 19: 2 Day 25: 1– Day 2: 2 Day 8: 2 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 1 Day 21: 1 Day 27: 1– Day 4: 2 Day 10: 3 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 3 Day 17: 1 Day 23: 1 Day 29: 1– Day 6: 2 Day 12: 1 Day 18: 2 Day 24: 1 Day 30: 1
Total = 43 games
Hmmm… 12 games (or 16 if extend to day 11)
16
1. Pigeonhole Principle: Example 4 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.
Try an example:
– Day 1: 1 Day 7: 1 Day 13: 2 Day 19: 2 Day 25: 1– Day 2: 2 Day 8: 2 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 1 Day 21: 1 Day 27: 1– Day 4: 2 Day 10: 3 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 3 Day 17: 1 Day 23: 1 Day 29: 1– Day 6: 2 Day 12: 1 Day 18: 2 Day 24: 1 Day 30: 1
Total = 43 games
Found it! Day 8 – Day 14: Exactly 14 games.
17
1. Pigeonhole Principle: Example 4 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.
Try ANOTHER example
– Day 1: 1 Day 7: 1 Day 13: 3 Day 19: 1 Day 25: 1– Day 2: 1 Day 8: 1 Day 14: 2 Day 20: 1 Day 26: 1– Day 3: 1 Day 9: 1 Day 15: 3 Day 21: 1 Day 27: 1– Day 4: 1 Day 10: 1 Day 16: 2 Day 22: 1 Day 28: 1– Day 5: 1 Day 11: 1 Day 17: 3 Day 23: 1 Day 29: 1– Day 6: 1 Day 12: 2 Day 18: 4 Day 24: 1 Day 30: 1
Total = 42 games
Day 3 – Day 13: Exactly 14 games.
So can you see the pigeons? And the holes? (Not obvious right?)
18
1. Pigeonhole Principle: Example 4 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.
We will have to ‘extract out’ the pigeons and the holes. Let the number of games played on the i-th day by ai.
Let bi be the total number of games played from the first day to the i-th day. – Meaning that…
• b1 = a1
• b2 = a1 + a2
• b3 = a1 + a2 + a3
• …
• b30 = a1 + a2 + … + a30
So we know that (1) b1 < b2 < b3 < …< b30 ; (2) 1 bi 45
19
1. Pigeonhole Principle: Example 4 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.
We therefore form another increasing sequence:• b1 + 14
• b2 + 14
• b3 + 14
• …
• b30 + 14
And this will also have the property that – (1) b1 + 14 < b2 + 14 < b3 + 14 < … < b30 + 14;
– (2) 15 bi+14 59 (Since 1 bi 45)
20
1. Pigeonhole Principle: Example 4 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{b1 , … , b30 , b1+14 , … , b30+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
b1
b2
b3
b30
b1+14
b2+14
b3+14
b30+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 bi and bj since the sequence of bi’s are strictly increasing (bi bj).
Similarly, both of the elements cannot be of the form of bi+14 and bj +14.
21
1. Pigeonhole Principle: Example 4 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.
YX
fb1
b2
b3
b30
b1+14
b2+14
b3+14
b30+14
1
2
3
4
59
Therefore one of the elements is of the form bi and the other is of the form bj +14.
So bi = bj +14
Which means that bi - bj = 14
So the 14 games are played from day j+1 to day i.
22
1. Pigeonhole Principle: Example 5 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.
Try some examples:
23
1. Pigeonhole Principle: Example 5 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.
Are you able to see the pigeons and the holes?
Not obvious right? 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.
It requires keen observation skills, through examples.
24
1. Pigeonhole Principle: Example 5 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.
First, a question: How do you calculate the midpoint of a line from (a,b) to (c,d)?
Ans: ((a+c)/2 , (b+d)/2) Still…
– What are the pigeons?– What are the holes?
25
1. Pigeonhole Principle: Example 5 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
(x1,y1)
(x2,y2)
(x3,y3)
(x4,y4)
(x5,y5)
26
1. Pigeonhole Principle: Example 5 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
2. Generalized Pigeonhole Principle
GENERALIZED Pigeonhole principle 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…
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
2. Generalized Pigeonhole Principle
GENERALIZED Pigeonhole principle 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.
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
The obvious ones…
30
2. Generalized Pigeonhole Principle
(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 yY (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
2. Generalized Pigeonhole Principle
(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 yY (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
The not so obvious ones…(“I can’t see the pigeons or holes or both…”)
33
2. Generalized Pigeonhole Principle
(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
2. Generalized Pigeonhole Principle
(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 yY 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
2. Generalized Pigeonhole Principle
(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…
In either case, we have shown that there are either 3 mutual friends or 3 mutual enemies.
36
End of Lecture