Birthday Problem: Expected number of people in a room

203 Views Asked by At

If an infinite amount of people enter a room one by one, what is the expected number of people in the room when you first find two that share the same birthday? (Assuming no leap years and every birthday is equally likely).

2

There are 2 best solutions below

4
On BEST ANSWER

Whenever $N$ is a random variable which takes values in the non-negative integers $\{0,1,2,3,\ldots\}$, there's a nice formula for the expected value $\mathbb{E}[N]$ of $N$: $$\mathbb{E}[N] = \sum_{n=1}^\infty \mathbb{P}(N \geq n) = \sum_{n=0}^\infty \mathbb{P}(N > n)$$

In this case, the second expression is the nicest, because if $N$ is the number of the first person who enters with a birthday matching a birthday in the room, then $$\begin{align*}\mathbb{P}(N > n) &= \text{ Probability that none of the first } n \text{ people has a birthday in common with another} \\ &= \left(\frac{365}{365}\right)\left(\frac{364}{365}\right)\cdots\left(\frac{366-n}{365}\right) \\ &= \frac{365!}{365^n(365-n)!} \qquad \text{ if } 0\leq n \leq 365 \text{ and zero otherwise}\end{align*}$$

Then $$\mathbb{E}[N] = \sum_{n=0}^{365} \frac{365!}{365^n(365-n)!} \approx 24.616586$$

Note that this is close to, but not equal, the well-known median of $23$. In fact, if you scroll down that page to here, you'll see the same formula we derived along with the same result we've found for the expected value.

6
On

According to Pigeonhole Principle the number of people in the room shall at least be 366 to ensure what you're saying. However it "is" possible for less people in the room but this is the number you can be sure that at least two of the people share their birthday