Please help me to find error in the following solution for the problem: "We randomly throw $n$ balls into 1000 boxes and note the number of empty boxes. We repeat this experiment large number of times and observe that the average number of boxes with zero balls in experiment is 20. What is $n$?"
I thought that we could use indicator random variables: $X_1=Bern((1-\frac{1}{1000})^n)$, where this $X_1$ indicates that box #1 remains empty after $n$ balls thrown. Then we could say that we have $X_2$, and so on for the other boxes, and they all are $Bern((1-\frac{1}{1000})^n)$ indicator random variables, but they are not independent.
Now, we say that random variable $Y=X_1+...+X_{1000}$. This $Y$ is actually number of empty boxes that we note for each experiment. Then we have that expected value $E[Y]=20$. And since expectation of sum is sum of expected values (even if random variables are not independent) we have $20=n(1-\frac{1}{1000})^n$. This gives me incorrect answer.
I need to understand what I'm missing here. Thank you very much.
You have mixed up your formulation,
imagine $n$ balls thrown randomly and independently into 1000 boxes.
In your last step, the formulation for the expected number of empty boxes should be
E[Y] $= 1000{(1- \frac1{1000})}^n =20$
which yields $n= 3910$