The Pigeonhole Principle
A deceptively simple counting fact — if you place more items into fewer containers than items, at least one container must hold more than one item — that proves surprisingly strong, non-obvious guarantees in probability, algorithms, and finance without needing any actual computation.
Prerequisites: Binomial Coefficients and Pascal's Triangle
Some facts feel almost too obvious to be useful — if you have 13 pigeons and only 12 pigeonholes, at least one hole must contain two or more pigeons. That's it; that's the whole idea. What makes this powerful isn't the statement itself but how often a hard-looking problem quietly reduces to exactly this shape once you correctly identify "the pigeons" and "the holes," letting you prove something must be true without ever needing to construct or compute it directly.
An analogy: coat hooks at a party
If 20 guests arrive at a party with only 19 coat hooks, you don't need to check the coat closet to know that at least one hook is holding two coats — it's a logical certainty the moment guest count exceeds hook count, entirely independent of which guests or which hooks end up paired. The principle guarantees existence of a collision without telling you where it is or which items collided; that's often exactly the kind of guarantee needed.
The principle, one symbol at a time
Basic form: if items are placed into containers and , at least one container holds at least 2 items. Generalized form: if items are placed into containers, at least one container holds at least items (the ceiling — round up — of divided by ). In plain English: you cannot spread more items than containers around so thinly that every container gets at most its "fair share" rounded down — averaging always forces at least one container to meet or exceed the rounded-up average. The entire proof technique is: identify what plays the role of "items," identify what plays the role of "containers," count both, and the conclusion follows automatically from simple division — no construction of an explicit example required.
Worked example 1: a direct headcount
A trading desk has 32 employees and each was born in one of 12 months. Can everyone have a distinct birth month? No — with 32 "items" (people) and 12 "containers" (months), the generalized pigeonhole principle guarantees at least one month contains at least people. This says nothing about which month or which three people — it's a pure existence guarantee, reached without checking a single actual birthdate, purely from the headcount of 32 against 12 possible categories.
Worked example 2: a rounding argument in trade sizing
A market maker must execute 47 orders throughout the day, and the exchange only allows orders to be tagged with one of 8 possible priority codes. By pigeonhole, at least one priority code is used by at least orders. Now suppose a compliance rule requires flagging any priority code used more than 5 times in a day for review — pigeonhole proves, before looking at a single actual order, that at least one code will trigger a compliance flag today, purely from the fact that 47 orders exceed (the maximum that could be spread across 8 codes at 5 each). This kind of guarantee is useful precisely because it holds regardless of how the orders happen to be distributed.
What this means in practice
Pigeonhole is the standard existence-proof tool behind hash-collision arguments (why any hash table with more items than buckets must have a collision somewhere), birthday-style problems, bounding worst-case scenarios in scheduling and order-routing (like the compliance example above), and a large share of "prove that..." style interview brainteasers where the answer is a guarantee, not a specific instance. Its appeal is that it proves something must exist without the far harder task of constructing or locating it.
If more items are distributed among fewer containers than items, at least one container must hold more than its "fair share" — specifically at least items for items in containers — a pure counting guarantee that requires no construction of an explicit example, only correctly identifying what the "items" and "containers" are.
Pigeonhole proves existence, not identity or uniqueness — it guarantees at least one container is overloaded, but says nothing about which one, how many are overloaded, or whether more than the minimum required overlap actually occurs. A common mistake in interview settings is trying to extract more specific information (like "which month has 3 people" or "exactly how many collisions") from a pure pigeonhole argument, when the principle only ever promises that some collision exists somewhere, not where or how many.
Related concepts
Practice in interviews
Further reading
- Graham, Knuth & Patashnik, Concrete Mathematics, ch. 5
- Engel, Problem-Solving Strategies, ch. 2