Application The Pigeonhole Principle Lecture 37 Section 7

  • Slides: 20
Download presentation
Application: The Pigeonhole Principle Lecture 37 Section 7. 3 Wed, Apr 4, 2007

Application: The Pigeonhole Principle Lecture 37 Section 7. 3 Wed, Apr 4, 2007

The Pigeonhole Principle Pigeon version: If you put n pigeons into m pigeonholes, and

The Pigeonhole Principle Pigeon version: If you put n pigeons into m pigeonholes, and n > m, then at least two pigeons are in the same pigeonhole. ¢ Mathematical version: If A and B are finite sets and |A| > |B| and f : A B, then f is not one-to-one. ¢

Example ¢ If a drawer contains 10 black socks and 12 blue socks, how

Example ¢ If a drawer contains 10 black socks and 12 blue socks, how many socks must you draw at random in order to guarantee that you have two socks of the same color?

Example A bag of jellybeans contains dozens of jelly beans of each of 8

Example A bag of jellybeans contains dozens of jelly beans of each of 8 different colors. How many jellybeans must we choose in order to guarantee that we have at least two jellybeans of the same color? ¢ To guarantee three of the same color? ¢ To guarantee four of the same color? ¢

The Power. Mod function Define the Power. Mod() function as Power. Mod(n, a, m)

The Power. Mod function Define the Power. Mod() function as Power. Mod(n, a, m) = na mod m. ¢ Then the sequence of numbers Power. Mod(3, i, 7), 0 i 10, must contain at least one repeated value. ¢

Example If we choose 6 distinct integers from 1 to 9, at least one

Example If we choose 6 distinct integers from 1 to 9, at least one pair of them adds to 10. ¢ Why? ¢

Example If we choose 6 distinct integers from 1 to 9, at least two

Example If we choose 6 distinct integers from 1 to 9, at least two pairs of the chosen integers have the same total. ¢ Why? ¢

Example ¢ How many integers must we choose from 1 to 99 in order

Example ¢ How many integers must we choose from 1 to 99 in order to guarantee that at least two distinct pairs of them will have the same total?

Functions of Finite Sets Theorem: Let A and B be finite sets with |A|

Functions of Finite Sets Theorem: Let A and B be finite sets with |A| = |B| and let f : A B. Then f is one-toone if and only if f is onto. ¢ Proof: ¢ Suppose that f is not onto. l Let f(A) be the set {f(a) | a A}. l Then f : A f(A) and |f(A)| < |A|. l

Functions of Finite Sets By the mathematical version of the pigeonhole principle, there at

Functions of Finite Sets By the mathematical version of the pigeonhole principle, there at least two distinct members a 1, a 2 A with the same image in f(A). l That is, f(a 1) = f(a 2) for some a 1 a 2. l Thus, f is not one-to-one. l By the contrapositive, if f is one-to-one, then f is onto. l

Functions of Finite Sets ¢ We also need to prove that if f is

Functions of Finite Sets ¢ We also need to prove that if f is onto, then f is one-to-one. (Exercise)

The Locker Problem A hallway has 1000 lockers, numbered 1 through 1000. ¢ We

The Locker Problem A hallway has 1000 lockers, numbered 1 through 1000. ¢ We have 1000 students, numbered 1 through 1000. ¢ For each k from 1 to 1000, we send student #k down the hallway, with instructions to reverse the open/closed status every kth locker door, beginning with locker #k. ¢

The Locker Problem After all the students are done, which lockers doors will be

The Locker Problem After all the students are done, which lockers doors will be open? ¢ Did it matter in which order the students were dispatched? ¢

The Locker Problem Suppose we have only 10 doors and 10 students. ¢ We

The Locker Problem Suppose we have only 10 doors and 10 students. ¢ We wish to leave open doors 2, 4, 5, 8, 9, and no others. ¢ Which students do we send down the hallway so that in the end only doors 2, 4, 5, 8, and 9 are open? ¢

The Locker Problem Clearly, we must not send student #1 down the hallway. ¢

The Locker Problem Clearly, we must not send student #1 down the hallway. ¢ Thus, clearly, we must send student #2 down the hallway. ¢ That will leave open doors 2, 4, 6, 8, 10. ¢ Thus, clearly, we must not send student #3 down the hallway. ¢

The Locker Problem Thus, clearly, neither should we send student #4 down the hallway.

The Locker Problem Thus, clearly, neither should we send student #4 down the hallway. ¢ Thus, clearly, we must send student #5 down the hallway. ¢ That will leave open doors 2, 4, 5, 6, 8. ¢ Thus, clearly, we must send student #6 down the hallway. ¢

The Locker Problem Thus, clearly, we must not send students #7 or #8 down

The Locker Problem Thus, clearly, we must not send students #7 or #8 down the hallway. ¢ Thus, clearly, we must send student #9 down the hallway and we must not send student #10 down the hallway. ¢

The Locker Problem ¢ Given an arbitrary subset D of the 1000 locker doors,

The Locker Problem ¢ Given an arbitrary subset D of the 1000 locker doors, is it possible to send some subset S of the 1000 students down the hallway with their instructions such that in the end, only the doors in set D are open?

The Locker Problem Let A be the set of choices of which students to

The Locker Problem Let A be the set of choices of which students to send down the hallway. ¢ Let B be the set of choices of which locker doors to be left open in the end. ¢ How many elements are in A and B? ¢

The Locker Problem Let f : A B by defining f(A) = the set

The Locker Problem Let f : A B by defining f(A) = the set of doors left open when the students in A are sent down the hallway. ¢ If we can show that f is one-to-one, then it follows that it is onto. ¢ How can we show that f is one-to-one? ¢