### 7.4.3 The multinomial probability function: multinomial

If X follows a multinomial probability distribution with
P = [p_{0},p_{1},…,p_{j}] (where p_{0} + … + p_{j} = 1),
then for K=[k_{0},…,k_{j}] with k_{0} + … + k_{j} = n, the
probability that X=K is given by the multinomial command;

multinomial(n,P,K)= | | (p_{0}^{k0}p_{1}^{k1}… p_{j}^{kj}. |

You will get an error if k_{0} + … + k_{j} is not equal to n,
although you won’t get one if p_{0} + … + p_{j} is not equal to 1.

For example, if you make 10 choices, where each choice is one of
three items; the first has a 0.2 probability of being chosen, the
second a 0.3 probability and the third a 0.5 probability, the
probability that you end up with 3 of the first item, 2 of the
second and 5 of the third will be

multinomial(10,[0.2,0.3,0.5],[3,2,5])

or

0.0567