Birthday problem calculator

Put in how many people are in the room and how many days a birthday can fall on, and you'll get the chance that two of them share one. You'll also see how many people you'd need for even odds, and the chance that somebody shares your own birthday, which is a much smaller number and the one most people actually have in mind.

Chance two people share a birthday
Expected number of pairs that share
People needed for a 50% chance
People needed for a 99% chance
Chance someone shares your birthday
Others needed for that to reach 50%

How it works

It's easier to work out the chance that nobody matches. The second person misses the first one's birthday with probability (d - 1)/d, the third misses both with (d - 2)/d, and so on, and you multiply those together. One minus that product is your answer. With 365 days it passes a half at 23 people and 99% at 57.

Why so few? I think it helps to count pairs rather than people. Twenty-three people make 253 pairs, and each pair matches with probability 1/365, so you'd expect about 0.69 matching pairs. For somebody to share your birthday, though, only the 22 pairs that include you count, and you'd need 253 other people before your odds pass a half. I've checked these numbers against exact fractions.

More probability questions of this kind, with worked answers: quant interview probability questions