[Math] a generating function in combinatorics

combinatoricsgenerating-functionspermutations

I just sat in on a lecture on exponential generating functions in combinatorics (I have no formal education in combinatorics myself). It was quite interesting, but I'm afraid I don't actually understand what the generating function is/does. I've tried doing some minimal research online, but everything I've seen seems to be either too complex or too general to understand well. For example, I know how to find the generating function for permutations of a finite set, $\frac{1}{1-x}$. But what role does $x $ play here, and what does the generating function tell us? I don't see how it's at all related to the species of permutations itself.

Best Answer

Suppose you have the sequence $2, 5, 8, 11,...$

One idea might be to have the terms in the sequence as the coefficients of some polynomial. This polynomial is called a generating function of the sequence.

For example:

$$ g(x)=2x^1+5x^2+8x^3+11x^4+...$$

All seems fine but how do you recover the sequence if you have the generating function? In this example it is obvious but let's try out a couple of ideas to gain a greater insight.

Notice that differentiation of a power reduces its power by one. We are going to use this idea as a way of sliding the terms of the sequence forwards.

Suppose we want the first term we differentiate $g(x)$ once.

$$g'(x)=2+10x+24x^2+44x^3+....$$

Notice now we can evaluate the polynomial at $x=0$ and find the first term! $g'(0)=2$

The second term is more troublesome, can you see why?

Note the second derivative of the function is $g''(x)=10+48x+132x^2+...$ and that $g''(0)=10$ which is not the 2nd term. All is not lost as we can divide $g''(0)$ by $2$ to recover the second term (we multiplied by $2$ in differentiating). This problem will be exaggerated if we want higher terms in the sequence. The 4th term is found by computing $g^{iv}(0)$ and dividing by $4 \times 3 \times 2$ or $4!$

This situation is a pain and so we may choose to adapt the method.

One idea might be to preload the generating function with the dividing factorials first.

Let's define $$G_1(x)=2\frac{x^1}{1!}+5\frac{x^2}{2!}+8\frac{x^3}{3!}+11\frac{x^4}{4!}+...$$

Now we may differentiate the appropriate number of times and substitute $x=0$ with out hassle.

Finally we can observe the connection to the exponential function as $$e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+...$$

Hope this helps to demystify the exponential at least in part.