Definitions
Ordinary generating function (OGF)
The ''ordinary generating function'' of a sequence is When the term ''generating function'' is used without qualification, it is usually taken to mean an ordinary generating function. If is the probability mass function of a discrete random variable, then its ordinary generating function is called aExponential generating function (EGF)
The ''exponential generating function'' of a sequence is Exponential generating functions are generally more convenient than ordinary generating functions for combinatorial enumeration problems that involve labelled objects. Another benefit of exponential generating functions is that they are useful in transferring linear recurrence relations to the realm ofPoisson generating function
The ''Poisson generating function'' of a sequence isLambert series
The ''Lambert series'' of a sequence is The Lambert series coefficients in the power series expansions for integers are related by the divisor sum The main article provides several more classical, or at least well-known examples related to special arithmetic functions inBell series
The Bell series of a sequence is an expression in terms of both an indeterminate and a prime and is given byDirichlet 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 is The Dirichlet series generating function is especially useful when is a multiplicative function, in which case it has an Euler product expression in terms of the function's Bell series If is a Dirichlet character then its Dirichlet series generating function is called a Dirichlet -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 if and only if where is the Riemann zeta function.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 where is a sequence of polynomials and is a function of a certain form.Ordinary generating functions
Examples of generating functions 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 , whose ordinary generating function is the geometric series 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 , and checking that the result is the constant power series 1 (in other words, that all coefficients except the one of are equal to 0). Moreover, there can be no other power series with this property. The left-hand side therefore designates theRational functions
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 where the reciprocal roots, , are fixed scalars and where is a polynomial in for all . In general, Hadamard products of rational functions produce rational generating functions. Similarly, if is a bivariate rational generating function, then its corresponding ''diagonal generating function'', is ''algebraic''. For example, if we let then this generating function's diagonal coefficient generating function is given by the well-known OGF formula 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
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) of a sequence with ordinary generating function has the generating function because is the ordinary generating function for the sequence . 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 , we have the following two analogous identities for the modified generating functions enumerating the shifted sequence variants of and , respectively: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: The differentiation–multiplication operation of the second identity can be repeated times to multiply the sequence by , but that requires alternating between differentiation and multiplication. If instead doing differentiations in sequence, the effect is to multiply by the th falling factorial: Using theEnumerating arithmetic progressions of sequences
In this section we give formulas for generating functions enumerating the sequence given an ordinary generating function where , , and (see the main article on transformations). For , this is simply the familiar decomposition of a function into even and odd parts (i.e., even and odd powers): More generally, suppose that and that denotes the th primitive root of unity. Then, as an application of the-recursive sequences and holonomic generating functions
Definitions
A formal power series (or function) is said to be holonomic if it satisfies a linear differential equation of the form where the coefficients are in the field of rational functions, . Equivalently, is holonomic if the vector space over 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, are polynomials in . Thus we can see an equivalent condition that a generating function is holonomic if its coefficients satisfy a -recurrence of the form for all large enough and where the are fixed finite-degree polynomials in . In other words, the properties that a sequence be ''-recursive'' and have a holonomic generating function are equivalent. Holonomic functions are closed under the Hadamard product operation on generating functions.Examples
The functions , , , , , the dilogarithm function , the generalized hypergeometric functions and the functions defined by the power series and the non-convergent are all holonomic. Examples of -recursive sequences with holonomic generating functions include and , where sequences such as and are ''not'' -recursive due to the nature of singularities in their corresponding generating functions. Similarly, functions with infinitely many singularities such as , , and are ''not'' holonomic functions.Software for working with '-recursive sequences and holonomic generating functions
Tools for processing and working with -recursive sequences in ''Guess
package for guessing ''-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 -recurrences involving generalized harmonic numbers. Other packages listed on this particular RISC site are targeted at working with holonomic ''generating functions'' specifically.
Relation to discrete-time Fourier transform
When the seriesAsymptotic 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 that has a finite radius of convergence of can be written as where each of and is a function that is analytic to a radius of convergence greater than (or is entire), and where then using theAsymptotic growth of the sequence of squares
As derived above, the ordinary generating function for the sequence of squares is With , , , , and , we can verify that the squares grow as expected, like the squares:Asymptotic growth of the Catalan numbers
The ordinary generating function for the Catalan numbers is With , , , , and , we can conclude that, for the Catalan numbers,Bivariate and multivariate generating functions
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 , one may ask for a bivariate generating function that generates the binomial coefficients for all and . To do this, consider itself as a sequence in , and find the generating function in that has these sequence values as coefficients. Since the generating function for is the generating function for the binomial coefficients is:Representation by continued fractions (Jacobi-type '-fractions)
Definitions
Expansions of (formal) ''Jacobi-type'' and ''Stieltjes-type'' continued fractions (''-fractions'' and ''-fractions'', respectively) whose th rational convergents represent -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 (-fractions) are expanded as in the following equation and have the next corresponding power series expansions with respect to for some specific, application-dependent component sequences, and , where denotes the formal variable in the second power series expansion given below: The coefficients of , denoted in shorthand by , in the previous equations correspond to matrix solutions of the equations where , for , if , and where for all integers , we have an ''addition formula'' relation given byProperties of the 'th convergent functions
For (though in practice when ), we can define the rational th convergents to the infinite -fraction, , expanded by component-wise through the sequences, and , defined recursively by Moreover, the rationality of the convergent function for all implies additional finite difference equations and congruence properties satisfied by the sequence of , ''and'' for if then we have the congruence for non-symbolic, determinate choices of the parameter sequences and when , that is, when these sequences do not implicitly depend on an auxiliary parameter such as , , or 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) in several special cases of the prescribed sequences, , generated by the general expansions of the -fractions defined in the first subsection. Here we define and the parameters , and to be indeterminates with respect to these expansions, where the prescribed sequences enumerated by the expansions of these -fractions are defined in terms of the -Pochhammer symbol, Pochhammer symbol, and the binomial coefficients. : The radii of convergence of these series corresponding to the definition of the Jacobi-type -fractions given above are in general different from that of the corresponding power series expansions defining the ordinary generating functions of these sequences.Examples
Generating functions for the sequence ofOrdinary generating function
Exponential generating function
Lambert series
As an example of a Lambert series identity not given in the main article, we can show that for we have that where we have the special case identity for the generating function of the divisor function, , given byBell series
Dirichlet series generating function
using the Riemann zeta function. The sequence generated by a Dirichlet series generating function (DGF) corresponding to: where is the Riemann zeta function, has the ordinary generating function:Multivariate generating functions
Multivariate generating functions arise in practice when calculating the number ofApplications
Various techniques: Evaluating sums and tackling other problems with generating functions
Example 1: A 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 . We then know that for the corresponding ordinary generating functions. For example, we can manipulate where are the harmonic numbers. Let be the ordinary generating function of the harmonic numbers. Then and thus Using convolution with the numerator yields which can also be written asExample 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 we define the two sequences of sums for all , 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 Since the generating function for the sequence is given by we may write the generating function for the second sum defined above in the form In particular, we may write this modified sum generating function in the form of for , , , and , where . Finally, it follows that we may express the second sums through the first sums in the following form: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 ) to tile a 3-by- rectangle with unmarked 2-by-1 domino pieces. Let the auxiliary sequence, , be defined as the number of ways to cover a 3-by- rectangle-minus-corner section of the full rectangle. We seek to use these definitions to give a closed form formula for 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 If we consider the possible configurations that can be given starting from the left edge of the 3-by- rectangle, we are able to express the following mutually dependent, or ''mutually recursive'', recurrence relations for our two sequences when defined as above where , , , and : Since we have that for all integers , the index-shifted generating functions satisfy 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 which then implies by solving the system of equations (and this is the particular trick to our method here) that 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 and that for all integers . We also note that the same shifted generating function technique applied to the second-orderConvolution (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). #Consider and are ordinary generating functions. #Consider and are exponential generating functions. #Consider the triply convolved sequence resulting from the product of three ordinary generating functions #Consider the -fold convolution of a sequence with itself for some positive integer (see the example below for an application) 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 is denoted by , then we can show that for any two random variables if and are independent. Similarly, the number of ways to pay cents in coin denominations of values in the set (i.e., in pennies, nickels, dimes, quarters, and half dollars, respectively) is generated by the product and moreover, if we allow the 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 -Pochhammer symbol product ofExample: The 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, . In particular, this sequence has the combinatorial interpretation as being the number of ways to insert parentheses into the product so that the order of multiplication is completely specified. For example, which corresponds to the two expressions and . It follows that the sequence satisfies a recurrence relation given by and so has a corresponding convolved generating function, , satisfying Since , we then arrive at a formula for this generating function given by Note that the first equation implicitly defining above implies that 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 '' is defined to be a graph on the vertices with edges connected according to the following rules: Vertex 0 is connected by a single edge to each of the other vertices, and vertex is connected by a single edge to the next vertex for all . There is one fan of order one, three fans of order two, eight fans of order three, and so on. AImplicit generating functions and the Lagrange inversion formula
Introducing a free parameter (snake oil method)
Sometimes the sum 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 as limit in the summation. When n does not appear explicitly in the summation, we may consider as a “free” parameter and treat as a coefficient of , change the order of the summations on and , and try to compute the inner sum. For example, if we want to compute we can treat as a "free" parameter, and set Interchanging summation (“snake oil”) gives Now the inner sum is . Thus Then we obtain It is instructive to use the same method again for the sum, but this time take as the free parameter instead of . We thus set Interchanging summation ("snake oil") gives Now the inner sum is . Thus Thus we obtain for as before.Generating functions prove congruences
We say that two generating functions (power series) are congruent modulo , written if their coefficients are congruent modulo for all , i.e., for all relevant cases of the integers (note that we need not assume that is an integer here—it may very well be polynomial-valued in some indeterminate , for example). If the "simpler" right-hand-side generating function, , is a rational function of , then the form of this sequence suggests that the sequence is eventually periodic modulo fixed particular cases of integer-valued . For example, we can prove that theThe Stirling numbers modulo small integers
The main article on the Stirling numbers generated by the finite products 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 which implies that the parity of these Stirling numbers matches that of the binomial coefficient and consequently shows that is even whenever . Similarly, we can reduce the right-hand-side products defining the Stirling number generating functions modulo 3 to obtain slightly more complicated expressions providing thatCongruences 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 is generated by the reciprocal infinite -Pochhammer symbol product (or -Pochhammer product as the case may be) given by 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: 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 all of the coefficients are divisible by 5 except for those which correspond to the powers and moreover in those cases the remainder of the coefficient is 1 modulo 5. Thus, or equivalently It follows that Using the infinite product expansions of it can be shown that the coefficient of in is divisible by 5 for all . Finally, since we may equate the coefficients of in the previous equations to prove our desired congruence result, namely that for all .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 in the form of involving the original sequence generating function. For example, if the sums are then the generating function for the modified sum expressions is given by (see also the binomial transform and the Stirling transform). There are also integral formulas for converting between a sequence's OGF, , and its exponential generating function, or EGF, , and vice versa given by provided that these integrals converge for appropriate values of .Other applications
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 inOther generating functions
Examples
Examples of polynomial sequences generated by more complex generating functions include: *Convolution polynomials
Knuth's article titled "''Convolution Polynomials''" defines a generalized class of ''convolution polynomial'' sequences by their special generating functions of the form for some analytic function with a power series expansion such that . We say that a family of polynomials, , forms a ''convolution family'' if and if the following convolution condition holds for all , and for all : 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: * The sequence is of binomial type * Special values of the sequence include and , and * For arbitrary (fixed) , these polynomials satisfy convolution formulas of the form For a fixed non-zero parameter , we have modified generating functions for these convolution polynomial sequences given by where is implicitly defined by a functional equation of the form . Moreover, we can use matrix methods (as in the reference) to prove that given two convolution polynomial sequences, and , with respective corresponding generating functions, and , then for arbitrary we have the identity Examples of convolution polynomial sequences include the ''binomial power series'', , so-termed ''tree polynomials'', the Bell numbers, , the Laguerre polynomials, and the Stirling convolution polynomials.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.See also the ''1031 Generating Functions'' found in :History
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.''
See also
* Moment-generating function *Notes
References
Citations
* * Reprinted in * * * * *External links