Probability generating functions
| English | Chinese | Pinyin |
|---|---|---|
| discrete distribution | 离散分布 | lí sàn fēn bù |
| probability generating function | 概率母函数 | gài lǜ mǔ hán shù |
| coefficient | 系数 | xì shù |
| variance | 方差 | fāng chà |
| derivative | 导数 | dǎo shù |
| independent | 独立 | dú lì |
A distribution in a single function
- A discrete distribution 离散分布 is a list of probabilities — clumsy to manipulate.
- A probability generating function 概率母函数 (PGF) packs the whole list into one tidy function, turning hard probability sums into easy calculus.
Probability generating function lab
G(x) = p0 + p1 x + p2 x^2 + ...
Change x and see how a PGF stores probabilities in powers of x.
Defining the PGF
- For a discrete variable $X$ taking values $0, 1, 2, \dots$:
- The coefficient 系数 of $t^x$ is exactly $P(X = x)$ — the function encodes the distribution.

A probability generating function stores all the probabilities as coefficients
The probability generating function of X is defined as:
G(t) = E(tˣ) = Σ P(X=x) tˣ.
Mean and variance 方差 from derivatives 导数
- Differentiate and evaluate at $t = 1$:
Worked example. $G(t) = 0.5 + 0.3t + 0.2t^2$. Then $G'(t) = 0.3 + 0.4t$, so $E(X) = G'(1) = 0.3 + 0.4 = 0.7$.
X has G(t) = 0.5 + 0.3t + 0.2t². Since E(X) = G′(1) and G′(t) = 0.3 + 0.4t, what is E(X)?
G'(1) = 0.3 + 0.4(1) = 0.7.
The mean is found from the PGF by E(X) = G′(______).
E(X) = G'(1).
Sums of independent 独立 variables
- The single most useful property: the PGF of a sum of independent variables is the product of their PGFs:
- This makes adding independent variables (e.g. total of several dice) almost effortless.
For any valid PGF, what is the value of G(1)?
G(1) = Σ P(X=x) = 1, since probabilities sum to 1.
The PGF of a sum of two independent variables is the product of their PGFs.
G_{X+Y}(t) = G_X(t) G_Y(t) for independent X and Y.
Check it's a valid PGF
$G(1)$ must equal 1. Since $G(1) = \sum P(X = x)$, a valid PGF always gives $G(1) = 1$ — a quick sanity check before you differentiate.
You've got it
- PGF: $G(t) = E(t^X) = \sum P(X=x)\,t^x$ (and $G(1) = 1$)
- $E(X) = G'(1)$; $\text{Var}(X) = G''(1) + G'(1) - (G'(1))^2$
- the PGF of a sum of independent variables is the product of their PGFs