PGF of a Binomial Random Variable

Random Variables · Easy · Free problem

For a non-negative integer-valued random variable $X$, the probability generating function (PGF) is defined as

$p_X(z) = E[z^X]$

for $|z| \leq 1$.

  1. Derive the PGF $p_X(z)$ for $X \sim \text{Bin}(n, p)$ in closed form.
  1. Evaluate $p_X(1/2)$ for the specific case $n = 5$, $p = 1/2$.

Hints

  1. The PGF $E[z^X]$ expands via LOTUS into a sum over the PMF. Look at how $z$ combines with the existing terms.
  2. After grouping $z^k$ with $p^k$, the sum has the form $\sum \binom{n}{k} a^k b^{n-k}$. What classical identity evaluates this?
  3. Apply the binomial theorem: $\sum_{k=0}^{n} \binom{n}{k} a^k b^{n-k} = (a + b)^n$ with $a = pz$ and $b = 1 - p$.

Worked Solution

How to Think About It: The PGF is just a fancy way of encoding a discrete distribution into a polynomial. For a Binomial, $X$ counts successes in $n$ trials, so $P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}$. When you plug that into $E[z^X]$, each term picks up a factor of $z^k$ next to $p^k$, which means $p$ and $z$ always appear together as the product $pz$. That is a strong hint that the binomial theorem will collapse the whole sum into a neat closed form. Once you have the general formula, plugging in numbers is arithmetic.

Quick Estimate: Before deriving anything, think about what $p_X(1/2)$ should look like. The PGF at $z = 1$ is always

$ (total probability). At $z = 0$ it equals $P(X = 0) = (1/2)^5 = 1/32 \approx 0.031$. So $p_X(1/2)$ should be somewhere between $0.031$ and
$. Since $z = 1/2$ weights the higher-$k$ terms down exponentially, the answer will be pulled toward the lower end -- maybe around $0.2$ to $0.3$.

Approach: Expand $E[z^X]$ using LOTUS and recognize the resulting sum as a binomial expansion.

Formal Solution:

By LOTUS (Law of the Unconscious Statistician):

$p_X(z) = E[z^X] = \sum_{k=0}^{n} z^k \binom{n}{k} p^k (1-p)^{n-k}$

Group the $z^k$ with $p^k$:

$= \sum_{k=0}^{n} \binom{n}{k} (pz)^k (1-p)^{n-k}$

This is exactly the binomial theorem expansion of $(a + b)^n$ with $a = pz$ and $b = 1 - p$:

$p_X(z) = (pz + 1 - p)^n$

Now plug in $n = 5$, $p = 1/2$, and $z = 1/2$:

$p_X\!\left(\frac{1}{2}\right) = \left(\frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2}\right)^5 = \left(\frac{1}{4} + \frac{1}{2}\right)^5 = \left(\frac{3}{4}\right)^5$

$= \frac{3^5}{4^5} = \frac{243}{1024} \approx 0.2373$

This lands right in our estimated range of $0.2$ to $0.3$.

Answer: The PGF of $X \sim \text{Bin}(n, p)$ is $p_X(z) = (pz + 1 - p)^n$. For $n = 5$, $p = 1/2$, the value at $z = 1/2$ is $p_X(1/2) = (3/4)^5 = 243/1024$.

Intuition

The PGF is one of the most useful "encoding" tools in probability. For any distribution supported on non-negative integers, it packs the entire PMF into a single function -- and for well-known families like the Binomial, it collapses into a clean closed form. The key move here is recognizing that LOTUS turns $E[z^X]$ into a sum that is tailor-made for the binomial theorem. This is not a coincidence: the Binomial distribution was essentially built from the binomial theorem in the first place, so its PGF inherits that structure.

In practice, PGFs show up whenever you need to work with sums of independent discrete random variables (the PGF of a sum is the product of the PGFs) or extract moments quickly (differentiate and evaluate at $z = 1$). Recognizing when a sum is secretly a binomial expansion -- or a geometric series, or an exponential series -- is a pattern that recurs constantly in interview probability problems. The reflex to check whether your LOTUS sum matches a known identity is worth developing.

Open the full interactive solver →