The Pigeonhole Principle

If n+1 pigeons fly into n holes, at least one hole has 2+ pigeons

The Pigeonhole Principle

The Pigeonhole Principle is one of the simplest yet most powerful proof techniques in mathematics. If you have more pigeons than pigeonholes, at least one hole must contain multiple pigeons. Despite its simplicity, this principle underlies surprising results in combinatorics, number theory, and computer science.

The key to applying the principle is correctly identifying what the "pigeons" and "holes" represent in your problem. Once you find the right formulation, many "impossible" sounding problems become trivial.

Basic Pigeonhole

Drag pigeons into holes and watch the principle in action. With n+1 pigeons and n holes, a collision is unavoidable -- try to avoid it!

Basic Pigeonhole Demo

Drag the pigeons into the holes. When you have more pigeons than holes, at least one hole must contain 2+ pigeons!

5
4
You have 5 pigeons and 4 holes. Since 5 > 4, the pigeonhole principle guarantees at least one hole will have 2+ pigeons. Try placing all pigeons!

Key Insight

If n+1 objects are placed into n containers, at least one container must hold more than one object. This simple fact is surprisingly powerful in mathematics!

Key insight: The Pigeonhole Principle proves existence without construction. We know a hole with 2+ pigeons must exist, but we cannot predict which one it will be.

Generalized Pigeonhole

The extended principle: if kn+1 objects are distributed among n containers, at least one container holds k+1 or more objects. Adjust the parameters and see the guaranteed minimum per container.

Generalized Pigeonhole Principle

If kn+1 objects are placed into n boxes, at least one box contains k+1 or more objects.

Objects needed = k × n + 1 = 2 × 4 + 1 = 9
Guarantees at least one box has 3+ objects
4
2
Objects placed: 0 / 9Max in any box: 0

Generalized Form

If kn+1 objects are distributed among n containers, at least one container must hold at least k+1 objects. This generalizes the basic principle (where k=1).

Key insight: The generalized form is proved by contradiction. If every container held at most k objects, the total would be at most kn, which is less than kn+1. So at least one container must hold k+1.

Classic Applications

Explore famous problems solved by the Pigeonhole Principle. For each one, identify the pigeons and holes, then see how the conclusion follows immediately.

Classic Applications

Practice identifying the "pigeons" and "holes" in famous problems. This skill is key to applying the principle!

Matching Socks

A drawer contains socks of 2 different colors (black and white). What is the minimum number of socks you must draw (without looking) to guarantee you have at least 2 socks of the same color?

Key insight: The creative step is choosing what counts as a "pigeon" and what counts as a "hole." The same problem can often be solved by different pigeonhole formulations.

Key Takeaways

  • Basic form -- n+1 objects in n containers guarantees a container with 2+
  • Generalized form -- kn+1 objects in n containers guarantees a container with k+1
  • Existence without construction -- we know a collision exists but not which one
  • The art is the formulation -- correctly identifying pigeons and holes is the creative step