Pigeonhole Principle

Category: Discrete Math   Level: 301

n + 1 items in n boxes ⇒ some box holds at least 2

If there are more items than boxes, some box must hold two or more. With N items in k boxes, some box holds at least ⌈N/k⌉.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: 10 pigeons, 9 holes

There are 10 pigeons and only 9 holes. Every pigeon needs a hole. No pigeon gets a vote.

10 > 9

Step 1: 10 pigeons, 9 holes

Step 2: Spread them out

Give each hole one pigeon, the fairest way. That uses 9 pigeons, and every hole is now full of exactly one.

9 pigeons placed, 1 per hole

Step 2: Spread them out

Step 3: The last pigeon has to double up

Pigeon 10 still needs a hole, and every hole is taken. Wherever it goes, that hole holds 2. No clever plan avoids it.

10 pigeons in 9 holes ⇒ some hole has ≥ 2

Step 3: The last pigeon has to double up

Step 4: Birthdays: 13 people, 12 months

Months are holes and people are pigeons. With 13 people, at least two share a birth month, no matter who shows up.

13 people > 12 months ⇒ shared month

Step 4: Birthdays: 13 people, 12 months

Step 5: More pigeons, bigger piles

With 25 people and 12 months, fill each month with 2 first. That is only 24, so person 25 makes a 3. Some month always has at least ⌈25/12⌉ = 3.

⌈25/12⌉ = 3

Step 5: More pigeons, bigger piles

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render pigeonhole --out /tmp/pigeonhole

Source: svgmath/diagrams/counting.py