The birthday problem: collisions, pairs, and approximations
How can only 23 people have a better than even chance of sharing a birthday? The question asks whether any pair matches, and 23 people create 253 pairs. Counting the complement gives an exact answer; counting pairs explains the scale and leads to a useful approximation.
How fast does a shared birthday appear?
Independent uniform birthdays across 365 dates; leap day ignored.
Count no collisions first
Assume birthdays are independent and uniformly distributed across days. With people, the first birthday can be anything, the second must avoid one occupied day, the third must avoid two, and so on. Thus
For , the no-match probability is approximately 0.4927, so the chance of at least one shared birthday is 50.73%. With more than people, a match is certain by the pigeonhole principle. These are model results: real birthday frequencies are not exactly uniform, and birthdays within some groups need not be independent.
Why the square root appears
Let be the number of matching pairs, including all pairs in a group of three or more. Each pair matches with probability , and linearity of expectation gives
The expected number of matches becomes order one when is order , well before approaches . For 23 people it is about 0.693. This is not the probability of at least one match: a single outcome can contain several matching pairs.
Taking logs of the exact product and using for small yields
At this gives approximately 50.0%. Solving the approximation for a 50% collision chance gives , about 22.5 for 365 days. The omitted terms matter more as grows; use the exact product when high precision matters.
A fixed birthday is a different question
Suppose instead that you choose one person’s birthday in advance and ask whether at least one of the other people shares it. The probability is
For 23 people this is about 5.9%, much smaller than 50.7%. The first question allows any pair to match; the second only counts pairs involving the chosen person.
Unequal categories
If independent draws land in category with probability , a particular pair matches with probability . Therefore . Uneven probabilities increase this pairwise collision probability relative to a uniform distribution over the same number of categories. The simple uniform product no longer applies, and substituting an effective category count into the exponential is only an approximation whose accuracy depends on the distribution.
Common mistakes
- Confusing the expected count of matching pairs with the probability of any match.
- Multiplying pairwise no-match probabilities as if all pair events were independent.
- Counting one three-person birthday group as one matching pair: it contains three pairs.
- Applying the uniform formula to dependent draws or heavily unequal category probabilities without checking the model.
Practice
PairsHow many distinct pairs can be formed from 10 people, and how many matching pairs are created by three people sharing one birthday?Show answer
There are possible pairs. The three-person matching group creates matching pairs.
ScaleIf the number of equally likely categories increases by a factor of 100, about how does the sample size needed for a fixed collision probability change?Show answer
It grows by roughly a factor of 10, because the threshold scales as the square root of the number of categories.
ExpectationFour independent draws are uniform over 10 categories. What is the expected number of matching pairs?Show answer
. This is an expectation, not the probability of at least one collision.
Further reading: MIT OpenCourseWare, The Birthday Principle; Diaconis and Mosteller, Methods for Studying Coincidences.
Related: First-step analysis and the max trick.