- A pigeon is looking for a spot in the grid, but each box or pigeonhole is occupied. Where should the poor pigeon on the outside go? No matter which box he chooses, he must share with another pigeon. Therefore, if we want all of the pigeons to fit into the grid, there is definitely a pigeonhole that contains more than one pigeon. This concept is commonly known as the pigeonhole principle. The pigeonhole principle itself may seem simple but it is a powerful tool in mathematics.
- 1 Basic Description
- 2 Interesting Applications
- 3 A More Mathematical Explanation
- 4 Why It's Interesting
- 5 Teaching Materials
- 6 References
- 7 Future Directions for this Page
If more than pigeons are put into pigeonholes, then at least one pigeonhole must contain more than one pigeon. This is the famous pigeonhole principle.
Consider the main image of putting pigeons into pigeonholes instead. We have only pigeonholes but more than pigeons; the average value of pigeons per pigeonhole, , is greater than one. Thus, the maximum value of the number of pigeons in a pigeonhole should be greater than one as well, which means that there must be at least two pigeons in a pigeonhole. Now we know that the two versions are actually talking about the same mathematical principle.
The pigeonhole principle is also called the Dirichlet principle, named after a German mathematician Johann Dirichlet. Dirichlet was the first person who formalized this idea in 1834. At that time, Dirichlet named it Schubfachprinzip (drawer principle or shelf principle in English), so Dirichlet's box principle, Dirichlet's drawer principle also refer to pigeonhole principle.
Pigeonhole principle can solve lots of seemingly unbelievable statements. Even though some statements seem out of order, they are actually connected inside and sometimes we need the pigeonhole principle to find the hidden connections.
Here are 6 real world applications to give you a better grasp of this famous principle.
Two or more people in a college have the same birthday (the particular year is not considered).
As we know, there are 366 possible days in a year (including leap year) and a college usually has more than 367 students.
In the most extreme condition when each of the first 366 students have their birthdays on different days from January 1st to December 31th, the birthday of the 367th person must be a repeat of one of those days. Thus, there are definitely two of the students who have their birthday falling on the same day.
In fact, we can view this problem as there are at least 367 pigeons (students in a college) but 366 pigeon holes (the most days during a year). According to the pigeonhole principle, at least two pigeons share the same pigeonhole (at least two people share the same birthday).
2. A Pair of Socks
Assume you have 10 orange socks and 10 blue socks and you want to find a matching pair of socks from a random pick. You will only need to pick three socks.
Translate the statement like this: you have 2 holes (2 kinds of color) but 3 pigeons (3 socks). By the pigeonhole principle, at least two pigeons have the same pigeonhole or at least two socks must be of the same color.
You can also think of it step by step. If the second sock you pick matches the first, you find the matching pair. If not, then one sock must be blue and the other one orange. You pick the third sock and it is either blue or orange. Whichever it is, you can always find a matching pair.
3. A Suit of Cards
Pick 5 cards from a standard deck of 52 cards, and at least two cards will be of the same suit.
Each of the five cards can belong to one of the four suits. So we have five pigeons (five cards) here but four pigeonholes (four suits). By the pigeonhole principle, if four of the cards each belongs to the four suits, then the fifth card has to belong to the same suit as one of the four cards.
There is a more mathematical way to think about this statement. The average value = so the maximum must be at least that, and since we can't pick a fraction of a card, there must be at least two cards of the same suit.
At any given time in New York City there live at least two people who have the same amount of hairs on their head.
A human has a maximum of about 500,000 hairs. In comparison, there are millions of people in New York, which outnumbers the number of hairs a human normally has. By pigeonhole principle, at least two of them must have the same number of hairs.
More mathematically, the average value = is bigger than one, and since we cannot find a fraction of a person, there must be at least 2 people have the same amount of hairs.
This example may sound impossible to believe, but the seemingly obvious pigeonhole principle tells us it must be true.
If 9 people are seated in a row of 12 chairs, then some consecutive set of 3 chairs are filled with people.
As is shown in the figure below, there are 9 people who want to sit on the chairs. We have 9 people and 12 chairs, which leaves us with 3 empty chairs. [...]
As is shown in the figure below, there are 9 people who want to sit on the chairs. We have 9 people and 12 chairs, which leaves us with 3 empty chairs.
Wherever the 3 empty chairs are, they will always partition the 9 filled chairs into 4 groups of consecutive filled chairs. The first two examples below show two ways of partitioning the chairs without two empty chairs next to each other..
Note that if two empty chairs are next to each other, we can consider there to be a group of filled chairs in between; it's just that this group has 0 filled chairs (Example 3). If the empty chair is at one of the two ends of this row, we also say that there exists a group with 0 filled chairs at that end (Example 4). No matter how you place the 3 empty chairs even if they are side by side, the filled chairs will be split into four groups.
So, we want to put 9 people in four groups. The average value of the number of peoples per group, , is . Recall that the maximum value is at least the average value for any non-empty finite set of real numbers. Because , one of the four groups must have at least 3 filled chairs.
6. Strangers or Friends
In a room with six people in it, there will always be either 3 people who know each other or 3 people who don't know each other.
This seems to be a chaotic problem but we need to find order in this mess. Note that these people are randomly chosen, so there will probably be a jumb [...]
We can use a diagram to help us show that this statement is true. Note that these people are randomly chosen, so there will probably be a jumble of friends and strangers in the room. To make the explanation clear, denote the six people as six points of a hexagon. Draw lines joining every pair of two points, and color the lines pink if the two are friends, green if they are strangers. Then it make look like this:
What the statement graphically means is that we can always find a pink triangle (3 mutual friends) or a green triangle (3 mutual strangers) in this hexagon. For instance, there is a pink triangle ADE and a green triangle BFE.
Since there are over 32,000 possible colorings, we could not draw and check every one of the situations. Then let's take a look at a smart and efficient way.
Consider any point of the six: it can connect to five other points with five lines coming out of it. The lines are either pink or green, so we have 2 pigeonholes (2 colors) and 5 pigeons (5 lines). By the pigeonhole principle, the average value is , so the maximum value is at least 3. In other words, at least 3 lines must have the same color and let's suppose the color is pink (it doesn't matter which color has more lines, the result will be the same). To sum up, we suppose that there are at least 3 pink lines coming out of a single point (Figure 1.1).
We will have four points connected by the three pink lines (Figure 1.2). This generates three potential triangles, each with two pink lines already. What about the third line of the three triangles? If we color any of the three remaining lines pink, then we have a pink triangle, which means that there are three people who are friends and know each other (Figure 2.1, Figure 2.2, Figure 2.3). Otherwise, the three third lines make a green triangle (Figure 3). Either way, we get a triangle with three sides the same color, which means that we can always find three people in a group of six who either know each other or don't know each other at all.
A More Mathematical Explanation
- Note: understanding of this explanation requires: *Combinatorics
More Mathematical Examples1. Choose 51 numbers from integers between 1 and 100 inclusiv [...]
More Mathematical Examples
1. Choose 51 numbers from integers between 1 and 100 inclusively. Then there must be two consecutive numbers of among the chosen integers.
We divide the 100 integers in pairs,
There are 50 pigeonholes (pairs) and 51 pigeons (chosen numbers). By the pigeonhole principle, the average value = , so the maximum value is at least 2. There are definitely two pigeons share the same hole. Therefore, we can definitely find two numbers that are a pair of consecutive numbers among the 51 chosen numbers.
2. If you pick 5 integers from 1 to 8, you will definitely find two of them must add up to 9.
No matter which integer you choose, you can always pair it with another integer from 1 to 8 to sum to 9. Thus, there are four such pairs overall:
We are going to stuff five pigeons (chosen integers) into four pigeonholes (pairs). By the pigeonhole principle, the average value = , so the maximum value is at least 2. Two of the integers must be from the same pair, which sums to 9.
3. Given any positive integers, there must exist two integers whose difference can be exactly divided by .
Denote the numbers as . Let be the remainder that results from dividing by where . Because of the bounds ( and ), there are possible values (pigeonholes) for each , but there are 's (pigeons). Thus, by the pigeonhole principle, the average value = , so the maximum value is at least 2. There must be two of the 's that are the same such that
for some positive integers and .
Thus, their corresponding and
- (where is the quotient; it's an integer)
- (where is the quotient; it's an integer)
have the same remainder when divided by , and so the difference is divisible by .
- ( is an integer)
Therefore, among given integers, we definitely will find two integers whose difference can be exactly divided by .
- Given 10 positive integers , there must exist two integers whose difference can be exactly divided by 9.
- Denote the 10 numbers as:
- Denote the 10 numbers as:
- Divide each number by 9 and get the remainder.
- The remainders range from 0 to 8. There are 10 remainders above but only 9 possible values for each remainder. By pigeonhole principle, there must be two of the remainders that are the same such that . Thus, their corresponding have the same remainder when divided by 9, and so the difference is divisible by 9.
How to Construct Pigeonholes
Sometimes, "pigeons" and "pigeonholes" are abstract and not so easy to find. In order to find the clues, we can draw a diagram for the problem. The examples below will show you how pigeonholes can be constructed.
1. We are given a rectangle divided into 27 squares as shown below. If we paint all of the smaller squares either blue or red, we will always find a rectangle whose four corners are of the same color no matter how we paint these squares.
Try to color the rectangles to see how it always works. If you paint them randomly, you will find that there are always two columns that are the sam [...]
Try to color the rectangles to see how it always works. If you paint them randomly, you will find that there are always two columns that are the same. This is our solution.
Since we have to deal with squares, let's narrow it down. If we look at the big rectangles by columns, we only have possible ways to paint a column as Figure 6 shows. This is because each column has three small squares and each square can be painted two possible colors. Thus, .
There are ways to paint a column (pigeonholes) but columns (pigeons). By the pigeonhole principle, the average value = , so the maximum value has to be at least 2. There are at least two columns painted exactly the same.
In each of the two identical columns, we have three squares (pigeons) and two colors (pigeonholes) that we can use. Apply the pigeonhole principle again and we will find that there must be two squares in each column painted the same color. Therefore, the two squares in the same color in each of the identical columns could form the desired rectangle.
2. There are 18 students in a school and they have to choose 4 courses from among 15 different courses. Then two students will find that they take two of the same courses together.
Since the conclusion is about two common courses, we treat the two courses as a whole to avoid working on two courses. This will make it easier to defi [...]
Since the conclusion is about two common courses, we treat the two courses as a whole (a course pair) to avoid working on two courses separately. This would make it easier to define pigeonholes.
Then, let's figure out what are the pigeons and what are the pigeonholes. Because this problem is about course choosing, the pigeonholes are course pairs available to choose and pigeons are course pairs chosen by all of the students. In this case, if a student picks one kind of combination, then he or she puts a pigeon into this pigeonhole.
- Pick courses from available ones, and we can find combinations of course pairs. In other words, we can find 105 pigeonholes.
- The combination notation, , represents the number of possible combinations of objects from a collection of objects.
- Pair up the courses each student chooses and we can know that each student has combinations of course pairs. Overall there are total course pairs chosen by all of the students (that is, there are pigeons).
To sum up, the students have pigeons and they put them into pigeonholes. According to the pigeonhole principle, the average value = , so the maximum is at least 2. There must be two pigeons in one pigeonhole, which means that two students choose the same pigeonhole (the same two courses).
3. Choose 51 numbers from integers from 1 to 100. Then there are definitely two distinct chosen integers such that one is a multiple of the other.
To apply the pigeonhole principle, we need to divide the 100 integers into groups, constructing pigeonholes with certain amount. If we put integers wit [...]
To apply the pigeonhole principle, we need to divide the 100 integers into groups. So we need to put integers with the same quality in a group as we did in previous problems. For this problem, we are going to create 50 groups with any two numbers in each group satisfying the condition such that one is a multiple of the other. The problem is: how should we divide them? Since this problem is about multiples, let's put integers with the same common divisor together.
Consider the odd numbers from to . For each odd number we create a set (where represents positive integers starting at 1 and stopping when becomes greater than 100 ). Thus, we get
- For we have . The set stops at 64 because the next one is going to be .
- For we have . It stops at 96 because the next one is going to be .
- For we have . It stops at 80 because the next one is going to be
- For we have . There is only 97 itself because the next one is going to be .
- For we have . There is only 99 itself because the next one is going to be .
In this way, we divide the 100 integers into 50 disjoint groups where numbers of each group are multiples of each other. Because each group represents a pigeonhole, we have 50 pigeonholes but 51 pigeons (chosen integers) to put into the pigeonholes. By the pigeonhole principle, the average value = , so the maximum value is at least 2. Two of the chosen integers must be in the same group. In other words, the larger number is a multiple of the smaller one.
Based on the examples discussed above, hopefully you have a better understanding of how to construct pigeonholes. Think about how many possible ways you can find in the problem; this is your restriction and also the pigeonholes you are trying to find.
- In the first example, the restriction is 8 because there are only 8 possible ways to color a column consisting of three squares.
- In the second example, if two students choose two common courses, then this pair of courses is definitely one of the 105 combinations. Thus, the restriction is 105.
- In the last example, the restriction ends up being 50 because only 50 distinct groups can be made; there are only 50 odd numbers for integers from 1 to 100.
You can also find inspiration on how to solve the problem from the conclusions in each statement.
- For Example 1, a rectangle with corners the same color suggests you to think of two identical columns because you will definitely find such rectangle with two identical columns.
- For Example 2, two common courses suggest you to treat them as a whole and choose 2 from 15 courses, reminding you to use combinations.
- For Example 3, knowing that one must be a multiple of the other tells you how to divide up the 100 integers.
Therefore, please pay attention to every conclusion because they help a lot!
How to Find the Bounds
So far, we have only been told to prove the statements but one may wonder whether we have reached the lower bound or not. For example, could the rectangle be smaller and still satisfy the condition? This leads to the interesting question of how to find the lower bounds.
Since we want to prove that a number is the best lower bound, the basic idea is to show that a smaller number leads to a contradiction or an error.
1. In a room with 6 people in it, there will always be three people who either know each other or don't know each other.
We've proved that the statement is true. Now think about this question: at least how many people do we need to make sure that there are three mutual fr [...]
We've proved that the statement is true. Now think about this question: at least how many people do we need to make sure that there are three mutual friends or three mutual strangers? This kind of question is related to Ramsey Number. The minimum number of people needed to insure three mutual friends or mutual strangers is denoted as . We know that 6 works, so let's think about 5. It turns out that 5 is impossible because of the image below:
This counterexample tells us that 5 people doesn't always work. So since it can't be less than six people, .
Why It's Interesting
There are more real world applications of the pigeonhole principle.
There are people in a party and is more than 1 so they can shake hands with one another at will. You will always find two people who shake hands with the same number of people.
In this case, the pigeonhole is hands shaken and pigeons are people. Because you can never shake hands with yourself, you only could shake other people's hands, for a total of at most handshakes. So there are possible numbers of handshakes for a given person, and possible people: more pigeons than pigeonholes. According to the pigeonhole principle, the average value is greater than 1 but smaller than 2, so the maximum must be at least 2. At least two people have the same handshake numbers.
- Please note that if you shake hands with a person, this person is also shaking hands with you. Handshaking is mutual.
- This is not an easy example to understand. To solve hard problems like this, we need to know how to construct "pigeons" and "pigeonholes." (See section How to Construct Pigeonholes)
A person is told to take at least one aspirin a day and aspirin in all over a day period. Then there definitely will be a period of consecutive days where he takes exactly aspirin in total. (Assume that .)
Denote as the cumulative number of aspirin taken by day . is increasing every day because he takes at lest one aspirin every day. And since the total number of aspirin is , we have
In order to prove there is a period of consecutive days where the person takes aspirin in total, we have to prove that the equation is true for some . So we first add to every term in the inequality above:
From the two inequalities above we can find integers overall: from the first inequality and from the second inequality .
We also know that the integers have non-decreasing values from 1 to . Hence, there are numbers (pigeons) with possible values (pigeonholes) to assign to.
According to the pigeonhole principle, the average value = . This average value is smaller than 2 but greater than 1, since we assumed that , which is equivalent to saying that . Thus, the maximum value should be at least 2 and two of the integers must be the same.
Which two numbers? Can any two of the integers be the same?
The answer is no. Because the person takes at least one aspirin everyday, the sequence in the first inequality is increasing. So those first terms cannot be equal and it is the same for those in the second inequality. Therefore, we must have one value from the first group equal to one of the values from the second group . Therefore, for some , which is what we wanted to prove.
Dominoes on a Chess Board
Assume we remove two of the diagonally opposite corners of a chess board. Then it is impossible to cover the chess board with dominoes whose size is two board squares each.
The two opposite squares on the diagonal of a chess board have the same color. Thus, there are two more squares of one color than that of another color after the corners are removed (See the figure below).
However, each domino piece covers two squares of exactly two different colors. Every time you put a domino piece (a pigeon) on the chess board, you cover 1 white square and 1 black square. But we don't have the same amount of white and black squares (pigeonholes) on the board. Some squares will be left. By the pigeonhole principle, we can never cover the whole board with dominoes whose size is two board squares each.
Do I Know You?
In a room with people in it, there must be at least two people who know the same number of people.
For a single person, he or she could know from to people (can't include himself or herself), so there are possible numbers. Thus, if we want everyone to have different numbers of acquaintances, one has to have and one acquaintances. This is a contradiction. If one knows people, then the person knows everyone in the room. Since acquaintanceship is a symmetric non-reflexive relationship, the other people must know at least one person. Hence, there couldn't be a person who has acquaintances if there is one who knows people.
- There are currently no teaching materials for this page. Add teaching materials.
 Dijkstra, Edsger W. The Strange Case of The Pigeon-hole Principle. Retrieved from http://www.cs.utexas.edu/users/EWD/transcriptions/EWD09xx/EWD980.html.
 Ramsey Theory. Retrieved from http://www.learner.org/courses/mathilluminated/units/2/textbook/06.php.
 Talwalkar, Presh. 16 fun applications of the pigeonhole principle. Retrieved from http://mindyourdecisions.com/blog/2008/11/25/16-fun-applications-of-the-pigeonhole-principle/.
 Bogomolny, Alexander. Pigeonhole Principle. Retrieved from http://www.cut-the-knot.org/do_you_know/pigeon.shtml.
 Leader, Imre. Friends and strangers. Retrieved from http://plus.maths.org/content/friends-and-strangers.
 The Pigeon Hole Principle. Retrieved from http://zimmer.csufresno.edu/~larryc/proofs/proofs.pigeonhole.html.
 Bautista. The Pigeonhole Principle. Retrieved from http://www.math.admu.edu.ph/~banjo/ajss/Pigeonhole.pdf.
 Pigeonhole Principle. Retrieved from http://www.mathdb.org/notes_download/elementary/combinatorics/de_D4.pdf.
Future Directions for this Page
- There is a helper page linked to this page, Ramsey Number. It is not fully done, so please pick it up and investigate more! Thanks.
Leave a message on the discussion page by clicking the 'discussion' tab at the top of this image page.