<s>[INST] Balls in bins, probability that exactly two bins are empty If we throw randomly $n+1$ balls into $n$ bins, what is the probability that exactly two bins are empty?
I tried to do this problem but I didn't get right solution, I would be very grateful if someone would point where am I making mistake, and how should I think about that. Also, if there are any simpler approaches, I would like to see them. I have seen that there have been similar questions but I would really like to find out where my intuition is making mistake.
First case:
$4$ balls inside one bin, and in other bins exactly one ball in each. We have $\binom{n+1}{4}$ ways of choosing $4$ balls from $n+1,$ and we can choose one from $n$ bins. Other balls we can place in $(n-3)!$ ways, so that is finally $n\cdot\binom{n+1}{4}\cdot(n-3)!$ ways. This way $2$ bins stay empty each time.
Second case:
$3$ balls inside one bin, $2$ balls in some other bin, and in left bins $n-4$ balls. I can choose $3$ balls in $\binom{n+1}{3}$ ways and place them into one of $n$ bins, after that I can choose two from $n-2$ left balls in $\binom{n-2}{2}$ ways and place them in one of $(n-1)$ left bins. Considering permutations of balls that I didn't pick, that is finally 
$\binom{n+1}{3}\cdot n\cdot\binom{n-2}{2}\cdot(n-4)!$ ways.
In this case also two bins will be empty.
Third case:
Two bins with two balls in them and other bins with $1$ ball in them, that will also result in $2$ empty bins. Same as described in previous cases, this would be $\binom{n+1}{2}\cdot n\cdot\binom{n-1}{2}\cdot(n-1)\cdot(n-3)! $
Total number of cases is $n^{n+1}.$
Probability is sum of these three cases over total number of cases, but I am making some mistake in counting. Thank you.
 [/INST] This is a probability question, so you have a choice of considering ways to arrange indistinguishable balls or ways to arrange balls that are all different. You just have to be consistent in how you add up the probability of each arrangement.
The number of ways to arrange $n+1$ balls (all different) into the $n$ bins is $n^{n+1}.$  All these arrangements are equally likely.
The arrangements of indistinguishable balls are not all equally likely, so I will consider the balls all different.
When counting arrangements, you must consider the fact that different choices of which bins are empty will give you different arrangements.
I did not see any consideration of that in the question.
So for the first case, after choosing one of $n$ bins to put the four balls in, you must choose two of the remaining $n-1$ bins to be empty,
so instead of $n\binom{n+1}{4}(n-3)!$ arrangements
you have $n\binom{n-1}{2}\binom{n+1}{4}(n-3)!.$
Simplifying this a bit, it is  $\frac{1}{48}n(n-1)(n-2)(n+1)!.$
For the second case, you are missing a factor of $n-1$ to account for the number of ways to select the bin to put two balls in,
and a factor of $\binom{n-2}{2}$ for the choice of two empty bins,
so instead of 
$n\binom{n+1}{3}\binom{n-2}{2}(n-4)!$ ways
you should have $n\binom{n+1}{3}(n-1)\binom{n-2}{2}\binom{n-2}{2}(n-4)!.$
This simplifies to $\frac{1}{24}n(n-1)(n-2)(n-3)(n+1)!.$
For the third case, you actually need to put two balls into each of
three bins.
But you also need to avoid multiple counting of the same arrangement:
for example, choosing bin $1,$ putting balls $1$ and $2$ in that bin,
then choosing bin $2$ and putting balls $3$ and $4$ in it,
is the same result as choosing bin $2,$ putting $3$ and $4$ in it,
then choosing $1$ and putting $1$ and $2$ in it.
To avoid double-counting, rather than choosing one bin, then another, then another ($n(n-1)(n-2)$ ways), you can first choose the three bins that will each have two balls ($\binom{n}{3}$ ways) and then fill them left to right.
But also remember to choose two empty bins from the remaining $n-3$
before placing the remaining balls. So instead of
$\binom{n+1}{2}n\binom{n-1}{2}(n-1)(n-3)!$ you should have
$\binom{n}{3}\binom{n+1}{2}\binom{n-1}{2}\binom{n-3}{2}\binom{n-3}{2}(n-5)!.$
This simplifies to
$\frac{1}{96}n(n-1)(n-2)(n-3)(n-4)(n+1)!.$
Adding these up, we have $M$ arrangements with exactly two empty bins, where
\begin{align}
M &= \frac{1}{48}n(n-1)(n-2)(n+1)!
 + \frac{1}{24}n(n-1)(n-2)(n-3)(n+1)! \\
 &\qquad + \frac{1}{96}n(n-1)(n-2)(n-3)(n-4)(n+1)! \\
&= \frac{n(n-1)(n-2)(n+1)!}{96}\left(2 + 4(n-3) + (n-3)(n-4)\right) \\
&= \frac{n(n-1)(n-2)(n+1)!}{96}\left(n^2 - 3n + 2\right) \\
&= \frac{n(n-1)^2(n-2)^2(n+1)!}{96}.
\end{align}
And then the probability is just the number of arrangements with exactly
two empty bins divided by the total number of arrangements:
$$\frac{M}{n^{n+1}} = \frac{(n-1)^2(n-2)^2(n+1)!}{96n^n}.
$$
</s>