The Birthday Problem at 99.9%
Home · Interesting Math Problems · Problem 1

1. The problem

How many people must be in a room so that a shared birthday is 99.9 % certain?

The question hides a trap in its wording. "A common birthday" can mean two quite different things:

  • Any pair — at least two people in the room (any two) were born on the same day.
  • Your birthday — at least one other person was born on the same day as you.

Most people's intuition mixes the two up, and that is exactly why the classic answer feels "wrong". We assume 365 equally likely birthdays and ignore 29 February.

2. The answer (two of them)

70
people in the room give a 99.92 % chance that some two share a birthday. (69 people give only 99.896 %.)
2,518
other people (2,519 in the room with you) give a 99.900 % chance that someone shares your birthday.

Same question, same 99.9 %, but answers that differ by a factor of 36. The "any pair" room fits in a classroom; the "your birthday" room needs a large auditorium.

3. Any two people match

It is far easier to compute the chance that nobody matches, then subtract from 1. Seat people one at a time:

  • Person 1 can have any birthday: 365/365.
  • Person 2 must avoid person 1's day: 364/365.
  • Person 3 must avoid two days: 363/365 … and person n must avoid n−1 days.
P(no match among n) = (365/365)·(364/365)·(363/365)···((365−n+1)/365) = 365! / [ (365−n)! · 365n ]
P(some pair matches) = 1 − P(no match)

We need P(no match) ≤ 0.001. Multiplying the factors out: at n = 69 it is still 0.00104, and at n = 70 it falls to 0.00084. So 70 is the smallest room.

A quick approximation

Each factor (1 − k/365) ≈ e−k/365, so P(no match) ≈ e−n(n−1)/730. Setting this to 0.001 gives n(n−1) ≈ 730 × ln 1000 = 5043, so n ≈ 71.5. The estimate is slightly high but lands in the right place. The term n(n−1)/2 is simply the number of pairs in the room, and that is the real secret.

4. Someone matches you

Now only comparisons with you count. Each other person independently misses your birthday with probability 364/365, so with m others:

P(nobody shares your birthday) = (364/365)m
(364/365)m ≤ 0.001  ⇒  m ≥ ln(0.001) / ln(364/365) = 6.9078 / 0.0027435 = 2517.9

So 2,518 other people are needed. A handy rule: m ≈ 365 × ln(1000) ≈ 365 × 6.9 ≈ 2,520.

5. Why so different?

In reading A, every pair is a chance for a match. In reading B, only the pairs that include you count.

People in roomPairs that can match (any pair)Pairs that include you
2325322
702,41569
2,5193,171,3212,518

Look at the 70-person room: it holds 2,415 pairs, roughly the same number of chances as the 2,518 strangers you need in reading B. Pairs grow as n², so a modest room has a huge number of them. (The pairs in reading A are not fully independent, which is why the numbers are close but not identical.)

Milestones

Target chanceAny pair — people in roomYour birthday — other people
50 %23253
90 %41840
99 %571,679
99.9 %702,518

6. Try any room size

Chance some pair shares a birthday
–
Chance someone shares your birthday
–

Reverse: what target chance?

7. The two curves

Any pair matches (solid) Someone matches you (dashed) Horizontal line: 99.9 %. Horizontal axis is logarithmic.

8. Fill a room — simulation

Random rooms with the size set in section 6. Each room is tested both ways and the running counts are compared with the exact formula. Watch the estimates settle as more rooms are filled.

Room size: 70
Any pair
Rooms with a match: 0 / 0
Simulated: –   Exact: –
Your birthday
Rooms with a match: 0 / 0
Simulated: –   Exact: –

Press S to fill one room and see what happened.

9. Fine print

  • Leap years: including 29 February (weight ¼ in 366 days) barely moves the answers.
  • Real birthdays are not uniform. Births cluster in some months and scheduled deliveries avoid holidays. Any unevenness only raises the chance of a pair match, so 70 is, if anything, a safe upper bound.
  • "Exactly one match" ≠ "at least one". All figures here are for at least one shared birthday.
  • Where else it appears: hash collisions in computing ("birthday attack"), duplicate serial numbers, and coincidences in large data sets all follow the same n² arithmetic.