Multinomial Distribution
Multinomial Distribution
๐งฎ Multinomial Distribution
The Multinomial distribution generalizes the Binomial: it models the counts of outcomes in multiple categories from a fixed number of independent trials.
๐ Definition
Let $X = (X_1, \dots, X_k) \sim \text{Multinomial}(n, \mathbf{p})$, where:
- $n$ is the number of trials,
- $\mathbf{p} = (p_1, \dots, p_k)$ is a probability vector such that $\sum p_i = 1$.
Then:
\[P(X_1 = x_1, \dots, X_k = x_k) = \frac{n!}{x_1! \cdots x_k!} p_1^{x_1} \cdots p_k^{x_k}\]subject to $\sum x_i = n$.
๐ Key Properties
Property | Value |
---|---|
Parameters | $n \in \mathbb{N}$, $\mathbf{p} \in \Delta_k$ |
Support | $x_i \in {0, \dots, n}$, $\sum x_i = n$ |
Mean | $\mathbb{E}[X_i] = np_i$ |
Variance | $\text{Var}(X_i) = np_i(1 - p_i)$ |
Covariance | $\text{Cov}(X_i, X_j) = -np_ip_j$, $i \neq j$ |
๐ Real-World Examples
Dice Rolls
Number of times each face appears in 60 rolls of a fair 6-sided die.Survey Responses
Count of responses in a multiple-choice survey with 4 options.
Notes
- Reduces to Binomial when $k = 2$.
- Often used in NLP, classification, and contingency tables.
- Describes outcomes of n categorical trials.
๐ Python Example
1
2
3
4
5
6
7
8
9
from numpy.random import multinomial
# n = number of trials, p = probability vector
n = 10
p = [0.2, 0.3, 0.5]
# Sample a single multinomial outcome
sample = multinomial(n, p)
print("Sample:", sample)
This post is licensed under CC BY 4.0 by the author.