Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

This is a homework question I was assigned to do. I was thinking about the problem and I thought the answer was $$ \frac{1}{k^j} \cdot \left(1 - \frac{1}{k}\right)^{n-j} . $$ I now have some doubts, though. I was thinking that I am not taking into account that the balls could be distributed into the urns in different combinations, so perhaps I have to include some expression involving ${{A}\choose{B}}$, where $A$ and $B$ are some expressions involving $n, k$ or $j$ ?

Thanks in advance.

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

As a first hint, look into "stars and bars" problems, perhaps searching for stars and bars here.

As a second hint, the number of ways to do it where $j$ balls end up in the last urn is the same as the number of ways to put $n-j$ balls into $k-1$ urns.

share|cite|improve this answer

The answer depends on whether the balls are distinguishable or not. If they are not, which is almost certainly what is intended, Isaac’s answer points the way.

If they are, the reasoning is a bit different. Your expression gives the probability that a particular set of $j$ balls goes into the last urn and the other $n-j$ balls into the other urns. But there are $\binom{n}j$ different possible sets of $j$ balls, and each of them the same probability of being the final contents of the last urn, so the total probability of ending up with exactly $j$ balls in the last urn is $$\binom{n}j\left(\frac1{k^j}\right)\left(1-\frac1k\right)^{n-j}=\binom{n}j\cdot\frac{(k-1)^{n-j}}{k^n}$$ if the balls are distinguishable.

Mind you, I include this answer only for the sake of completeness: it’s much more likely that you’re supposed to assume that the balls are indistinguishable.

share|cite|improve this answer

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.