Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume that there are $m$ balls and $n$ urns with $m\gt n$. Each ball is thrown randomly and uniformly into urns. That is, each ball goes into each urn with probability $\dfrac1n$.

What is the probability that there are exactly $r$ urns with at least one ball in it? In other words, what is the probability that there are $n-r$ empty urns?

( I am Not sure whether it makes any difference whether balls and urns being distinguishable or not. If there is a difference assume that both balls and urns are distinguishable)

share|cite|improve this question
up vote 5 down vote accepted

The result should not depend on whether the ball and urns are distinguishable - only the derivation. Let's assume they are distinguishable.

The number of ways of placing $m$ (distinguishable) balls in $r$ (distinguishable) urns with no empty urn is

$$r! \, S_{m,r}$$

where $S_{m,r}$ is the Stirling number of the second kind. Hence the total number of ways of occupying $r$ urns out of $n$ is

$$ {n \choose r} r! \, S_{m,r}$$

and the probability then is

$$ p= \frac{{n \choose r} r! \, S_{m,r}}{n^m} = \frac{n! \, S_{m,r} }{(n-r)!\, n^m} = {n \choose r} \sum_{j=0}^r (-1)^{r-j} {r \choose j} \left(\frac{j}{n}\right)^m$$

(BTW, this is basically the same as a recent question)

share|cite|improve this answer
Excellent, thank you.Thanks also for providing the similar question. – Ava Jun 5 '13 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.