# Solution conflict: Expected number of distinct birthdays for $100$ people

I was given a homework question that is stated in the title. Although I have a conflict with the solution provided, and was wondering if you could help me understand why the solution is correct or if it is indeed incorrect.

Define $X$ to be number of distinct birthdays.

The answer given is to set up a RV $X_i$ which is $1$ if the ith day is a birthday or $0$ otherwise, where:

$P(X_i = 1) = P(\text{at least one person has birthday on day i}) = 1- P(\text{no one has birthday on this day}) = 1 - \frac{364}{365}^{100}$. And so $\mathrm{E}X_i = 1 - \frac{364}{365}^{100}$

Thus $\mathrm{E}X =\mathrm{E}[X_1 + X_2 \dots X_{365}] = 365\left (1 - \frac{364}{365}^{100} \right)$

I think this is incorrect, however. The reason being is that it seems like they are calculating the expected number of birthdays not the expected number of distinct birthdays.

The answer that I think is correct is to define $X_i$ as $1$ if the ith day is a distinct birthday and $0$ otherwise. Then:

$P(X_i = 1) = 100 \times \left(\frac{1}{365}\right)\left(\frac{364}{365}\right)^{99}$.

Thus $\mathrm{E}X =\mathrm{E}[X_1 + X_2 \dots X_{365}] = 365 \times 100 \times \left(\frac{1}{365}\right)\left(\frac{364}{365}\right)^{99} = 100 \times \left(\frac{364}{365}\right)^{99}$.

This has been bothering me for quite some time. Any help would be great.

• It looks as if the two calculations interpret distinct birthday differently. The homework solution sees it a day where at least one person has a birthday, distinct from other days where at least one person has a birthday. You see it as a day where exactly one person has a birthday distinct from all the other people's birthdays. For a very large number of people, almost every day is likely to have at least two people, so the first tends towards $365$ and the second towards $0$ Jan 19 at 12:03

The provided solution is correct. When it computes the chance that somebody has a birthday on Jan 1, it doesn't care how many people share the birthday. Then it says each day has the same chance of being somebody's birthday and uses the linearity of expectation.

We can see what is going on with smaller numbers. Say we throw two dice and ask what is the expected number of different numbers seen. We can do the problem directly by saying the first die is some number. The second die has $\frac 56$ chance of adding a new number, so the expected number of distinct numbers seen is $\frac {11}6$. This is less than $2$ because of the chance that the two numbers are the same. The approach in the solution you quote is to say the chance $1$ does not appear is $(\frac 56)^2$, so the chance it does appear is $1-(\frac 56)^2=\frac {11}{36}$. Then the expected number of numbers we see is $6 \cdot \frac {11}{36}=\frac {11}6$

• Okay this makes a lot more sense. Thank you. Mar 19, 2017 at 15:05
• Would you know how to compute the variance of X in this scenario? Apr 8, 2020 at 13:29
• @EoinS Given the probability of a birthday on a given day you can compute the variance on a given day. Unfortunately, it is not accurate to multiply by $365$ because the variables on different days are correlated. I think you would have to compute the probabilities of different numbers of birthdays occurring. Apr 8, 2020 at 13:43
• @Ross Millikan Isn't the expected number to get two different numbers 11/5? The probability of seeing a different number in second die roll is 5/6. Since it follows geometric distribution, the expectation is 6/5. Add to this 1 and we get 11/5. Apr 19, 2020 at 0:04
• @ForumWhiner: I was talking about the expected number of different rolls, not the expected number of rolls to get two different numbers. Those are different things. Your calculation is correct for what you were calculating. Apr 19, 2020 at 0:34

The solution provided is correct. I even checked it via simulation just to make sure. Here are the complete steps:

$$E[X] = E[X_1 + ... + X_{365}] = 365 \times E[X_1] = 365 \times P(X_1 = 1) = 365 \times (1 - P(X_1 = 0)) = 365 \times \Big(1 - \prod_{i=1}^{100} P(\text{person i not born on day 1})\Big) = 365 \times \Big(1 - \Big(\dfrac {364} {365}\Big)^{100}\Big)$$

I have the same answer as the given result. But I do think the idea of the given answer is not accurate. My way is: Let Xi be the ith person who has a distinct birthday. The probability of Xi is (1/365)*(364/365)^(i-1). The i has the range from 1 to 100. The sum of P(xi) is the probability of 100 persons all have distinct birthdays. And then time 365 days. We got the same result of 87.56.