Generating function

From testwiki
Jump to navigation Jump to search

Template:Short description Template:About


In mathematics, a generating function is a representation of an infinite sequence of numbers as the coefficients of a formal power series. Generating functions are often expressed in closed form (rather than as a series), by some expression involving operations on the formal series.

There are various types of generating functions, including ordinary generating functions, exponential generating functions, Lambert series, Bell series, and Dirichlet series. Every sequence in principle has a generating function of each type (except that Lambert and Dirichlet series require indices to start at 1 rather than 0), but the ease with which they can be handled may differ considerably. The particular generating function, if any, that is most useful in a given context will depend upon the nature of the sequence and the details of the problem being addressed.

Generating functions are sometimes called generating series,[1] in that a series of terms can be said to be the generator of its sequence of term coefficients.

History

Generating functions were first introduced by Abraham de Moivre in 1730, in order to solve the general linear recurrence problem.[2]

George Pólya writes in Mathematics and plausible reasoning:

The name "generating function" is due to Laplace. Yet, without giving it a name, Euler used the device of generating functions long before Laplace [..]. He applied this mathematical tool to several problems in Combinatory Analysis and the Theory of Numbers.

Definition

Template:Block quote

Template:Block quote

Convergence

Unlike an ordinary series, the formal power series is not required to converge: in fact, the generating function is not actually regarded as a function, and the "variable" remains an indeterminate. One can generalize to formal power series in more than one indeterminate, to encode information about infinite multi-dimensional arrays of numbers. Thus generating functions are not functions in the formal sense of a mapping from a domain to a codomain.

These expressions in terms of the indeterminate Template:Mvar may involve arithmetic operations, differentiation with respect to Template:Mvar and composition with (i.e., substitution into) other generating functions; since these operations are also defined for functions, the result looks like a function of Template:Mvar. Indeed, the closed form expression can often be interpreted as a function that can be evaluated at (sufficiently small) concrete values of Template:Mvar, and which has the formal series as its series expansion; this explains the designation "generating functions". However such interpretation is not required to be possible, because formal series are not required to give a convergent series when a nonzero numeric value is substituted for Template:Mvar.

Limitations

Not all expressions that are meaningful as functions of Template:Mvar are meaningful as expressions designating formal series; for example, negative and fractional powers of Template:Mvar are examples of functions that do not have a corresponding formal power series.

Types

Ordinary generating function (OGF)

When the term generating function is used without qualification, it is usually taken to mean an ordinary generating function. The ordinary generating function of a sequence Template:Math is: G(an;x)=n=0anxn. If Template:Math is the probability mass function of a discrete random variable, then its ordinary generating function is called a probability-generating function.

Exponential generating function (EGF)

The exponential generating function of a sequence Template:Math is EG(an;x)=n=0anxnn!.

Exponential generating functions are generally more convenient than ordinary generating functions for combinatorial enumeration problems that involve labelled objects.[3]

Another benefit of exponential generating functions is that they are useful in transferring linear recurrence relations to the realm of differential equations. For example, take the Fibonacci sequence Template:Math that satisfies the linear recurrence relation Template:Math. The corresponding exponential generating function has the form EF(x)=n=0fnn!xn

and its derivatives can readily be shown to satisfy the differential equation Template:Math as a direct analogue with the recurrence relation above. In this view, the factorial term Template:Math is merely a counter-term to normalise the derivative operator acting on Template:Math.

Poisson generating function

The Poisson generating function of a sequence Template:Math is PG(an;x)=n=0anexxnn!=exEG(an;x).

Lambert series

Template:Main article

The Lambert series of a sequence Template:Math is LG(an;x)=n=1anxn1xn.Note that in a Lambert series the index Template:Mvar starts at 1, not at 0, as the first term would otherwise be undefined.

The Lambert series coefficients in the power series expansions bn:=[xn]LG(an;x)for integers Template:Math are related by the divisor sum bn=d|nad.The main article provides several more classical, or at least well-known examples related to special arithmetic functions in number theory. As an example of a Lambert series identity not given in the main article, we can show that for Template:Math we have that [4]n=1qnxn1xn=n=1qnxn21qxn+n=1qnxn(n+1)1xn,

where we have the special case identity for the generating function of the divisor function, Template:Math, given byn=1xn1xn=n=1xn2(1+xn)1xn.

Bell series

The Bell series of a sequence Template:Math is an expression in terms of both an indeterminate Template:Mvar and a prime Template:Mvar and is given by:[5] BGp(an;x)=n=0apnxn.

Dirichlet series generating functions (DGFs)

Formal Dirichlet series are often classified as generating functions, although they are not strictly formal power series. The Dirichlet series generating function of a sequence Template:Math is:[6] DG(an;s)=n=1anns.

The Dirichlet series generating function is especially useful when Template:Math is a multiplicative function, in which case it has an Euler product expression[7] in terms of the function's Bell series: DG(an;s)=pBGp(an;ps).

If Template:Math is a Dirichlet character then its Dirichlet series generating function is called a [[Dirichlet L-series|Dirichlet Template:Mvar-series]]. We also have a relation between the pair of coefficients in the Lambert series expansions above and their DGFs. Namely, we can prove that: [xn]LG(an;x)=bnif and only if DG(an;s)ζ(s)=DG(bn;s),where Template:Math is the Riemann zeta function.[8]

The sequence Template:Mvar generated by a Dirichlet series generating function (DGF) corresponding to:DG(ak;s)=ζ(s)mhas the ordinary generating function:k=1k=nakxk=x+(m1)2anxa+(m2)a=2b=2abnxab+(m3)a=2c=2b=2abcnxabc+(m4)a=2b=2c=2d=2abcdnxabcd+

Polynomial sequence generating functions

The idea of generating functions can be extended to sequences of other objects. Thus, for example, polynomial sequences of binomial type are generated by: exf(t)=n=0pn(x)n!tnwhere Template:Math is a sequence of polynomials and Template:Math is a function of a certain form. Sheffer sequences are generated in a similar way. See the main article generalized Appell polynomials for more information.

Examples of polynomial sequences generated by more complex generating functions include:

Other generating functions

Other sequences generated by more complex generating functions include:

Convolution polynomials

Knuth's article titled "Convolution Polynomials"[9] defines a generalized class of convolution polynomial sequences by their special generating functions of the form F(z)x=exp(xlogF(z))=n=0fn(x)zn, for some analytic function Template:Mvar with a power series expansion such that Template:Math.

We say that a family of polynomials, Template:Math, forms a convolution family if Template:Math and if the following convolution condition holds for all Template:Mvar, Template:Mvar and for all Template:Math: fn(x+y)=fn(x)f0(y)+fn1(x)f1(y)++f1(x)fn1(y)+f0(x)fn(y).

We see that for non-identically zero convolution families, this definition is equivalent to requiring that the sequence have an ordinary generating function of the first form given above.

A sequence of convolution polynomials defined in the notation above has the following properties:

fn(x+y)=k=0nfk(x)fnk(y)fn(2x)=k=0nfk(x)fnk(x)xnfn(x+y)=(x+y)k=0nkfk(x)fnk(y)(x+y)fn(x+y+tn)x+y+tn=k=0nxfk(x+tk)x+tkyfnk(y+t(nk))y+t(nk).

For a fixed non-zero parameter t, we have modified generating functions for these convolution polynomial sequences given by zFn(x+tn)(x+tn)=[zn]t(z)x, where Template:Math is implicitly defined by a functional equation of the form Template:Math. Moreover, we can use matrix methods (as in the reference) to prove that given two convolution polynomial sequences, Template:Math and Template:Math, with respective corresponding generating functions, Template:Math and Template:Math, then for arbitrary Template:Mvar we have the identity [zn](G(z)F(zG(z)t))x=k=0nFk(x)Gnk(x+tk).

Examples of convolution polynomial sequences include the binomial power series, Template:Math, so-termed tree polynomials, the Bell numbers, Template:Math, the Laguerre polynomials, and the Stirling convolution polynomials.

Ordinary generating functions

Examples for simple sequences

Polynomials are a special case of ordinary generating functions, corresponding to finite sequences, or equivalently sequences that vanish after a certain point. These are important in that many finite sequences can usefully be interpreted as generating functions, such as the Poincaré polynomial and others.

A fundamental generating function is that of the constant sequence Template:Nowrap, whose ordinary generating function is the geometric series n=0xn=11x.

The left-hand side is the Maclaurin series expansion of the right-hand side. Alternatively, the equality can be justified by multiplying the power series on the left by Template:Math, and checking that the result is the constant power series 1 (in other words, that all coefficients except the one of Template:Math are equal to 0). Moreover, there can be no other power series with this property. The left-hand side therefore designates the multiplicative inverse of Template:Math in the ring of power series.

Expressions for the ordinary generating function of other sequences are easily derived from this one. For instance, the substitution Template:Math gives the generating function for the geometric sequence Template:Math for any constant Template:Mvar: n=0(ax)n=11ax.

(The equality also follows directly from the fact that the left-hand side is the Maclaurin series expansion of the right-hand side.) In particular, n=0(1)nxn=11+x.

One can also introduce regular gaps in the sequence by replacing Template:Mvar by some power of Template:Mvar, so for instance for the sequence Template:Nowrap (which skips over Template:Math) one gets the generating function n=0x2n=11x2.

By squaring the initial generating function, or by finding the derivative of both sides with respect to Template:Mvar and making a change of running variable Template:Math, one sees that the coefficients form the sequence Template:Nowrap, so one has n=0(n+1)xn=1(1x)2,

and the third power has as coefficients the triangular numbers Template:Nowrap whose term Template:Mvar is the binomial coefficient Template:Math, so that n=0(n+22)xn=1(1x)3.

More generally, for any non-negative integer Template:Mvar and non-zero real value Template:Mvar, it is true that n=0an(n+kk)xn=1(1ax)k+1.

Since 2(n+22)3(n+11)+(n0)=2(n+1)(n+2)23(n+1)+1=n2,

one can find the ordinary generating function for the sequence Template:Nowrap of square numbers by linear combination of binomial-coefficient generating sequences: G(n2;x)=n=0n2xn=2(1x)33(1x)2+11x=x(x+1)(1x)3.

We may also expand alternately to generate this same sequence of squares as a sum of derivatives of the geometric series in the following form: G(n2;x)=n=0n2xn[4px]=n=0n(n1)xn+n=0nxn[4px]=x2D2[11x]+xD[11x][4px]=2x2(1x)3+x(1x)2=x(x+1)(1x)3.

By induction, we can similarly show for positive integers Template:Math that[10][11] nm=j=0m{mj}n!(nj)!,

where Template:Math denote the Stirling numbers of the second kind and where the generating function n=0n!(nj)!zn=j!zj(1z)j+1,

so that we can form the analogous generating functions over the integral Template:Mvarth powers generalizing the result in the square case above. In particular, since we can write zk(1z)k+1=i=0k(ki)(1)ki(1z)i+1,

we can apply a well-known finite sum identity involving the Stirling numbers to obtain that[12] n=0nmzn=j=0m{m+1j+1}(1)mjj!(1z)j+1.

Rational functions

Template:Main

The ordinary generating function of a sequence can be expressed as a rational function (the ratio of two finite-degree polynomials) if and only if the sequence is a linear recursive sequence with constant coefficients; this generalizes the examples above. Conversely, every sequence generated by a fraction of polynomials satisfies a linear recurrence with constant coefficients; these coefficients are identical to the coefficients of the fraction denominator polynomial (so they can be directly read off). This observation shows it is easy to solve for generating functions of sequences defined by a linear finite difference equation with constant coefficients, and then hence, for explicit closed-form formulas for the coefficients of these generating functions. The prototypical example here is to derive Binet's formula for the Fibonacci numbers via generating function techniques.

We also notice that the class of rational generating functions precisely corresponds to the generating functions that enumerate quasi-polynomial sequences of the form [13] fn=p1(n)ρ1n++p(n)ρn,

where the reciprocal roots, ρi, are fixed scalars and where Template:Math is a polynomial in Template:Mvar for all Template:Math.

In general, Hadamard products of rational functions produce rational generating functions. Similarly, if F(s,t):=m,n0f(m,n)wmzn

is a bivariate rational generating function, then its corresponding diagonal generating function, diag(F):=n=0f(n,n)zn,

is algebraic. For example, if we let[14] F(s,t):=i,j0(i+ji)sitj=11st,

then this generating function's diagonal coefficient generating function is given by the well-known OGF formula diag(F)=n=0(2nn)zn=114z.

This result is computed in many ways, including Cauchy's integral formula or contour integration, taking complex residues, or by direct manipulations of formal power series in two variables.

Operations on generating functions

Multiplication yields convolution

Template:Main

Multiplication of ordinary generating functions yields a discrete convolution (the Cauchy product) of the sequences. For example, the sequence of cumulative sums (compare to the slightly more general Euler–Maclaurin formula) (a0,a0+a1,a0+a1+a2,) of a sequence with ordinary generating function Template:Math has the generating function G(an;x)11x because Template:Math is the ordinary generating function for the sequence Template:Nowrap. See also the section on convolutions in the applications section of this article below for further examples of problem solving with convolutions of generating functions and interpretations.

Shifting sequence indices

For integers Template:Math, we have the following two analogous identities for the modified generating functions enumerating the shifted sequence variants of Template:Math and Template:Math, respectively: zmG(z)=n=mgnmzn[4px]G(z)g0g1zgm1zm1zm=n=0gn+mzn.

Differentiation and integration of generating functions

We have the following respective power series expansions for the first derivative of a generating function and its integral: G(z)=n=0(n+1)gn+1zn[4px]zG(z)=n=0ngnzn[4px]0zG(t)dt=n=1gn1nzn.

The differentiation–multiplication operation of the second identity can be repeated Template:Mvar times to multiply the sequence by Template:Math, but that requires alternating between differentiation and multiplication. If instead doing Template:Mvar differentiations in sequence, the effect is to multiply by the Template:Mvarth falling factorial: zkG(k)(z)=n=0nk_gnzn=n=0n(n1)(nk+1)gnznfor all k.

Using the Stirling numbers of the second kind, that can be turned into another formula for multiplying by nk as follows (see the main article on generating function transformations): j=0k{kj}zjF(j)(z)=n=0nkfnznfor all k.

A negative-order reversal of this sequence powers formula corresponding to the operation of repeated integration is defined by the zeta series transformation and its generalizations defined as a derivative-based transformation of generating functions, or alternately termwise by and performing an integral transformation on the sequence generating function. Related operations of performing fractional integration on a sequence generating function are discussed here.

Enumerating arithmetic progressions of sequences

In this section we give formulas for generating functions enumerating the sequence Template:Math given an ordinary generating function Template:Math, where Template:Math, Template:Math, and Template:Math and Template:Math are integers (see the main article on transformations). For Template:Math, this is simply the familiar decomposition of a function into even and odd parts (i.e., even and odd powers): n=0f2nz2n=F(z)+F(z)2[4px]n=0f2n+1z2n+1=F(z)F(z)2.

More generally, suppose that Template:Math and that Template:Math denotes the Template:Mvarth primitive root of unity. Then, as an application of the discrete Fourier transform, we have the formula[15] n=0fan+bzan+b=1am=0a1ωambF(ωamz).

For integers Template:Math, another useful formula providing somewhat reversed floored arithmetic progressions — effectively repeating each coefficient Template:Mvar times — are generated by the identity[16] n=0fnmzn=1zm1zF(zm)=(1+z++zm2+zm1)F(zm).

Template:Math-recursive sequences and holonomic generating functions

Definitions

A formal power series (or function) Template:Math is said to be holonomic if it satisfies a linear differential equation of the form[17] c0(z)F(r)(z)+c1(z)F(r1)(z)++cr(z)F(z)=0,

where the coefficients Template:Math are in the field of rational functions, (z). Equivalently, F(z) is holonomic if the vector space over (z) spanned by the set of all of its derivatives is finite dimensional.

Since we can clear denominators if need be in the previous equation, we may assume that the functions, Template:Math are polynomials in Template:Mvar. Thus we can see an equivalent condition that a generating function is holonomic if its coefficients satisfy a Template:Mvar-recurrence of the form c^s(n)fn+s+c^s1(n)fn+s1++c^0(n)fn=0,

for all large enough Template:Math and where the Template:Math are fixed finite-degree polynomials in Template:Mvar. In other words, the properties that a sequence be Template:Mvar-recursive and have a holonomic generating function are equivalent. Holonomic functions are closed under the Hadamard product operation Template:Math on generating functions.

Examples

The functions Template:Math, Template:Math, Template:Math, Template:Math, 1+z, the dilogarithm function Template:Math, the generalized hypergeometric functions Template:Math and the functions defined by the power series n=0zn(n!)2

and the non-convergent n=0n!zn are all holonomic.

Examples of Template:Mvar-recursive sequences with holonomic generating functions include Template:Math and Template:Math, where sequences such as n and Template:Math are not Template:Mvar-recursive due to the nature of singularities in their corresponding generating functions. Similarly, functions with infinitely many singularities such as Template:Math, Template:Math, and [[Gamma function|Template:Math]] are not holonomic functions.

Software for working with Template:Mvar-recursive sequences and holonomic generating functions

Tools for processing and working with Template:Mvar-recursive sequences in Mathematica include the software packages provided for non-commercial use on the RISC Combinatorics Group algorithmic combinatorics software site. Despite being mostly closed-source, particularly powerful tools in this software suite are provided by the Guess package for guessing Template:Mvar-recurrences for arbitrary input sequences (useful for experimental mathematics and exploration) and the Sigma package which is able to find P-recurrences for many sums and solve for closed-form solutions to Template:Mvar-recurrences involving generalized harmonic numbers.[18] Other packages listed on this particular RISC site are targeted at working with holonomic generating functions specifically.

Relation to discrete-time Fourier transform

Template:Main

When the series converges absolutely, G(an;eiω)=n=0aneiωn is the discrete-time Fourier transform of the sequence Template:Math.

Asymptotic growth of a sequence

In calculus, often the growth rate of the coefficients of a power series can be used to deduce a radius of convergence for the power series. The reverse can also hold; often the radius of convergence for a generating function can be used to deduce the asymptotic growth of the underlying sequence.

For instance, if an ordinary generating function Template:Math that has a finite radius of convergence of Template:Mvar can be written as G(an;x)=A(x)+B(x)(1xr)βxα

where each of Template:Math and Template:Math is a function that is analytic to a radius of convergence greater than Template:Mvar (or is entire), and where Template:Math then anB(r)rαΓ(β)nβ1(1r)nB(r)rα(n+β1n)(1r)n=B(r)rα((βn))(1r)n, using the gamma function, a binomial coefficient, or a multiset coefficient. Note that limit as Template:Mvar goes to infinity of the ratio of Template:Math to any of these expressions is guaranteed to be 1; not merely that Template:Math is proportional to them.

Often this approach can be iterated to generate several terms in an asymptotic series for Template:Math. In particular, G(anB(r)rα(n+β1n)(1r)n;x)=G(an;x)B(r)rα(1xr)β.

The asymptotic growth of the coefficients of this generating function can then be sought via the finding of Template:Mvar, Template:Mvar, Template:Mvar, Template:Mvar, and Template:Mvar to describe the generating function, as above.

Similar asymptotic analysis is possible for exponential generating functions; with an exponential generating function, it is Template:Math that grows according to these asymptotic formulae. Generally, if the generating function of one sequence minus the generating function of a second sequence has a radius of convergence that is larger than the radius of convergence of the individual generating functions then the two sequences have the same asymptotic growth.

Asymptotic growth of the sequence of squares

As derived above, the ordinary generating function for the sequence of squares is: G(n2;x)=x(x+1)(1x)3.

With Template:Math, Template:Math, Template:Math, Template:Math, and Template:Math, we can verify that the squares grow as expected, like the squares: anB(r)rαΓ(β)nβ1(1r)n=1+111Γ(3)n31(11)n=n2.

Asymptotic growth of the Catalan numbers

Template:Main

The ordinary generating function for the Catalan numbers is G(Cn;x)=114x2x.

With Template:Math, Template:Math, Template:Math, Template:Math, and Template:Math, we can conclude that, for the Catalan numbers: CnB(r)rαΓ(β)nβ1(1r)n=12(14)1Γ(12)n121(114)n=4nn32π.

Bivariate and multivariate generating functions

The generating function in several variables can be generalized to arrays with multiple indices. These non-polynomial double sum examples are called multivariate generating functions, or super generating functions. For two variables, these are often called bivariate generating functions.

Bivariate case

The ordinary generating function of a two-dimensional array Template:Math (where Template:Mvar and Template:Mvar are natural numbers) is: G(am,n;x,y)=m,n=0am,nxmyn.For instance, since Template:Math is the ordinary generating function for binomial coefficients for a fixed Template:Mvar, one may ask for a bivariate generating function that generates the binomial coefficients Template:Math for all Template:Mvar and Template:Mvar. To do this, consider Template:Math itself as a sequence in Template:Mvar, and find the generating function in Template:Mvar that has these sequence values as coefficients. Since the generating function for Template:Math is: 11ay,the generating function for the binomial coefficients is: n,k(nk)xkyn=11(1+x)y=11yxy.Other examples of such include the following two-variable generating functions for the binomial coefficients, the Stirling numbers, and the Eulerian numbers, where Template:Math and Template:Math denote the two variables:[19] ez+wz=m,n0(nm)wmznn![4px]ew(ez1)=m,n0{nm}wmznn![4px]1(1z)w=m,n0[nm]wmznn![4px]1we(w1)zw=m,n0nmwmznn![4px]ewezwezzew=m,n0m+n+1mwmzn(m+n+1)!.

Multivariate case

Multivariate generating functions arise in practice when calculating the number of contingency tables of non-negative integers with specified row and column totals. Suppose the table has Template:Mvar rows and Template:Mvar columns; the row sums are Template:Math and the column sums are Template:Math. Then, according to I. J. Good,[20] the number of such tables is the coefficient of: x1t1xrtry1s1ycscin:i=1rj=1c11xiyj.

Representation by continued fractions (Jacobi-type Template:Mvar-fractions)

Definitions

Expansions of (formal) Jacobi-type and Stieltjes-type continued fractions (Template:Mvar-fractions and Template:Mvar-fractions, respectively) whose Template:Mvarth rational convergents represent [[Order of accuracy|Template:Math-order accurate]] power series are another way to express the typically divergent ordinary generating functions for many special one and two-variate sequences. The particular form of the Jacobi-type continued fractions (Template:Mvar-fractions) are expanded as in the following equation and have the next corresponding power series expansions with respect to Template:Mvar for some specific, application-dependent component sequences, Template:Math and Template:Math, where Template:Math denotes the formal variable in the second power series expansion given below:[21] J[](z)=11c1zab2z21c2zab3z2[4px]=1+c1z+(ab2+c12)z2+(2ab2c1+c13+ab2c2)z3+

The coefficients of zn, denoted in shorthand by Template:Math, in the previous equations correspond to matrix solutions of the equations: [k0,1k1,100k0,2k1,2k2,20k0,3k1,3k2,3k3,3]=[k0,0000k0,1k1,100k0,2k1,2k2,20][c1100ab2c2100ab3c31],

where Template:Math, Template:Math for Template:Math, Template:Math if Template:Math, and where for all integers Template:Math, we have an addition formula relation given by: jp+q=k0,pk0,q+i=1min(p,q)ab2abi+1×ki,pki,q.

Properties of the Template:Mvarth convergent functions

For Template:Math (though in practice when Template:Math), we can define the rational Template:Mvarth convergents to the infinite Template:Mvar-fraction, Template:Math, expanded by: Convh(z):=Ph(z)Qh(z)=j0+j1z++j2h1z2h1+n=2hj~h,nzn

component-wise through the sequences, Template:Math and Template:Math, defined recursively by: Ph(z)=(1chz)Ph1(z)abhz2Ph2(z)+δh,1Qh(z)=(1chz)Qh1(z)abhz2Qh2(z)+(1c1z)δh,1+δ0,1.

Moreover, the rationality of the convergent function Template:Math for all Template:Math implies additional finite difference equations and congruence properties satisfied by the sequence of Template:Math, and for Template:Math if Template:Math then we have the congruence jn[zn]Convh(z)(modh),

for non-symbolic, determinate choices of the parameter sequences Template:Math and Template:Math when Template:Math, that is, when these sequences do not implicitly depend on an auxiliary parameter such as Template:Mvar, Template:Mvar, or Template:Mvar as in the examples contained in the table below.

Examples

The next table provides examples of closed-form formulas for the component sequences found computationally (and subsequently proved correct in the cited references[22]) in several special cases of the prescribed sequences, Template:Math, generated by the general expansions of the Template:Mvar-fractions defined in the first subsection. Here we define Template:Math and the parameters R,α+ and Template:Mvar to be indeterminates with respect to these expansions, where the prescribed sequences enumerated by the expansions of these Template:Mvar-fractions are defined in terms of the [[q-Pochhammer symbol|Template:Mvar-Pochhammer symbol]], Pochhammer symbol, and the binomial coefficients.

jn c1 ci(i2) abi(i2)
qn2 q q2h3(q2h+q2h21) q6h10(q2h21)
(a;q)n 1a qh1aqh2(qh+qh11) aq2h4(aqh21)(qh11)
(zqn;q)n qzq qhzqz+qhzq2h1 (qh11)(qh1z)zq4h5
(a;q)n(b;q)n 1a1b qi2(q+abq2i3+a(1qi1qi)+b(qiq1))(1bq2i4)(1bq2i2) q2i4(1bqi3)(1aqi2)(abqi2)(1qi1)(1bq2i5)(1bq2i4)2(1bq2i3)
αn(Rα)n R R+2α(i1) (i1)α(R+(i2)α)
(1)n(xn) x (x+2(i1)2)(2i1)(2i3) {(xi+2)(x+i1)4(2i3)2for i3;[4px]12x(x+1)for i=2.
(1)n(x+nn) (x+1) (x2i(i2)1)(2i1)(2i3) {(xi+2)(x+i1)4(2i3)2for i3;[4px]12x(x+1)for i=2.

The radii of convergence of these series corresponding to the definition of the Jacobi-type Template:Mvar-fractions given above are in general different from that of the corresponding power series expansions defining the ordinary generating functions of these sequences.

Examples

Square numbers

Generating functions for the sequence of square numbers Template:Math are:

Generating function type Equation
Ordinary generating function G(n2;x)=n=0n2xn=x(x+1)(1x)3
Exponential generating function EG(n2;x)=n=0n2xnn!=x(x+1)ex
Bell series BGp(n2;x)=n=0(pn)2xn=11p2x
Dirichlet series DG(n2;s)=n=1n2ns=ζ(s2)

where Template:Math is the Riemann zeta function.

Applications

Generating functions are used to:

  • Find a closed formula for a sequence given in a recurrence relation, for example, Fibonacci numbers.
  • Find recurrence relations for sequences—the form of a generating function may suggest a recurrence formula.
  • Find relationships between sequences—if the generating functions of two sequences have a similar form, then the sequences themselves may be related.
  • Explore the asymptotic behaviour of sequences.
  • Prove identities involving sequences.
  • Solve enumeration problems in combinatorics and encoding their solutions. Rook polynomials are an example of an application in combinatorics.
  • Evaluate infinite sums.

Various techniques: Evaluating sums and tackling other problems with generating functions

Example 1: Formula for sums of harmonic numbers

Generating functions give us several methods to manipulate sums and to establish identities between sums.

The simplest case occurs when Template:Math. We then know that Template:Math for the corresponding ordinary generating functions.

For example, we can manipulate sn=k=1nHk, where Template:Math are the harmonic numbers. Let H(z)=n=1Hnzn be the ordinary generating function of the harmonic numbers. Then H(z)=11zn=1znn, and thus S(z)=n=1snzn=1(1z)2n=1znn.

Using 1(1z)2=n=0(n+1)zn, convolution with the numerator yields sn=k=1nn+1kk=(n+1)Hnn, which can also be written as k=1nHk=(n+1)(Hn+11).

Example 2: Modified binomial coefficient sums and the binomial transform

As another example of using generating functions to relate sequences and manipulate sums, for an arbitrary sequence Template:Math we define the two sequences of sums sn:=m=0n(nm)fm3nm[4px]s~n:=m=0n(nm)(m+1)(m+2)(m+3)fm3nm, for all Template:Math, and seek to express the second sums in terms of the first. We suggest an approach by generating functions.

First, we use the binomial transform to write the generating function for the first sum as S(z)=113zF(z13z).

Since the generating function for the sequence Template:Math is given by 6F(z)+18zF(z)+9z2F(z)+z3F(z) we may write the generating function for the second sum defined above in the form S~(z)=6(13z)F(z13z)+18z(13z)2F(z13z)+9z2(13z)3F(z13z)+z3(13z)4F(z13z).

In particular, we may write this modified sum generating function in the form of a(z)S(z)+b(z)zS(z)+c(z)z2S(z)+d(z)z3S(z), for Template:Math, Template:Math, Template:Math, and Template:Math, where Template:Math.

Finally, it follows that we may express the second sums through the first sums in the following form: s~n=[zn](6(13z)3n=0snzn+18(13z)3n=0nsnzn+9(13z)3n=0n(n1)snzn+(13z)3n=0n(n1)(n2)snzn)[4px]=(n+1)(n+2)(n+3)sn9n(n+1)(n+2)sn1+27(n1)n(n+1)sn2(n2)(n1)nsn3.

Example 3: Generating functions for mutually recursive sequences

In this example, we reformulate a generating function example given in Section 7.3 of Concrete Mathematics (see also Section 7.1 of the same reference for pretty pictures of generating function series). In particular, suppose that we seek the total number of ways (denoted Template:Math) to tile a 3-by-Template:Mvar rectangle with unmarked 2-by-1 domino pieces. Let the auxiliary sequence, Template:Math, be defined as the number of ways to cover a 3-by-Template:Mvar rectangle-minus-corner section of the full rectangle. We seek to use these definitions to give a closed form formula for Template:Math without breaking down this definition further to handle the cases of vertical versus horizontal dominoes. Notice that the ordinary generating functions for our two sequences correspond to the series: U(z)=1+3z2+11z4+41z6+,V(z)=z+4z3+15z5+56z7+.

If we consider the possible configurations that can be given starting from the left edge of the 3-by-Template:Mvar rectangle, we are able to express the following mutually dependent, or mutually recursive, recurrence relations for our two sequences when Template:Math defined as above where Template:Math, Template:Math, Template:Math, and Template:Math: Un=2Vn1+Un2Vn=Un1+Vn2.

Since we have that for all integers Template:Math, the index-shifted generating functions satisfyTemplate:NoteTag zmG(z)=n=mgnmzn, we can use the initial conditions specified above and the previous two recurrence relations to see that we have the next two equations relating the generating functions for these sequences given by U(z)=2zV(z)+z2U(z)+1V(z)=zU(z)+z2V(z)=z1z2U(z), which then implies by solving the system of equations (and this is the particular trick to our method here) that U(z)=1z214z2+z4=13311(2+3)z2+13+311(23)z2.

Thus by performing algebraic simplifications to the sequence resulting from the second partial fractions expansions of the generating function in the previous equation, we find that Template:Math and that U2n=(2+3)n33, for all integers Template:Math. We also note that the same shifted generating function technique applied to the second-order recurrence for the Fibonacci numbers is the prototypical example of using generating functions to solve recurrence relations in one variable already covered, or at least hinted at, in the subsection on rational functions given above.

Convolution (Cauchy products)

A discrete convolution of the terms in two formal power series turns a product of generating functions into a generating function enumerating a convolved sum of the original sequence terms (see Cauchy product).

  1. Consider Template:Math and Template:Math are ordinary generating functions. C(z)=A(z)B(z)[zn]C(z)=k=0nakbnk
  2. Consider Template:Math and Template:Math are exponential generating functions. C(z)=A(z)B(z)[znn!]C(z)=k=0n(nk)akbnk
  3. Consider the triply convolved sequence resulting from the product of three ordinary generating functions C(z)=F(z)G(z)H(z)[zn]C(z)=j+k+l=nfjgkhl
  4. Consider the Template:Mvar-fold convolution of a sequence with itself for some positive integer Template:Math (see the example below for an application) C(z)=G(z)m[zn]C(z)=k1+k2++km=ngk1gk2gkm

Multiplication of generating functions, or convolution of their underlying sequences, can correspond to a notion of independent events in certain counting and probability scenarios. For example, if we adopt the notational convention that the probability generating function, or pgf, of a random variable Template:Mvar is denoted by Template:Math, then we can show that for any two random variables [23] GX+Y(z)=GX(z)GY(z), if Template:Mvar and Template:Mvar are independent. Similarly, the number of ways to pay Template:Math cents in coin denominations of values in the set {1, 5, 10, 25, 50} (i.e., in pennies, nickels, dimes, quarters, and half dollars, respectively) is generated by the product C(z)=11z11z511z1011z2511z50, and moreover, if we allow the Template:Mvar cents to be paid in coins of any positive integer denomination, we arrive at the generating for the number of such combinations of change being generated by the partition function generating function expanded by the infinite [[q-Pochhammer symbol|Template:Mvar-Pochhammer symbol]] product of n=1(1zn)1.

Example: Generating function for the Catalan numbers

An example where convolutions of generating functions are useful allows us to solve for a specific closed-form function representing the ordinary generating function for the Catalan numbers, Template:Math. In particular, this sequence has the combinatorial interpretation as being the number of ways to insert parentheses into the product Template:Math so that the order of multiplication is completely specified. For example, Template:Math which corresponds to the two expressions Template:Math and Template:Math. It follows that the sequence satisfies a recurrence relation given by Cn=k=0n1CkCn1k+δn,0=C0Cn1+C1Cn2++Cn1C0+δn,0,n0, and so has a corresponding convolved generating function, Template:Math, satisfying C(z)=zC(z)2+1.

Since Template:Math, we then arrive at a formula for this generating function given by C(z)=114z2z=n=01n+1(2nn)zn.

Note that the first equation implicitly defining Template:Math above implies that C(z)=11zC(z), which then leads to another "simple" (of form) continued fraction expansion of this generating function.

Example: Spanning trees of fans and convolutions of convolutions

A fan of order Template:Mvar is defined to be a graph on the vertices Template:Math with Template:Math edges connected according to the following rules: Vertex 0 is connected by a single edge to each of the other Template:Mvar vertices, and vertex k is connected by a single edge to the next vertex Template:Math for all Template:Math.[24] There is one fan of order one, three fans of order two, eight fans of order three, and so on. A spanning tree is a subgraph of a graph which contains all of the original vertices and which contains enough edges to make this subgraph connected, but not so many edges that there is a cycle in the subgraph. We ask how many spanning trees Template:Math of a fan of order Template:Mvar are possible for each Template:Math.

As an observation, we may approach the question by counting the number of ways to join adjacent sets of vertices. For example, when Template:Math, we have that Template:Math, which is a sum over the Template:Mvar-fold convolutions of the sequence Template:Math for Template:Math. More generally, we may write a formula for this sequence as fn=m>0k1+k2++km=nk1,k2,,km>0gk1gk2gkm, from which we see that the ordinary generating function for this sequence is given by the next sum of convolutions as F(z)=G(z)+G(z)2+G(z)3+=G(z)1G(z)=z(1z)2z=z13z+z2, from which we are able to extract an exact formula for the sequence by taking the partial fraction expansion of the last generating function.

Implicit generating functions and the Lagrange inversion formula

Template:Expand section

One often encounters generating functions specified by a functional equation, instead of an explicit specification. For example, the generating function Template:Math for the number of binary trees on Template:Math nodes (leaves included) satisfies

T(z)=z(1+T(z)2)

The Lagrange inversion theorem is a tool used to explicitly evaluate solutions to such equations.

Template:Math theorem

Applying the above theorem to our functional equation yields (with ϕ(z)=1+z2):

[zn]T(z)=[zn1]1n(1+z2)n

Via the binomial theorem expansion, for even n, the formula returns 0. This is expected as one can prove that the number of leaves of a binary tree are one more than the number of its internal nodes, so the total sum should always be an odd number. For odd n, however, we get

[zn1]1n(1+z2)n=1n(nn+12)

The expression becomes much neater if we let n be the number of internal nodes: Now the expression just becomes the nth Catalan number.

Introducing a free parameter (snake oil method)

Sometimes the sum Template:Math is complicated, and it is not always easy to evaluate. The "Free Parameter" method is another method (called "snake oil" by H. Wilf) to evaluate these sums.

Both methods discussed so far have Template:Mvar as limit in the summation. When n does not appear explicitly in the summation, we may consider Template:Mvar as a "free" parameter and treat Template:Math as a coefficient of Template:Math, change the order of the summations on Template:Mvar and Template:Mvar, and try to compute the inner sum.

For example, if we want to compute sn=k=0(n+km+2k)(2kk)(1)kk+1,m,n0, we can treat Template:Mvar as a "free" parameter, and set F(z)=n=0(k=0(n+km+2k)(2kk)(1)kk+1)zn.

Interchanging summation ("snake oil") gives F(z)=k=0(2kk)(1)kk+1zkn=0(n+km+2k)zn+k.

Now the inner sum is Template:Math. Thus F(z)=zm(1z)m+1k=01k+1(2kk)(z(1z)2)k[4px]=zm(1z)m+1k=0Ck(z(1z)2)kwhere Ck=kth Catalan number[4px]=zm(1z)m+111+4z(1z)22z(1z)2[4px]=zm12(1z)m1(11+z1z)[4px]=zm(1z)m=zzm1(1z)m.

Then we obtain sn={(n1m1)for m1,[n=0]for m=0.

It is instructive to use the same method again for the sum, but this time take Template:Mvar as the free parameter instead of Template:Mvar. We thus set G(z)=m=0(k=0(n+km+2k)(2kk)(1)kk+1)zm.

Interchanging summation ("snake oil") gives G(z)=k=0(2kk)(1)kk+1z2km=0(n+km+2k)zm+2k.

Now the inner sum is Template:Math. Thus G(z)=(1+z)nk=01k+1(2kk)((1+z)z2)k[4px]=(1+z)nk=0Ck((1+z)z2)kwhere Ck=kth Catalan number[4px]=(1+z)n11+4(1+z)z22(1+z)z2[4px]=(1+z)nz2zz2+4+4z2(1+z)[4px]=(1+z)nz2z(z+2)2(1+z)[4px]=(1+z)n2z2(1+z)=z(1+z)n1.

Thus we obtain sn=[zm]z(1+z)n1=[zm1](1+z)n1=(n1m1), for Template:Math as before.

Generating functions prove congruences

We say that two generating functions (power series) are congruent modulo Template:Mvar, written Template:Math if their coefficients are congruent modulo Template:Mvar for all Template:Math, i.e., Template:Math for all relevant cases of the integers Template:Mvar (note that we need not assume that Template:Mvar is an integer here—it may very well be polynomial-valued in some indeterminate Template:Mvar, for example). If the "simpler" right-hand-side generating function, Template:Math, is a rational function of Template:Mvar, then the form of this sequence suggests that the sequence is eventually periodic modulo fixed particular cases of integer-valued Template:Math. For example, we can prove that the Euler numbers, En=1,1,5,61,1385,1,1,2,1,2,1,2,(mod3), satisfy the following congruence modulo 3:[25] n=0Enzn=1z21+z2(mod3).

One useful method of obtaining congruences for sequences enumerated by special generating functions modulo any integers (i.e., not only prime powers Template:Math) is given in the section on continued fraction representations of (even non-convergent) ordinary generating functions by Template:Mvar-fractions above. We cite one particular result related to generating series expanded through a representation by continued fraction from Lando's Lectures on Generating Functions as follows: Template:Math theorem

Generating functions also have other uses in proving congruences for their coefficients. We cite the next two specific examples deriving special case congruences for the Stirling numbers of the first kind and for the [[partition function (number theory)|partition function Template:Math]] which show the versatility of generating functions in tackling problems involving integer sequences.

The Stirling numbers modulo small integers

The main article on the Stirling numbers generated by the finite products Sn(x):=k=0n[nk]xk=x(x+1)(x+2)(x+n1),n1,

provides an overview of the congruences for these numbers derived strictly from properties of their generating function as in Section 4.6 of Wilf's stock reference Generatingfunctionology. We repeat the basic argument and notice that when reduces modulo 2, these finite product generating functions each satisfy

Sn(x)=[x(x+1)][x(x+1)]=xn2(x+1)n2,

which implies that the parity of these Stirling numbers matches that of the binomial coefficient

[nk](n2kn2)(mod2),

and consequently shows that Template:Math is even whenever Template:Math.

Similarly, we can reduce the right-hand-side products defining the Stirling number generating functions modulo 3 to obtain slightly more complicated expressions providing that [nm][xm](xn3(x+1)n13(x+2)n3)(mod3)k=0m(n13k)(n3mkn3)×2n3+n3(mk)(mod3).

Congruences for the partition function

In this example, we pull in some of the machinery of infinite products whose power series expansions generate the expansions of many special functions and enumerate partition functions. In particular, we recall that the partition function Template:Math is generated by the reciprocal infinite [[q-Pochhammer symbol|Template:Mvar-Pochhammer symbol]] product (or Template:Mvar-Pochhammer product as the case may be) given by n=0p(n)zn=1(1z)(1z2)(1z3)=1+z+2z2+3z3+5z4+7z5+11z6+.

This partition function satisfies many known congruence properties, which notably include the following results though there are still many open questions about the forms of related integer congruences for the function:[26] p(5m+4)0(mod5)p(7m+5)0(mod7)p(11m+6)0(mod11)p(25m+24)0(mod52).

We show how to use generating functions and manipulations of congruences for formal power series to give a highly elementary proof of the first of these congruences listed above.

First, we observe that in the binomial coefficient generating function 1(1z)5=i=0(4+i4)zi, all of the coefficients are divisible by 5 except for those which correspond to the powers Template:Math and moreover in those cases the remainder of the coefficient is 1 modulo 5. Thus, 1(1z)511z5(mod5), or equivalently 1z5(1z)51(mod5). It follows that (1z5)(1z10)(1z15)((1z)(1z2)(1z3))51(mod5).

Using the infinite product expansions of z(1z5)(1z10)(1z)(1z2)=z((1z)(1z2))4×(1z5)(1z10)((1z)(1z2))5, it can be shown that the coefficient of Template:Math in Template:Math is divisible by 5 for all Template:Mvar.[27] Finally, since n=1p(n1)zn=z(1z)(1z2)[6px]=z(1z5)(1z10)(1z)(1z2)×(1+z5+z10+)(1+z10+z20+) we may equate the coefficients of Template:Math in the previous equations to prove our desired congruence result, namely that Template:Math for all Template:Math.

Transformations of generating functions

There are a number of transformations of generating functions that provide other applications (see the main article). A transformation of a sequence's ordinary generating function (OGF) provides a method of converting the generating function for one sequence into a generating function enumerating another. These transformations typically involve integral formulas involving a sequence OGF (see integral transformations) or weighted sums over the higher-order derivatives of these functions (see derivative transformations).

Generating function transformations can come into play when we seek to express a generating function for the sums sn:=m=0n(nm)Cn,mam,

in the form of Template:Math involving the original sequence generating function. For example, if the sums are sn:=k=0(n+km+2k)ak then the generating function for the modified sum expressions is given by[28] S(z)=zm(1z)m+1A(z(1z)2) (see also the binomial transform and the Stirling transform).

There are also integral formulas for converting between a sequence's OGF, Template:Math, and its exponential generating function, or EGF, Template:Math, and vice versa given by F(z)=0F^(tz)etdt,[4px]F^(z)=12πππF(zeiϑ)eeiϑdϑ,

provided that these integrals converge for appropriate values of Template:Mvar.

Tables of special generating functions

An initial listing of special mathematical series is found here. A number of useful and special sequence generating functions are found in Section 5.4 and 7.4 of Concrete Mathematics and in Section 2.5 of Wilf's Generatingfunctionology. Other special generating functions of note include the entries in the next table, which is by no means complete.[29]

Template:Expand section

Formal power series Generating-function formula Notes
n=0(m+nn)(Hn+mHm)zn 1(1z)m+1ln11z Hn is a first-order harmonic number
n=0Bnznn! zez1 Bn is a Bernoulli number
n=0Fmnzn Fmz1(Fm1+Fm+1)z+(1)mz2 Fn is a Fibonacci number and m+
n=0{nm}zn (z1)m=zm(1z)(12z)(1mz) xn denotes the rising factorial, or Pochhammer symbol and some integer m0
n=0[nm]zn zm=z(z+1)(z+m1)
n=1(1)n14n(4n2)B2nz2n(2n)(2n)! lntan(z)z
n=0(1/2)nz2n(2n+1)n! z1arcsin(z)
n=0Hn(s)zn Lis(z)1z Lis(z) is the polylogarithm function and Hn(s) is a generalized harmonic number for (s)>1
n=0nmzn 0jm{mj}j!zj(1z)j+1 {nm} is a Stirling number of the second kind and where the individual terms in the expansion satisfy zi(1z)i+1=k=0i(ik)(1)ki(1z)k+1
k<n(nkk)nnkzk (1+1+4z2)n+(11+4z2)n
n1,,nm0min(n1,,nm)z1n1zmnm z1zm(1z1)(1zm)(1z1zm) The two-variable case is given by M(w,z):=m,n0min(m,n)wmzn=wz(1w)(1z)(1wz)
n=0(sn)zn (1+z)s s
n=0(nk)zn zk(1z)k+1 k
n=1log(n)zn sLis(z)|s=0

See also

Notes

Template:NoteFoot

References

Template:Reflist

Citations

Template:Authority control

  1. This alternative term can already be found in E.N. Gilbert (1956), "Enumeration of Labeled graphs", Canadian Journal of Mathematics 3, p. 405–411, but its use is rare before the year 2000; since then it appears to be increasing.
  2. Template:Cite book
  3. Template:Harvnb
  4. Template:Cite web
  5. Template:Apostol IANT pp.42–43
  6. Template:Harvnb
  7. Template:Harvnb
  8. Template:Cite book
  9. Template:Cite journal
  10. Template:Cite journal
  11. Template:Cite arXiv v4 eq. (0.4)
  12. Template:Harvnb for finite sum identities involving the Stirling number triangles.
  13. Template:Harvnb
  14. Example from Template:Cite book
  15. Template:Harvnb
  16. Solution to Template:Harvnb
  17. Template:Harvnb
  18. Template:Cite journal
  19. See the usage of these terms in Template:Harvnb on special sequence generating functions.
  20. Template:Cite journal
  21. For more complete information on the properties of Template:Mvar-fractions see:
  22. See the following articles:
  23. Template:Harvnb
  24. Template:Harvnb for another method and the complete setup of this problem using generating functions. This more "convoluted" approach is given in Section 7.5 of the same reference.
  25. Template:Harvnb
  26. Template:Harvnb
  27. Template:Cite book p.288, Th.361
  28. Template:Harvnb
  29. See also the 1031 Generating Functions found in Template:Cite thesis