Probability

Ordinary Generating Function

Pupils organize successive piles of counters along a strip.

Ordinary Generating Function definition

The ordinary generating function of a sequence a₀, a₁, a₂, … is the formal series Σ aₙxⁿ.

In Spanish
función generadora ordinaria
Topic
Counting and combinatorics

Ordinary Generating Function in a picture

Ordinary Generating Function diagramThe coefficient of x² comes from all pairs of exponents that sum to two.(1 + x + x²)(1 + x)Multiply two seriesx² × 1 and x × xTwo products make x²Coefficient at index 2: 2Add both contributions
The coefficient of x² comes from all pairs of exponents that sum to two.

How it works

The coefficient of xⁿ is exactly aₙ. Multiplying two ordinary generating functions combines coefficients: the coefficient at index n is the sum of aᵢbⱼ over i + j = n. This is useful when a total size can be split between independent choices.

Worked examples

Find the ordinary generating function for 0, 1, 0, 1, 0, 0, …

x + x³.

Find the coefficient of x² in (1 + 2x)(1 + 3x).

2 × 3 = 6.

Give a closed form for 1 + x + x² + ⋯.

1/(1 − x), as a formal series or for |x| < 1 analytically.

Common mistake

Read aₙ directly as a coefficient in the ordinary form. Multiplying by n! would change the encoded sequence.

Quick check

What is the constant term?

Show answer

a₀.

What is the coefficient at x³ in 4 + 7x³?

Show answer

7.

Which pairs contribute to index 1 in a product?

Show answer

Indices (0, 1) and (1, 0).

Sources

Flashcard

Ordinary Generating Function

Reveal the definition

The ordinary generating function of a sequence a₀, a₁, a₂, … is the formal series Σ aₙxⁿ.

Effortless Math. “Ordinary Generating Function.” Math Dictionary.