🏠
Guest Not signed in

Generating functions: turn counting into coefficient extraction

Turn a counting problem into 'what is the coefficient of $x^n$ in this polynomial?' β€” a multiplication that does the bookkeeping for you.

Method · Generating Functions
Prereqs: Recursion
Intro

Generating functions turn counting problems into polynomial multiplication. Pack a die’s outcomes into a polynomial $g(x) = x + x^2 + \ldots + x^6$. Then the chance of rolling a total of $T$ with $k$ dice is just the coefficient of $x^T$ in $g(x)^k$. Counting becomes multiplying — and computers (or factoring tricks) do the heavy lifting.

βœ“ Intro Β· expand
Independent · Legal