18.9 KB · commit a9602da
Suppose that a flock of 20 pigeons flies into a set of 19 pigeonholes to roost. Because there are 20 pigeons but only 19 pigeonholes, at least one of these 19 pigeonholes must have at least two pigeons in it. To see why this is true, note that if each pigeonhole had at most one pigeon in it, at most 19 pigeons, one per hole, could be accommodated. This illustrates a general principle called the pigeonhole principle, which states that if there are more pigeons than pigeonholes, then there must be at least one pigeonhole with at least two pigeons in it (see Figure 1). Of course, this principle applies to other objects besides pigeons and pigeonholes.
Figure 1 — There Are More Pigeons Than Pigeonholes.
Proof: We prove the pigeonhole principle using a proof by contraposition. Suppose that none of the k boxes contains more than one object. Then the total number of objects would be at most k. This is a contradiction, because there are at least k+1 objects. ■
The pigeonhole principle is also called the Dirichlet drawer principle, after the nineteenth-century German mathematician G. Lejeune Dirichlet, who often used this principle in his work. (Dirichlet was not the first person to use this principle; a demonstration that there were at least two Parisians with the same number of hairs on their heads dates back to the 17th century—see Exercise 33.) It is an important additional proof technique supplementing those we have developed in earlier chapters. We introduce it in this chapter because of its many important applications to combinatorics.
We will illustrate the usefulness of the pigeonhole principle. We first show that it can be used to prove a useful corollary about functions.
Proof: Suppose that for each element y in the codomain of f we have a box that contains all elements x of the domain of f such that f(x)=y. Because the domain contains k+1 or more elements and the codomain contains only k elements, the pigeonhole principle tells us that one of these boxes contains two or more elements x of the domain. This means that f cannot be one-to-one. ■
Examples 1–3 show how the pigeonhole principle is used.
Among any group of 367 people, there must be at least two with the same birthday, because there are only 366 possible birthdays. ◀
In any group of 27 English words, there must be at least two that begin with the same letter, because there are 26 letters in the English alphabet. ◀
How many students must be in a class to guarantee that at least two students receive the same score on the final exam, if the exam is graded on a scale from 0 to 100 points?
Solution: There are 101 possible scores on the final. The pigeonhole principle shows that among any 102 students there must be at least 2 students with the same score. ◀
The pigeonhole principle is a useful tool in many proofs, including proofs of surprising results, such as that given in Example 4.
Show that for every integer n there is a multiple of n that has only 0s and 1s 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 1s in its decimal expansion). Note that 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 0s and 1s. ◀
The pigeonhole principle states that there must be at least two objects in the same box when there are more objects than boxes. However, even more can be said when the number of objects exceeds a multiple of the number of boxes. For instance, among any set of 21 decimal digits there must be 3 that are the same. This follows because when 21 objects are distributed into 10 boxes, one box must have more than 2 objects.
Proof: We will use a proof by contraposition. Suppose that none of the boxes contains more than ⌈N/k⌉−1 objects. Then, the total number of objects is at most k(⌈kN⌉−1)<k((kN+1)−1)=N, where the inequality ⌈N/k⌉<(N/k)+1 has been used. This is a contradiction because there are a total of N objects. ■
A common type of problem asks for the minimum number of objects such that at least r of these objects must be in one of k boxes when these objects are distributed among the boxes. When we have N objects, the generalized pigeonhole principle tells us there must be at least r objects in one of the boxes as long as ⌈N/k⌉≥r. The smallest integer N with N/k>r−1, namely, N=k(r−1)+1, is the smallest integer satisfying the inequality ⌈N/k⌉≥r. Could a smaller value of N suffice? The answer is no, because if we had k(r−1) objects, we could put r−1 of them in each of the k boxes and no box would have at least r objects.
When thinking about problems of this type, it is useful to consider how you can avoid having at least r objects in one of the boxes as you add successive objects. To avoid adding a rth object to any box, you eventually end up with r−1 objects in each box. There is no way to add the next object without putting an rth object in that box.
Examples 5–8 illustrate how the generalized pigeonhole principle is applied.
Among 100 people there are at least ⌈100/12⌉=9 who were born in the same month. ◀
What is the minimum number of students required in a discrete mathematics class to be sure that at least six will receive the same grade, if there are five possible grades, A, B, C, D, and F?
Solution: The minimum number of students needed to ensure that at least six students receive the same grade is the smallest integer N such that ⌈N/5⌉=6. The smallest such integer is N=5⋅5+1=26. If you have only 25 students, it is possible for there to be five who have received each grade so that no six students have received the same grade. Thus, 26 is the minimum number of students needed to ensure that at least six students will receive the same grade. ◀
a) How many cards must be selected from a standard deck of 52 cards to guarantee that at least three cards of the same suit are chosen? b) How many must be selected to guarantee that at least three hearts are selected?
Solution: a) Suppose there are four boxes, one for each suit, and as cards are selected they are placed in the box reserved for cards of that suit. Using the generalized pigeonhole principle, we see that if N cards are selected, there is at least one box containing at least ⌈N/4⌉ cards. Consequently, we know that at least three cards of one suit are selected if ⌈N/4⌉≥3. The smallest integer N such that ⌈N/4⌉≥3 is N=2⋅4+1=9, so nine cards suffice. Note that if eight cards are selected, it is possible to have two cards of each suit, so more than eight cards are needed. Consequently, nine cards must be selected to guarantee that at least three cards of one suit are chosen. One good way to think about this is to note that after the eighth card is chosen, there is no way to avoid having a third card of some suit.
b) We do not use the generalized pigeonhole principle to answer this question, because we want to make sure that there are three hearts, not just three cards of one suit. Note that in the worst case, we can select all the clubs, diamonds, and spades, 39 cards in all, before we select a single heart. The next three cards will be all hearts, so we may need to select 42 cards to get three hearts. ◀
What is the least number of area codes needed to guarantee that the 25 million phones in a state can be assigned distinct 10-digit telephone numbers? (Assume that telephone numbers are of the form NXX-NXX-XXXX, where the first three digits form the area code, N represents a digit from 2 to 9 inclusive, and X represents any digit.)
Solution: There are eight million different phone numbers of the form NXX-XXXX (as shown in Example 8 of Section 6.1). Hence, by the generalized pigeonhole principle, among 25 million telephones, at least ⌈25,000,000/8,000,000⌉=4 of them must have identical phone numbers. Hence, at least four area codes are required to ensure that all 10-digit numbers are different. ◀
Example 9, although not an application of the generalized pigeonhole principle, makes use of similar principles.
Suppose that a computer science laboratory has 15 workstations and 10 servers. A cable can be used to directly connect a workstation to a server. For each server, only one direct connection to that server can be active at any time. We want to guarantee that at any time any set of 10 or fewer workstations can simultaneously access different servers via direct connections. Although we could do this by connecting every workstation directly to every server (using 150 connections), what is the minimum number of direct connections needed to achieve this goal?
Solution: Suppose that we label the workstations W1,W2,…,W15 and the servers S1,S2,…,S10. Furthermore, suppose that we connect Wk to Sk for k=1,2,…,10 and each of W11,W12,W13,W14, and W15 to all 10 servers. We have a total of 60 direct connections. Clearly any set of 10 or fewer workstations can simultaneously access different servers. We see this by noting that if workstation Wj is included with 1≤j≤10, it can access server Sj, and for each workstation Wk with k≥11 included, there must be a corresponding workstation Wj
with 1≤j≤10 not included, so Wk can access server Sj. (This follows because there are at least as many available servers Sj as there are workstations Wj with 1≤j≤10 not included.)
Now suppose there are fewer than 60 direct connections between workstations and servers. Then some server would be connected to at most ⌊59/10⌋=5 workstations. (If all servers were connected to at least six workstations, there would be at least 6⋅10=60 direct connections.) This means that the remaining nine servers are not enough to allow the other 10 workstations to simultaneously access different servers. Consequently, at least 60 direct connections are needed. It follows that 60 is the answer. ◀
In many interesting applications of the pigeonhole principle, the objects to be placed in boxes must be chosen in a clever way. A few such applications will be described here.
During a month with 30 days, a baseball team plays at least one game a day, but no more than 45 games. Show that there must be a period of some number of consecutive days during which the team must play exactly 14 games.
Solution: Let aj be the number of games played on or before the jth day of the month. Then a1,a2,…,a30 is an increasing sequence of distinct positive integers, with 1≤aj≤45. Moreover, a1+14,a2+14,…,a30+14 is also an increasing sequence of distinct positive integers, with 15≤aj+14≤59.
The 60 positive integers a1,a2,…,a30,a1+14,a2+14,…,a30+14 are all less than or equal to 59. Hence, by the pigeonhole principle two of these integers are equal. Because the integers aj, j=1,2,…,30 are all distinct and the integers aj+14, j=1,2,…,30 are all distinct, there must be indices i and j with ai=aj+14. This means that exactly 14 games were played from day j+1 to day i. ◀
Show that among any n+1 positive integers not exceeding 2n there must be an integer that divides one of the other integers.
Solution: Write each of the n+1 integers a1,a2,…,an+1 as a power of 2 times an odd integer. In other words, let aj=2kjqj for j=1,2,…,n+1, where kj is a nonnegative integer and qj is odd. The integers q1,q2,…,qn+1 are all odd positive integers less than 2n. Because there are only n odd positive integers less than 2n, it follows from the pigeonhole principle that two of the integers q1,q2,…,qn+1 must be equal. Therefore, there are distinct integers i and j such that qi=qj. Let q be the common value of qi and qj. Then, ai=2kiq and aj=2kjq. It follows that if ki<kj, then ai divides aj; while if ki>kj, then aj divides ai. ◀
A clever application of the pigeonhole principle shows the existence of an increasing or a decreasing subsequence of a certain length in a sequence of distinct integers. We review some definitions before this application is presented. Suppose that a1,a2,…,aN is a sequence of real numbers. A subsequence of this sequence is a sequence of the form ai1,ai2,…,aim, where 1≤i1<i2<⋯<im≤N. Hence, a subsequence is a sequence obtained from the original sequence by including some of the terms of the original sequence in their original order, and perhaps not including other terms. A sequence is called strictly increasing if each term is larger than the one that precedes it, and it is called strictly decreasing if each term is smaller than the one that precedes it.
We give an example before presenting the proof of Theorem 3.
The sequence 8,11,9,1,4,6,12,10,5,7 contains 10 terms. Note that 10=32+1. There are four strictly increasing subsequences of length four, namely, 1,4,6,12; 1,4,6,7; 1,4,6,10; and 1,4,5,7. There is also a strictly decreasing subsequence of length four, namely, 11,9,6,5. ◀
The proof of the theorem will now be given.
Proof of Theorem 3: Let a1,a2,…,an2+1 be a sequence of n2+1 distinct real numbers. Associate an ordered pair with each term of the sequence, namely, associate (ik,dk) to the term ak, where ik is the length of the longest increasing subsequence starting at ak, and dk is the length of the longest decreasing subsequence starting at ak.
Suppose that there are no increasing or decreasing subsequences of length n+1. Then ik and dk are both positive integers less than or equal to n, for k=1,2,…,n2+1. Hence, by the product rule there are n2 possible ordered pairs for (ik,dk). By the pigeonhole principle, two of these n2+1 ordered pairs are equal. In other words, there exist terms as and at, with s<t such that is=it and ds=dt. We will show that this is impossible. Because the terms of the sequence are distinct, either as<at or as>at. If as<at, then, because is=it, an increasing subsequence of length it+1 can be built starting at as, by taking as followed by an increasing subsequence of length it beginning at at. This is a contradiction. Similarly, if as>at, the same reasoning shows that ds must be greater than dt, which is a contradiction. ■
The final example shows how the generalized pigeonhole principle can be applied to an important part of combinatorics called Ramsey theory, after the English mathematician F. P. Ramsey. In general, Ramsey theory deals with the distribution of subsets of elements of sets.
Assume that in a group of six people, each pair of individuals consists of two friends or two enemies. Show that there are either three mutual friends or three mutual enemies in the group.
Solution: Let A be one of the six people. Of the five other people in the group, there are either three or more who are friends of A, or three or more who are enemies of A. This follows from the generalized pigeonhole principle, because when five objects are divided into two sets, one of the sets has at least ⌈5/2⌉=3 elements. In the former case, suppose that B,C, and D are friends of A. If any two of these three individuals are friends, then these two and A form a group of three mutual friends. Otherwise, B,C, and D form a set of three mutual enemies. The proof in the latter case, when there are three or more enemies of A, proceeds in a similar manner. ◀
The Ramsey number R(m,n), where m and n are positive integers greater than or equal to 2, denotes the minimum number of people at a party such that there are either m mutual friends or n mutual enemies, assuming that every pair of people at the party are friends or enemies.
Example 13 shows that R(3,3)≤6. We conclude that R(3,3)=6 because in a group of five
people where every two people are friends or enemies, there may not be three mutual friends or three mutual enemies (see Exercise 26).
It is possible to prove some useful properties about Ramsey numbers, but for the most part it is difficult to find their exact values. Note that by symmetry it can be shown that R(m,n)=R(n,m) (see Exercise 30). We also have R(2,n)=n for every positive integer n≥2 (see Exercise 29). The exact values of only nine Ramsey numbers R(m,n) with 3≤m≤n are known, including R(4,4)=18. Only bounds are known for many other Ramsey numbers, including R(5,5), which is known to satisfy 43≤R(5,5)≤49.