Main Menu Main Menu (Click on the topics below)
Pigeonhole Principle
Example
Example
Example
Example
Example
Example
Generalized Pigeonhole PrincipleExample
Proof of Pigeonhole Principle
Click on the picture
Pigeonhole PrinciplePigeonhole Principle
Sanjay Jain, Lecturer, Sanjay Jain, Lecturer,
School of ComputingSchool of Computing
Pigeonhole PrinciplePigeonhole Principle
If we place m balls in n boxes, m > n, then at least one box gets 2 balls.
Another formulation:
Consider a function f from A to B, where
#(A) > #(B), and
A, B are finite.Then f cannot be 1—1.
END OF SEGMENT
ExampleExample
In a group of 13 people, there are at least 2 who are born in the same month.
S = set of people (13 elements)M = months of the year (12 elements)
f: S —> M
f(x)= the month x was born.Since #(S) > #(M), by pigeonhole principle, f cannot be
1—1.That is, there exist x, y in S, x y, such that
f(x)=f(y) In other words, x and y are born in the same month.
END OF SEGMENT
ExampleExample
Let A={1,2,3,…,8}
If we pick 5 integers from A, then there exist 2 integers among the selected integers, which add up to 9.
Proof:
A1={1,8}; A2={2,7}; A3={3,6}; A4={4,5}B: set of numbers picked.C={1,2,3,4}f: B --> C,
if xB, is a member of Ai then f(x)=i.
Since #(B) > #(C), by pigeonhole principle, f cannot be 1 —1.Thus, there exist a, b, in B such that f(a) = f(b).But then a+b = 9
END OF SEGMENT
ExampleExample
In a set of four numbers, two are same mod 3.
Proof:A = Set of 4 numbers.B={0,1,2}f: A —> B
where f(x)=x mod 3.Now #(A) > #(B). So f cannot be 1 —1.Thus, there exists distinct x, y in A, such that f(x) = f(y).In other words, x mod 3 = y mod 3.
END OF SEGMENT
ExampleExample
There are 600 students. Each of them takes 3 compulsory modules, and 1 of 2 electives.
In each module they can get a grade of A, B, C, or D. Show that there are 2 students with identical grade sheet.
ExampleExampleProof:
A= set of students (600)
B= set of grade sheets.
How many grade sheets are there?T1: select the elective.
T2: select the grade for module 1
T3: select the grade for module 2
T4: select the grade for module 3
T5: select the grade for module 4
T1 can be done in two ways. Each of T2 to T5 can be done in four ways.
Using multiplication rule, the number of elements of B = 2*4*4*4*4 = 512
ExampleExampleA= set of students (600)B= set of grade sheets. (512)
f: A —> Bwhere f(x)=grade sheet of x.
Since #(A) > #(B), f cannot be 1 — 1Thus, there exist distinct x, y in A such that f(x) = f(y)In other words, x and y have the same grade sheets.
END OF SEGMENT
ExampleExample
Suppose there are 19 people in a party. Suppose friendship relation is mutual.Show that there are 2 persons in the party with same number of friends
ExampleExampleA= set of people in the party. B={0,1,2…,18}f: A —> B
where f(x) = number of friends of x#(A) = 19, #(B) = 19.We cannot apply pigeonhole principle yet.Note that, either
for all x, f(x)0, orfor all x, f(x)18
Why? Suppose for all x, f(x) 0 is false.Then there is an a such that f(a)=0.Thus a has no friends.Then, a is not a friend of anyone.Thus, for all x, f(x)18
ExampleExampleA= set of people in the party. B={0,1,2…,18}f: A —> B
where f(x) = number of friends of x#(A) = 19, #(B) = 19.We cannot apply pigeonhole principle yet.Note that, either
for all x, f(x)0, orfor all x, f(x)18
Let B’=B - {w}, where w = 0 or 18, based on which of above cases holds.Note that #(B’)=18.Thus f: A—> B’ cannot be 1—1.Therefore, there exist distinct x and y in A, such that f(x)=f(y).In other words, there are two people in A, with the same number of friends.
END OF SEGMENT
ExampleExample
Let X={1,2,….,2n}Let S be a subset of X containing n+1 elements.Then, there exist distinct x and y in S, such that x divides y.
ExampleExampleSuppose the elements of S are s1, s2, …,sn+1
Let si=2riwi, where wi is odd.Let B= set of odd numbers 2n. Note that #(B)=nLet f:S—> B
where f(si)=wi
Thus, f cannot be1— 1 (by PH principle)Thus, there exist distinct i and j, such that
f(si)= f(sj)
In other words, wi= wj.
si=2riwi, sj=2rjwj
Now if, ri>rj then, sj divides si
otherwise, si divides sj.
END OF SEGMENT
Floors and CeilingsFloors and Ceilings
w denotes the largest integer w.For example: 6.9 = 6; -9.2 = -10; 9 = 9
w denotes the smallest integer w.For example: 6.9 =7; -9.2 = -9; 9 = 9
END OF SEGMENT
Generalized Pigeonhole PrincipleGeneralized Pigeonhole PrincipleIf I place m balls in n boxes, then at least one box will get m/n balls.
If I place m balls in n boxes, then at least one box will get m/n balls.
For any function f from a finite set X to a finite set Y, if #(X) > k* #(Y), thenthere exists a y in Y such that y is the image of at least k+1 distinct elements of X.
END OF SEGMENT
ExampleExampleSuppose I place 26 letters of English alphabet in a circle. Then there exists a consecutive sequence of 5 consonants.
B1
B4
B5
B3
B2
21 consonants ---> balls.B1,…, B5 boxes.At least one box will get 21/5 =5 balls. Thus there are 5 consecutive consonants.
END OF SEGMENT
Proof of Pigeonhole PrincipleProof of Pigeonhole PrincipleRecall the pigeonhole principle:For any function f from a finite set X to a finite set Y, if #(X) > #(Y), then f is not 1—1.Proof: Suppose f is 1—1.
Let Y={y1, y2,…, ym}f -1(y)={x X | f(x)=y}
f -1(y1), f -1(y2), …,f -1(ym) are pairwise disjoint, whose union is X.Therefore by Addition Rule,
#(X) = #(f -1(y1)) + #(f -1(y2)) + … + #(f -1(ym) ) 1+ 1+……+1 = m#(X) #(Y)a contradiction. Thus f is not 1—1.
END OF SEGMENT