The Birthday Paradox
How many people do you need in a room before two of them probably share a birthday? Far fewer than you think.
Press “New room” to fill a room with people and look for a shared birthday.
What’s going on
There are 365 possible birthdays, so it seems you would need a crowd of about 180 people to make a shared birthday likely. In fact 23 people are enough for a better-than-even chance, and with 70 people a match is almost certain (99.9%).
The trick is that we are not asking whether someone shares your birthday. We are asking whether any two people share one. In a room of 23 there are 23 × 22 ÷ 2 = 253 pairs, and every pair is a fresh chance for a match.
The formula
It is easier to count the opposite: everyone has a different birthday. The second person must avoid one day, the third must avoid two, and so on:
P(no match among n people) = (365/365) × (364/365) × (363/365) × … × ((365 − n + 1)/365)
For n = 23 that product is about 0.493, so the chance of at least one match is about 0.507. The curve in the scene is this formula; the “Simulate” button checks it by brute force.
We assume every day is equally likely and ignore 29 February. Real birthdays are slightly uneven, which makes matches a little more likely, not less.
Try it yourself
1. Your own birthday
How many other people do you need before someone probably shares your birthday?
Answer
Now there is only one target day. The chance that n others all miss it is (364/365)ⁿ, which falls below one half at n = 253. That is the same number as the count of pairs among 23 people — not a coincidence.2. A football match
Two teams of 11 players and a referee are on the pitch. Is it more likely than not that two of them share a birthday?
Answer
Yes. That is 23 people — exactly the size where the chance passes 50%.3. Hash collisions
A computer gives each file a random label from a million possibilities. Roughly how many files before two probably get the same label?
Answer
Around 1,200. A rule of thumb: with N possibilities a collision becomes likely after about 1.18 × √N items. For N = 365 that gives about 22.5. This “birthday bound” is why programmers use labels with far more than a million possibilities.Inspired by the article «Парадокс дней рождения» by A. Alaeva in Kvantik magazine, May 2019. The text, code and pictures on this page are our own.
Comments
No comments yet. Be the first to share what you noticed.