Exercise 5.4-1

How many people must there be in a room before the probability that someone has the same birthday as you do is at least \(\frac{1}{2}\)? How many people must there be before the probability that at least two people have a birthday on July 4 is greater than \(\frac{1}{2}\)?

The probability of a single individual having the same birthday as me is \(\frac{1}{365}\) so the complementary event has probability \(1 - \frac{1}{365} = \frac{364}{365}\). The probability that none of \(k\) individuals have the same birthday as me is \(\frac{364^k}{365^k}\). This probability exceeds \(\frac{1}{2}\) when \(k \geq \log_{\frac{364}{365}}(\frac{1}{2}) \approx 253\). So there must must be \(253 + 1\) people (counting myself) in a room before the probability that someone has the same birthday as me.

It is simpler to calculate the probability that 0 or 1 people have a birthday on July 4 and then take the complement. So the probability that \(k\) out of \(n\) people have a birthday on July 4 is \({n \choose k} \frac{364^{n-k}}{365}\). So when \(k = 0\) we have \(\frac{364}{365}^n\) and when \(k = 1\) we have \(\frac{n364^{n-1}}{365^n}\). Solving this normally would be pretty obnoxious, so I opted to write a quick python script to determine that the first value of \(n\) for when the sum of these two values exceeds \(\frac{1}{2}\) is \(n = 613\).

x = 1
result = 1
while result > .5:
    result = (((364/365)**x) * (1 + x/364))
    print(str(x) + ": " + str(result))
    x += 1