Virtual laboratory/Mathematics/Combinatorics/The pigeonhole principle (Dirichlet)

The pigeonhole principle (Dirichlet)

The pigeonhole principle (Dirichlet, 1834): if there are more objects than boxes, some box must contain at least two. Set the numbers and watch the unavoidable collision.

The pigeonhole principle (Dirichlet)
Mathematics · Combinatorics · The pigeonhole principle (Dirichlet, 1834)
Objects NN9 pcs
Boxes MM4 box
In a group of 13 people, were at least two born in the same month?
objects N
9
boxes M
4
min. in fullest ⌈N/M⌉
3
collision
certain
🎯 Challenge: force the guaranteed minimum
streak: 0

I’ll give you a target minimum — choose N and M so that the fullest box is guaranteed at least that many, i.e. ⌈N/M⌉ = goal.

What just happened?

We placed N objects into M boxes, spreading them as evenly as possible. When there are more objects than boxes, at least one box must take a second object — there is no other way.

Dirichlet’s pigeonhole principle:

N>M  ⇒  ∃ a box with≥⌈NM⌉objectsN > M \;\Rightarrow\; \exists\, \text{a box with} \ge \left\lceil \tfrac{N}{M} \right\rceil \text{objects}

If we place N objects into M boxes and N>MN > M, then at least one box contains two or more objects. N — number of objects, M — number of boxes.

General version (stronger):

Not just “at least two” — there is always a box with at least the ceiling of the average:

max⁡j ∣Sj∣  ≥  ⌈NM⌉\max_j \, |S_j| \;\ge\; \left\lceil \frac{N}{M} \right\rceil

For 13 people and 12 months: ⌈13/12⌉=2\lceil 13/12\rceil = 2 — a guaranteed pair. For 25 people and 12 months: ⌈25/12⌉=3\lceil 25/12\rceil = 3 — a guaranteed triple.

Why does this work?

Proof by contradiction: if every one of the M boxes had at most one object, then at most M objects would fit in total. But we have N > M, so that is impossible — a contradiction. The collision is therefore necessary.

Why you need this for the exam:

The pigeonhole principle is a flagship tool in combinatorial proofs. The trick: name the “objects” and “boxes” so that there are N and M of them with N > M — the rest follows on its own. Classics: two people with the same number of acquaintances, two points close together, a repeated remainder of a division.

Remember: more objects than boxes ⇒ a certain collision. In general the fullest box has at least ⌈N/M⌉ objects. It is not chance — it is necessity.

Illustrative model · NexTutor Virtual Laboratory

Enjoyed the experiment? Share it.

It's free — send it to friends from school.

Theory & formulas

Dirichlet's principle

If we place NN objects into MM boxes and N>MN>M, then at least one box contains ≥2\ge 2 objects.

General version

There is a box containing at least: ⌈NM⌉\left\lceil \frac{N}{M}\right\rceil objects.

Example

1313 people, 1212 months — two of them are sure to have birthdays in the same month.

Notation: NN number of objects, MM number of boxes, ⌈⋅⌉\lceil\cdot\rceil rounding up.

Frequently asked questions

›

In a group of 13 people, must two share a birthday month?

Yes, for certain — 13 people, 12 months, so by the pigeonhole principle some month repeats.

›

What does the pigeonhole principle say in general?

With N objects and M boxes there is a box containing at least ⌈N/M⌉ objects.

Teaching? Embed this experiment on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →