Color ball drawer probability question There is a ball drawer.
Seven color balls will be drawn with the same probability ($1/7$).
(black, blue, green, yellow, white, pink, orange)
If Anson attempts $9$ times,
what is the probability that he gets all $7$ different color balls?
My work:
I separate the answer to $3$ ways.

*

*$7$ attempts -> done (get $7$ colors)

*$8$ attempts -> done (get $7$ colors)

*$9$ attempts -> done (get $7$ colors)

Therefore, my answer is $$\frac{9C7 + 8C7 + 7C7}{7^7 \cdot (7!)}$$
However, I don't know it is correct or not.
 A: Since there are seven choices for each of the nine balls Anson selects, there are $7^9$ possible sequences of colors.
Method 1:  If each color appears among the nine balls, there are two possibilities:

*

*One color is selected three times and each of the other colors is selected once.

*Two colors are each selected twice and each of the other colors is selected once.

One color is selected three times and each of the other colors is selected once:  There are seven ways to select the color which appears three times, $\binom{9}{3}$ ways to select the three positions occupied by that color, and $6!$ ways to arrange the remaining six colors in the remaining six positions.  There are
$$\binom{7}{1}\binom{9}{3}6!$$
such cases.
Two colors are each selected twice and each of the other colors is selected once:  There are $\binom{7}{2}$ ways to select the two colors which each appear twice, $\binom{9}{2}$ ways to select two positions for the selected color which appears first in an alphabetical list, $\binom{7}{2}$ ways to select two positions for the other selected color, and $5!$ ways to arrange the remaining five colors in the remaining five positions.  There are
$$\binom{7}{2}\binom{9}{2}\binom{7}{2}5!$$
such cases.
Therefore, the number of favorable cases is
$$\binom{7}{1}\binom{9}{3}6! +  \binom{7}{2}\binom{9}{2}\binom{7}{2}5!$$
so the probability that all seven colors are selected is
$$\Pr(\text{all seven colors selected}) = \frac{\dbinom{7}{1}\dbinom{9}{3}6! + \dbinom{7}{2}\dbinom{9}{2}\dbinom{7}{2}5!}{7^9}$$
Method 2:  We use the Inclusion-Exclusion Principle.
There are $7^9$ possible sequences of colors.  From these, we must exclude those sequences in which one or more colors is missing.
There are $\binom{7}{k}$ ways to select which $k$ colors are missing and $(7 - k)^9$ sequences of colors which can be formed with the remaining colors.  Thus, by the Inclusion-Exclusion Principle, the number of favorable cases is
\begin{align*}
& \sum_{k = 0}^{7} (-1)^k\binom{7}{k}(7 - k)^9\\
& \qquad = 7^9 - \binom{7}{1}6^9 + \binom{7}{2}5^9 - \binom{7}{3}4^9 + \binom{7}{4}3^9 - \binom{7}{5}2^9 + \binom{7}{6}1^9 - \binom{7}{7}0^9
\end{align*}
Hence, the probability that each color appear is
\begin{align*}
& \Pr(\text{all seven colors selected})\\
& \qquad = \frac{7^9 - \dbinom{7}{1}6^9 + \dbinom{7}{2}5^9 - \dbinom{7}{3}4^9 + \dbinom{7}{4}3^9 - \dbinom{7}{5}2^9 + \dbinom{7}{6}1^9 - \dbinom{7}{7}0^9}{7^9}
\end{align*}
A: You can also count using generating functions.
Each of the $7$ colors can be used once, twice, or thrice so the generating function for each color is $\left(x+\frac{x^2}{2!} +\frac{x^3}{3!}\right)$
and to fill $9$ slots, we need to find  coefficient of $x^9$ in $9!\left(x+\frac{x^2}{2!} +\frac{x^3}{3!}\right)^7 =2328480$
so $Pr = \dfrac{2328480}{7^9}$
