---
tag: 0REMT01N36
kind: statement
role: proposition
name: Generating function of a sum of independent random variables
aliases: [pgf-of-sum-of-independent-random-variables]
msc: ["60E05"]
uses: [0Z8PSSAVBA, 05AW1G0WE1, 0XCE070V8B]
sources:
  - url: https://en.wikipedia.org/wiki/Probability_generating_function
    locator: Functions of independent random variables
---

## Statement

Let $X_1, \dots, X_n$ be [[independent|0XCE070V8B]] random variables with values in $\{0, 1, 2, \dots\}$, and let $S = X_1 + \dots + X_n$.
Then for each complex $z$ with $|z| \le 1$, the [[probability-generating functions|0Z8PSSAVBA]] satisfy
$$G_S(z) = G_{X_1}(z) \, G_{X_2}(z) \cdots G_{X_n}(z).$$

## Remarks

Proof: $z^S = z^{X_1} \cdots z^{X_n}$. The factors are independent, so the [[product rule for expectations|05AW1G0WE1]] applies.
Example: a sum of $n$ independent Bernoulli($p$) variables has the generating function $(1 - p + pz)^n$. This is the generating function of $\operatorname{Bin}(n, p)$.
For a random number $N$ of i.i.d. terms $X_i$ with $N$ independent of the $X_i$, the sum $S_N = X_1 + \dots + X_N$ has $G_{S_N}(z) = G_N(G_{X_1}(z))$.

## Explanations

### L1 human

Adding independent counts corresponds to multiplying their generating functions.
This turns the hard computation of the law of a sum into a product of power series.
