From Wikipedia, the free encyclopedia - View original article

This article is about generating functions in mathematics. For generating functions in classical mechanics, see Generating function (physics). For signalling molecule, see Epidermal growth factor. For Generator in computer programming, see Generator (computer programming).

In mathematics, a **generating function** is a formal power series in one indeterminate, whose coefficients encode information about a sequence of numbers *a*_{n} that is indexed by the natural numbers. Generating functions were first introduced by Abraham de Moivre in 1730, in order to solve the general linear recurrence problem.^{[1]} One can generalize to formal power series in more than one indeterminate, to encode information about arrays of numbers indexed by several natural numbers.

There are various types of generating functions, including **ordinary generating functions**, **exponential generating functions**, **Lambert series**, **Bell series**, and **Dirichlet series**; definitions and examples are given below. 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 often expressed in closed form (rather than as a series), by some expression involving operations defined for formal power series. These expressions in terms of the indeterminate *x* may involve arithmetic operations, differentiation with respect to *x* 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 *x*. Indeed, the closed form expression can often be interpreted as a function that can be evaluated at (sufficiently small) concrete values of *x*, and which has the formal power series as its Taylor series; this explains the designation "generating functions". However such interpretation is not required to be possible, because formal power series are not required to give a convergent series when a nonzero numeric value is substituted for *x*. Also, not all expressions that are meaningful as functions of *x* are meaningful as expressions designating formal power series; negative and fractional powers of *x* are examples of this.

Generating functions are not functions in the formal sense of a mapping from a domain to a codomain; the name is merely traditional, and they are sometimes more correctly called **generating series**.^{[2]}

*A generating function is a clothesline on which we hang up a sequence of numbers for display.*- —Herbert Wilf,
*Generatingfunctionology*(1994)

The *ordinary generating function* of a sequence *a*_{n} is

When the term *generating function* is used without qualification, it is usually taken to mean an ordinary generating function.

If *a*_{n} is the probability mass function of a discrete random variable, then its ordinary generating function is called a probability-generating function.

The ordinary generating function can be generalized to arrays with multiple indices. For example, the ordinary generating function of a two-dimensional array *a*_{m, n} (where *n* and *m* are natural numbers) is

The *exponential generating function* of a sequence *a*_{n} is

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

The *Poisson generating function* of a sequence *a*_{n} is

The *Lambert series* of a sequence *a*_{n} is

Note that in a Lambert series the index *n* starts at 1, not at 0, as the first term would otherwise be undefined.

The Bell series of a sequence *a*_{n} is an expression in terms of both an indeterminate *x* and a prime *p* and is given by^{[4]}

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 *a*_{n} is^{[5]}

The Dirichlet series generating function is especially useful when *a*_{n} is a multiplicative function, when it has an Euler product expression^{[6]} in terms of the function's Bell series

If *a*_{n} is a Dirichlet character then its Dirichlet series generating function is called a Dirichlet L-series.

The idea of generating functions can be extended to sequences of other objects. Thus, for example, polynomial sequences of binomial type are generated by

where *p*_{n}(*x*) is a sequence of polynomials and *f*(*t*) 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.

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 key generating function is the constant sequence 1, 1, 1, 1, 1, 1, 1, 1, 1, ..., whose ordinary generating function is

The left-hand side is the Maclaurin series expansion of the right-hand side. Alternatively, the right-hand side expression can be justified by multiplying the power series on the left by 1 − *x*, and checking that the result is the constant power series 1, in other words that all coefficients except the one of *x*^{0} vanish. Moreover there can be no other power series with this property. The left-hand side therefore designates the multiplicative inverse of 1 − *x* 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 *x* → *ax* gives the generating function for the geometric sequence 1, *a*, *a*^{2}, *a*^{3}, ... for any constant *a*:

(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,

One can also introduce regular "gaps" in the sequence by replacing *x* by some power of *x*, so for instance for the sequence 1, 0, 1, 0, 1, 0, 1, 0, .... one gets the generating function

By squaring the initial generating function, or by finding the derivative of both sides with respect to *x* and making a change of running variable *n* → *n-1*, one sees that the coefficients form the sequence 1, 2, 3, 4, 5, ..., so one has

and the third power has as coefficients the triangular numbers 1, 3, 6, 10, 15, 21, ... whose term *n* is the binomial coefficient , so that

More generally, for any positive integer *k*, it is true that

Note that, since

one can find the ordinary generating function for the sequence 0, 1, 4, 9, 16, ... of square numbers by linear combination of binomial-coefficient generating sequences;

Main article: Linear recursive sequence

The ordinary generating function of a sequence can be expressed as a rational function (the ratio of two polynomials) if and only if the sequence is a linear recursive sequence with constant coefficients; this generalizes the examples above. Going in the reverse direction, 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).

Main article: Cauchy product

Multiplication of ordinary generating functions yields a discrete convolution (the Cauchy product) of the sequences. For example, the sequence of cumulative sums

of a sequence with ordinary generating function *G*(*a _{n}*;

because 1/(1-*x*) is the ordinary generating function for the sequence (1, 1, ...).

Main article: Discrete-time Fourier transform

When the series converges absolutely,

is the discrete-time Fourier transform of the sequence *a*_{0}, *a*_{1}, ....

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 *G*(*a*_{n}; *x*) that has a finite radius of convergence of *r* can be written as

where *A*(*x*) and *B*(*x*) are functions that are analytic to a radius of convergence greater than *r* (or are entire), and where *B*(*r*) ≠ 0 then

using the Gamma function or a binomial coefficient. Instead, if *G* is an exponential generating function then it is *a*_{n}/*n*! that grows according to these asymptotic formulae.

As derived above, the ordinary generating function for the sequence of squares is

With *r* = 1, α = 0, β = 3, *A*(*x*) = 0, and *B*(*x*) = *x*(*x*+1), we can verify that the squares grow as expected, like the squares:

Main article: Catalan number

The ordinary generating function for the Catalan numbers is

With *r* = 1/4, α = 1, β = −1/2, *A*(*x*) = 1/2, and *B*(*x*) = −1/2, we can conclude that, for the Catalan numbers,

One can define generating functions in several variables for arrays with several indices. These are called **multivariate generating functions** or, sometimes, **super generating functions**. For two variables, these are often called **bivariate generating functions**.

For instance, since is the ordinary generating function for binomial coefficients for a fixed *n*, one may ask for a bivariate generating function that generates the binomial coefficients for all *k* and *n*. To do this, consider as itself a series, in *n*, and find the generating function in *y* that has these as coefficients. Since the generating function for is

the generating function for the binomial coefficients is:

Main article: Examples of generating functions

Generating functions for the sequence of square numbers *a*_{n} = *n*^{2} are:

using the Riemann zeta function.

The sequence *a _{n}* generated by a Dirichlet series generating function corresponding to:

where is the Riemann zeta function, has the ordinary generating function:

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 *r* rows and *c* columns; the row sums are and the column sums are . Then, according to I. J. Good,^{[7]} the number of such tables is the coefficient of

in

Generating functions are used to:

- Find a closed formula for a sequence given in a recurrence relation. For example consider 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.

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

- Appell polynomials
- Chebyshev polynomials
- Difference polynomials
- Generalized Appell polynomials
- Q-difference polynomials

- Moment-generating function
- Probability-generating function
- Stanley's reciprocity theorem
- Applications to partitions
^{[which?]} - Combinatorial principles
- Cyclic sieving

**^**Donald E. Knuth,*The Art of Computer Programming, Volume 1 Fundamental Algorithms (Third Edition)*Addison-Wesley. ISBN 0-201-89683-4. Section 1.2.9: "Generating Functions".**^**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.**^**Flajolet & Sedgewick (2009) p.95**^**Apostol, Tom M. (1976),*Introduction to analytic number theory*, Undergraduate Texts in Mathematics, New York-Heidelberg: Springer-Verlag, ISBN 978-0-387-90163-3, MR 0434929, Zbl 0335.10001 pp.42–43**^**Wilf (1994) p.56**^**Wilf (1994) p.59**^**Good, I. J. (1986). "On applications of symmetric Dirichlet distributions and their mixtures to contingency tables".*Annals of Statistics***4**(6): 1159–1189. doi:10.1214/aos/1176343649.

- Doubilet, Peter; Rota, Gian-Carlo; Stanley, Richard (1972). "On the foundations of combinatorial theory. VI. The idea of generating function".
*Proceedings of the Sixth Berkeley Symposium on Mathematical Statistics and Probability***2**: 267–318. Zbl 0267.05002. Reprinted in Rota, Gian-Carlo (1975). "3. The idea of generating function".*Finite Operator Calculus*. With the collaboration of P. Doubilet, C. Greene, D. Kahaner, A. Odlyzko and R. Stanley. Academic Press. pp. 83–134. ISBN 0-12-596650-4. Zbl 0328.05007. - Flajolet, Philippe; Sedgewick, Robert (2009).
*Analytic Combinatorics*. Cambridge University Press. ISBN 978-0-521-89806-5. Zbl 1165.05001. - Goulden, Ian P.; Jackson, David M. (2004).
*Combinatorial Enumeration*. Dover Publications. ISBN 978-0486435978. - Ronald L. Graham, Donald E. Knuth, Oren Patashnik (1994). "Chapter 7: Generating Functions".
*Concrete Mathematics. A foundation for computer science*(second ed.). Addison-Wesley. pp. 320–380. ISBN 0-201-55802-5. Zbl 0836.00001. - Wilf, Herbert S. (1994).
*Generatingfunctionology*(2nd ed.). Boston, MA: Academic Press. ISBN 0-12-751956-4. Zbl 0831.05001.

- Hazewinkel, Michiel, ed. (2001), "Generating function",
*Encyclopedia of Mathematics*, Springer, ISBN 978-1-55608-010-4 - Generating Functions, Power Indices and Coin Change at cut-the-knot
- "Generating Functions" by Ed Pegg, Jr., Wolfram Demonstrations Project, 2007.