3 ms·
I think the easiest way to think about it is to invert the problem. What is the probability that no one shares a birthday? One person, nobody shares a birthday
by dhosek 4y ago
I think the easiest way to think about it is to invert the problem. What is the probability that no one shares a birthday?
One person, nobody shares a birthday because they’re alone.
Two people, it’s going to be a 364/365 ≈ 99.7% that they don’t share a birthday.¹
Now add a third person. We have the initial probability for the first pair and then the third person can’t share a birthday with either of them, so the probability is going to be 363/365 that they don’t share a birthday with either, but since we have two events that both must occur, we multiply the probabilities. That gives us (363364)/365² ≈ 99.2%
For the fourth person it becomes (362363364)/365³ ≈ 98.4%
You’ll notice that the probability is decreasing more and more with each step.²
In general, for n* people we would have³ P = 365!/((365-n!)365ⁿ). At n = 23, we drop below 50%.
This technique is useful for a lot of statistical calculations, e.g., for calculating the probabilities of poker hands, some of them are easier to calculate the probability of not getting the hand then the probability of getting the hand (a pair being the most obvious case).
⸻
1. We’re mostly programmers here so we’re going to pretend leap years don’t exist.
2. This will not continue indefinitely, obviously. The first derivative hits a minimum⁴ around n = 20 for this formula and at n=365. The graph kind of looks like cos θ over the range [0,π] but not exactly, it’s just the first well-known graph that comes to mind of this shape.
3. If you’re eagle eyed, you might notice that my examples before had a denominator of 365 raised to the n-1 power. Then you’ll also notice that my factorials have n terms and end with 365 and not 364. Remember our lonely birthday dude? His probability of not sharing a birthday (1) can be thought of as 365/365 and should also be part of the product, but when we’re doing the math for small numbers, it’s easier to just ignore that but for a general formula, keeping him in the product makes the formula clearer.
4. Minimum because we’re decreasing, remember.