Probability

Generating Function

A student organizes a row of tokens to represent a sequence.

Generating Function definition

A generating function represents a sequence by the coefficients of a series in an auxiliary variable.

In Spanish
función generadora
Topic
Counting and combinatorics

Generating Function in a picture

Generating Function diagramThe exponent marks the index and the coefficient records the count in the ordinary form.Sequence 1, 3, 5, …Index from 01 + 3x + 5x² + …Store each termCoefficient of x²: 5Read index 2
The exponent marks the index and the coefficient records the count in the ordinary form.

How it works

The variable is a bookkeeping tool. In the ordinary form, the term aₙxⁿ records aₙ at index n. In the exponential form, the term aₙxⁿ/n! records aₙ. Algebra on these series can solve recurrences and count ways to combine choices. The series can be treated formally, by working with its coefficients.

Worked examples

Encode the sequence 2, 5, 7, 0, 0, … in ordinary form.

2 + 5x + 7x².

What sequence is represented in ordinary form by 1 + x + x² + ⋯?

The all-ones sequence, indexed from zero.

Why distinguish ordinary and exponential forms?

Their coefficients store the same numbers with different normalization.

Common mistake

Check where the sequence begins and which generating-function convention the problem uses.

Quick check

What does the exponent represent?

Show answer

The sequence index.

Where does the first term go if indexing begins at zero?

Show answer

The constant term.

What divides aₙ in an exponential generating function?

Show answer

n!.

Sources

Flashcard

Generating Function

Reveal the definition

A generating function represents a sequence by the coefficients of a series in an auxiliary variable.

Effortless Math. “Generating Function.” Math Dictionary.