ConceptComplete

Ordinary and Exponential Generating Functions

Generating functions transform combinatorial problems into algebraic ones by encoding sequences as formal power series. The choice between ordinary and exponential generating functions depends on the combinatorial structure being counted.

DefinitionOrdinary Generating Function (OGF)

For a sequence {an}n=0\{a_n\}_{n=0}^\infty, the ordinary generating function is: A(x)=n=0anxnA(x) = \sum_{n=0}^\infty a_n x^n

OGFs are natural for counting unordered structures, such as:

  • Partitions of integers
  • Compositions (ordered partitions)
  • Paths in graphs
  • Solutions to linear recurrences
DefinitionExponential Generating Function (EGF)

For a sequence {an}n=0\{a_n\}_{n=0}^\infty, the exponential generating function is: A(x)=n=0anxnn!A(x) = \sum_{n=0}^\infty a_n \frac{x^n}{n!}

EGFs are natural for counting labeled structures where order matters, such as:

  • Permutations with restricted patterns
  • Labeled graphs and trees
  • Set partitions
  • Arrangements with symmetries

The key difference is that OGF multiplication gives convolution cn=k=0nakbnkc_n = \sum_{k=0}^n a_k b_{n-k}, while EGF multiplication gives cn=k=0n(nk)akbnkc_n = \sum_{k=0}^n \binom{n}{k} a_k b_{n-k}, which counts ways to partition an nn-set and apply operations to each part.

ExampleBasic OGF Examples
  1. Geometric series: 11x=n=0xn\frac{1}{1-x} = \sum_{n=0}^\infty x^n (counts an=1a_n = 1 for all nn)

  2. Binomial series: (1+x)k=n=0k(kn)xn(1+x)^k = \sum_{n=0}^k \binom{k}{n} x^n (finite) or (1+x)α=n=0(αn)xn(1+x)^\alpha = \sum_{n=0}^\infty \binom{\alpha}{n} x^n (for x<1|x| < 1)

  3. Fibonacci numbers: If FnF_n satisfies Fn=Fn1+Fn2F_n = F_{n-1} + F_{n-2} with F0=0,F1=1F_0 = 0, F_1 = 1, then: F(x)=n=0Fnxn=x1xx2F(x) = \sum_{n=0}^\infty F_n x^n = \frac{x}{1-x-x^2}

  4. Catalan numbers: C(x)=114x2xC(x) = \frac{1-\sqrt{1-4x}}{2x} satisfies C(x)=1+xC(x)2C(x) = 1 + xC(x)^2

ExampleBasic EGF Examples
  1. Exponential function: ex=n=0xnn!e^x = \sum_{n=0}^\infty \frac{x^n}{n!} (counts all permutations, an=n!a_n = n!)

  2. Permutations: The EGF for an=n!a_n = n! is 11x=n=0n!xnn!\frac{1}{1-x} = \sum_{n=0}^\infty \frac{n! x^n}{n!}

  3. Derangements: D(x)=ex1x=exn=0xnD(x) = \frac{e^{-x}}{1-x} = e^{-x} \cdot \sum_{n=0}^\infty x^n gives: Dn=n!k=0n(1)kk!D_n = n! \sum_{k=0}^n \frac{(-1)^k}{k!}

  4. Bell numbers: The EGF is B(x)=eex1B(x) = e^{e^x - 1}, encoding all set partitions

Remark

The product principle differs between OGF and EGF:

  • OGF: If A(x)=anxnA(x) = \sum a_n x^n and B(x)=bnxnB(x) = \sum b_n x^n, then A(x)B(x)=cnxnA(x)B(x) = \sum c_n x^n where cn=k=0nakbnkc_n = \sum_{k=0}^n a_k b_{n-k}.
  • EGF: If A(x)=anxnn!A(x) = \sum a_n \frac{x^n}{n!} and B(x)=bnxnn!B(x) = \sum b_n \frac{x^n}{n!}, then A(x)B(x)=cnxnn!A(x)B(x) = \sum c_n \frac{x^n}{n!} where cn=k=0n(nk)akbnkc_n = \sum_{k=0}^n \binom{n}{k} a_k b_{n-k}.

The binomial coefficient in EGF multiplication counts ways to select which elements get the first operation vs. the second.

DefinitionCommon Operations

Key operations on generating functions:

  1. Addition: (A+B)(x)=A(x)+B(x)(A+B)(x) = A(x) + B(x) corresponds to disjoint union
  2. Multiplication: (AB)(x)=A(x)B(x)(AB)(x) = A(x)B(x) corresponds to Cartesian product (with appropriate interpretation)
  3. Differentiation: A(x)=n=1nanxn1A'(x) = \sum_{n=1}^\infty n a_n x^{n-1} shifts indices
  4. Integration: A(x)dx=n=0ann+1xn+1\int A(x)dx = \sum_{n=0}^\infty \frac{a_n}{n+1} x^{n+1}
  5. Substitution: A(B(x))A(B(x)) for composition of structures (requires B(0)=0B(0) = 0 for OGF)
ExampleSolving Recurrences with Generating Functions

Find a closed form for an=3an12an2a_n = 3a_{n-1} - 2a_{n-2} with a0=1,a1=1a_0 = 1, a_1 = 1.

Let A(x)=n=0anxnA(x) = \sum_{n=0}^\infty a_n x^n. Multiply the recurrence by xnx^n and sum: n=2anxn=3n=2an1xn2n=2an2xn\sum_{n=2}^\infty a_n x^n = 3\sum_{n=2}^\infty a_{n-1} x^n - 2\sum_{n=2}^\infty a_{n-2} x^n

This gives: A(x)a0a1x=3x(A(x)a0)2x2A(x)A(x) - a_0 - a_1 x = 3x(A(x) - a_0) - 2x^2 A(x) A(x)1x=3xA(x)3x2x2A(x)A(x) - 1 - x = 3x A(x) - 3x - 2x^2 A(x) A(x)(13x+2x2)=12xA(x)(1 - 3x + 2x^2) = 1 - 2x

Thus: A(x)=12x(1x)(12x)=11xx12x=n=0xnn=02nxn+1A(x) = \frac{1-2x}{(1-x)(1-2x)} = \frac{1}{1-x} - \frac{x}{1-2x} = \sum_{n=0}^\infty x^n - \sum_{n=0}^\infty 2^n x^{n+1}

Comparing coefficients: an=1a_n = 1 for n=0n = 0 and an=12na_n = 1 - 2^n for n1n \geq 1.

Generating functions provide a unified framework connecting combinatorics, algebra, analysis, and number theory through the language of formal power series.