How Many People Before Two Share a Birthday? Far Fewer Than You Think
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
In a room of twenty three people the chance that two share a birthday is already better than even, which almost nobody believes on first hearing. The reason the intuition fails is worth understanding.
Why the answer surprises people
Asked how many people are needed, most people give a figure in the hundreds, reasoning from the three hundred and sixty five possible dates. The error is in which question is being answered. Most people instinctively calculate the chance that somebody shares their own birthday, which does indeed require a large group, whereas the actual question asks whether any two of the people share with each other, which is a completely different and far easier condition. The number of pairs grows much faster than the number of people, since each new arrival can pair with everybody already present, and it is pairs rather than people that matter.
How the calculation goes
The clean method computes the opposite and subtracts:
- •Work out the chance that everybody has a different birthday
- •The first person can have any date at all
- •The second must avoid one date, so has 364 out of 365 chances
- •The third must avoid two dates, giving 363 out of 365
- •Multiply these fractions together for the whole group
- •Subtract from one to get the chance that at least two match
The numbers themselves
The results are worth stating because they carry the argument better than the method does. With ten people the chance of a shared birthday is around twelve per cent. With twenty it is about forty one per cent. With twenty three it passes fifty per cent, which is the famous threshold. With thirty it is about seventy per cent, with fifty it is ninety seven per cent, and with seventy it is above ninety nine. By contrast, the chance that somebody shares one specific date, such as your own, needs around two hundred and fifty three people to reach even odds, which is the figure people's intuition is actually producing and attaching to the wrong question.
What the calculation assumes
The standard figure rests on assumptions that are not quite true, and checking them is a good exercise in how such problems work. It assumes birthdays are spread evenly through the year, and real distributions are not, with seasonal patterns that differ by country and by decade, and with dates around certain holidays notably depleted because scheduled deliveries avoid them. Uneven distribution makes matches slightly more likely rather than less, so the figure of twenty three is a conservative bound rather than an overestimate. It ignores leap days, which changes the result negligibly. It assumes the people are unrelated, which fails in a room containing twins. None of these corrections moves the answer meaningfully, which is itself worth knowing.
Why it matters beyond parties
The same arithmetic underlies a serious result in computer security. A cryptographic hash function converts data of any size into a fixed-length value, and its usefulness depends on it being impractical to find two different inputs producing the same value, which is called a collision. The reasoning above shows that finding some pair that collides requires searching only around the square root of the number of possible values rather than the number itself, which is a devastating reduction, and attacks exploiting it are named after this problem directly. It is why hash functions need output lengths twice what a naive analysis suggests, and why several once-standard functions were retired once collisions were actually produced.
The takeaway
Twenty three people suffice for even odds that two share a birthday, because the question asks about any pair rather than about matching one specific person, and pairs grow far faster than people. Computing the chance that all differ and subtracting is the clean method. Matching one specific date needs around two hundred and fifty three people. The same arithmetic halves the effective strength of cryptographic hash functions.