Question 198: Place $\mathrm{n}$ distinct balls into $\mathrm{n}$ distinct boxes, assuming that each ball is equally likely to fall into any of the boxes. Find the mathematical expectation of the number of empty boxes.


Question 198, Answer: Define the random variable $\mathrm{x}_{\mathrm{i}}(\mathrm{i}=1, 2, \ldots, \mathrm{n})$ as follows: when the $\mathrm{i}$-th box contains a ball, let $x_{1}=0$; when the $\mathrm{i}$-th box is empty, let $x_{i}=1$. Let $\xi=x_{1}+x_{2}+\ldots+x_{n}$, then $\xi$ is the number of empty boxes.
Since the probability of each ball being placed in the $\mathrm{i}$-th box is $\frac{1}{\mathrm{n}}$, the probability of not being placed in the $\mathrm{i}$-th box is $\frac{\mathrm{n}-1}{\mathrm{n}}$. Because whether each ball is placed in the $\mathrm{i}$-th box is independent, the probability that none of the $\mathrm{n}$ balls are placed in the $\mathrm{i}$-th box is $\left(\frac{\mathrm{n}-1}{\mathrm{n}}\right)^{n}$, and the probability that at least one ball is placed in the $\mathrm{i}$-th box is $1-\left(\frac{n-1}{n}\right)^{n}$. Thus, we get the distribution of $x_{i}$:
Therefore, $E\left(x_{i}\right)=0 \cdot\left[1-\left(\frac{n-1}{n}\right)^{n}\right]+1 \cdot\left(\frac{n-1}{n}\right)^{n}=\left(\frac{n-1}{n}\right)^{n}$. Since $\xi=x_{1}+x_{2}+\ldots+x_{n}$, we have $E(\xi)=E\left(x_{1}\right)+E\left(x_{2}\right)+\ldots+E\left(x_{n}\right)=n \cdot\left(\frac{n-1}{n}\right)^{n}=\frac{(n-1)^{n}}{n^{n-1}}$.