Probability generating functions
Introduced| English | Meaning |
|---|---|
| discrete distribution/dɪˈskriːt ˌdɪstrɪˈbjuːʃn/ | A list of probabilities — clumsy to manipulate. |
| probability generating function/ˌprɒbəˈbɪlɪti ˈdʒenəreɪtɪŋ ˈfʌŋkʃn/ | For a nonnegative integer-valued random variable X, the function E(s to the power X), whose power-series coefficients give the probabilities of X. |
| coefficient/ˌkəʊɪˈfɪʃənt/ | A numerical or constant factor multiplying a term in an expression. |
| variance/ˈveərɪəns/ | A measure of spread based on the squared deviations of values from their mean. |
| derivative/dɪˈrɪvətɪv/ | The instantaneous rate of change of a function with respect to its input. |
| independent/ˌɪndɪˈpendənt/ | Describing quantities, events or choices that do not depend on one another in the relationship being considered. |
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:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
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)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
G'(1) = 0.3 + 0.4(1) = 0.7.
The mean is found from the PGF by E(X) = G′(______).
Difficulty 1/5 · 100 coins + a small bonus on first completion today
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)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
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.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
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