 # Applied Combinatorics

## Section8.1Basic Notation and Terminology

With a sequence $$\sigma=\{a_n:n\ge0\}$$ of real numbers, we associate a “function” $$F(x)$$ defined by
\begin{equation*} F(x)=\sum_{n=0}^\infty a_n x^n. \end{equation*}
The word “function” is put in quotes as we do not necessarily care about substituting a value of $$x$$ and obtaining a specific value for $$F(x)\text{.}$$ In other words, we consider $$F(x)$$ as a formal power series and frequently ignore issues of convergence.
It is customary to refer to $$F(x)$$ as the generating function of the sequence $$\sigma\text{.}$$ As we have already remarked, we are not necessarily interested in calculating $$F(x)$$ for specific values of $$x\text{.}$$ However, by convention, we take $$F(0)=a_0\text{.}$$

### Example8.1.

Consider the constant sequence $$\sigma=\{a_n:n\ge0\}$$ with $$a_n=1$$ for every $$n\ge0\text{.}$$ Then the generating function $$F(x)$$ of $$\sigma$$ is given by
\begin{equation*} F(x)=1+x+x^2+x^3+x^4+x^5+x^6+\cdots\text{,} \end{equation*}
which is called the infinite geometric series.
You may remember that this last expression is the Maclaurin series for the function $$F(x)=1/(1-x)$$ and that the series converges when $$|x|\lt 1\text{.}$$ Since we want to think in terms of formal power series, let’s see that we can justify the expression
\begin{equation*} \frac{1}{1-x}=1+x+x^2+x^3+x^4+x^5+x^6+\cdots=\sum_{n=0}^\infty x^n \end{equation*}
without any calculus techniques. Consider the product
\begin{equation*} (1-x)(1+x+x^2+x^3+x^4+x^5+x^6+\cdots) \end{equation*}
and notice that, since we multiply formal power series just like we multiply polynomials (power series are pretty much polynomials that go on forever), we have that this product is
\begin{equation*} (1+x+x^2+x^3+x^4+x^5+x^6+\cdots)-x(1+x+x^2+x^3+x^4+x^5+x^6+\cdots) = 1. \end{equation*}
Now we have that
\begin{equation*} (1-x)(1+x+x^2+x^3+x^4+x^5+x^6+\cdots) = 1, \end{equation*}
or, more usefully, after dividing through by $$1-x\text{,}$$
\begin{equation*} \frac{1}{1-x} = \sum_{n=0}^\infty x^n. \end{equation*}
The method of Example 8.1 can be adapted to address the finite geometric series $$\sum_{j=0}^n x^j\text{.}$$ In that case, we look at
\begin{align*} (1-x) \sum_{j=0}^nx^j \amp= \sum_{j=0}^n x^j - \sum_{j=0}^n x^{j+1}\\ \amp= (1+x+\cdots + x^n) - (x+x^2+\cdots x^n + x^{n+1})\text{.} \end{align*}
Looking carefully, we see that everything cancels in the final expression except $$1-x^{n+1}\text{.}$$ Dividing both sides by $$1-x$$ gives us
\begin{equation} 1+x+\cdots + x^n = \frac{1-x^{n+1}}{1-x}\tag{8.1.1} \end{equation}
as the formula for the sum of a finite geometric series.

### Example8.2.

Just like you learned in calculus for Maclaurin series, formal power series can be differentiated and integrated term by term. The rigorous mathematical framework that underlies such operations is not our focus here, so take us at our word that this can be done for formal power series without concern about issues of convergence.
To see this in action, consider differentiating the power series of the previous example. This gives
\begin{equation*} \frac{1}{(1-x)^2}=1+2x+3x^2+4x^3+5x^4+6x^5+7x^6+\dots=\sum_{n=1}^\infty nx^{n-1}. \end{equation*}
Integration of the series represented by $$1/(1+x) = 1/(1-(-x))$$ yields (after a bit of algebraic manipulation)
\begin{equation*} \log(1+x)=x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\frac{x^5}{5}- \frac{x^6}{6}+\dots=\sum_{n=1}^\infty (-1)^{n+1}\frac{x^n}{n}. \end{equation*}
Before you become convinced that we’re only going to concern ourselves with generating functions that actually converge, let’s see that we can talk about the formal power series
\begin{equation*} F(x)=\sum_{n=0}^{\infty} n! x^n, \end{equation*}
even though it has radius of convergence $$0\text{,}$$ i.e., the series $$F(x)$$ converges only for $$x=0\text{,}$$ so that $$F(0)=1\text{.}$$ Nevertheless, it makes sense to speak of the formal power series $$F(x)$$ as the generating function for the sequence $$\{a_n:n\ge0\}\text{,}$$ $$a_0=1$$ and $$a_n$$ is the number of permutations of $$\{1,2,\dots,n\}$$ when $$n\ge1\text{.}$$
For reference, we state the following elementary result, which emphasizes the form of a product of two power series.