Birthday Room

How many people need to be in a room before two of them probably share a birthday? Test your intuition against an exact calculation and a simulation.

Established Supported by convergent, high-quality evidence.

Make a prediction first

How many people need to be in a room before there’s better than even odds that some two of them share a birthday? Most people’s gut answer is somewhere in the hundreds. Set the slider below to your guess, then check the exact figure.

Exact probability of at least one shared birthday: 50.7%

Number of pairs being compared: 253

Click "Run simulation" to see a Monte Carlo estimate here.

What changed and why

The exact figure updates as soon as you change the number of people or the number of days — it’s a closed-form calculation, not a simulation, so there’s nothing to wait for. The Monte Carlo estimate only updates when you click “Run simulation”: it actually builds the requested number of simulated rooms, in a background worker, and reports what fraction of them had a shared birthday, alongside the estimate’s standard error.

The two numbers should agree, within the Monte Carlo estimate’s standard error, every time — if they didn’t, that would mean either the exact formula or the simulation had a bug. Both are unit-tested against the textbook birthday-problem values (for example, 23 people → 50.7%, 70 people → 99.9%) rather than checked by eye.

Any two people versus someone sharing your birthday

These two questions sound similar and have very different answers. “Does someone in the room share my birthday?” only has one fixed target date, so even in a room of 50 the chance is still under 15% (roughly 1 − (364/365)⁵⁰). “Do any two people in the room share a birthday?” lets every pair count, and with 50 people there are 1,225 pairs — which is why that probability is already above 97%. The number of pairs grows roughly with the square of the number of people, which is the whole reason this probability climbs so much faster than intuition expects.

Model assumptions

  • Birthdays are treated as independent across people — real birth dates cluster somewhat by season and show small day-of-week effects, which this model ignores.
  • Birthdays are treated as uniformly spread across the chosen number of days, with no leap-day adjustment.
  • “Days in the year” is a parameter you can change specifically so you can see how sensitive the result is to that assumption — it is not fixed at 365 by the model itself.

Reproducibility

Every run is seeded: the same number of people, days, trial count, and seed will always produce the same Monte Carlo estimate, using a documented seeded generator (mulberry32). Clicking “Run simulation” also updates this page’s URL with your current parameters, so you can copy the link to share the exact setup — nothing about your session is stored anywhere but the URL.

Sources and method

The generalised birthday-problem model used here — including why “any match” and “a match with me” are different calculations — follows the treatment in the statistics literature on studying coincidences.(Diaconis & Mosteller, 1989) See Probability is a model, not a verdict for the underlying explanation in plain language.

Sources

  1. Diaconis, Mosteller (1989). Methods for Studying Coincidences. Journal of the American Statistical Association, 84(408), 853-861. https://doi.org/10.1080/01621459.1989.10478847 ↩