Skip to main content

Pigeonhole Principle


The Pigeonhole Principle is a simple but powerful tool used in Discrete Mathematics and Combinatorics. It is also called the Dirichlet box principle (in honor of the German mathematician Dirichlet) or the Drawer Principle. The Pigeonhole principle states that if there are more pigeons than there are pigeonholes, there must be more than one pigeon in at least one pigeon hole. It may seem like a trivial statement, but the Pigeonhole Principle has applications in various fields, from computer science to cryptography. 

To understand the Pigeonhole principle, consider a scenario where we have 4 pigeons and 3 pigeonholes. If we try to put each pigeon in a separate pigeon hole, we will get one pigeon hole with two pigeons in it. This is because there are more pigeons than pigeonholes. 




Generally the Pigeonhole Principle can be stated as follows:

Theorem 1: (Pigeonhole Principle)

If n objects are placed into m containers (n>m), then at least one box must contain more than one object.
Proof: (Proof by Contradiction)
Suppose each container contains at most 1 object.
Then the total number of objects is at most m.
This contradicts the fact that there are n (n>m) pigeons.

To understand the principle of pigeonhole, let us consider a simple example.

Example 1:
Suppose there are six students in a class and each student is assigned a unique number from 1 to 5. The Pigeonhole Principle tells us that at least two students must have the same number. why is that? Well, there are only five different numbers, but six students. Therefore, two students should be assigned at least one number.

Let's consider another example to see how the Pigeonhole Principle can be used to solve a problem.

Example 2:
A box contains three pairs of socks, red, blue and white. Suppose a person takes out a sock without looking at it. At least how many socks must he take out of the box to ensure that he has at least one pair of the same color?

Answer:
If he buys only 2 or 3 socks, they can all be different. For example, they may be one red and one blue; Or maybe a red one, a blue one, and a white one. But if I take out 4 socks, a pair of socks of the same color must be included. Here the four selected socks are "objects" and the 3 colors are "containers"; (Theorem 1). According to the Pigeonhole Principle, at least two of the four chosen must have the same color and therefore be a matching pair. Thus the minimum number of socks to be taken out is 4.

This kind of problem was published earlier     on this blog site itself. Click here.

Example 3:
How many students does a school need to have to ensure that there are at least two students with the same first two initials?

Answer:
There are 26×26=676 different possible sets of two initials that can be obtained using the 26 letters A, B, C, ..., Z. So the number of students should be more than 676. Thus the minimum number of students is 677.

Example 4:
Imagine you have a group of 400 people and you want to know if any two of them share the same birthday. To solve this problem, we can use the pigeonhole principle. There are 365 days in a year, but there are 400 people in the team. So there are more people than there are days in a year. Therefore, according to the Pigeonhole principle, at least two people must share the same birthday.

The pigeonhole principle can also be used to solve more complex problems.

Example 5:
Suppose you randomly select k from the first 2022 positive integers. What is the smallest k that ensures that at least one pair of selected integers adds up to 2023?

Answer:
There are 2022/2=1011 pairs of integers that add up to 2023. They are (1,2022),(2,2021),(3,2020),..., (1011,1012). If only 1008 positive integers are selected, , 1008 positive integers can be selected such that none of them add to 2023 in pairs. If only 1008 integers are selected, 1008 positive integers can be selected, none of which add to 2023 in pairs. According to the Pigeonhole Principle, choosing at least 1011+1=1012 integers guarantees that at least one pair will be part of a pair that adds up to 2023.

Now let's look at some of the  practical application.

The pigeonhole principle is used in a variety of contexts, from computer science and cryptography to music theory and sports scheduling. Below are some examples:

  • Computer Science: In computer science, this principle is used to prove the existence of certain solutions and to analyze algorithms. One example of an application of the pigeonhole principle in computer science is Analyzing Hash Functions. A hash function maps a large input space to a small output space. According to the Pigeonhole principle, if the input space is larger than the output space, then two different inputs must be mapped to the same output. This is called a collision and is a fundamental problem in hash function design. By analyzing the number of possible collisions, computer scientists can determine the efficiency and security of a hash function.
  • Cryptography: Pigeonhole principle can be used to show that no encryption scheme is completely unbreakable. When there are more messages than all possible keys, at least one message must be encrypted with the same key. This is called a collision, and it means that the encryption scheme is vulnerable to attack. A possible piece of information.(This is usually a string of numbers or letters stored in a file.))
  • Sport Scheduling: Pigeonhole principle is used in game scheduling to ensure that each team plays an equal number of games. For example, in a league with 10 teams and a 9-game schedule, each team must play at least one opponent twice.

Finally, the Pigeonhole Principle is a powerful tool that can be used to solve a wide range of problems. By understanding the principle and applying it to different situations, we can gain new insights and solve problems that otherwise seemed intractable. Whether you're a mathematician, computer scientist, musician, or sports fan, the Pigeonhole Principle is a concept you should be familiar with.


References 

  • https://brilliant.org/wiki/pigeonhole-principle-definition/
  • https://en.wikipedia.org/wiki/Pigeonhole_principle


-Ashan Jayamal-

Comments