Compositions and partitions · Definition

Partition generating function

enumerative combinatoricscompositions and partitions

Before you start you need to know

Euler observed that counting partitions amounts to multiplying geometric series, one for each part size. That idea turns a counting problem into a product of series.

Definition

The partition generating function is the formal series \(\sum_{n\ge 0} p(n)\,x^n\), where \(p(n)\) counts the partitions of the integer \(n\).

\[\sum_{n\ge 0} p(n)x^n=\prod_{k\ge 1}\frac{1}{1-x^k}\]

Each part of size \(k\) may appear \(0,1,2,\dots\) times, contributing \(1+x^k+x^{2k}+\cdots=\frac{1}{1-x^k}\). Since the choices for different part sizes are independent, the generating function is the product \(\prod_{k\ge 1}\frac{1}{1-x^k}\). Expanding the product, the coefficient of \(x^n\) counts exactly the partitions of \(n\).

For example, for \(n=4\) the partitions are \(4,\ 3+1,\ 2+2,\ 2+1+1,\ 1+1+1+1\), so \(p(4)=5\). Expanding \(\prod_{k\ge1}\frac{1}{1-x^k}\) up to \(x^4\) gives \(1+x+2x^2+3x^3+5x^4+\cdots\), where the coefficient of \(x^4\) matches this count.

A typical mistake is confusing partitions with compositions. In a composition the order of the summands matters, so \(1+2\) and \(2+1\) are counted separately and the generating function becomes \(\frac{1}{1-x-x^2-\cdots}\). For partitions order does not matter, and the product above is the correct model.

Think about it

Why does the product of geometric series ignore the order of the summands, unlike \(1/(1-x-x^2-\cdots)\)?

The product chooses how many times each size k appears without regard to order, while compositions record the order of the summands.

Exercises 10

References

  • Richard P. Stanley, Enumerative Combinatorics, Volume 1, 2nd edition, Cambridge University Press, 2012.
  • Herbert S. Wilf, generatingfunctionology, 3rd edition, A K Peters, 2006.