GLOBAL KNOWLEDGE ARK

Mathematics · Article

Generating functions and combinatorial structures

Store counts by size in coefficients, multiply by matching total sizes, and derive different series for ordered lists, multisets, integer partitions and short-strip tilings.

Back to Mathematics

After reading, you can

  • Read an ordinary generating function as an indexed coefficient sequence, including the constant and zero coefficients.
  • Prove the finite Cauchy coefficient rule and use positive weights to distinguish ordered and unordered constructions.
  • Derive partition and tiling formulas formally, with exact truncation and initial values rather than unsupported convergence claims.
01

Three strips or two selections: what are you counting?

You can fill a strip of length 3 with tiles of lengths 1 and 2. From left to right the possibilities are (1,1,1), (1,2) and (2,1): three tilings. If instead you choose an unordered collection of those lengths totalling 3, there are only two choices: three ones, or one one and one two. The second and third strips use the same collection but place its tiles in different orders.

A generating function keeps all these totals in one indexed record. Its coefficient at degree 3 will be 3 for ordered tilings and 2 for unordered selections. Before choosing a formula, define what one object is, how its size is measured, and when two objects are considered different.

Useful preparation is collecting terms in polynomial multiplication, reading powers, and following a rule through a numbered sequence. The linked published lessons provide that algebra and pattern background. Formal series, coefficient extraction, pairs, multiplicity vectors, partitions and recurrences are defined here; later counting articles are optional.

On a first reading, follow the coefficient examples, two-factor grid, ordered-versus-unordered comparison and length-three tilings. Return to the formal inverse proof and the infinite partition product after you can explain why only finitely many terms affect one chosen coefficient. You do not need limits or analytic convergence for the counting formulas.

02

A coefficient's position gives the size

For n = 0,1,2,… let aₙ count the objects of size n, with finitely many objects at each size. The ordinary generating function is A(x) = a₀+a₁x+a₂x²+⋯. Ordinary means the coefficient is aₙ itself, without a factorial denominator. We will not use exponential generating functions here.

The symbol [xⁿ]A(x) means the coefficient aₙ. For A(x) = 1+2x², we have [x⁰]A = 1, [x¹]A = 0 and [x²]A = 2. A missing term is zero, rather than permission to shift the later indices. If this expression denotes a finite polynomial, all higher coefficients are also zero.

A missing first-degree term

Target degree n
2
Finite input polynomial
1 + 2x^2
Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-2210012203040506n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
01
10
22
30
40
50
60
Coefficient at the target degree
2

The coefficient of x² is 2, while that of x is 0. The constant coefficient is 1; the displayed finite polynomial has zero coefficients beyond its last term.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

A gap is an exact zero coefficient. Degree zero is included rather than silently shifted to degree one.

The constant coefficient records size zero. A class containing just one empty object has series 1. A class with no objects at any size has the zero series 0. These are different classes: one has a size-zero object, and the other does not.

Integer sizes are nonnegative throughout this lesson. Object counts are nonnegative integers, but formal algebra can also use signed coefficients: (1−x)(1+x) = 1−x². The coefficient −1 is useful algebraically and is not a number of objects. A coefficient list becomes a counting model only after its objects and size rule have been specified.

The same values in different positions describe different sizes
SeriesDegree 0Degree 1Degree 2Degree 3
1+2x²1020
3x+x²0310
11000
00000
03

A formal series is a sequence, without evaluating x

A formal power series over the integers is a sequence of integer coefficients written A(x) = Σₙ₌₀^∞ aₙxⁿ. Here x is a bookkeeping symbol. Equality means agreement of every coefficient. Addition is coefficientwise: [xⁿ](A+B) = aₙ+bₙ. Multiplication will use the finite rule below. An infinite-looking expression is legitimate only when each requested coefficient has a finite, well-defined computation.

This interpretation differs from an analytic power series, where x is a number and the numerical series must converge before it gives a value. The formal identity 1+x+x²+⋯ = 1/(1−x) does not license substituting x = 1 or x = 2 into the left side as a convergent real sum. Analytically the geometric series converges for |x| < 1; formally no such numerical input is being chosen.

Write A(x) ≡ B(x) modulo x^(N+1) when their coefficients agree from degree 0 through N, where N is a nonnegative integer. This is a finite prefix claim, not full equality. In diagrams the horizontal coordinate is degree n, not a numerical input value of x. A seven-column display cannot by itself prove an identity at every degree.

04

Multiply by all pairs of indices with the same total

Let A(x) = Σᵢ₌₀^∞ aᵢxⁱ and B(x) = Σⱼ₌₀^∞ bⱼxʲ. Their Cauchy product has coefficient cₙ = Σᵢ₌₀^n aᵢbₙ₋ᵢ. In the grid, every product aᵢbⱼ belongs to degree i+j because xⁱxʲ = x^(i+j). Exactly the n+1 index pairs (0,n),(1,n−1),…,(n,0) can contribute to degree n.

This defines multiplication even when both series are infinite: the sum for one fixed n contains finitely many products. Neither a coefficient beyond n nor a negative index can affect it. For finite polynomials, use zero for any coefficient beyond the last term.

Two positive factors

Target degree n
1
First factor A
1 + 2x
Second factor B
1 + x
Cauchy multiplication gridRows have first-factor indices i and columns second-factor indices j. Each cell contains aᵢbⱼ. Outlined diamond cells satisfy i+j=n and contribute to the selected coefficient; other cells contribute to other degrees. All selected terms are in the exact table.i / j01011122

Outlined diamond: selected degree or selected diagonal

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-3310312203040506n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
01
13
22
30
40
50
60
Coefficient at the target degree
3
All terms for the selected Cauchy coefficient
First index iSecond index jaᵢbⱼaᵢbⱼ
01111
10212

At degree 1 the two contributions are 1×1 and 2×1, giving 3. Multiplication combines all pairs of indices whose sum is 1.

Signed values can cancel in algebra. Only nonnegative integer coefficients with a specified construction are interpreted as object counts.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

A cancellation

Target degree n
1
First factor A
1 − x
Second factor B
1 + x
Cauchy multiplication gridRows have first-factor indices i and columns second-factor indices j. Each cell contains aᵢbⱼ. Outlined diamond cells satisfy i+j=n and contribute to the selected coefficient; other cells contribute to other degrees. All selected terms are in the exact table.i / j010111-1-1

Outlined diamond: selected degree or selected diagonal

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-111001-1203040506n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
01
10
2-1
30
40
50
60
Coefficient at the target degree
0
All terms for the selected Cauchy coefficient
First index iSecond index jaᵢbⱼaᵢbⱼ
01111
10-11-1

At degree 1, 1 and −1 cancel. The product is 1−x². These signed coefficients illustrate algebra, not numbers of objects.

Signed values can cancel in algebra. Only nonnegative integer coefficients with a specified construction are interpreted as object counts.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

Following i+j=n gives all and only the terms for one coefficient. The number of contributing positions is finite, even for two infinite formal series.

For (1+2x)(1+x), the degree-one terms are 1×1 and 2×1, so c₁ = 3. At degrees zero and two the coefficients are 1 and 2. The product is 1+3x+2x². For (1−x)(1+x), the two degree-one contributions cancel, giving 1−x²; forgetting the second grid cell would give the wrong coefficient.

For counting, choose an ordered pair (a,b) consisting of one object from class A and one from class B, and give the pair size size(a)+size(b). For total n, first separate disjoint cases by size(a)=i. There are aᵢbₙ₋ᵢ pairs in that case. Every pair has one first size, so adding these cases counts each pair exactly once. This proves the product formula when sizes add; a different size rule requires its own argument.

05

A finite truncation can answer an exact finite question

To find coefficients through degree N, keep the coefficients 0 through N of each factor. In a Cauchy term i+j = n ≤ N, both i and j are at most N. Therefore deleting all higher-degree terms leaves every required coefficient unchanged. The same argument works for a finite number of factors by induction on the number of multiplications.

A shift by xᵏ, for integer k ≥ 0, moves each coefficient k places right: [xⁿ](xᵏA) is aₙ₋ₖ when n ≥ k and is 0 otherwise. For x²(1+2x+x²), the degree-three coefficient is 2. Keep the zero coefficients at degrees zero and one rather than reindexing the output.

A two-place shift

Target degree n
3
First factor A
x^2
Second factor B
1 + 2x + x^2
Cauchy multiplication gridRows have first-factor indices i and columns second-factor indices j. Each cell contains aᵢbⱼ. Outlined diamond cells satisfy i+j=n and contribute to the selected coefficient; other cells contribute to other degrees. All selected terms are in the exact table.i / j012300000100002121030000

Outlined diamond: selected degree or selected diagonal

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-2200011223140506n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
00
10
21
32
41
50
60
Coefficient at the target degree
2
All terms for the selected Cauchy coefficient
First index iSecond index jaᵢbⱼaᵢbⱼ
03000
12010
21122
30010

Only the coefficient at degree 2 of the first factor is nonzero. At target degree 3, it multiplies the second factor's degree-1 coefficient, giving 2.

Signed values can cancel in algebra. Only nonnegative integer coefficients with a specified construction are interpreted as object counts.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

Keep every coefficient through the required degree in every factor. Discarding higher nonnegative degrees cannot affect a lower-degree Cauchy coefficient.

These guarantees require nonnegative exponents. If negative powers were allowed, a discarded high positive degree could combine with a negative degree to reach a low target. Such Laurent-series questions are outside this lesson. Likewise, a truncated coefficient table must not be presented as the full polynomial unless all later coefficients are actually zero.

06

Ordered lists use repeated products

Suppose the available item types have positive integer weights. There are finitely many types of each weight; let aⱼ be their number at weight j. Then A(x) = Σⱼ₌₁^∞ aⱼxʲ has a₀ = 0. A list remembers the first, second and subsequent item types. Its weight is their sum. Distinct types remain distinct even if they have the same weight.

Lists of exactly k items have series A(x)^k by the ordered-pair product rule, used repeatedly. The empty list has weight zero and contributes A(x)^0 = 1. All finite lists therefore have series L(x) = 1+A+A²+⋯. At target degree n, a list can have at most n items because every item has weight at least 1. Only k ≤ n can contribute, and there are finitely many types at every weight up to n, so that coefficient is a finite count.

One type of each size

Target degree n
3
Distinct type weights, in type-index order
0: 1; 1: 2

Ordered-list coefficient

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-1313101122335485136n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Multiset coefficient

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-4410112223343546n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Two different object definitions, one weight list
Total weight nOrdered listsMultisets
011
111
222
332
453
583
6134
Coefficient at the target degree
3
Ordered-list coefficient
3
Multiset coefficient
2
Every ordered list at the target weight, using type indices
List numberType-index sequence
1(0, 0, 0)
2(0, 1)
3(1, 0)
Every multiset at the target weight, using type multiplicities
Multiset numberMultiplicity vector
1(1, 1)
2(3, 0)

The target-three ordered lists of weights are (1,1,1), (1,2) and (2,1). The two multisets are three ones or one one plus one two.

A type's index distinguishes it from other types, even when their weights agree. In a multiplicity vector, one position records how many objects of that type are used.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

Two distinct size-one types

Target degree n
3
Distinct type weights, in type-index order
0: 1; 1: 1; 2: 2

Ordered-list coefficient

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-1691691021521232947051696n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Multiset coefficient

Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-16161021426394125166n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Two different object definitions, one weight list
Total weight nOrdered listsMultisets
011
122
254
3126
4299
57012
616916
Coefficient at the target degree
12
Ordered-list coefficient
12
Multiset coefficient
6
Every ordered list at the target weight, using type indices
List numberType-index sequence
1(0, 0, 0)
2(0, 0, 1)
3(0, 1, 0)
4(0, 1, 1)
5(0, 2)
6(1, 0, 0)
7(1, 0, 1)
8(1, 1, 0)
9(1, 1, 1)
10(1, 2)
11(2, 0)
12(2, 1)
Every multiset at the target weight, using type multiplicities
Multiset numberMultiplicity vector
1(0, 1, 1)
2(0, 3, 0)
3(1, 0, 1)
4(1, 2, 0)
5(2, 1, 0)
6(3, 0, 0)

Types 0 and 1 both have weight 1 but remain distinct. There are 12 ordered lists and 6 multiplicity vectors at total weight 3; merging the types changes the question.

A type's index distinguishes it from other types, even when their weights agree. In a multiplicity vector, one position records how many objects of that type are used.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

The same positive weights can describe ordered lists or independent multiplicities. Their formulas and coefficients differ; equal weights do not merge distinct named types.

Check the Cauchy product one coefficient at a time: (1−A)(1+A+A²+⋯) = 1. At every fixed degree the terms cancel within finitely many relevant powers; no numerical limit is being used. Thus L(x) = 1/(1−A(x)), where the fraction means the unique formal multiplicative inverse of 1−A. Its constant coefficient is 1, so integer coefficients can be solved successively: l₀ = 1 and lₙ = Σⱼ₌₁^n aⱼlₙ₋ⱼ for n ≥ 1.

The condition a₀ = 0 matters. If one repeatable type had weight zero, arbitrarily long lists of it would all have weight zero, giving infinitely many size-zero objects. The geometric list construction would not define a finite coefficient at that degree. We are not saying every series with a nonzero constant term is uninvertible; the counting interpretation of this unlimited-list sum specifically needs positive weights.

With one type of weight 1 and one of weight 2, A = x+x². Then L = 1/(1−x−x²), whose degree-three coefficient is 3. With two distinct types of weight 1 and one of weight 2, A = 2x+x². At degree three, eight lists use three weight-one items; four more have one weight-one item and the weight-two item. The total is 12.

07

Multisets choose one multiplicity per type

A multiset selection specifies a nonnegative integer multiplicity kⱼ for each available named type j. It does not record an order. With a finite list of types of positive weights w₁,…,wᵣ, the total weight is Σⱼ₌₁^r wⱼkⱼ. The vector (k₁,…,kᵣ) identifies the object completely. For an empty type list, there is one empty vector of total weight zero.

For one type of weight w ≥ 1, its permitted multiplicities 0,1,2,… give series 1+xʷ+x^(2w)+⋯ = 1/(1−xʷ). Choices for different types combine by adding weights, so the multiset series is M(x) = ∏ⱼ₌₁^r 1/(1−x^(wⱼ)). Every coefficient is finite since each kⱼ ≤ n/wⱼ at total n. Each vector is selected once; reordering the chosen items does not create another vector.

With weights 1 and 2, M = 1/((1−x)(1−x²)). To reach 3, solve k₁+2k₂ = 3: the solutions are (3,0) and (1,1). The coefficient is 2, unlike the ordered-list coefficient 3. This is the distinction behind the two unordered selections in the opening example.

If two named types both have weight 1, retain two separate factors (1−x)⁻¹. Together with one weight-two type, reaching 3 means k₀+k₁+2k₂ = 3. When k₂ = 0 there are four pairs (k₀,k₁); when k₂ = 1 there are two. The coefficient is 6, still different from the 12 ordered lists. If those two types were physically indistinguishable, merging them would change the class and its formula.

A coin-change question normally ignores the order of the coins, so one factor per denomination is appropriate. An ordered list of coin denominations is a different question and uses the list formula. For denominations 2 and 3 and target 5, one of each coin is one multiset but has two ordered lists, (2,3) and (3,2). State the convention instead of inferring it from the word change.

08

Integer partitions have one type for each part size

An integer partition of n ≥ 0 is an unordered collection of positive integers whose sum is n. Equivalently it is a nonincreasing list of positive parts, or a multiplicity vector: mⱼ records how many parts equal j. The empty partition is the one partition of 0. For n > 0, only part sizes j ≤ n can occur.

For a maximum part size k ≥ 1, the generating series is Pₖ(x) = ∏ⱼ₌₁^k 1/(1−xʲ). Its degree-n coefficient counts the nonnegative solutions m₁+2m₂+⋯+kmₖ = n. This is exactly the multiset construction with one type of every permitted part size. Define P₀ = 1 for no permitted parts, so it has coefficient 1 at degree zero and 0 at every positive degree.

Parts at most three

Target degree n
4
Distinct type weights, in type-index order
0: 1; 1: 2; 2: 3
Maximum allowed part size
3
Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-7710112233445576n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
01
11
22
33
44
55
67
Coefficient at the target degree
4
Every multiset at the target weight, using type multiplicities
Multiset numberMultiplicity vector
1(0, 2, 0)
2(1, 0, 1)
3(2, 1, 0)
4(4, 0, 0)

The four partitions of 4 using parts at most 3 are 3+1, 2+2, 2+1+1 and 1+1+1+1. The missing partition 4 uses an excluded part size.

There is one type for each allowed positive part size. A partition ignores order and is determined by its multiplicities. The degree-six prefix uses no larger parts.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

All parts needed through six

Target degree n
6
Distinct type weights, in type-index order
0: 1; 1: 2; 2: 3; 3: 4; 4: 5; 5: 6
Maximum allowed part size
6
Exact coefficient prefix by degreeDegrees zero through six lie on the horizontal axis. Signed bars show exact coefficients with one scale in this panel. Zero bars remain labelled; the selected degree has an outlined diamond. The table gives every value.-1111101122335475116n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

Complete coefficient prefix through degree 6
Degree nCoefficient
01
11
22
33
45
57
611
Coefficient at the target degree
11

The complete target coefficient is shown in the table. This panel does not enumerate the eleven degree-six partitions; the article gives the finite-product proof.

Parts 1 through 6 give every partition of totals at most 6. The coefficient at degree 6 is 11. Parts larger than 6 cannot change this prefix.

There is one type for each allowed positive part size. A partition ignores order and is determined by its multiplicities. The degree-six prefix uses no larger parts.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

For a target at most 6, each factor for a part larger than 6 contributes only its constant term. The finite prefix is exact without asserting analytic convergence.

For k = 3 and n = 4, the four partitions are 3+1, 2+2, 2+1+1 and 1+1+1+1. The partition 4 is excluded because its part is larger than 3. Thus [x⁴]P₃ = 4, whereas the unrestricted partition count p(4) is 5.

The unrestricted formal series is P(x) = ∏ⱼ₌₁^∞ 1/(1−xʲ). This infinite product is defined coefficient by coefficient: through degree N, every factor with j > N contributes only its constant term 1. Consequently P and the finite product P_N agree through degree N. All coefficients are finite, and no analytic convergence claim is needed. A zero-sized part would destroy this reasoning; partitions here have strictly positive parts.

09

Removing the first tile gives a recurrence

Let tₙ count the ways to tile a strip of integer length n ≥ 0 with tiles of lengths 1 and 2, preserving left-to-right order. There is one empty tiling, so t₀ = 1. A strip of length 1 has only a length-one tile, so t₁ = 1. For n ≥ 2, separate tilings by their first tile. Removing a first tile of length 1 leaves a tiling of n−1, while removing one of length 2 leaves a tiling of n−2.

The two cases are disjoint and reversible: prepend the removed tile to reconstruct exactly one original tiling. Therefore tₙ = tₙ₋₁+tₙ₋₂ for n ≥ 2. The coefficients begin 1,1,2,3,5,8,13. The empty tiling is necessary both for a lone length-two tile at n = 2 and for the constant term in the series.

A strip of length five

Target degree n
5
Every tiling of the selected finite stripEach row is one complete tiling from left to right. A length-one tile has a filled blue panel; a length-two tile has an outlined orange panel with a central dash. Widths use the same unit. Numbered rows and a complete length-list table identify all tilings.n=511111121112311214121151226211172128221

Filled panel: one-unit tile; outlined panel: two-unit tile

Complete coefficient prefix through degree 6
Degree nCoefficient
01
11
22
33
45
58
613
Number of complete tilings
8
Every complete tiling of the selected strip
Tiling numberTile lengths from left to right
1(1, 1, 1, 1, 1)
2(1, 1, 1, 2)
3(1, 1, 2, 1)
4(1, 2, 1, 1)
5(1, 2, 2)
6(2, 1, 1, 1)
7(2, 1, 2)
8(2, 2, 1)

There are eight complete tilings of length 5. Splitting by the first tile gives five beginning with 1 and three beginning with 2.

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

The empty strip has one tiling. Removing the first tile from a nonempty strip gives the length-one or length-two case exactly once.

Let T(x) = Σₙ₌₀^∞ tₙxⁿ. Then T−1−x = x(T−1)+x²T, because each shifted sum starts at the correct initial index. Rearranging gives (1−x−x²)T = 1, hence T = 1/(1−x−x²). This agrees with the ordered-list construction for item series x+x².

With the convention F₀ = 0, F₁ = 1 and Fₙ = Fₙ₋₁+Fₙ₋₂ for n ≥ 2, these tiling counts are tₙ = Fₙ₊₁. The Fibonacci series Σₙ₌₀^∞ Fₙxⁿ instead has numerator x: x/(1−x−x²). Keeping the initials prevents an off-by-one error. The picture enumerates all eight length-five tilings, but the first-tile argument proves the recurrence for every n ≥ 2.

Two related sequences with different constant terms
Index n0123456
tₙ11235813
Fₙ0112358
10

Check the objects before the algebra

Use a sum for disjoint alternatives, a product for an ordered tuple whose sizes add, a geometric list formula for arbitrarily long ordered lists of positive-weight items, and one multiplicity factor per type for unordered selections. A partition product is a special multiset model with one type per positive integer size. These descriptions explain the formulas, rather than making the symbols interchangeable.

For a desired coefficient, first write the object and size definitions. Check the empty object, positivity of repeatable weights and finiteness at each degree. Then choose the construction, keep enough terms, and compare a small hand-counted case with the computed coefficient. A numerical match is a useful error check; the reversible counting argument is what establishes the formula in general.

The explorer uses exact small integer data through degree 6, with every selected convolution term and every short list or multiplicity vector shown where stated. Its finite input and enumeration caps keep the interaction readable. They are not bounds on the mathematics of formal series, and the displayed prefix does not establish the whole infinite identity.

Generating function explorer

Predict a coefficient or compare what counts as one object. Each displayed table is exact through degree 6; an infinite formula needs the separate proof in the article.

Choose a construction
Choose an exact case
Target degree n
2
Finite input polynomial
1 + 2x^2

Predict before revealing the exact result.

The selected coefficient and the exact object lists are hidden. The finite input data and diagram indices remain available.

Exact coefficient prefix by degreeDegrees zero through six identify coefficient positions. A question mark replaces each coefficient before reveal. The diagram does not assert a numerical value.?0?1?2?3?4?5?6n

Horizontal indices are degrees, not input values of x

Outlined diamond: selected degree or selected diagonal

The display ends at degree 6. These coefficients are exact; the window alone does not establish an identity at every degree.

Worked examples

Read a gap without shifting degrees

For A(x) = 2x+x³, find [x⁰]A, [x²]A and [x³]A.

  1. Write the coefficients in index order as (0,2,0,1). The absent constant and degree-two terms have coefficient zero.
  2. Match each requested exponent with its position; the first nonzero term is still degree one.
  3. Because A is a finite polynomial, all coefficients beyond degree three are zero as well.

The requested coefficients are 0, 0 and 1. The value 2 belongs to degree one, not to degree zero.

Collect every term on one diagonal

Find [x²](1+x+x²)(1+2x).

  1. The index pairs are (0,2),(1,1),(2,0), and the missing second-factor degree-two coefficient is zero.
  2. Their products are 1×0 = 0, 1×2 = 2 and 1×1 = 1.
  3. Add the three contributions to obtain 3. The full product is 1+3x+3x²+2x³, which gives the same degree-two result.

The coefficient is 3. A zero contribution still belongs to the complete index inventory.

Do not merge different types of the same size

Types a and b have weight 1, and c has weight 2. Compare ordered lists and multisets of total weight 3.

  1. Three weight-one items give 2³ = 8 ordered lists. One weight-one item with c gives two choices of that item and two orders, adding 4.
  2. For multisets solve k_a+k_b+2k_c = 3. If k_c = 0 there are four vectors, and if k_c = 1 there are two.
  3. The list series is 1/(1−2x−x²); the multiset series is 1/((1−x)²(1−x²)). These formulas encode the same types with different object definitions.

There are 12 ordered lists and 6 multisets. Neither answer would remain valid if a and b were merged into one type.

Use only the factors that can reach the target

Derive the unrestricted partition count p(4), and compare maximum part size 3.

  1. For target 4, factors with part size larger than 4 cannot contribute a positive-degree term. Use ∏ⱼ₌₁^4(1−xʲ)⁻¹.
  2. The complete partitions are 4, 3+1, 2+2, 2+1+1 and 1+1+1+1, so p(4) = 5.
  3. Restricting to parts at most 3 removes only the partition 4. The four remaining partitions give [x⁴]P₃ = 4.

The unrestricted coefficient is 5; the restricted coefficient is 4. The finite-degree reduction is exact.

Use an initial value instead of an empty-case guess

Find the length-five tiling count and identify how many start with each tile length.

  1. Start from t₀ = 1 and t₁ = 1. The recurrence gives t₂ = 2, t₃ = 3, t₄ = 5 and t₅ = 8.
  2. The first-tile classes have t₄ = 5 tilings starting with length 1 and t₃ = 3 starting with length 2.
  3. Prepending the chosen tile reconstructs each tiling once, so these two counts add without overlap.

There are 8 tilings: 5 start with a length-one tile and 3 with a length-two tile. The counts include the empty remainder when it is needed.

Try it yourself

  1. A class has one empty object and no positive-size objects. Is its series 0 or 1? How does a class containing no objects differ?

    Show the answer and reasoning

    Its series is 1. The class containing no objects has series 0.

    The constant coefficient counts size-zero objects. One empty object contributes one, whereas an empty class contributes zero. Absence of positive-size objects does not settle the constant coefficient.

  2. Find [x²](1−2x+x²)(1+x). Can every coefficient of these factors be interpreted as an object count?

    Show the answer and reasoning

    The degree-two coefficient is −1. No: negative coefficients are algebraic values rather than numbers of objects.

    The products on the degree-two diagonal are 1×0, (−2)×1 and 1×1. Their sum is −1. Formal multiplication works for integer coefficients even when a direct counting interpretation does not.

  3. For x³(2+x+4x²+⋯), find the coefficients at degrees 2 and 4. Could any term hidden after degree two of the inner series alter them?

    Show the answer and reasoning

    They are 0 and 1. Later inner terms cannot alter either coefficient.

    The shift makes all degrees below three zero and takes the degree-four coefficient from inner degree one. With nonnegative exponents, a higher inner degree shifts to an even higher total; it cannot return to these targets.

  4. Using one type of weight 2 and one of weight 3, compare the coefficients at degree 5 for ordered lists and unordered selections. State both series.

    Show the answer and reasoning

    Ordered lists give 2, with series 1/(1−x²−x³). Multisets give 1, with series 1/((1−x²)(1−x³)).

    The ordered lists are (2,3) and (3,2). The only multiplicity vector is (1,1). Both constructions allow the empty object at weight zero, and their positive weights make every target coefficient finite.

  5. Why can one freely repeatable type of weight zero not be inserted into the unlimited-list counting formula as though it were an ordinary positive-weight type?

    Show the answer and reasoning

    There would be infinitely many ordered lists of total weight zero, one for every length, so the constant coefficient would not be a finite object count.

    The positive-weight proof bounded the number of items by the target weight. A zero-weight item removes that bound. This objection concerns the list construction; it is not a claim that every series with a nonzero constant term lacks a formal inverse.

  6. With no available item types, how many ordered lists and multiplicity vectors have weight zero? How many have weight 4?

    Show the answer and reasoning

    Each construction has one empty object of weight zero and no object of weight 4. Both series are 1.

    The empty sequence and empty vector are well-defined single objects. A positive total cannot be built without items. This is distinct from the zero series, whose class has no objects even at size zero.

  7. List the partitions of 5 whose parts are at most 2, and state their generating series.

    Show the answer and reasoning

    They are 2+2+1, 2+1+1+1 and 1+1+1+1+1. Their series is 1/((1−x)(1−x²)), so the degree-five coefficient is 3.

    Solving m₁+2m₂ = 5 gives m₂ = 0,1,2 and determines m₁ as 5,3,1 respectively. Different orders of the same parts are not new partitions.

  8. Why do part factors 1/(1−xʲ) with j > 6 have no effect on p(6)? Does the prefix prove analytic convergence at x = 1?

    Show the answer and reasoning

    Their first nonconstant terms have degree greater than 6, so they act as 1 through that degree. No analytic convergence at x = 1 follows.

    Products use only nonnegative degrees. A contribution using one of those nonconstant terms already exceeds the target, even if the other chosen terms are constant. This defines a formal finite coefficient; it does not evaluate the infinite series numerically.

  9. What are t₀, t₁ and t₄ for lengths-one-and-two tilings? With F₀ = 0 and F₁ = 1, is t₄ = F₄ or F₅?

    Show the answer and reasoning

    t₀ = 1, t₁ = 1 and t₄ = 5. The correct relation is t₄ = F₅, with tₙ = Fₙ₊₁.

    The empty strip is one tiling. The recurrence gives 1,1,2,3,5 for tilings, whereas Fibonacci begins 0,1,1,2,3,5. Their formal series have the same denominator but numerators 1 and x respectively.

  10. Explain why (1−x)(1+x+x²+⋯) = 1 is valid formally, but substituting x = 2 does not give a convergent real sum on the left.

    Show the answer and reasoning

    At each positive degree the two formal contributions cancel, and the constant coefficient is 1. At x = 2 the numerical terms 1,2,4,… do not even tend to zero.

    Formal multiplication checks each coefficient separately and needs only a finite calculation for that coefficient. Numerical convergence is a different requirement; the analytic geometric formula is valid for |x| < 1, not for this input.

What to carry forward

  • Ordinary coefficients record sizes from degree zero. A missing term is zero; the series 1 for an empty object differs from the zero series.
  • Formal series are coefficient sequences. Equality at every degree is stronger than a displayed prefix, and formal identities do not automatically permit numerical substitution.
  • The Cauchy coefficient at n sums all aᵢbₙ₋ᵢ for i = 0,…,n. Nonnegative exponents make truncation through the target exact.
  • Positive-weight ordered lists give 1/(1−A), with A₀ = 0. Multisets instead use one reciprocal factor per named type.
  • Positive-part partitions have a coefficientwise finite infinite product. Length-one-and-two tilings have initial values 1,1 and series 1/(1−x−x²).

References

Sources for the concepts and teaching approaches in this article.

  1. Enumerative Combinatorics, Volume 1 · Second edition, author-hosted PDF version of 15 July 2011Richard P. StanleyTextbook chapter · PDF1.1 How to count: ordinary coefficients and formal operations1.1 Coefficientwise finite sums and products1.8 Partition identitiesmath.mit.edu
  2. Generating Functions, 18.200 Lecture Notes · 26 February 2024; Spring 2024 coursePeter ShorCourse notes · PDF2 Product of classes and ordered sequences3 Number of ways of giving change4 Dots and dashes: recurrence and initial valuesocw.mit.edu