Beginner Topic 9 of 51 Theory & Discrete Math
Pigeonhole Principle
If more items than boxes, some box holds two.
How it works
The pigeonhole principle states that if more than n items are placed into n containers, at least one container holds at least two items. The generalized form says that with m items in n boxes, some box has at least the ceiling of m/n items. It is simple but powerful for proving that something must exist without constructing it.
Step-by-step walkthrough
- Place 4 pigeons in 3 boxes.
- Three pigeons fill one box each.
- The fourth must share a box.
- So some box holds at least two.
- It proves that two people in a city of 1000 must share the same number of hairs.
Where it is used
It proves that in any group of 367 people two share a birthday, that any compression algorithm cannot shrink all inputs, that hash collisions are unavoidable and that any sequence of n squared plus 1 distinct numbers has a monotone subsequence of length n plus 1.
Common pitfall
The difficulty lies in identifying the right pigeons and holes, which requires creativity. It shows existence only, not which box or items. Miscounting the number of holes gives weak or false conclusions. Define items and categories carefully, and check whether the generalized version gives a stronger bound.
Where it fits in the course
Pigeonhole Principle is topic 9 of 51 in Theory & Discrete Math, rated Beginner. It follows Permutations and Combinations. The next topic is Recurrence Relations.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Theory & Discrete Math quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Theory & Discrete Math quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Pigeonhole Principle?
Where do people use Pigeonhole Principle?
What is the most common mistake with Pigeonhole Principle?
What should I learn before this topic?
How can I practice it?
Is Pigeonhole Principle hard to learn?
How long does it take to learn Pigeonhole Principle?
Which topics are related to Pigeonhole Principle?
What should I study after Pigeonhole Principle?
Related topics
- Permutations and Combinations (Theory & Discrete Math)
- Recurrence Relations (Theory & Discrete Math)
- Counting Principles (Theory & Discrete Math)
- Graph Theory Basics (Theory & Discrete Math)
- Principle of Least Privilege (Security & Cryptography)