Artificial intelligent assistant

If I randomly (uniformly) distribute n balls into k bags, what is the distribution of the number of empty bags? If I uniformly distribute $n$ balls into $k$ bags, I am trying to work out the distribution of the number of bags which are empty. Now I had thought that I could use that each bag has $\text{Binomial}(n, \frac{1}{k})$ balls and use this but these distributions are not independent so this doesn't work. Any help will be greatly appreciated.

Define $P_k^n(m)$ as the probability, that there will be $m$ empty bags after $n$ balls were thrown into $k$ bags. Now, suppose, you have $k$ bags total and have already thrown $n - 1$ balls, and it resulted in $m$ bags remaining empty. Then, after the next ball is thrown, $m$ bags remain empty with probability $\frac{k - m}{k}$ and the number of empty bags will become $m - 1$ is $\frac{m}{k}$. So we have the following recurrence, that is sufficient to define all probabilities you search:

$$P_k^n(m) = \frac{k - m}{k}P_k^{n - 1}(m) + \frac{m}{k}P_k^{n-1}(m + 1)$$ $$P_k^0(k) = 1$$ $$P_k^0(m) = 0, \text{ if } m \
eq k$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 9df0f3b8dd59d23b96df2f33f02443de