The Birthday Paradox

Twenty-three people, and a match is an even bet.

Pairs, not people

In a room of 23 people, what is the chance that at least two of them share a birthday? Take every birthday to be equally likely to fall on any of 365 days.

The answer is a little more than a half, which surprises most people. The instinct is to compare one person with the 22 others. But a match can come from any two people in the room, so what matters is the number of pairs.

Each of the 23 people can be paired with each of the other 22, which gives 23 × 22 = 506. That counts every pair twice, once from each end, so there are 506 ÷ 2 = 253 pairs. In the same way, 5 people make 5 × 4 ÷ 2 = 10 pairs.

pairs5 people1010 people4523 people25357 people1596

n people make n × (n − 1) / 2 pairs. The people go up by a factor of about 11 from 5 to 57, and the pairs go up by a factor of about 160.

A rough estimate

One pair of people share a birthday with probability 1/365: whatever the first person's birthday is, the second person's is the same day 1 time in 365.

With 5 people there are 10 pairs, so a rough estimate of the chance of a match is 10 × 1/365 = 10/365, which is about 0.027, or about 3 in 100. It is rough because the pairs share people: if A matches B and B matches C, then A matches C as well, so the pairs are not separate chances.

Everyone different, one person at a time

The exact answer comes from the complement. At least one match is the opposite of all the birthdays being different, so find the chance that all are different and take it away from 1.

Line the 5 people up. The first can have any birthday: 365/365. The second must avoid the first person's day: 364/365. The third must avoid two days, 363/365, the fourth three days, 362/365, and the fifth four days, 361/365. The chance that all five are different is 365/365 × 364/365 × 363/365 × 362/365 × 361/365, which is about 0.973.

So the chance of at least one match is 1 − 0.973 = 0.027, the 3 in 100 that the estimate gave. In 97 rooms of 5 people out of 100, nobody matches.

nobody matches: 97 in 100

Out of 100 rooms of 5 people, about 97 have no shared birthday. The 3 squares left over are the rooms with a match.

Twenty-three people

For 23 people the chain has 23 fractions, one for each person, from 365/365 down to 343/365. Each fraction is close to 1, but they multiply, and each one is a little smaller than the one before. The product is about 0.493.

So the chance of at least one match is 1 − 0.493 = 0.507. With 23 people a shared birthday is slightly more likely than not.

The same chain gives every room size. With 10 people the chance of a match is about 0.12, with 30 people about 0.71, with 40 people about 0.89, and with 57 people about 0.99. The chance never reaches 1 while there are 365 people or fewer, because they could all still have different birthdays. With 366 people there are more people than days, so a match is certain.

n
(23, 0.507)(57, 0.99)

The chance of at least one shared birthday against n, the number of people. The curve crosses the level line at one half between 22 and 23 people, and it is at 0.99 with 57 people.

Someone with your birthday

A different question has a much smaller answer. In a room with you and 22 other people, what is the chance that someone shares your own birthday? Each of the others misses your day with probability 364/365, so the chance that all 22 miss it is (364/365)²², which is about 0.941. The chance that someone shares your birthday is about 1 − 0.941 = 0.059, about 6 in 100.

For that chance to pass one half, you need 253 other people: 1 − (364/365)²⁵³ is about 0.500. That is the same number as the pairs in a room of 23. A room of 23 gives 253 pairs, and each pair is one chance to match.

The usual mistakes

Comparing 23 with 365 and expecting a chance of about 23/365. That is close to the chance that someone matches one particular person. Any of the 253 pairs can match.

Giving the product of the chain as the answer. 365/365 × 364/365 × … is the chance that all the birthdays are different. The chance of at least one match is 1 minus it.

Adding the pair chances as if they were separate: 253 × 1/365, which is about 0.69 for 23 people. The pairs share people, so the sum counts some matches more than once. With 28 people the sum would be 378/365, more than 1, which no probability can be.

Days of the week

In the application below, part (a) runs the same chain for three friends and the 7 days of the week, and part (b) finishes the calculation for 23 people.

Worked example: Three Friends Born on the Same Day of the Week, and 23 People Sharing a Birthday

Question (a) Three friends are each equally likely to have been born on any of the 7 days of the week, independently of one another. Find the probability that at least two of them were born on the same day of the week. (b) There are 23 people in a room. Take every birthday to be equally likely to fall on any of 365 days. The chance that all 23 birthdays are different is 365365 × 364365 × ⋯ × 343365, which is 0.493 to 3 decimal places. Find the probability that at least two of the people share a birthday.

  1. 1.The complement of at least two sharing a day is all three born on different days. The first friend can be born on any day, with probability 77.

    first friend7/7the first friend: any day, 7/7
    first friend7/7the first friend: any day, 7/7
    The complement of at least two sharing is all three different. The first friend can have any day.
  2. 2.The second friend must avoid the first friend's day, 67, and the third must avoid both, 57. So P(all different) = 77 × 67 × 57 = 210343 = 3049.

    first friend7/7second friend6/7third friend5/7all different 30/49share a day 19/497/7 × 6/7 × 5/7 = 210/343 = 30/49
    first friend7/7second friend6/7third friend5/7all different 30/49share a day 19/497/7 × 6/7 × 5/7 = 210/343 = 30/49
    Each friend must avoid the days already taken: 77 × 67 × 57 = 3049.
  3. 3.(a) P(at least two share a day) = 1 − 3049 = 1949.

    first friend7/7second friend6/7third friend5/7all different 30/49share a day 19/491 − 30/49 = 19/49
    first friend7/7second friend6/7third friend5/7all different 30/49share a day 19/491 − 30/49 = 19/49
    (a) 1 − 3049 = 1949.
  4. 4.For 23 people the same chain has 23 fractions, one for each person, from 365365 down to 343365. Its product is given as 0.493.

    all different 0.493share1/2365/365 × 364/365 × ... × 343/365all 23 different: 0.493 (given)
    all different 0.493share1/2365/365 × 364/365 × ... × 343/365all 23 different: 0.493 (given)
    For 23 people the chain runs from 365365 to 343365, and its product is 0.493.
  5. 5.(b) P(at least two share a birthday) = 1 − 0.493 = 0.507, so a shared birthday is slightly more likely than not. There are 23 × 222 = 253 pairs of people, and every pair is a chance for a match.

    all different 0.493share 0.5071/21 − 0.493 = 0.507, more than 1/223 × 22 / 2 = 253 pairs
    all different 0.493share 0.5071/21 − 0.493 = 0.507, more than 1/223 × 22 / 2 = 253 pairs
    (b) 1 − 0.493 = 0.507: a shared birthday is slightly more likely than not.

Answer: (a) 1949; (b) 0.507

Common mistakes

  • Comparing 23 with 365 and expecting a chance of about 23365. That is close to the chance that someone shares one particular person's birthday. Any of the 253 pairs can match, so the chance is far larger.
  • Giving 77 × 67 × 57 = 3049 as the answer to (a). That product is the chance that all three friends were born on different days; the chance that at least two share is 1 minus it.

More probability with several events problems, worked step by step →

Practice The Birthday Paradox in the app