A total of n balls, numbered 1 through n, are put into n urns, also numbered 1 through n in such a way that ball i is equally likely to go into any of the urns 1, 2, . . . , i.
Find
(a) the expected number of urns that are empty; (b) the variance of the number of empty urns.
(a)Let $X_i$ be a random variable that is 1 if the i-th urn is empty, 0 otherwise.
$X=\sum_{i=1}^N X_i$=number of empty urns.
$E[X]=\sum_{i=1}^N E[X_i]=\sum_{k=1}^N \frac{i-1}{N}=\frac{N-1}{2}$
(b) $$\begin{align} Var (X) &=Var (\sum_{i=1}^NX_i)\\ &=\sum_{i=1}^N Var (X_i)+2*\sum_{}^ {}\sum_{i
for $i $$\begin{align}E[X_i X_j] &= P(X_i=1,X_j=1)\\ &=P(X_i)P(X_j=1|X_i=1)\\ &=\prod_{i=1}^{j-1} (1-\frac{1}{i})*\prod_{j=1}^{N} (1-\frac{2}{j})\end{align}$$ $$\begin{align}Cov(X_i,X_j) &= E[X_i X_j]-E[X_i]*E[ X_j]\\ &=\prod_{i=1}^{j-1} (1-\frac{1}{i})*\prod_{j=1}^{N} (1-\frac{2}{j})-\prod_{i=1}^{j-1} (1-\frac{1}{i})*\prod_{j=1}^{N} (1-\frac{1}{j})\end{align}$$