Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Games & Chance 3 min read

Why 23 people are enough to share a birthday

It feels like you would need hundreds. You need 23 — here is the maths.

In a room of just 23 people, there is a better-than-even chance that two of them share a birthday. It sounds impossible with 365 days to choose from — until you count the right thing.

Count the pairs, not the people

Your instinct compares each person to you. But a shared birthday can happen between ANY two people. With 23 people there are (232)=253\binom{23}{2} = 253 possible pairs — and each pair is a fresh chance for a match.

The trick: work out the chance of NO match

It is easier to find the probability that everyone has a different birthday, then subtract from 1.

P(match)=1−365365×364365×⋯×343365P(\text{match}) = 1 - \dfrac{365}{365}\times\dfrac{364}{365}\times\cdots\times\dfrac{343}{365}

One minus the chance all 23 birthdays differ

Probability of a shared birthday among 23 people

  1. 1

    Chance all 23 are different

    365365×364365×⋯×343365≈0.493\dfrac{365}{365}\times\dfrac{364}{365}\times\cdots\times\dfrac{343}{365} \approx 0.493
  2. 2

    So the chance of a match

    1−0.493=0.5071 - 0.493 = 0.507
Answer

About 50.7% — a better-than-even chance with only 23 people. At 70 people it is 99.9%.

Why it matters beyond parties

The same "collisions are more likely than you think" maths is why passwords get cracked and why digital fingerprints (hashes) must be huge. Security engineers call attacks that exploit it "birthday attacks".

The takeaway

Coincidences scale with the number of PAIRS, which grows fast. That is why shared birthdays, lottery repeats and hash collisions all happen far sooner than intuition expects.

Back to all stories