OUTCRY

// BRAIN TEASERS

Birthday Problem: Puzzle and Step-by-Step Solution

  • Probability
  • Easy
  • Reported at SIG, Optiver, Akuna, Belvedere

The puzzle

Twenty-three people are in a room. A friend bets you even money that at least two of them share a birthday. Only about 6% of the calendar is covered. Should you take the other side of the bet?

Short answer: No. With 23 people the probability of at least one shared birthday is about 50.7%, so the bet is slightly in your friend's favour.

Step 1: Compute the complement

P(at least one shared birthday) is messy to compute directly, because the matches can overlap in many ways. P(all 23 birthdays are different) is easy. Ignore leap years and assume every day is equally likely.

The first person can have any birthday. The second must avoid one day, probability 364/365. The third must avoid two days, 363/365, and so on until the 23rd person avoids 22 days, 343/365. Multiplying the chain gives about 0.493. So the probability of at least one match is 1 - 0.493 = 0.507.

Step 2: A quick estimate you can do in your head

Each factor is 1 - k/365, and for small x, 1 - x is close to e^(-x). So the product is close to e^(-(1 + 2 + ... + 22)/365) = e^(-253/365) = e^(-0.693). And e^(-0.693) is 1/2, because ln 2 is 0.693. That is why 23 is the magic number.

The same approximation gives a general rule: with n people the chance of no match is about e^(-n²/730), so the 50% point sits near the square root of 2 × 365 × ln 2, which is about 22.5.

Step 3: Why intuition misses by so much

The 6%-of-the-calendar instinct compares 23 people with 365 days. But matches happen between pairs, and 23 people contain C(23, 2) = 253 pairs, each with a 1-in-365 chance of matching. Two hundred and fifty-three nearly independent chances at 1/365 land close to a half.

The count that matters grows with the square of the number of people, not linearly. The same effect is why hash collisions, duplicate trade IDs and shared PINs appear far sooner than people expect.

A quick check on the size: with 57 people the probability of a shared birthday is above 99%, and with 70 people it is about 99.9%. Being able to quote those numbers, or estimate them quickly from e^(-n²/730) without a calculator, is a common follow-up in trading interviews.

Why interviewers ask it

Interviewers check two habits: reaching for the complement instead of a union bound, and noticing that pair counts grow quadratically. The e^(-x) estimate is the follow-up that separates strong candidates.

Knowing the proof is half of it. Work Birthday Problem interactively, then take it under a clock with the rest of the Outcry simulators.

Related Firm Questions

Firm names show where candidates report meeting this puzzle or a close variant. Outcry is not affiliated with any firm named here.