TITLE: another balls and bins question
QUESTION [21 upvotes]: I've seen many variations of this problem but I can't find a good, thorough explanation on how to solve it. I'm not just looking for a solution, but a step-by-step explanation on how to derive the solution.
So the problem at hand is: 
You have m balls and n bins. Consider throwing each ball into a bin uniformly and at random. 

What is the expected number of bins that are empty, in terms of m and n?
What is the expected number of bins that contain exactly 1 ball, in terms of m and n?

How would I approach solving this problem?
Thanks!

REPLY [6 votes]: Let's work out the probability there are $k$ balls (out of $m$) in the first bin (out of $n$).  This is a simple binomial probability with $p=1/n$ and $1-p = (n-1)/n$ so the probability is ${m \choose k} \dfrac{(n-1)^{m-k}}{n^m}$.  
The expected number of times the first bin has $k$ balls is the same, so the expected number of bins with $k$ balls is $n$ times this, i.e. 
$${m \choose k} \dfrac{(n-1)^{m-k}}{n^{m-1}}$$