Interactive demo · Introduction to Mathematical Statistics · Chapter 2

The birthday problem

How many people are needed before two of them probably share a birthday? Count the no match sequences: P(no match) = (1 − 1/d)(1 − 2/d)···(1 − (k−1)/d) for d equally likely days. The top panel shows the exact probability (teal), the approximation 1 − exp(−λ) with λ = k(k−1)/(2d), the expected number of matching pairs (gold dashed), and, if you choose it, a seasonal distribution of births (pink), which always makes a match more likely. The simulated proportion of R random groups is the white dot with a two standard error bar; the bottom panel counts the matching pairs Y in those groups.

Number of days d

Number of people k

Distribution of birthdays

Simulated groups R

Try these

Seasonal: day i has probability proportional to 1 + 0.6 cos(2π(i − 0.63d)/d), a smooth peak about 63% of the way through the year (births are in fact more common in summer). A birthday is drawn by inverting the cumulative distribution. “Exactly one pair” means two people share a day and everyone else has a different one (Y = 1). All counts come from the seeded generator of this page.

In the lecture notes