Tutorials › Statistical Theory I - Probability and Distribution Theory › Deriving the Multinomial Probability Formula

Bernoulli and Binomial Families · Tutorial 116 of 994

Deriving the Multinomial Probability Formula

Learn how the number of compatible trial sequences and the probability of each sequence combine to give a multinomial count probability.

Beginner 8 min read

What You'll Learn

  • Specify the independent, identically distributed categorical-trial model behind the formula.
  • Distinguish an ordered sequence of outcomes from its category-count vector.
  • Count sequences with fixed category counts using sequential choices of positions.
  • Derive the multinomial probability by multiplying the sequence count by the probability of one sequence.
  • Apply the formula, including when a category has count zero.
  • Check that the probabilities over all count vectors sum to one.

From Trial Sequences to Category Counts

In a categorical experiment, the recorded result may be a count for each category rather than the order in which the outcomes occurred. For example, after several trials we might know that category A occurred twice and category B occurred three times, without retaining whether the outcomes arrived in the order A, B, A, B, B or another order. To find the probability of those counts, we need two ingredients: the probability of one particular ordered sequence and the number of sequences that produce the same counts.

Assume there are \(k\) categories, labelled \(1,\ldots,k\), and \(n\) independent trials. On every trial, category \(j\) occurs with probability \(p_j\), where \(p_j\geq 0\) and \(\sum_{j=1}^k p_j=1\). Write \(X_j\) for the number of trials resulting in category \(j\). The count vector is \((X_1,\ldots,X_k)\). The key feature of this model is that each trial has the same category probabilities and the trials are independent.

Definition: A count vector \((x_1,\ldots,x_k)\) specifies how many of the \(n\) trials result in each category. In the event that the counts equal this vector, \(x_j\) trials have outcome \(j\), for each \(j\), and the counts satisfy \(\sum_{j=1}^k x_j=n\). An ordered sequence records the category from each trial in its original trial position; several different ordered sequences can have the same count vector.

For a fixed count vector, every compatible ordered sequence has the same probability. Independence gives that probability by multiplying the category probabilities for its \(n\) trial outcomes. The count probability is then the sum of those equal sequence probabilities over all compatible sequences.

Counting the Compatible Sequences

First determine how many ordered sequences produce counts \((x_1,\ldots,x_k)\). Choose the \(x_1\) trial positions occupied by category 1 from the \(n\) available positions. From the remaining positions, choose \(x_2\) for category 2. Continue until the positions for the final category are determined.

The number of choices at these stages is \(\binom{n}{x_1}\), then \(\binom{n-x_1}{x_2}\), and so on, ending with \(\binom{x_k}{x_k}=1\). Multiplying gives

$$ \binom{n}{x_1} \binom{n-x_1}{x_2} \binom{n-x_1-x_2}{x_3} \cdots \binom{n-x_1-\cdots-x_{k-1}}{x_k} = \frac{n!}{x_1!x_2!\cdots x_k!}. $$

To see the cancellation, write each binomial coefficient as a factorial ratio. The first numerator is \(n!\); each later numerator is the remaining-position factorial from the previous denominator. These intermediate factorials cancel, leaving \(n!/(x_1!\cdots x_k!)\). Every sequence with the specified counts is counted exactly once: its positions for each category determine one set of choices, and any such set of choices specifies exactly one sequence.

Counting result: The number of ordered sequences with \(x_j\) occurrences of category \(j\), for \(j=1,\ldots,k\), is the multinomial coefficient \(\frac{n!}{x_1!\cdots x_k!}\).

Deriving the Multinomial Probability Formula

Consider any one ordered sequence that contains \(x_j\) occurrences of category \(j\). By independence, its probability is the product of the probabilities of its individual outcomes. Since the same probability \(p_j\) appears once for each occurrence of category \(j\), that product is \(\prod_{j=1}^k p_j^{x_j}\). All sequences with the same counts have this same probability. Their events are disjoint, so adding their probabilities multiplies the probability of one sequence by the number of compatible sequences.

Theorem: For \(n\) independent categorical trials with the same category probabilities \(p_1,\ldots,p_k\), the probability of the count vector \((x_1,\ldots,x_k)\), where the counts are nonnegative integers summing to \(n\), is
$$ P(X_1=x_1,\ldots,X_k=x_k) = \frac{n!}{x_1!x_2!\cdots x_k!} \prod_{j=1}^k p_j^{x_j}. $$
The convention \(p_j^0=1\) applies, including when \(p_j=0\). If \(p_j=0\) but \(x_j>0\), the product and the probability are zero.

The derivation has two separate parts: the factorial ratio counts how many sequences yield the given counts, while the product of powers gives the probability of each one. Neither part alone is the count probability.

Worked Calculations

Worked Example: Three Categories in Five Trials

Each of five independent trials results in A with probability \(0.5\), B with probability \(0.3\), or C with probability \(0.2\). Find the probability of exactly two A outcomes, two B outcomes, and one C outcome.

A particular sequence with these counts, such as A, B, A, C, B, has probability \(0.5^2(0.3)^2(0.2)\). Calculate: \(0.5^2=0.25\), \((0.3)^2=0.09\), and \(0.25(0.09)(0.2)=0.0045\).

The number of sequences with these counts is \(5!/(2!2!1!)=120/(2\cdot2\cdot1)=30\). Thus the probability of the entire count event is \(30(0.0045)=0.135\).

As a check on the interpretation, the probability \(0.0045\) belongs to one particular ordering; the probability \(0.135\) includes all 30 orderings with those counts.

Worked Example: A Category with Count Zero

In four independent trials, the probabilities of categories 1, 2, 3, and 4 are \(0.1, 0.2, 0.5,\) and \(0.2\). Find the probability of counts \((1,0,2,1)\).

One compatible sequence is category 1, category 3, category 3, category 4. Its probability is \(0.1(0.5)(0.5)(0.2)=0.005\). The count of category 2 is zero, so category 2 does not appear in a compatible sequence.

The number of compatible sequences is \(4!/(1!0!2!1!)=24/(1\cdot1\cdot2\cdot1)=12\), using \(0!=1\). The count probability is therefore \(12(0.005)=0.06\).

Equivalently, the category-probability product is \((0.1)^1(0.2)^0(0.5)^2(0.2)^1=0.005\), because the zero count contributes the factor \(1\).

Worked Example: Six Trials with Two Equally Likely Categories

Each trial results in red with probability \(0.4\), blue with probability \(0.4\), or green with probability \(0.2\), independently of the other trials. Find the probability of three red outcomes, two blue outcomes, and one green outcome in six trials.

The number of orderings is \(6!/(3!2!1!)=720/(6\cdot2\cdot1)=60\).

Each such ordering has probability \((0.4)^3(0.4)^2(0.2)=(0.4)^5(0.2)\). Since \((0.4)^2=0.16\), \((0.4)^3=0.064\), and \((0.4)^5=0.064(0.16)=0.01024\), the sequence probability is \(0.01024(0.2)=0.002048\).

Multiplying by the 60 compatible orderings gives \(60(0.002048)=0.12288\). This is the probability of the specified counts, not the probability of any single ordering.

Why the Formula Sums to One

A useful check is that the probabilities assigned to all possible count vectors add to one. Every ordered sequence of \(n\) trial outcomes has exactly one count vector, so the events corresponding to the count vectors partition all possible sequences. For completeness, the sum of the formula over the count vectors can also be seen directly.

Normalization result: For independent categorical trials with \(\sum_{j=1}^k p_j=1\), the multinomial probabilities over all count vectors of total \(n\) sum to one.

Indeed, group all ordered sequences according to their count vector. The formula gives the sum of the sequence probabilities within each group. Summing across all groups therefore gives the sum over every ordered sequence. Alternatively, sum first over the category chosen on each trial; distributivity of finite sums gives

$$ \sum_{\text{all count vectors}} \frac{n!}{x_1!\cdots x_k!}\prod_{j=1}^k p_j^{x_j} = \sum_{(y_1,\ldots,y_n)\in\{1,\ldots,k\}^n} \prod_{i=1}^n p_{y_i} = \left(\sum_{j=1}^k p_j\right)^n = 1. $$

The middle sum is over the \(k^n\) ordered sequences \((y_1,\ldots,y_n)\). It equals the sum of the grouped probabilities because each sequence belongs to exactly one count vector. The final equality uses the fact that the category probabilities sum to one.

Common Mistake: Forgetting the Number of Orderings

A frequent error is to calculate the probability of one sequence and report it as the probability of the count event. In the first worked example, the sequence A, B, A, C, B has probability \(0.0045\), but there are 30 sequences with the required counts. The count-event probability is \(30(0.0045)=0.135\). The opposite error is to multiply by \(n!\) without dividing by the factorials of the counts; that counts permutations that exchange identical category labels as if they were different orderings. The correct number is \(n!/(x_1!\cdots x_k!)\).

Key takeaway: To obtain a multinomial count probability, first count the ordered sequences that have the required category counts, then multiply that number by the probability of one such sequence.

Check Your Understanding

Use the sequence-counting argument to answer each question.

  1. In four trials with category probabilities \(0.6\) and \(0.4\), how many ordered sequences have counts \((3,1)\), and what is the probability of those counts?
  2. For five trials and counts \((2,0,3)\), write the number of compatible ordered sequences. Explain why the zero count contributes a factorial of \(0!\).
  3. Why do all ordered sequences with the same category counts have the same probability under the model?
  4. In the multinomial formula, identify which factor counts orderings and which factor gives the probability of one ordering.
  5. Explain why summing the count probabilities over all count vectors gives the same total as summing probabilities over all ordered sequences.