Multinomial Coefficients
The binomial coefficient $\binom{n}{r}$ splits $n$ items into two groups: chosen and unchosen. But sometimes we want to split into more groups — three teams, four bins, $k$ types. The natural generalisation is the multinomial coefficient, and it shows up everywhere from card-dealing to symbol-counting to multinomial probability distributions in Ross Chapter 4.
Definition
Multinomial coefficient. Suppose $n_1, n_2, \dots, n_k$ are non-negative integers with $n_1 + n_2 + \dots + n_k = n$. Define
$\displaystyle \binom{n}{n_1, n_2, \dots, n_k} = \dfrac{n!}{n_1!\, n_2! \cdots n_k!}.$
It counts the number of ways to partition $n$ distinct items into $k$ labelled groups of sizes $n_1, n_2, \dots, n_k$.
When $k = 2$, this collapses to $\binom{n}{n_1, n_2} = \dfrac{n!}{n_1!\, n_2!} = \binom{n}{n_1}$, recovering the binomial coefficient. So multinomials are a strict generalisation.
Why It Works — Two Derivations
Derivation 1: stage-by-stage choice
Form the groups one at a time:
- Pick which $n_1$ of the $n$ items go to group 1: $\binom{n}{n_1}$ ways.
- From the remaining $n - n_1$ items, pick the $n_2$ for group 2: $\binom{n - n_1}{n_2}$ ways.
- From what's left, pick the $n_3$ for group 3: $\binom{n - n_1 - n_2}{n_3}$.
- $\vdots$
- The last group is forced: $\binom{n_k}{n_k} = 1$.
By the multiplication rule:
$\binom{n}{n_1}\binom{n - n_1}{n_2} \cdots \binom{n_k}{n_k} = \dfrac{n!}{n_1!\,(n - n_1)!} \cdot \dfrac{(n - n_1)!}{n_2!\,(n - n_1 - n_2)!} \cdots = \dfrac{n!}{n_1! n_2! \cdots n_k!}.$
The intermediate factorials telescope, leaving the multinomial. $\Box$
Derivation 2: line up and label
Imagine arranging the $n$ items in a row ($n!$ orderings), then assigning the first $n_1$ to group 1, the next $n_2$ to group 2, and so on. We have overcounted: any reordering within a group produces the same partition. Divide out by $n_1!\, n_2! \cdots n_k!$ and we get the same formula. This is exactly the “permutations of indistinguishable objects” argument from Part 3, viewed from a different angle.
▶ Visual: Partitioning 6 Students into Groups of 3 / 2 / 1
Step through one assignment to see why $\binom{6}{3, 2, 1} = \dfrac{6!}{3!\,2!\,1!} = 60.$
The Multinomial Theorem
Multinomial theorem. For any non-negative integer $n$ and any quantities $x_1, x_2, \dots, x_k$,
$\displaystyle (x_1 + x_2 + \dots + x_k)^n = \sum_{n_1 + n_2 + \dots + n_k = n} \binom{n}{n_1, n_2, \dots, n_k} x_1^{n_1} x_2^{n_2} \cdots x_k^{n_k}.$
The sum runs over all compositions of $n$ into $k$ non-negative parts.
Proof. Same idea as the binomial theorem. Expand the product of $n$ identical factors $(x_1 + x_2 + \dots + x_k)$. To produce the monomial $x_1^{n_1} x_2^{n_2} \cdots x_k^{n_k}$ we must pick $x_i$ from exactly $n_i$ of the $n$ factors, and the count of those choices is the multinomial coefficient. $\Box$
Worked Examples
Ross 1.5a — Bridge deals
How many ways are there to deal 52 cards into four 13-card hands (north, south, east, west)?
The hands are labelled (we know which player is north and which is south), so this is a multinomial:
$\binom{52}{13, 13, 13, 13} = \dfrac{52!}{(13!)^4} \approx 5.36 \times 10^{28}.$
Ross 1.5b — MISSISSIPPI revisited
How many distinct anagrams of MISSISSIPPI are there?
Either view it as “permutations of a multiset” (Part 3) or as “partition the 11 positions into label-groups of sizes 1, 4, 4, 2” (this post). Both give:
$\binom{11}{1, 4, 4, 2} = \dfrac{11!}{1!\,4!\,4!\,2!} = 34{,}650.$
Ross 1.5c — Splitting students into groups
If 10 students are split into 3 distinct teams of sizes 4, 4, and 2, how many ways are there?
$\binom{10}{4, 4, 2} = \dfrac{10!}{4!\,4!\,2!} = \dfrac{3{,}628{,}800}{24 \cdot 24 \cdot 2} = 3{,}150.$
What if the two teams of size 4 are unlabelled — say "two practice teams that play each other"?
If the two same-sized teams are interchangeable, divide further by the $2!$ ways to swap them:
$\dfrac{3{,}150}{2!} = 1{,}575.$
Worked: $(x + y + z)^3$
Apply the multinomial theorem with $n = 3$ and $k = 3$:
(x + y + z)^3 =
x^3 [coefficient C(3; 3,0,0) = 1]
+ y^3 [C(3; 0,3,0) = 1]
+ z^3 [C(3; 0,0,3) = 1]
+ 3 x^2 y [C(3; 2,1,0) = 3]
+ 3 x^2 z [C(3; 2,0,1) = 3]
+ 3 x y^2 [C(3; 1,2,0) = 3]
+ 3 y^2 z [C(3; 0,2,1) = 3]
+ 3 x z^2 [C(3; 1,0,2) = 3]
+ 3 y z^2 [C(3; 0,1,2) = 3]
+ 6 x y z [C(3; 1,1,1) = 6]
Sum of coefficients: $1 + 1 + 1 + 6 \cdot 3 + 6 = 27 = 3^3$. Setting $x = y = z = 1$ in the theorem confirms the row sum identity.
Useful Properties
- Reduces to binomial. $\binom{n}{n_1, n - n_1} = \binom{n}{n_1}$.
- Permutation invariance. $\binom{n}{n_1, n_2, \dots, n_k}$ is unchanged by reordering its arguments.
- Sum over compositions. $\displaystyle \sum_{n_1 + \dots + n_k = n} \binom{n}{n_1, \dots, n_k} = k^n$ (set every $x_i = 1$).
- Recursion. $\displaystyle \binom{n}{n_1, \dots, n_k} = \sum_{i=1}^{k} \binom{n - 1}{n_1, \dots, n_i - 1, \dots, n_k}$, a generalisation of Pascal's identity.
Computing Multinomial Coefficients
// Modular multinomial using precomputed fact[] / invFact[].
long long multinomial(int n, const std::vector<int>& parts) {
long long sum = 0;
for (int p : parts) sum += p;
if (sum != n) return 0; // invalid input
long long r = fact[n];
for (int p : parts) r = r * invFact[p] % MOD;
return r;
}
For exact integer answers (no modulus), the safest method is to multiply binomials in stages and divide in integer arithmetic — exactly Derivation 1 from earlier in this post.
Probability Application: The Multinomial Distribution
Roll an $k$-sided die $n$ times. The probability of seeing exactly $n_i$ outcomes of side $i$ for $i = 1, \dots, k$ (with $n_1 + \dots + n_k = n$) is
$\Pr[(N_1, \dots, N_k) = (n_1, \dots, n_k)] = \binom{n}{n_1, \dots, n_k} p_1^{n_1} p_2^{n_2} \cdots p_k^{n_k}$
where $p_i$ is the probability of side $i$ on one roll. The multinomial coefficient counts the orderings; the product of $p_i^{n_i}$ accounts for the probability of any one such ordering. Ross devotes Section 4.6 to this — and you'll be ready for it because you understand where the multinomial coefficient comes from.
Common Mistakes
- Treating identical-sized groups as labelled. “Two teams of 5” without labels is half of $\binom{10}{5, 5}$.
- Forgetting that the parts must sum to $n$. $\binom{n}{n_1, \dots, n_k}$ is undefined (or zero) otherwise.
- Mixing groups and elements. The multinomial treats elements as distinct and groups as labelled. If groups are unlabelled but elements are distinct, divide by the appropriate symmetry. If elements are also indistinguishable inside groups, you have a partition-of-an-integer problem instead.
Summary
- $\binom{n}{n_1, \dots, n_k} = \dfrac{n!}{n_1! \cdots n_k!}$ counts partitions of $n$ distinct items into labelled groups of given sizes.
- Generalises $\binom{n}{r}$ and arises naturally from the multinomial theorem $(x_1 + \dots + x_k)^n$.
- Multinomial probability problems use the same coefficient as the multiplier of $p_1^{n_1} \cdots p_k^{n_k}$.
- If groups of equal size are interchangeable, divide by the appropriate factorial of the swappable groups.
Practice Problems
- Ross 1.27. A group of 8 women and 6 men is to be divided into a debating team of 4 women and 4 men, and a "control group" team of the rest. How many ways are there to do this?
- Ross 1.30. If 8 distinct identical (oxymoron alert — read: "indistinguishable") blackboards are to be divided among 4 schools, how many ways are there to do this if each school must receive at least one blackboard? this is actually stars-and-bars; preview for Part 7
- Practice — coin tosses. Toss a fair coin 10 times. What is the probability of getting exactly 3 heads, 4 tails, and 3 heads-then-tails transitions (HT)? Express your answer as a multinomial-style count.
- Practice — three-digit anagrams. How many 7-letter sequences can be formed using two A's, two B's, and three C's?
- Practice — group split with a constraint. 12 students must be split into three labelled study groups of 4 each, but Alice and Bob refuse to be in the same group. Count the valid splits.
- Practice — coefficient extraction. Find the coefficient of $x^3 y^2 z$ in $(x + 2y + z)^6$.