# Multinomial Probabilities (Counting Problem)

Question: We draw $n$ balls out of a hat. At each draw there is a probability of $p_i$ of getting a ball of color $c_i$. What is the probability of obtaining exactly $n_i$ of each ball of color $c_i$? Note that $n_1 + n_2 + \cdots + n_r = n$.

Answer: I am trying to understand the answer to this problem. It's broken into two parts and I don't quite understand the second part.

We know that drawing a particular sequence of balls containing exactly $n_i$ of color $c_i$ balls is $$p_1^{n_1} + p_2^{n_2} + \cdots + p_r^{n_r}$$

The solution says "the number of possible sequences containing $n_i$ balls of color $c_i$ is the number of ways to form a partition of n distinct slots into subsets of cardinality $n_1, \cdots n_r$. Therefore, our answer is

$$\dbinom{n}{n_1,n_2,\cdots,n_r} p_1^{n_1} + p_2^{n_2} + \cdots + p_r^{n_r}$$

I understand the first part with the probabilities, but I don't understand why the multinomial coefficient counts all the possible sequences. Could someone demonstrate a simple example with the $2+1+1 = 4$, where our colors are red, blue and green?

Thank you.

## 2 Answers

First up, you multiply, rather than add, to get the probabilities of the sequence. $$\dbinom{n}{n_1,n_2,\cdots,n_r}\times p_1^{n_1} \times p_2^{n_2} \times \cdots \times p_r^{n_r}$$

Second: Consider this example from the results of flipping 2 coins. The ways to get 1 head and 1 tail are: HT, TH, and the ways not to get exactly one of each are: HH, TT. Clearly then the probability of getting 1 of each is $\frac 12$

And by the multinomial distribution: $\displaystyle \mathrm{\large P}(H=1, T=1) = {2\choose 1,1} \left(\tfrac 12\right)^1 \left(\tfrac 12\right)^1 = \tfrac 12$

That's all it is. The probability of getting the numbers of each atomic event (the product), times the number of permutations that yield the same result (the multinomial coefficient).

Third

Could someone demonstrate a simple example with the 2+1+1=4, where our colors are red, blue and green?

There are ${4\choose 2,1,1}=12$ permutations of this sequence.

There are $n!=24$ ways to rearrange $n=4$ objects, but these are subgrouped into equivalent cases. There are $2!$ ways to rearrange $2$ distinct ball, but only $1$ way to select $2$ non-distinct balls, et cetera. So we need to divide by $n_r!\times n_b! \times n_g!=2$

$${(n_r+n_b+n_g)\choose n_r, n_g, n_b}=\frac{(n_r+n_b+n_g)!}{(n_r!\times n_b!\times n_g)!} \\ = {4\choose 2,1,1} = \frac{4!}{2!1!1!}= 12$$

These sequences are: RRBG, RRGB, RBRG, RBGR, RGRB, RGBR, BRRG, BRGR, BGRR, GRRB, GRBR, GBRR

The probability of getting RRBG (in that order) is $\mathrm{\large P}(RRBG) = p_r^2 \times p_b\times p_g$, and it is the same probability for getting each of those sequence.

So the probability of getting any of those sequences is (that is, RRGB in any order) is $\mathrm{\large P}(R=2,B=1,G=1) = 12\times p_r^2 \times p_b\times p_g$

• Thanks! It makes a lot of sense now. Commented May 29, 2014 at 17:07

Addition is wrong (see the answer of Graham).

If you have $n=n_{1}+\dots+n_{r}$ colored balls, then they can be put in $n!$ orders. For every pattern of colors there are $n_{1}!\times\cdots\times n_{r}!$ of these orders that result in this pattern. So to count the distinct number of the patterns you should divide $n!$ by $n_{1}!\times\cdots\times n_{r}!$.