Enumerative Combinatorics

Generating Functions

For a counting sequence \((a_n)_{n\ge0}\), the ordinary generating function and exponential generating function are \[F(x)=\sum_{n\ge0}a_nx^n,\qquad A(x)=\sum_{n\ge0}a_n\frac{x^n}{n!}.\] Thus \(a_n=[x^n]F(x)=n![x^n]A(x)\). These may be treated as formal power series, without convergence assumptions. Ordinary generating functions apply to any sequence; exponential ones are particularly useful for labelled objects.

Catalan Numbers

The number of balanced parenthesis strings with \(n\) pairs is \[C_0=1,\qquad C_{n+1}=\sum_{i=0}^n C_iC_{n-i},\qquad C_n=\frac1{n+1}\binom{2n}{n}.\] Decompose a nonempty string uniquely as \((u)v\) to obtain the recurrence. Its generating function satisfies \[C(x)=1+xC(x)^2=\frac{1-\sqrt{1-4x}}{2x}=1+x+2x^2+5x^3+\cdots,\] where the square root is the formal branch with constant term \(1\).

Inclusion–Exclusion and Symmetry

For finite sets \(A_1,\dots,A_k\), \[\left|\bigcup_{i=1}^k A_i\right| =\sum_{\varnothing\ne S\subseteq\{1,\dots,k\}}(-1)^{|S|+1}\left|\bigcap_{i\in S}A_i\right|.\] If a finite group \(G\) acts on a finite set \(X\), Burnside’s lemma gives \[|X/G|=\frac1{|G|}\sum_{g\in G}|\operatorname{Fix}(g)|.\] For \(G\) permuting \(n\) positions, let \(c_j(g)\) count its cycles of length \(j\). The cycle index is \[Z_G(t_1,\dots,t_n)=\frac1{|G|}\sum_{g\in G}\prod_{j=1}^n t_j^{c_j(g)}.\] Pólya enumeration gives \(Z_G(q,\dots,q)\) orbits of colorings with \(q\) available colors. Example: binary colorings of three positions up to rotation number \((2^3+2\cdot2)/3=4\).