Probability and Combinatorics – Distributing n Distinguishable Balls into n Boxes

combinatoricsprobability

We have n distinguishable balls (say they have different labels or colours). If these
balls are dropped at random in n boxes, what is the probability that:

1- No box is empty?
2- Exactly one box is empty?

For 1, I figured that we have $n^n$ ways to put the n balls into the n boxes. And I figured there are $n!$ to sort the balls so there is one ball for each box.

So is the answer to question 1 $n!/(n^n)$?

For 2, there are $n-1$ ways for the boxes to be empty. This is because you can have box 1 be empty (and just that), box 2 be empty and just that, so ultimately you can have at most $n-1$ variations of empty boxes.

So I figured the solution to part 2 was $\frac{n-1}{n^n}$

Is any of this right?

Best Answer

Your answer to part 1 is correct.

For part 2, you must place the balls so that there is one empty box, one box with two balls, and the remaining balls will have one ball each. There are $n$ ways to pick the empty box, and $n-1$ ways to then pick the box with two balls.

We can now fill the $n$ spaces for the balls with the $n$ balls in any order you wish. There are of course $n!$ ways to do this. However, there is a caveat. If the box with two spaces is filled with ball $a$ and then ball $b$, that is the same as if we put ball $b$ and then ball $a$. So we are double counting, and the number of ways to fill in the boxes is $\frac{n!}{2}$.

Thus the total number of ways to have one empty box is $\frac{n(n-1)(n!)}{2}$, so the probability of having one empty box is $\frac{\frac{n(n-1)(n!)}{2}}{n^n} = \frac{(n-1)(n!)}{2n^{n-1}}$.