Skip to content

The pigeonhole principle

4 min read

Short answer

If n+1n+1 objects go into nn boxes, some box gets at least two. Generalized: NN objects in kk boxes force some box to hold at least ⌈N/k⌉\lceil N/k\rceil. It proves that something exists without finding it.

Basic form compared with Generalized formBasic formn + 1 objects, n boxesSome box holds ≥ 213 people: two share abirth monthGeneralized formN objects, k boxesSome box holds ≥ ⌈N/k⌉25 people, 12 months:≥ 3 in one month
The hard part is deciding what the pigeons and the holes are.

Why it works

Suppose every box held at most one object. Then the total would be at most nn, contradicting n+1n+1. The proof is a one-line contradiction, yet the consequences are surprisingly strong.

How to apply it

Name the pigeons (the things you have) and the holes (the categories). If pigeons outnumber holes, a collision is guaranteed. Good holes are remainders, birthdays, colors, or ranges of values.

Worked example

What is the smallest group of integers that guarantees two of them leave the same remainder when divided by 44?

There are only 44 possible remainders (0,1,2,30,1,2,3), the holes. With 55 integers (pigeons) two must share a remainder. With only 44 integers they could all differ, so the minimum is 55.

Try it yourself

A drawer has 1010 red, 1010 blue and 1010 green socks. How many must you draw in the dark to be sure of a matching pair?

Show the answer

Three colors are the holes, so drawing 44 socks guarantees two of the same color. Three socks could all differ.

Keep going with practice

Vidi's probability lessons count outcomes; the pigeonhole principle is the counting tool for certainty.