Home › Probability › The birthday paradox: why 23 people are enough
The birthday paradox: why 23 people are enough
In a room of just 23 people, it's more likely than not that two share a birthday.
The puzzle
How many people need to be in a room before there's a better-than-even chance that two of them share a birthday? Most people guess somewhere around 180, about half of 365.
The real answer is 23. With 50 people it's about 97%, and with 70 it's over 99.9%.
🎂 Fill a room
Each square is a day of the year. Pale squares have one birthday; dark squares with a number are shared. Birthdays are random and equally likely, ignoring 29 February.
How the chance grows with the size of the room
Why it happens: count the pairs, not the people
Our intuition quietly answers a different question: "how likely is it that someone shares my birthday?" That really does need a big group: about 253 other people for an even chance.
But the paradox asks whether any two people match. With 23 people there are 23 × 22 ÷ 2 = 253 different pairs, and every pair is a fresh chance of a match. The number of pairs grows much faster than the number of people, which is why the curve shoots up.
The maths
It's easiest to work out the chance that nobody shares a birthday, then subtract from 1. The second person avoids the first person's birthday with probability 364/365, the third avoids both with 363/365, and so on:
P(no match among n) = 365/365 × 364/365 × 363/365 × … × (365 − n + 1)/365
For 23 people that product is about 0.493, so the chance of at least one shared birthday is about 50.7%.
| People | Chance of a shared birthday |
|---|---|
| 10 | 11.7% |
| 20 | 41.1% |
| 23 | 50.7% |
| 30 | 70.6% |
| 40 | 89.1% |
| 50 | 97.0% |
| 70 | 99.9% |
Real birthdays make it even more likely
The calculation assumes every day is equally likely. Real birthdays aren't spread evenly: some months are noticeably busier than others. Any unevenness makes matches slightly more likely, so the true number for real people is, if anything, a little under 23.
Where it matters
The same maths explains "hash collisions" in computing and the birthday attack in cryptography: when you generate many random codes, duplicates turn up far sooner than you'd expect. A system with a million possible codes has a 50% chance of a repeat after only about 1,200 of them.
Questions
How many people do you need for a 50% chance of a shared birthday?
23. With 23 people the chance is about 50.7%.
How many people do you need to be certain?
To be 100% certain you need 367 people (366 possible birthdays, including 29 February, plus one). In practice 70 people already gives better than a 99.9% chance.
How many people do you need for someone to share my birthday?
About 253 other people for a 50% chance. That's the question our intuition usually answers, and why the real answer of 23 feels so wrong.