Learn/Combinatorics/Pigeonhole Principle
Combinatorics • Topic 12

Pigeonhole Principle

The Pigeonhole Principle (also known as Dirichlet's box principle) is a deceptively simple yet incredibly powerful tool in combinatorics. It states that if you have more objects than containers, at least one container must hold more than one object.

Basic Statement

Theorem: If or more objects are placed into boxes, then at least one box contains two or more objects.

More generally: If objects are placed into boxes, then at least one box contains or more objects.

The Generalized Pigeonhole Principle

Theorem: If objects are placed into boxes, then at least one box contains at least objects.

(Here denotes the ceiling function—the smallest integer .)

Classic Examples

1. Birthday Problem (Weak Form)

In any group of 367 people, at least two share a birthday.

Why? There are only 366 possible birthdays (including Feb 29), so by pigeonhole, with 367 people, at least two share the same birthday.

2. Handshake Problem

At a party of people, at least two people have the same number of friends at the party.

Proof: Each person can have friends (n possibilities). But if someone has 0 friends, then no one has friends (and vice versa). So there are really only possible values for people. By pigeonhole, two people have the same count.

3. Subset Sum Problem

Among any 10 distinct integers from 1 to 100, there exist two disjoint non-empty subsets with equal sums.

Proof: There are non-empty subsets. The maximum possible sum is at most . So the possible sums range from 1 to 955 (at most 955 values). Since , two subsets have the same sum. If they share elements, remove common elements to get disjoint subsets with equal sums.

Olympiad Techniques

1. Residue Classes

Many pigeonhole problems involve modular arithmetic.

Example: Prove that among any integers, two of them are congruent modulo .

Solution: There are only residue classes modulo : . With integers, by pigeonhole, two fall in the same class.

2. Continuous Pigeonhole

For problems on the real line or plane:

Example: Given 5 points inside a unit square, prove that some two are at distance .

Solution: Divide the unit square into 4 smaller squares of side . By pigeonhole, at least 2 of the 5 points lie in the same small square. The maximum distance within a small square is its diagonal: .

3. Covering Arguments

Example: Color each integer from 1 to 2n with one of n colors. Prove some two consecutive integers have the same color.

Solution: Consider the pairs . If no two consecutive integers share a color, then each pair uses two different colors. But we only have colors for numbers... wait, this needs a different approach.

Actually: There are consecutive pairs: . If no pair has the same color, consider alternating colors along . With only colors and numbers, by pigeonhole, some two numbers share a color. If they're at positions and with same color , and is odd, then there must be two adjacent numbers with the same color between them.

Practice Problems

  1. Prove that among any 52 integers, there exist two whose difference is divisible by 51.
  1. Given 5 lattice points in the plane, prove that some pair has midpoint that is also a lattice point.
  1. (IMO 1972) Prove that from any 10 distinct two-digit numbers, one can select two disjoint subsets with equal sums.
  1. Among 51 points inside a square, prove that some 3 can be covered by a unit circle.