Ordinary generating functions
Encode a sequence as a formal power series and translate additive size decompositions into coefficient identities.
On this page
The question for today
What you’ll understand
- Interpret coefficient extraction and Cauchy products combinatorially.
- Solve a recurrence using a formal generating function.
- Separate formal algebra from analytic convergence claims.
A generating function stores one count at each power of a bookkeeping symbol. Its value at a numerical input is initially irrelevant: the coefficient is the information we want. This viewpoint turns choices of component sizes into multiplication and recurrences into algebraic identities. It also clarifies a common source of confusion. Manipulating an infinite formal series is justified by finite coefficient calculations, while substituting a real or complex number requires a separate convergence argument.
Coefficients are the data
For a sequence , its ordinary generating function is the formal expression . The notation extracts one coefficient. Equality of formal series means equality of every coefficient, not equality of sums on an interval. Addition is coefficientwise, and multiplication uses a finite Cauchy sum at each degree. Consequently these operations make sense even when no nonzero numerical input gives a convergent series.
The geometric-series identity is formal because multiplying by one minus the symbol cancels every positive-degree coefficient, leaving one. More generally a series over a field has a multiplicative inverse exactly when its constant coefficient is nonzero. Composition needs more care: substituting a series with zero constant coefficient into another formal series ensures that each resulting coefficient receives only finitely many contributions. Without that condition, an infinite sum may appear even at degree zero and no longer be defined in the purely formal setting.
Products describe recoverable size splits
Suppose an object is an ordered pair of components with additive sizes. Choosing a term from each generating function records the two sizes in the exponent of their product, and multiplying their coefficients counts the possible component choices. Summing terms of a fixed total degree gives the convolution already obtained by a direct structural decomposition. If the pair is unordered, this product generally counts each object multiple times and cannot be used without an additional symmetry argument.
A sequence of nonempty building blocks with generating function has generating function . Nonempty means , which is precisely the condition that makes the infinite formal sum coefficientwise finite. A class with a repeatable zero-size block violates this condition: arbitrarily many such blocks would contribute to the same size. The algebraic restriction therefore has a concrete counting meaning, rather than being an arbitrary technical qualification.
Recurrences become equations, with boundary terms
To convert a recurrence, multiply by the appropriate power and sum only over the indices where it is valid. Shift the sums carefully, retaining missing initial terms. These boundary contributions often form the numerator of the rational generating function. Dropping them produces a function with the right denominator but the wrong sequence. After solving algebraically, extract the first few coefficients to check the original initial conditions before seeking a general coefficient formula.
Analytic information can later be added to a formal identity. For example the geometric series converges numerically only inside the unit disk, even though its formal identity has no such restriction. Outside that disk the rational expression may still have a numerical value, but that value is not the sum of the divergent series. Likewise singularity-based asymptotic estimates require analytic hypotheses and cannot be inferred merely by treating the bookkeeping symbol as a convenient real number. Keep those two levels of argument distinct.
Work it through
Parts of size one or three, in order
Count ordered compositions of six in which every part is either one or three, using an ordinary generating function.
One part has series B(x)=x+x³, so a sequence of parts has C(x)=1/(1−x−x³). The empty sequence contributes the coefficient at degree zero.
The identity C=1+(x+x³)C gives cₙ=cₙ₋₁+cₙ₋₃, with c₀=1 and negative-index counts zero. Thus c₁=1, c₂=1, c₃=2, c₄=3, c₅=4, and c₆=6.
Check directly by the number of threes. Zero threes gives one composition; one three and three ones can be ordered in four ways; two threes give one further composition.
There are six compositions. Treating the parts as unordered would merge the four middle arrangements and give a different problem.
The living notebook
Explore the model
Interactive lab · probability
Recovering coefficients from normalized bars
Pause and Reset, then set p=0.5 and n=6. Predict the coefficient of x² in (1+x)⁶. Multiply the exact mass of two successes by 64 and compare with your coefficient. The normalization turns coefficient counts into probabilities; no random sampling is performed.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forThe coefficient is fifteen and the bar mass is 15/64. This finite polynomial example illustrates coefficient extraction; it does not establish convergence of an infinite generating function.
Pause & reason
Check your understanding
Your turn
Try it yourself
Find the coefficient of x⁵ in 1/((1−x)(1−x²)) and explain exactly what it counts.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Expand both geometric factors and solve the exponent equation with nonnegative integer indices.
Compare with the solution
A term has degree a+2b, where a and b are nonnegative. For degree five, b can be zero, one, or two, giving a=5,3,1. Hence the coefficient is three. It counts unordered collections of ones and twos totaling five, because a and b are their multiplicities; it does not count ordered compositions, which would require a sequence construction.
Keep the idea
Take it with you
- Formal series identities compare coefficients without substituting numbers.
- Multiplication encodes ordered component products with additive sizes.
- Boundary terms and zero-size blocks determine whether a formal construction is valid.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.