Presentation is loading. Please wait.

Presentation is loading. Please wait.

Main Menu Main Menu (Click on the topics below) Pigeonhole Principle Example Generalized Pigeonhole Principle Example Proof of Pigeonhole Principle Click.

Similar presentations


Presentation on theme: "Main Menu Main Menu (Click on the topics below) Pigeonhole Principle Example Generalized Pigeonhole Principle Example Proof of Pigeonhole Principle Click."— Presentation transcript:

1 Main Menu Main Menu (Click on the topics below) Pigeonhole Principle Example Generalized Pigeonhole Principle Example Proof of Pigeonhole Principle Click on the picture

2 Pigeonhole Principle Sanjay Jain, Lecturer, School of Computing

3 Pigeonhole 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.

4 END OF SEGMENT

5 Example 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.

6 END OF SEGMENT

7 Example 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: A 1 ={1,8}; A 2 ={2,7}; A 3 ={3,6}; A 4 ={4,5} B: set of numbers picked. C={1,2,3,4} f: B --> C, if x  B, is a member of A i 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

8 END OF SEGMENT

9 Example 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.

10 END OF SEGMENT

11 Example 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.

12 Example Proof: A= set of students (600) B= set of grade sheets. How many grade sheets are there? T 1 : select the elective. T 2 : select the grade for module 1 T 3 : select the grade for module 2 T 4 : select the grade for module 3 T 5 : select the grade for module 4 T 1 can be done in two ways. Each of T 2 to T 5 can be done in four ways. Using multiplication rule, the number of elements of B = 2*4*4*4*4 = 512

13 Example A= set of students (600) B= set of grade sheets. (512 ) f: A —> B where f(x)=grade sheet of x. Since #(A) > #(B), f cannot be 1 — 1 Thus, there exist distinct x, y in A such that f(x) = f(y) In other words, x and y have the same grade sheets.

14 END OF SEGMENT

15 Example 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

16 Example A= 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, or for 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

17 Example A= 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, or for 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.

18 END OF SEGMENT

19 Example 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.

20 Example Suppose the elements of S are s 1, s 2, …,s n+1 Let s i =2 r i w i, where w i is odd. Let B= set of odd numbers  2n. Note that #(B)=n Let f:S—> B where f(s i )=w i Thus, f cannot be1— 1 (by PH principle) Thus, there exist distinct i and j, such that f(s i )= f(s j ) In other words, w i = w j. s i =2 r i w i, s j =2 r j w j Now if, r i >r j then, s j divides s i otherwise, s i divides s j.

21 END OF SEGMENT

22 Floors 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

23 END OF SEGMENT

24 Generalized Pigeonhole Principle If 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), then there exists a y in Y such that y is the image of at least k+1 distinct elements of X.

25 END OF SEGMENT

26 Example Suppose 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.

27 END OF SEGMENT

28 Proof of Pigeonhole Principle Recall 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={y 1, y 2,…, y m } f -1 (y)={x  X | f(x)=y} f -1 (y 1 ), f -1 (y 2 ), …,f -1 (y m ) are pairwise disjoint, whose union is X. Therefore by Addition Rule, #(X) = #(f -1 (y 1 )) + #(f -1 (y 2 )) + … + #(f -1 (y m ) )  1+ 1+……+1 = m #(X)  #(Y) a contradiction. Thus f is not 1—1.

29 END OF SEGMENT


Download ppt "Main Menu Main Menu (Click on the topics below) Pigeonhole Principle Example Generalized Pigeonhole Principle Example Proof of Pigeonhole Principle Click."

Similar presentations


Ads by Google