Thought Toys · Chance & inference · Exhibit 35
Fill a room with people, one random birthday each. How many do you need before it's better than a coin flip that two of them share a day? Most people guess somewhere over a hundred. Drag the room size up and watch how fast the real answer arrives.
Unlikely, so far
10 people · 45 possible pairs · P(shared birthday) = 11.7% (exact)
Each dot in the top strip is a person, placed at their random birthday somewhere along the year. Drag people in the room up and new dots appear; whenever two land on the very same day, they light up red — a real match, in this particular random room. Hit New room to reroll everyone's birthdays at the same room size and see how often a match actually turns up.
The curve below is not a simulation — it's the exact probability, computed from counting collisions among 365 equally likely days. It rises far faster than most people expect. The usual wrong guess treats it like a coin collector's problem — "I need to fill about half of 365 days, so I need about 183 people" — the fainter, lazily-climbing dashed line. But that's not the right count. What matters isn't how many people are in the room; it's how many pairs of people are in the room, because any pair could be the one that matches. With n people there are n(n−1)/2 pairs — a number that grows roughly like n², not n — so the odds pile up far faster than the naive linear guess. At just 23 people there are already 253 pairs rolling the dice, and 253 independent-ish chances at 1-in-365 odds is enough to tip the balance past 50/50.
Click Run 2,000 rooms at any room size to see the exact formula checked against actual random sampling — thousands of freshly rolled rooms, counted up, landing right on the curve.
improve/verify/35-birthday.js): P(22)≈0.4757 and P(23)≈0.5073, matching the textbook values
exactly, with the crossing landing between them; P(2)=1/365 exactly; and by the
pigeonhole principle — with more people than days, somebody MUST repeat a day,
P(366)=1 exactly, no approximation needed. Two hundred thousand simulated rooms of 23 people land within 1% of
the exact 0.5073. Counter-example: the naive linear guess L(n)=n/365
crosses 50% at n=183 — but at that very room size, the true P(match) is already
1.0000000000, off by roughly 13 zeroes from what "50/50" would mean; the naive model isn't just a little
late, it fundamentally miscounts what's actually growing.
Also in Chance & inference: The drunkard's walk →
← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 35.