1

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!

RobPratt
  • 45,619

2 Answers2

0

This is a variation of the Coupon Collectors Problem. It can be solved by application of a generalization of the Principle of Inclusion and Exclusion. As stated in Section $3$, "The Realization of $m$ Among $N$ Events" in Chapter IV.4 of An Introduction to Probability Theory and Its Applications, Volume I, Third Edition by William Feller, the generalized principle is

" For any integer $m$ with $1 \le m \le N$ the probability $P_{[m]}$ that exactly $m$ among the $N$ events $A_1, \dots ,A_N$ occur simultaneously is given by $$P_{[m]} = S_m - \binom{m+1}{m} S_{m+1} + \binom{m+2}{m} S_{m+2} - \dots \pm \binom{N}{m}S_N"$$

Here $S_j$ is the sum of the probabilities of any $j$ of the events occurring simultaneously. You can find proofs and discussion of the generalized principle in the answers to this question: Generalized inclusion-exclusion principle.

To apply the principle, let's say a draw of $n$ colors from the bag has "property $i$" if color $i$ has not been drawn, for $1 \le i \le n$, and define $S_j$ to be the total probability of a draw having $j$ of the properties, for $1 \le j \le n$. So $$S_j = \binom{n}{j} \left(1 - \frac{j}{n} \right)^n$$

By the generalized principle of inclusion and exclusion, the probability that a draw of $n$ colors has exactly $n-k$ of the properties (and hence exactly $k$ colors have been drawn) is $$P_{[n-k]} = S_{n-k} - \binom{n-k+1}{n-k} S_{n-k+1} + \binom{n-k+2}{n-k} S_{n-k+2} - \dots \pm \binom{n}{n-k} S_n$$

awkward
  • 14,736
0

We have from first principles that the probability is

$$\frac{1}{n^n} {n\choose k} k! {n\brace k}.$$

This formula points to OEIS A090657 where we have confirmation. Here we first choose the $k$ values from the $n$ possibilities and partition the $n$ slots that will hold the values that are drawn into $k$ non-empty subsets. We can match the subsets to their labels in $k!$ ways.

Marko Riedel
  • 61,317