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,

Slides:



Advertisements
Similar presentations
Basic Permutations and Combinations
Advertisements

Binomial Coefficients
Counting Chapter 6 With Question/Answer Animations.
1 Section 4.3 Permutations & Combinations. 2 Permutation Set of distinct objects in an ordered arrangement An ordered arrangement of r members of a set.
Permutations and Combinations Rosen 4.3. Permutations A permutation of a set of distinct objects is an ordered arrangement these objects. An ordered arrangement.
Counting Chapter 6 With Question/Answer Animations.
Chapter 6 With Question/Answer Animations. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
1 Discrete Math CS 2800 Prof. Bart Selman Module Counting Chapter 5, Rosen.
CSE115/ENGR160 Discrete Mathematics 04/17/12
Permutations r-permutation (AKA “ordered r-selection”) An ordered arrangement of r elements of a set of n distinct elements. permutation of a set of n.
Lecture 5 Counting 4.3, Permutations r-permutation: An ordered arrangement of r elements of a set of n distinct elements. Example: S={1,2,3}:
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 The Pigeonhole Principle CS/APMA 202 Rosen section 4.2 Aaron Bloomfield.
1 Permutations and Combinations CS/APMA 202 Epp section 6.4 Aaron Bloomfield.
Permutations and Combinations
1 Permutations and Combinations CS/APMA 202 Rosen section 4.3 Aaron Bloomfield.
Permutations and Combinations
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Counting Chapter 6 With Question/Answer Animations.
1 Permutations and Combinations CS/APMA 202 Rosen section 4.3 Aaron Bloomfield.
Counting. Why counting  Determine the complexity of algorithms To sort n numbers, how many instructions are executed ?  Count the number of objects.
The Basics of Counting Section 6.1.
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Binomial Coefficients, Inclusion-exclusion principle
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
2 Permutations and Combinations Lesson 8 HAND OUT REFERENCE SHEET AND GO OVER IT.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Lecture 5 Counting 4.3, Permutations r-permutation: An ordered arrangement of r elements of a set of n distinct elements. Example: S={1,2,3}:
1 Binomial Coefficients CS 202 Epp, section ??? Aaron Bloomfield.
4.1.2 Pigeonhole principle:Strong Form  Theorem 4.2: Let q 1,q 2,…,q n be positive integers. If q 1 +q 2 +…+q n -n+1 objects are put into n boxes, then.
Module #15: Combinatorics Rosen 5 th ed., §§ & §6.5 Now we are moving on to Ch. 4 It is the study of arrangement of objects e.g. enumeration, counting.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 4 Counting methods and the pigeonhole principle.
Spatial Statistics and Spatial Knowledge Discovery First law of geography [Tobler]: Everything is related to everything, but nearby things are more related.
1 The Pigeonhole Principle CS 202 Epp section 7.3.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Introduction Suppose that a password on a computer system consists of 6, 7, or 8 characters. Each of these characters must be a digit or a letter of the.
Section 6.4. Powers of Binomial Expressions Definition: A binomial expression is the sum of two terms, such as x + y. (More generally, these terms can.
Binomial Coefficients and Identities
1 The Pigeonhole Principle CS 202 Epp section ??? Aaron Bloomfield.
L14: Permutations, Combinations and Some Review EECS 203: Discrete Mathematics.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
Chapter 6 With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
11.1 CompSci 102© Michael Frank Today’s topics CountingCounting –Generalized Pigeonhole Principle –Permutations –Combinations –Binomial Coefficients –Writing.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Section 6.3. Section Summary Permutations Combinations.
L14: Permutations, Combinations and Some Review
The Pigeonhole Principle
Permutations and Combinations
CSE15 Discrete Mathematics 04/19/17
Chapter 5, Section 5.1 The Basics of Counting
Today’s topics Counting Reading: Sections , 4.4 Upcoming
COCS DISCRETE STRUCTURES
Permutations and Combinations
The Pigeonhole Principle
Permutations and Combinations
Permutations and Combinations
CS 2210 Discrete Structures Counting
CS100: Discrete structures
Permutations and Combinations
Basic Counting.
The Pigeonhole Principle
Counting techniques Basic Counting Principles, Pigeonhole Principle, Permutations and Combinations.
Presentation transcript:

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, 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

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

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,..., (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.

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: *

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

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

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.

Permutation, Combination

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

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

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)!

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!

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)

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)?

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)!)

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

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)

Combination formula proof

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) = = 386

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) = = 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

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

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)

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

Binomial Coefficients

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

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

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

Polynomial expansion Consider (x+y) 3 : Rephrase it as: (x+y) 3 = x 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

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

Polynomial expansion: Binomial theorem

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= C i (2x) i (-3y) 25-i The coefficient occurs when i=12: 25 C 12 (2x) 12 (-3y) So coefficient should be 25 C (-3) 13.

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

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,

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

n = Pascal’s triangle

Pascal’s Identity By Pascal’s identity: 7 C 5 = 6 C 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

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)

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

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: