If people’s birthday are distributed evenly throughout the year, how many people do you need to put into a room to have a decent chance of a shared birthday? This is the classic birthday problem, and gives rise to an apparent paradox: the number is far, far lower than most people suspect! This is the known as the Birthday Paradox. Let’s work out what the number is.
The Original
Imagine placing people walking into a room, one by one. We’ll work out the probability that no two people share a birthday at the end of the process.
- The first person who walks in will not share a birthday with anybody else, since there is nobody else in the room.
- The second person has probability of not sharing the first person’s birthday, since only one day is already taken.
- Given that the first two did not share a birthday, the third person has probability of not sharing a birthday with the first and second, since two days are taken.
- Skipping ahead, given that all previous people had no birthday in common, the last person has probability of not sharing a birthday with any of the previous people.
This gives us . For the probability of a shared birthday to be greater than 50%, we need . With a pocket calculator, you can find out that the smallest number of people for at least a 50% chance of a shared birthday, is 23. But there’s a neater way than brute force.
Since , we have
If we want , we can take logs and see that . Solving this quadratic inequality shows that . If you work it out, this number is just less than 23.
There’s no reason we have to stick to 365 days in a year either. If we consider a more general collision problem, with balls thrown at random into pots, then the number of balls we require for at least a 50% chance that two share the same pot is
We could have asked a slightly different question: How many people, on average, are required before we get a shared birthday, or collision? Interestingly, the answer to this is different, approximately .
Another Birthday Paradox
Here’s another interesting paradox related to birthdays that I found here. Let’s say that this time, the people are split into two groups, boys and girls for example. This time, it isn’t enough to have a shared birthday; we want a shared birthday between a boy and a girl. We can push boys and girls into the room and ask how many we require, on average before getting a boy and girl with the same birthday. We can also ask questions about the proportion of boys and girls. You might reasonably expect that equal proportions are best.
But why not make things a little more interesting? What if instead of throughout the year, all of the boys’ birthdays were uniformly randomly distributed in January? How many people then, and what proportion? You might expect that more boys than girls are needed.
It turns out that this doesn’t really change anything! Equal proportions are always best! Check out this paper to find out why.