Question: Suppose we have $n$ distinguishable balls and $n$ distinguishable boxes. How many ways can we throw the balls into the boxes such that exactly $k$ boxes are empty?
The answer has already been found (e.g. here), but I am looking for a correction to my solution, which is very close.
Consider $k=2$. I used the following approach:
- There are $\binom{n}{2}$ choices for the empty boxes.
- There are $\binom{n}{2}$ choices for which balls will be considered to go into "repeated boxes".
- The remaining $(n-2)$ balls can be permuted arbitrarily to give a factor of $(n-2)!$
Lastly, we now pick the "repeated boxes". If the boxes are different, we have $(n-2)(n-3)$ choices. Within each of these, we can permute the order of the two balls. If the boxes are different, we can again permute the order, but only in one box now. Thus, the answer is:
$$\binom{n}{2}^2 (n-2)! \bigg[\frac{(n-2)(n-3)}{2^2} + \frac{n-2}{3}\bigg]$$
This turns out to be the correct answer, but I am not convinced by (my own) dubious reasoning. It also gives an incorrect answer for $k=3$. Using similar reasoning for this case, I arrive at:
$$\binom{n}{3}^2 (n-3)! \bigg[\frac{(n-3)(n-4)(n-5)}{2^3} + \frac{2(n-3)(n-4)}{3 \cdot 2} + \frac{n-3}{4}\bigg]$$
It turns out that the correct answer is:
$$\binom{n}{3}^2 (n-3)! \bigg[\frac{(n-3)(n-4)(n-5)}{2^3} + \frac{\color{red}3(n-3)(n-4)}{3 \cdot 2} + \frac{n-3}{4}\bigg]$$
I think I must be on the right lines with my solution -- the patterns with the falling factorials and powers of $2$ seems unlikely to be a coincidence -- but I'm struggling to understand why some of these combinatorial factors/quotients arise. Please could someone help with interpreting them?