Lesson
The theory β Birthday Paradox Explorer
The birthday problem asks for the probability that at least two people anywhere in the group share a birthday. It is not the probability that someone matches you, and it is not about any particular date β that distinction is the whole reason the answer feels wrong.
What each symbol means
P(match)- the probability that some pair shares a birthday β the headline figure,
50.7%atn = 23. P(all unique)- the probability that no two people share one. The two always add to 100%:
50.7% + 49.3%. pairs- how many pairs the group contains,
n(nβ1)/2β at 23 people that is253, and it is pairs rather than people that drives the probability up.
How to read what you see
The two probabilities come first, then the pair count, then a numbered walk-through. Below that the formula shows exactly what was multiplied: 1 β (365/365 Γ 364/365 Γ β― Γ 343/365), one factor per person, ending at 1 β 0.492703 = 0.507297. Each factor is the chance the next person misses every birthday already taken.
- Assumes
- 365 equally likely birthdays, independent between people. No leap days, no twins, and no seasonal pattern in births β all three are false in the real world, which is why this is a clean model rather than a demographic prediction.
- Breaks when
- The uniform assumption is not conservative in the direction you might guess. Real birth dates clump seasonally, and any departure from uniformity raises the chance of a collision β so
50.7%at 23 people is a floor, not an estimate. Push the slider to 80 and the probability rounds to 100%, but it never actually reaches it: with fewer than 366 people a no-match outcome always remains possible.
Practice
Check yourself
Predict the answer first, then use the controls above to find out. Reveal only after you have committed to a guess β that is what makes it practice.
-
Ten people make 45 pairs, and each pair has about a 1-in-365 chance of matching β which suggests 45/365 = 12.3%. The panel says 11.7%. Which way is the quick estimate wrong, and why is it wrong in that direction?
Show answer
It overestimates, and it always will. Adding up 45 pair-chances counts every double coincidence more than once: that sum is the first term of an inclusionβexclusion series whose next term subtracts. The panel goes the honest way round instead β P(all unique) = (365/365)(364/365)β¦(356/365) = 88.3%, and 100% β 88.3% = 11.7%. The gap widens fast: at 23 people the quick sum gives 253/365 = 69.3% against a true 50.7%, and once a group has more than 365 pairs the quick sum sails past 100%, which is the plainest possible proof that it was never a probability. -
Push the group size to its maximum of 80. P(shared birthday) reads 99.99% β not 100%. How many people does it take before a shared birthday is genuinely certain?
Show answer
366, or 367 once you allow 29 February. That is the pigeonhole principle, and it is the only route to certainty: with 365 possible dates, 366 people cannot all be different. Everything below that is merely likely, however close it looks. The slider stops at 80 because that is where the curve does its work β it is already at 99.99% there, and the remaining 286 people buy only the last hundredth of a percent. Watch the panel add a second decimal at n = 73 rather than print a 100% it cannot justify.
Problems solved in full
-
23 people in a room with a shared birthday 5 steps
How many people must be in a room before a shared birthday is more likely than not? Derive it, then explain why 23 feels far too small.
-
Compute the opposite. βAt least one sharedβ is awkward because the sharing can happen in many ways at once; βall differentβ is a single clean sequence of choices.
-
Each new person must avoid all the birthdays already taken, so the available days shrink by one each time. Multiply the fractions.
-
Subtract from one. The explorer above prints exactly this, and 23 is the first n for which the result passes a half.
-
You are not comparing yourself with 22 others β every pair counts, and the number of pairs grows as the square of the group.
-
That squared growth is visible in the approximation: the probability depends on nΒ² over 730, so the crossing point goes as a square root, not a fraction of 365.
Answer
23 people, for a 50.7% chance. The intuition that fails is a question-substitution: people picture "someone shares my birthday", which needs 253 people for even odds, when the question asked is "any two of us", which has 253 pairs at n = 23. The square-root scaling is the general lesson, and it is why hash collisions appear after roughly βN insertions rather than N β the same arithmetic decides how long a hash needs to be.
-
-
The 50.7% rule for twenty-three people in a 365-day year 6 steps
Twenty-three people, 50.7%. The number everyone remembers is 23, and it is the least useful part of the result β it belongs to a 365-day year and nothing else. Find the rule underneath it, the one that still holds when the calendar is a hash function.
-
The exact answer is a product: the second person misses the first, the third misses both, and so on down the room. That product is what the panel evaluates.
-
Products are hard to reason about, so take logarithms β and while k is small against 365, each logarithm is very nearly its own argument. What is left is a sum of the first nβ1 integers.
-
Set the probability to a half and solve. The nΒ² term dominates the n, so the answer is a square root, and it lands within half a person of the 23 on the panel.
-
Now write it with no 365 in it. The year was never special: for N equally likely slots the halfway point sits at about 1.1774βN.
-
Apply that where it actually bites. A 32-bit hash has 2Β³Β² slots, which sounds enormous β but the square root of an enormous number is not enormous.
-
Measure that against the size of the space it is drawn from.
Answer
The threshold grows like βN, not like N/2 β and for a 32-bit hash that means 77,162 items, 0.0018% of the space, before a collision is more likely than not. That is the birthday attack, and it is why 32-bit checksums are useless for deduplicating anything at scale, and why hash outputs are sized in bits with the square root already assumed. The 23 on the panel is a single point on that curve. The curve is the part that transfers.
-
Learning path
When two things land on the same value
References (1)
- Why real, non-uniform birth dates make a collision MORE likely, not less β so 50.7% at 23 people is a floor: A. G. Munford, βA Note on the Uniformity Assumption in the Birthday Problem.β The American Statistician 31, 119, 1977.