I randomly assign $m$ objects into one of $n$ sets. How do I compute expected value of the number of non-empty sets? To put it into more colorful terms, let's say I have $m$ balls and $n$ boxes.  I select one of the $m$ balls and randomly place it into one of the $n$ boxes.  I do this with each ball until I have none left.  I then take all of the boxes with no balls left in them and set them aside.  What is the expected value of the number of boxes left?
This question is derived from a math competition I participated in a year ago.  I spent weeks trying to figure this one out, but I never quite managed to wrap my head around the solution.

For $i=1,2,\cdots{},n$ define $X_i$ as $X_i=1$ if box $i$ ends up with non-zero balls and $X_i=0$ if not. Set $$X=X_1+X_2+\cdots{}X_n.$$
Notice that $X$ is the total number of boxes which are non-empty. Therefore,
$$\mathbb{E}(X)=\mathbb{E}\left(X_1+X_2+\cdots{}+X_n\right)=\mathbb{E}(X_1)+\mathbb{E}(X_2)+\cdots{}+\mathbb{E}(X_n).$$
For all $i$, we have $X_i=0$ if all the $m$ balls end up in one of the other boxes. Hence $$\mathbb{E}(X_i)=P(X_i=1)=1-P(X_i=0)=1-\left(\dfrac{n-1}{n}\right)^m.$$
Summing this up gives us,
$$\mathbb{E}(X)=\sum \mathbb{E}(X_i)=n\left(1-\left(\dfrac{n-1}{n}\right)^m\right).$$
