I have come up with an idea to myself, but cannot seem to solve it: we have a bag of n different colored balls. We draw one, write down the color, then put it back. We do it exactly n times. What is the probability of having drawn exactly $k$ different colors?
Example: bag with $3$ different colors $(n=3)$, having to draw exactly $2$ different colors $(k=2)$, probability is $18/27$. (all possibilities is $n^n$, and 18 different outcomes)
My idea was that it's the product of the combination with repetition and permutation with repetition, but not sure:
$$\frac{\displaystyle {n+k-1 \choose k}\cdot\dfrac{n!}{i_1! \cdot i_2! \cdot \dots \cdot i_s!}}{n^n}$$
Where $n$ is number of the balls in the bag, $k$ is the number of distinct colors we want to be drawn, and (here's where I got stuck) the $i$'s are the number of balls for each color that can be drawn for the given combination.
With the above example:
$$\frac{\displaystyle {3+2-1 \choose 2}\cdot\dfrac{3!}{2! \cdot 1!}}{3^3}$$
If the formula is correct, how to determine the $i$'s based on $n$ and $k$?
Any help is appreciated, thank you!