Math · Probability

The Birthday Paradox Explained Simply

Written by Viktor Jonas · Reading time about 6 minutes

In a class of 23 pupils the probability that two of them share a birthday is over 50 per cent. That sounds wrong — a year has 365 days. The error of reasoning lies in the question people ask themselves without noticing.

P(at least one pair) = 1 − (365/365 · 364/365 · 363/365 · … ) easier via the complement: work out "all different" first, then subtract from 1
Key terms

Complement — the opposite of the event you want. P(A) = 1 − P(not A).
Laplace probability — favourable over possible cases, when all are equally likely.
Independent events — their probabilities are multiplied.
Pairing — with n people there are n(n−1)/2 possible pairs.

The real reason: it is about pairs

Most people think: "How likely is it that someone shares my birthday?" That really is rare. But the question asked is whether any pair at all matches — and there are far more pairs than you would guess.

Number of possible pairs among n people: n · (n − 1) ÷ 2

with 10 people: 45 pairs
with 23 people: 253 pairs
with 40 people: 780 pairs

253 opportunities for a match — put that way, 50 per cent is no longer surprising but plausible.

Probability of at least one shared birthday
PeopleProbability
1011.7 %
2041.1 %
2350.7 %
3070.6 %
5097.0 %
7099.9 %

💬 Mia asks Grandpa Theo

Mia

But a year has 365 days! Surely you would need at least 183 people.

Grandpa Theo

That would answer a different question — whether someone shares your birthday. For that you really would need about 253 people to reach 50 per cent.

Mia

And here every pair counts?

Grandpa Theo

Exactly. With 23 people that is 253 pairs — and each one is a chance of a match.

How the calculation works

Probability that all are different:
365/365 · 364/365 · 363/365 · … · 343/365 ≈ 0.4927

We want the opposite:
1 − 0.4927 = 0.5073, so 50.7 %

Step by step: the first person may pick any day at all, which always works, 365 out of 365. That leaves 364 free days for the second, 363 for the third, and so on. For n people this gives the product (365 ÷ 365) · (364 ÷ 365) · … · ((366 − n) ÷ 365). At n = 23 that comes to about 0.4927. With 22 people the result is still 47.6 per cent — which is why 23 is the smallest number that passes one half.

Common mistakes

Answering the wrong question
"Someone shares my birthday" is something else entirely.
Adding probabilities
For independent events you multiply.
Calculating directly instead of via the complement
The direct route means summing a huge number of cases and is not practical.
Treating 29 February as a problem
It shifts the result by less than a tenth of a percentage point.
Practice question

Work out the probability of at least one shared birthday in a group of 5 people. Explain why the number is so much smaller than for 23.

Show solution

All different: 365/365 · 364/365 · 363/365 · 362/365 · 361/365 ≈ 0.9729
At least one pair: 1 − 0.9729 = 2.7 %

With 5 people there are only 5 · 4 ÷ 2 = 10 possible pairs, while 23 people give 253. The number of pairs grows quadratically with group size, not linearly — which is why the probability climbs so fast.

What happens after 23

The curve rises surprisingly quickly from there. At 30 people the probability is already 70.6 per cent, at 41 over 90 per cent, at 57 it reaches 99 per cent and at 70 people 99.9 per cent. Only at 366 people does it hit a certain 100 per cent, because by the pigeonhole principle at least one day must then be taken twice. So between "as good as certain" and "actually certain" lie almost 300 people — and that long flat tail is exactly why intuition fails here: we think about the 366 while the interesting part happened long ago at 23. Incidentally, real birthdays are not spread evenly across the year; more children are born in late summer than in winter. That unevenness makes matches slightly more likely still, but it moves the threshold only by fractions.

For a test the method matters most: complement first, then subtract. Counting directly how many pairs might match leads into a thicket of double counting, because three or more people can share a day as well. The detour through "all different" avoids that completely.

🎥 Explained in under two minutes — as a Short on our YouTube channel.

Watch the Short

The same principle is called a birthday attack in computer science: it is far easier to find any two files with the same hash value than one matching a given hash. That is why hash functions need twice as many bits as you would naively assume.

What "50 per cent" means in practice

A probability of 50.7 per cent says nothing about one particular class. It describes what happens in the long run. Check a thousand school classes of 23 children each and you would find at least one shared birthday in roughly 507 of them and none in about 493. Which group your own class falls into is decided purely by chance.

That is exactly why the experiment works so well as a bet. Offer it in a class of 30 and you win seven times out of ten — and the losers still put the result down to luck, because the number 365 looms so large in the mind.

Check it yourself

You do not need a computer for this. Collect the birthdays of several classes or sports groups and note only whether there was a pair each time. After twenty groups the trend is already clear: around a group size of 23 the ratio sits close to one to one, and at 30 and above it tips firmly towards hits. Frequency experiments like this are the most vivid way to understand probability — they show that a number such as 50.7 per cent is a statement about many repetitions, not about the next single case.

← Back to overview