On this page
Put 23 people in a room and it is slightly more likely than not that two of them share a birthday. If that sounds far too small, you are probably answering a different question from the one being asked.
What is the probability that two people share a birthday?
The standard version assumes 365 equally likely birthdays, ignores 29 February, and asks for the chance that at least two people in a group of n share a day. The Wikipedia article on the birthday problem gives these values:
10 people: 11.7%
20 people: 41.1%
23 people: 50.7%
30 people: 70.6%
40 people: 89.1%
50 people: 97.0%
70 people: 99.9%
Twenty-three is the smallest group in which the chance of a shared birthday passes 50% (MathWorld, Birthday Problem). A class of 40 sits at 89.1% on the same table, so in a class that size a shared birthday is the likely outcome, not a coincidence.
Real birthdays are not spread perfectly evenly across the year, but the same Wikipedia article notes that any unevenness only raises the chance of a match, and real data still gives 23 as the 50% point.
Why is the number so small?
The trap is thinking about yourself. A match does not have to involve you; any two people will do. With 23 people there are 23 × 22 / 2 = 253 pairs to consider (Wikipedia). Each pair has only a 1 in 365 chance of matching, but 253 chances add up quickly.
The pairs grow roughly with the square of the group size. Double the group from 20 to 40 and the pairs go from 190 to 780, about four times as many. That is why the curve in the diagram above climbs so steeply between 15 and 40 people.
How do you calculate it with the complement?
"At least two share" covers a huge number of cases: one pair, two pairs, three people on one day, and so on. The opposite event has just one case: everyone has a different birthday. The birthday problem is solved as p(n) = 1 − p̄(n), where p̄(n) is the probability that all n birthdays differ (Wikipedia).
Here it is for five people, one person at a time:
The first person can have any day: 365/365.
The second must avoid that day: 364/365.
The third must avoid two days: 363/365.
The fourth: 362/365. The fifth: 361/365.
Multiply: (365 × 364 × 363 × 362 × 361) / 365⁵ ≈ 0.9729.
Subtract from 1: 1 − 0.9729 ≈ 0.027, or about 2.7%.
That matches the 2.7% that Wikipedia lists for five people. For n people the top of the fraction becomes 365 × 364 × ... × (365 − n + 1), which is ³⁶⁵Pₙ, so p(n) = 1 − ³⁶⁵Pₙ / 365ⁿ. If you are comfortable with permutations, that one line is the whole problem.
Once n passes 365 the "all different" probability is zero, so a match is certain (Wikipedia). That is the pigeonhole principle, which we cover in IOQM combinatorics: counting and pigeonhole questions.
What other matching questions look similar?
These are close cousins, and they are easy to mix up.
Someone shares your birthday. Now every comparison must involve you, so the chance is 1 − (364/365)ⁿ for n other people. You need about 253 people for this to pass 50% (Wikipedia), compared with 23 for any pair.
Three people share a birthday. For at least three on one day, the 50% point is 88 people (MathWorld).
Two files get the same short code. The same maths drives birthday attacks on hash functions (Wikipedia).
The model treats birthdays as independent, as if drawn with replacement from 365 days, while "all different" works like drawing without replacement. If that distinction is shaky, read with and without replacement: probability problems compared.
A checklist for "at least one" problems
Use this for any question with "at least" in it:
Name the event exactly: any pair, or a pair involving one particular person?
Write the complement in words, such as "no two match" or "none succeed".
Check the complement has fewer cases than the original. If it does, use it.
Build the complement one step at a time, as in the five-person example.
Subtract from 1, then check the answer against a small case you can count by hand.
The same habit runs through at least one, at most two: selection problems with combinations. If you keep choosing the long route instead of the complement, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. If the gap is in permutations themselves, start from the lesson in the Fermi Concept Library.
Try it next: find the smallest class in which a shared birthday is more likely than not, using only the complement and a calculator. You should land on 23.



