# Generating Functions

In this post we will discuss generating functions. Generating functions are a powerful tool which can be used to solve many problems both in combinatorics and also in analysis.

Let $R^\infty$ denote the set of all sequences of real numbers. For all $i\ge 1$ we let $x^i$ denote the sequence which has value $1$ for its $(i+1)$th term and all its other terms are zero. The symbol 1 stands for the sequence $(1,0,0,\cdots)$. Also for any real number $\alpha$ we define the product of $\alpha$ and a sequence $\alpha(a_0,a_1,\cdots)$ as $(\alpha a_0,\alpha a_1,\cdots)$. We let two sequences ${a_n}$ and ${b_n}$ be equal if $a_i=b_i$ for all $i$. We define the sum of ${a_n}$ and ${b_n}$ by the sequence ${a_n+b_n}$ and the product by the sequence ${c_n}$ where $c_i=\sum_{j=1}^ia_jb_{i-j}$. Clearly the sequence $(a_0,a_1,\cdots )$ is equal to the sequence $a_0+a_1x+a_2x^2\cdots$ which we will also denote simply by $\sum a_ix^i$. Note that $a_0$ here stands for the sequence obtained as a product of $a_0$ and 1, i.e. $a_0(1,0,0\cdots)$. Algebraically speaking $\mathbb {R}^\infty$, equipped with these operations, is an $\mathbb {R}$-algebra.

More importantly there is an analytic viewpoint of $\mathbb {R}^\infty$ also. Readers who are familiar with the theory of power series can consider the elements of $\mathbb {R}^\infty$ to be power series, i.e. each element is basically a function with its domain an open interval (or simply $\{0\}$). By standard theorems in analysis, if $\sum a_ix^i$ and $\sum b_ix^i$ both converge for $|x|0$ then for all such $x$, $\sum a_ix^i=\sum b_ix^i$ if and only if $a_i=b_i$ for all $i$. Hence the approach of considering $\sum a_ix^i$ as a purely formal object may be considered equivalent to considering it as a power series.

However, we will soon see as to why convergence issues do not play any role in our context as long as the power series converges for at least one non zero $x$ and there is more value in interpreting $\sum a_ix^i$ as simply an element of $\mathbb {R}^\infty$.

Definition:
Let $(a_n)$ be a real sequence such that the power series $\sum a_ix^i$ converges for at least one non zero $x$. Then the function $f$ which sends such an $x$ to the power series $\sum a_ix^i$ is called the generating function of the sequence. We frequently abuse notation and refer to the value of the generating function at some non-zero point $x$ as the generating function (which is akin to referring the function $f$ as $f(x)$).

Example:
Let $(a_n)$ be the constant sequence of one’s. It is well known that for any real number $x$, if $|x|<1$ the series $1+x+x^2+\cdots$ converges to $1/(1-x)$. So the generating function of $(a_n)$ is $f$ where $f(x)=1/(1-x)$ for all $x$ at which the series converges.

The reason for requiring convergence at a non zero point is as follows. As soon as we have convergence at a non zero $x$, by a theorem of analysis it follows that there is convergence in an open interval around $0$. Now, $f$ has a unique power series expansion in that interval and so we are guaranteed that there is a one-one correspondence between the purely discrete object $(1,1,\cdots)$ thought of as an element of $\mathbb{R}^\infty$ and the generating function $f$. This can be exploited in the reverse direction, for if we wish to recover our sequence from the function $f$, then since $f$ is defined by $f(x)=1/(1-x)=1+x+x^2+\cdots x^n$ there is absolutely no ambiguity, and we cannot get back any other sequence. In fact, we may say that our sequence has been encoded within the definition of $f$, as a closed form expression $1/(1-x)$ .

If convergence was only given at $0$, then such a one-one correspondence is not possible, since any closed form analytic function $f$, which is $a_0$ at $0$ would become the generating function to the sequence $(a_0,a_1,a_2,\cdots)$. So for any sequence $(a_0,a_1,\cdots)$ we will consider its generating function to be defined by $a_0+a_1x+a_2x^2\cdots$ as long as there is a non zero $x$ for which there is convergence, and once we have done that will not bother about any convergence issues at all.

The reader may be wondering what was the point of giving an algebraic approach initially, for a generating function really seems to have to do more with a power series. Furthermore in the notation of the first paragraph when we were considering a sequence as an element of $\mathbb{R}^\infty$ we gave found that in our algebra $(a_0,a_1,\cdots)$ is nothing but $a_0+a_1x+a_2x^2+\cdots$. This was not a power series but simply our notation for a sequence. It may appear confusing to have the same notation for two different objects, but it has been deliberately adopted for a very good reason. During our computations, we often manipulate our series so that we may no longer be sure whether convergence of a given series at a non-zero point is guaranteed. This poses a mathematical problem of the validity of our operations. However our ambiguous notation comes to our rescue at that instant, for what we really are doing at that point, without explicitly saying so, is not dealing with the series $a_0+a_1x+a_2x^2+\cdots$. Instead we are manipulating the sequence $a_0+a_1x+a_2x^2+\cdots=(a_0,a_1,a_2,\cdots)$ with which there are absolutely no concepts of convergence attached. Of course if we need closed form expressions or some other analytic properties have to be established we need convergence so that one can use the one-one correspondence between the sequence and the generating function and dive in the world of analysis. In this way, a constant interplay between the discrete world of sequences and the analytic world of sequences brings out the real power of generating functions.

1 Comment

Filed under Algebra, Combinatorics, Real Analysis

### One response to “Generating Functions”

1. Have you written about following result in your wp blog:
Equivalence of Completeness Axioms of Real Numbers

There are many equivalent versions of completeness in the real number system:
i) LUB/supremum property
ii) Monotone Convergence property
iii) Nested Interval property
iv) Bolzano Weierstrass property
v) Cauchy Criterion property

Can you prove it independently without any external aid of books, etc?