The birthday paradox

How many people until two share a birthday?

Pick the group size that gives a 50% chance. A common hunch is 183, half the days in a year.

people in a room
100

Drag to choose, then lock it in.

Fill a room and check the calendar

Each square is one day of the year. Press the button and people walk in with random birthdays. A teal square has one person. An amber square means two or more people landed on the same day.

Nobody One birthday Shared birthday

The room is empty. Fill it.

23

0rooms filled
0had a shared birthday

It’s not about you. It’s about pairs.

Your gut asks: will someone match my birthday? The real question is: will any two people match? That’s a much easier bar to clear.

Picture a party where every guest shakes hands with every other guest once. Each handshake is a tiny lottery ticket that wins 1 time in 365. The number of handshakes grows much faster than the number of guests.

23

23

people for even odds that any two share a birthday

253

people for even odds that someone shares your birthday

Watch the odds climb, one person at a time

Counting every way a match could happen is messy. It’s easier to count the opposite: the chance that everyone has a different birthday. Then subtract that from 100%.

everyone different

at least one match

Show as a table
PeopleChance of a matchPairs

For the curious

Why discrete math people love this puzzle

Discrete math is the math of things you can count one by one: people, days, pairs, passwords. This one small room uses four of its biggest ideas.

Count the opposite

P(match) = 1 − P(all different)

“At least one match” can happen in millions of ways. “No match at all” happens in one tidy way. Count the tidy one and subtract from 1. This is the complement rule.

Multiply the choices

365 × 364 × 363 × …

The first person has 365 free days, the next 364, then 363. Multiplying them counts every way to give everyone a different birthday. This is the product rule.

Pairs grow like a square

n × (n − 1) ÷ 2

10 people make 45 pairs. 20 people make 190. Double the people and you roughly quadruple the pairs. That’s why the odds rise so fast.

Certainty costs far more

367 people = a sure match

There are 366 possible birthdays counting 29 February, so 367 people must include a repeat. That’s the pigeonhole principle. Yet just 70 people already get you past 99.9%.

Our gut thinks in straight lines. Pairs grow with the square. The birthday paradox is where careful counting beats intuition, cleanly and every time.

It also hides a handy rule of thumb. If there are N equally likely options, you need about 1.18 × √N picks before a repeat becomes a coin flip. For birthdays, √365 is about 19, and 19 × 1.18 is about 23.

That square root is why the idea travels so far. It tells engineers how long an ID must be before two things collide. Ask for three people on the same day instead of two and you need 88.

Same math, different rooms

Swap birthdays for anything with a fixed number of options. Pick one to see how many you need before a repeat is a coin flip.

16 of 32

The 2014 World Cup

Every squad had exactly 23 players, a perfect test. The BBC checked all 32 squads and found 16 with at least one shared birthday. Half, just as the math predicts.

2017

Computer security

Files get a fingerprint called a hash. Finding any two files with the same fingerprint takes about the square root of the work, a “birthday attack.” In 2017, researchers at Google and CWI made two different PDFs with the same SHA-1 fingerprint.

Uneven is worse

Real birthdays

Real birthdays aren’t spread evenly; some dates are more popular. Mathematicians proved that any unevenness makes a match more likely, never less. So 23 is, if anything, a cautious answer.

Check yourself

Three quick ones. Tap an answer.