Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,

Similar presentations


Presentation on theme: "The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,"— Presentation transcript:

1 The Pigeonhole Principle

2 The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes, then there must be at least 1 pigeonhole that has more than one pigeon in it If k+1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects

3 Pigeonhole principle examples In a group of 367 people, there must be two people with the same birthday As there are 366 possible birthdays In a group of 27 English words, at least two words must start with the same letter As there are only 26 letters

4 Pigeonhole principle examples Show that for every integer n there is a multiple of n that has only Os and I s in its decimal expansion. Solution: Let n be a positive integer. Consider the n + 1 integers 1, 11, 111,..., 11... 1 (where the last integer in this list is the integer with n + 1 I s in its decimal expansion). There are n possible remainders when an integer is divided by n. Because there are n + 1 integers in this list, by the pigeonhole principle there must be two with the same remainder when divided by n. The larger of these integers less the smaller one is a multiple of n, which has a decimal expansion consisting entirely of Os and 1 s.

5 Generalized pigeonhole principle If N objects are placed into k boxes, then there is at least one box containing  N/k  objects Proof by contradiction: Suppose that none of the boxes contains more than  N/k  -1 objects. Then, the total number of objects is at most: *

6 Generalized pigeonhole principle Among 100 people, there are at least  100/12  = 9 born on the same month How many students in a class must there be to ensure that 6 students get the same grade (one of A, B, C, D, or F)? The “boxes” are the grades. Thus, k = 5 Thus, we set  N/5  = 6 Lowest possible value for N is 26

7 Example A bowl contains 10 red and 10 yellow balls How many balls must be selected to ensure 3 balls of the same color? One solution: consider the “worst” case We can select all yellow balls before we select a single red ball The next two balls will be red, we may need to select 13 balls Via generalized pigeonhole principle How many balls are required if there are 2 colors, and one color must have 3 balls? How many pigeons are required if there are 2 pigeon holes, and one must have 3 pigeons? number of boxes: k = 2, We want  N/k  = 3 What is the minimum N? N = 5

8 More elegant applications Show that among any n+1 positive integers not exceeding 2n, there must be an integer that divides one of the other integers. Let a 1, a 2, …, a n+1 be such integers (increasing). For any j, a j could be written as 2 k j q j where q j is odd. The integers q 1, q 2, …, q n+1 are all odd positive integers less than 2n. Since there are only n odd numbers less than 2n, q i = q j by the Pigeonhole principle. Let q be q i = q j. Then a i = 2 k i q and a j = 2 k j q. If k i <k j, a i | a j. Otherwise, a j | a i.

9 Permutation, Combination

10 Permutations vs. Combinations Both are ways to count the possibilities The difference between them is whether order matters or not Consider a poker hand: A ♦, 5 ♥, 7 ♣, 10 ♠, K ♠ Is that the same hand as: K ♠, 10 ♠, 7 ♣, 5 ♥, A ♦ Does the order the cards are handed out matter? If yes, then we are dealing with permutations If no, then we are dealing with combinations

11 Permutations A permutation is an ordered arrangement of the elements of some set S Let S = {a, b, c} c, b, a is a permutation of S b, c, a is a different permutation of S An r-permutation is an ordered arrangement of r elements of the set a, b is a 2-permutation of S The notation for the number of r-permutations: P(n,r) a 2-permutation of S is one of P(3, 2) permutations

12 Permutations Number of 5 cards permutations: P(52,5) = 52*51*50*49*48 = 311,875,200 Number of 2 cards permutations: P(52,2) = 52*51 = 2,652 r-permutation notation: P(n,r) P(n, r) = n (n-1)(n-2)…(n-r+1) = n! / (n-r)!

13 r-permutations example How many ways are there for 5 people in this class to give presentations? If there are 27 students in the class: P(27,5) = 27*26*25*24*23 = 9,687,600 Note that the order they go in does matter in this example!

14 Permutation formula proof There are n ways to choose the first element n-1 ways to choose the second n-2 ways to choose the third … n-r+1 ways to choose the r th element By the product rule, that gives us: P(n,r) = n(n-1)(n-2)…(n-r+1)

15 Example How many permutations of {a, b, c, d, e, f, g} end with a? Note that the set has 7 elements The last character must be a The rest can be in any order Thus, we want a 6-permutation on the set {b, c, d, e, f, g} P(6,6) = 6! = 720 Why is it not P(7,6)?

16 Combinations What if order doesn’t matter? In set theory, the following two sets are equivalent: {a, b, c} {b, c, a} The number of r-combinations of a set with n elements, where n is non-negative and 0≤r≤n is: C(n, r) = n! / (r! (n-r)!)

17 Combinations example How many different 5 cards can be selected? C(52, 5) = 2,598,960 How many different 2 cards can be selected? C(52, 2) = 1,326

18 Combination formula proof Let C(n,r) be the number of ways to generate unordered combinations The number of ordered combinations (i.e. r-permutations) is P(n,r) The number of ways to order a single one of those r- permutations P(r,r) The total number of unordered combinations is the total number of ordered combinations (i.e. r-permutations) divided by the number of ways to order each combination Thus, P(n,r) = C(n,r)*P(r,r)

19 Combination formula proof

20 Examples How many bit strings of length 10 contain: exactly four 1’s? Find the positions of the four 1’s Does the order of these positions matter? Nope! Positions 2, 3, 5, 7 is the same as positions 7, 5, 3, 2 Thus, the answer is C(10,4) = 210 at most four 1’s? There can be 0, 1, 2, 3, or 4 occurrences of 1 Thus, the answer is: C(10,0) + C(10,1) + C(10,2) + C(10,3) + C(10,4) = 1+10+45+120+210 = 386

21 Examples How many bit strings of length 10 contain: at least four 1’s? There can be 4, 5, 6, 7, 8, 9, or 10 occurrences of 1 Thus, the answer is: C(10,4) + C(10,5) + C(10,6) + C(10,7) + C(10,8) + C(10,9) + C(10,10) = 210+252+210+120+45+10+1 = 848 Alternative answer: subtract from 2 10 the number of strings with 0, 1, 2, or 3 occurrences of 1 an equal number of 1’s and 0’s? Thus, there must be five 0’s and five 1’s Find the positions of the five 1’s Thus, the answer is C(10,5) = 252

22 Corollary 1 Let n and r be non-negative integers with r ≤ n. Then C(n,r) = C(n,n-r) Proof:

23 Corollary example There are C(52,5) ways to pick a 5-card poker hand There are C(52,47) ways to pick a 47-card hand P(52,5) = 2,598,960 = P(52,47)

24 Example How many ways are there to sit 6 people around a circular table? First, place the first person in the north-most chair Only one possibility Then place the other 5 people There are P(5,5) = 5! = 120 ways to do that By the product rule, we get 1*120 =120 Alternative means to answer this: There are P(6,6)=720 ways to seat the 6 people around the table For each seating, there are 6 “rotations” of the seating Thus, the final answer is 720/6 = 120

25 Binomial Coefficients

26 It allows us to do a quick expansion of (x+y) n Why it’s really important: It provides a good context to present proofs Especially combinatorial proofs

27 Let n and r be non-negative integers with r ≤ n. Then C(n,r) = C(n,n-r) Proof (from last slide set): Review

28 Review: combinatorial proof A combinatorial proof is a proof that uses counting arguments to prove a theorem, rather than some other method such as algebraic techniques Essentially, show that both sides of the proof manage to count the same objects

29 Polynomial expansion Consider (x+y) 3 : Rephrase it as: (x+y) 3 = x 3 + 3 x 2 y + 3 xy 2 + y 3 (x+y)(x+y)(x+y) = x 3 + x 2 y + x 2 y + x 2 y + xy 2 + xy 2 + xy 2 + y 3 When choosing x twice and y once, there are C(3,2) = C(3,1) = 3 ways to choose where the x comes from When choosing x once and y twice, there are C(3,2) = C(3,1) = 3 ways to choose where the y comes from

30 Polynomial expansion Consider: (x+y) 5 =x 5 +5x 4 y+10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5 To obtain the x 5 term Each time you multiple by (x+y), you select the x Thus, of the 5 choices, you choose x 5 times: C(5,5) = 1 Alternatively, you choose y 0 times: C(5,0) = 1 To obtain the x 4 y term Four of the times you multiply by (x+y), you select the x The other time you select the y Thus, of the 5 choices, you choose x 4 times: C(5,4) = 5 Alternatively, you choose y 1 time: C(5,1) = 5 To obtain the x 3 y 2 term C(5,3) = C(5,2) = 10

31 Polynomial expansion: Binomial theorem

32 Examples What is the coefficient of x 12 y 13 in (x+y) 25 ? 25 C 12 What is the coefficient of x 12 y 13 in (2x-3y) 25 ? Rephrase it as (2x+(-3y)) 25 (2x + (-3y)) 25 =  i=0 25 25 C i (2x) i (-3y) 25-i The coefficient occurs when i=12: 25 C 12 (2x) 12 (-3y) 25-12 So coefficient should be 25 C 12 2 12 (-3) 13.

33 Proof practice: corollary 1 Let n be a non-negative integer. Then Algebraic proof Binomial equation: Put x=1, and y = 1

34 Proof practice: corollary 1 Let n be a non-negative integer. Combinatorial proof A set with n elements has 2 n subsets By definition of power set Each subset has either 0 or 1 or 2 or … or n elements,… Thus, the total number of subsets is Thus,

35 Proof practice: corollary 2 Let n be a non-negative integer. Then Proof

36 012345678012345678 n = Pascal’s triangle

37 Pascal’s Identity By Pascal’s identity: 7 C 5 = 6 C 5 + 6 C 4 or 21=15+6 Let n and k be positive integers with n ≥ k. Then n+1 C k = n C k + n C k-1 We will prove this via two ways: Combinatorial proof Using the formula for n C k

38 Combinatorial proof of Pascal’s identity Prove C(n+1,k) = C(n,k-1) + C(n,k) Consider a set T of n+1 elements We want to choose a subset of k elements We will count the number of subsets of k elements via 2 methods Method 1: There are C(n+1,k) ways to choose such a subset Method 2: Let a be an element of set T Let S = T-{a} Two cases a is in such a subset of T: subsets of S with k-1 elements, adding a to these subsets There are C(n,k-1) ways to choose such a subset a is not in such a subset of S: subsets of S with k elements There are C(n,k) ways to choose such a subset Thus, there are C(n,k-1) + C(n,k) ways to choose a subset of k elements Therefore, C(n+1,k) = C(n,k-1) + C(n,k)

39 Vandermonde’s identity Let m, n, and r be non-negative integers with r not exceeding either m or n. Then

40 Vandermonde’s identity proof Consider two sets, one with m items and one with n items Then there are C(m+r, n) ways to choose r items from the union of those two sets Next, we’ll find that value Pick k elements from the set with n elements Pick the remaining r-k elements from the set with m elements Via the product rule, there are C(m, r-k).C(n,k) ways to do that for EACH value of i Lastly, consider this for all values of k:


Download ppt "The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,"

Similar presentations


Ads by Google