Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Generating function
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Formal power series; coefficients encode information about a sequence indexed by natural numbers}} {{About|generating functions in mathematics|generating functions in classical mechanics|Generating function (physics)|generators in computer programming|Generator (computer programming)|the moment generating function in statistics|Moment generating function}} In [[mathematics]], a '''generating function''' is a representation of an [[infinite sequence]] of numbers as the [[coefficient]]s of a [[formal power series]]. Generating functions are often expressed in [[Closed-form expression|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''',<ref>This alternative term can already be found in E.N. Gilbert (1956), "Enumeration of Labeled graphs", ''[[Canadian Journal of Mathematics]]'' 3, [https://books.google.com/books?id=x34z99fCRbsC&dq=%22generating+series%22&pg=PA407 p. 405–411], but its use is rare before the year 2000; since then it appears to be increasing.</ref> 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.<ref>{{cite book |last=Knuth |first=Donald E. |author-link=Donald Knuth |title=Fundamental Algorithms |publisher=Addison-Wesley |year=1997 |isbn=0-201-89683-4 |edition=3rd |series=[[The Art of Computer Programming]] |volume=1 |chapter=§1.2.9 Generating Functions}}</ref> [[George Pólya]] writes in ''[[Mathematics and plausible reasoning]]'': <blockquote>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 [[Number theory|Theory of Numbers]].</blockquote> ==Definition== {{block quote | text = A generating function is a device somewhat similar to a bag. Instead of carrying many little objects detachedly, which could be embarrassing, we put them all in a bag, and then we have only one object to carry, the bag. | author = [[George Pólya]] | source = ''[[Mathematics and plausible reasoning]]'' (1954) }} {{block quote | text = A generating function is a clothesline on which we hang up a sequence of numbers for display. | author = [[Herbert Wilf]] | source = ''[http://www.math.upenn.edu/~wilf/DownldGF.html Generatingfunctionology]'' (1994)}} ===Convergence=== Unlike an ordinary series, the ''formal'' [[power series]] is not required to [[Convergent series|converge]]: in fact, the generating function is not actually regarded as a [[Function (mathematics)|function]], and the "variable" remains an [[Indeterminate (variable)|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 of a function|domain]] to a [[codomain]]. These expressions in terms of the indeterminate {{mvar|x}} may involve arithmetic operations, differentiation with respect to {{mvar|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 {{mvar|x}}. Indeed, the closed form expression can often be interpreted as a function that can be evaluated at (sufficiently small) concrete values of {{mvar|x}}, 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 {{mvar|x}}. ===Limitations=== Not all expressions that are meaningful as functions of {{mvar|x}} are meaningful as expressions designating formal series; for example, negative and fractional powers of {{mvar|x}} 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 {{math|''a''<sub>''n''</sub>}} is: <math display="block">G(a_n;x)=\sum_{n=0}^\infty a_n x^n.</math> If {{math|''a''<sub>''n''</sub>}} 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 {{math|''a''<sub>''n''</sub>}} is <math display="block">\operatorname{EG}(a_n;x)=\sum_{n=0}^\infty a_n \frac{x^n}{n!}.</math> Exponential generating functions are generally more convenient than ordinary generating functions for [[combinatorial enumeration]] problems that involve labelled objects.<ref>{{harvnb|Flajolet|Sedgewick|2009|p=95}}</ref> 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]] {{math|{''f<sub>n</sub>''}<nowiki/>}} that satisfies the linear recurrence relation {{math|''f''<sub>''n''+2</sub> {{=}} ''f''<sub>''n''+1</sub> + ''f''<sub>''n''</sub>}}. The corresponding exponential generating function has the form <math display="block">\operatorname{EF}(x) = \sum_{n=0}^\infty \frac{f_n}{n!} x^n</math> and its derivatives can readily be shown to satisfy the differential equation {{math|EF{{pprime}}(''x'') {{=}} EF{{prime}}(''x'') + EF(''x'')}} as a direct analogue with the recurrence relation above. In this view, the factorial term {{math|''n''!}} is merely a counter-term to normalise the derivative operator acting on {{math|''x''<sup>''n''</sup>}}. ===Poisson generating function=== The ''Poisson generating function'' of a sequence {{math|''a''<sub>''n''</sub>}} is <math display="block">\operatorname{PG}(a_n;x)=\sum _{n=0}^\infty a_n e^{-x} \frac{x^n}{n!} = e^{-x}\, \operatorname{EG}(a_n;x).</math> ===Lambert series=== {{main article|Lambert series}} The ''Lambert series'' of a sequence {{math|''a''<sub>''n''</sub>}} is <math display="block">\operatorname{LG}(a_n;x)=\sum _{n=1}^\infty a_n \frac{x^n}{1-x^n}.</math>Note that in a Lambert series the index {{mvar|n}} starts at 1, not at 0, as the first term would otherwise be undefined. The Lambert series coefficients in the power series expansions <math display="block">b_n := [x^n] \operatorname{LG}(a_n;x)</math>for integers {{math|''n'' ≥ 1}} are related by the [[Divisor sum identities|divisor sum]] <math display="block">b_n = \sum_{d|n} a_d.</math>The [[Lambert series|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 {{math|{{abs|''x''}}, {{abs|''xq''}} < 1}} we have that <ref>{{cite web |date=2017 |title=Lambert series identity |url=https://mathoverflow.net/q/140418 |website=Math Overflow}}</ref><math display="block">\sum_{n = 1}^\infty \frac{q^n x^n}{1-x^n} = \sum_{n = 1}^\infty \frac{q^n x^{n^2}}{1-q x^n} + \sum_{n = 1}^\infty \frac{q^n x^{n(n+1)}}{1-x^n}, </math> where we have the special case identity for the generating function of the [[divisor function]], {{math|''d''(''n'') ≡ ''σ''<sub>0</sub>(''n'')}}, given by<math display="block">\sum_{n = 1}^\infty \frac{x^n}{1-x^n} = \sum_{n = 1}^\infty \frac{x^{n^2} \left(1+x^n\right)}{1-x^n}. </math> ===Bell series=== The [[Bell series]] of a sequence {{math|''a''<sub>''n''</sub>}} is an expression in terms of both an indeterminate {{mvar|x}} and a prime {{mvar|p}} and is given by:<ref>{{Apostol IANT}} pp.42–43</ref> <math display="block">\operatorname{BG}_p(a_n;x) = \sum_{n=0}^\infty a_{p^n}x^n.</math> ===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 {{math|''a''<sub>''n''</sub>}} is:<ref name="W56">{{harvnb|Wilf|1994|p=56}}</ref> <math display="block">\operatorname{DG}(a_n;s)=\sum _{n=1}^\infty \frac{a_n}{n^s}.</math> The Dirichlet series generating function is especially useful when {{math|''a''<sub>''n''</sub>}} is a [[multiplicative function]], in which case it has an [[Euler product]] expression<ref name="W59">{{harvnb|Wilf|1994|p=59}}</ref> in terms of the function's Bell series: <math display="block">\operatorname{DG}(a_n;s)=\prod_{p} \operatorname{BG}_p(a_n;p^{-s})\,.</math> If {{math|''a''<sub>''n''</sub>}} is a [[Dirichlet character]] then its Dirichlet series generating function is called a [[Dirichlet L-series|Dirichlet {{mvar|L}}-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: <math display="block">[x^n] \operatorname{LG}(a_n; x) = b_n</math>if and only if <math display="block">\operatorname{DG}(a_n;s) \zeta(s) = \operatorname{DG}(b_n;s),</math>where {{math|''ζ''(''s'')}} is the [[Riemann zeta function]].<ref>{{cite book |last1=Hardy |first1=G.H. |last2=Wright |first2=E.M. |last3=Heath-Brown |first3=D.R |last4=Silverman |first4=J.H. |title=An Introduction to the Theory of Numbers|url=https://archive.org/details/introductiontoth00ghha_922|url-access=limited|publisher=Oxford University Press |page=[https://archive.org/details/introductiontoth00ghha_922/page/n357 339]|edition=6th |isbn=9780199219858 |year=2008}}</ref> The sequence {{mvar|a<sub>k</sub>}} generated by a [[Dirichlet series]] generating function (DGF) corresponding to:<math display="block">\operatorname{DG}(a_k;s)=\zeta(s)^m</math>has the ordinary generating function:<math display="block">\sum_{k=1}^{k=n} a_k x^k = x + \binom{m}{1} \sum_{2 \leq a \leq n} x^{a} + \binom{m}{2}\underset{ab \leq n}{\sum_{a = 2}^\infty \sum_{b = 2}^\infty} x^{ab} + \binom{m}{3}\underset{abc \leq n}{\sum_{a = 2}^\infty \sum_{c = 2}^\infty \sum_{b = 2}^\infty} x^{abc} + \binom{m}{4}\underset{abcd \leq n}{\sum_{a = 2}^\infty \sum_{b = 2}^\infty \sum_{c = 2}^\infty \sum_{d = 2}^\infty} x^{abcd} + \cdots</math> ===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: <math display="block">e^{xf(t)}=\sum_{n=0}^\infty \frac{p_n(x)}{n!} t^n</math>where {{math|''p''<sub>''n''</sub>(''x'')}} is a sequence of polynomials and {{math|''f''(''t'')}} is a function of a certain form. [[Sheffer sequence]]s are generated in a similar way. See the main article [[generalized Appell polynomials]] for more information. Examples of [[polynomial sequence]]s generated by more complex generating functions include: * [[Appell polynomials]] * [[Chebyshev polynomials]] * [[Difference polynomials]] * [[Generalized Appell polynomials]] * [[Q-difference polynomial|{{mvar|q}}-difference polynomials]] === Other generating functions === Other sequences generated by more complex generating functions include: * Double exponential generating functions e.g. the [[Bell numbers#Generating function|Bell numbers]] * Hadamard products of generating functions and diagonal generating functions, and their corresponding [[generating function transformation#Hadamard products and diagonal generating functions|integral transformations]] ==== Convolution polynomials ==== Knuth's article titled "''Convolution Polynomials''"<ref>{{cite journal |last1=Knuth |first1=D. E. |date=1992 |title=Convolution Polynomials |journal=Mathematica J. |volume=2 |pages=67–78 |arxiv=math/9207221 |bibcode=1992math......7221K}}</ref> defines a generalized class of ''convolution polynomial'' sequences by their special generating functions of the form <math display="block">F(z)^x = \exp\bigl(x \log F(z)\bigr) = \sum_{n = 0}^\infty f_n(x) z^n,</math> for some analytic function {{mvar|F}} with a power series expansion such that {{math|''F''(0) {{=}} 1}}. We say that a family of polynomials, {{math|''f''<sub>0</sub>, ''f''<sub>1</sub>, ''f''<sub>2</sub>, ...}}, forms a ''convolution family'' if {{math|[[Degree of a polynomial|deg]] ''f<sub>n</sub>'' ≤ ''n''}} and if the following convolution condition holds for all {{mvar|x}}, {{mvar|y}} and for all {{math|''n'' ≥ 0}}: <math display="block">f_n(x+y) = f_n(x) f_0(y) + f_{n-1}(x) f_1(y) + \cdots + f_1(x) f_{n-1}(y) + f_0(x) f_n(y). </math> 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 {{math|''n''! · ''f<sub>n</sub>''(''x'')}} is of [[binomial type]] * Special values of the sequence include {{math|''f<sub>n</sub>''(1) {{=}} [''z<sup>n</sup>''] ''F''(''z'')}} and {{math|''f<sub>n</sub>''(0) {{=}} ''δ''<sub>''n'',0</sub>}}, and * For arbitrary (fixed) <math>x, y, t \isin \mathbb{C}</math>, these polynomials satisfy convolution formulas of the form <math display="block">\begin{align} f_n(x+y) & = \sum_{k=0}^n f_k(x) f_{n-k}(y) \\ f_n(2x) & = \sum_{k=0}^n f_k(x) f_{n-k}(x) \\ xn f_n(x+y) & = (x+y) \sum_{k=0}^n k f_k(x) f_{n-k}(y) \\ \frac{(x+y) f_n(x+y+tn)}{x+y+tn} & = \sum_{k=0}^n \frac{x f_k(x+tk)}{x+tk} \frac{y f_{n-k}(y+t(n-k))}{y+t(n-k)}. \end{align}</math> For a fixed non-zero parameter <math>t \isin \mathbb{C}</math>, we have modified generating functions for these convolution polynomial sequences given by <math display="block">\frac{z F_n(x+tn)}{(x+tn)} = \left[z^n\right] \mathcal{F}_t(z)^x, </math> where {{math|𝓕<sub>''t''</sub>(''z'')}} is implicitly defined by a [[functional equation]] of the form {{math|𝓕<sub>''t''</sub>(''z'') {{=}} ''F''(''x''𝓕<sub>''t''</sub>(''z'')<sup>''t''</sup>)}}. Moreover, we can use matrix methods (as in the reference) to prove that given two convolution polynomial sequences, {{math|⟨ ''f<sub>n</sub>''(''x'') ⟩}} and {{math|⟨ ''g<sub>n</sub>''(''x'') ⟩}}, with respective corresponding generating functions, {{math|''F''(''z'')<sup>''x''</sup>}} and {{math|''G''(''z'')<sup>''x''</sup>}}, then for arbitrary {{mvar|t}} we have the identity <math display="block">\left[z^n\right] \left(G(z) F\left(z G(z)^t\right)\right)^x = \sum_{k=0}^n F_k(x) G_{n-k}(x+tk). </math> Examples of convolution polynomial sequences include the ''binomial power series'', {{math|𝓑<sub>''t''</sub>(''z'') {{=}} 1 + ''z''𝓑<sub>''t''</sub>(''z'')<sup>''t''</sup>}}, so-termed ''tree polynomials'', the [[Bell numbers]], {{math|''B''(''n'')}}, the [[Laguerre polynomials]], and the [[Stirling polynomial|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 {{nowrap|1, 1, 1, 1, 1, 1, 1, 1, 1, ...}}, whose ordinary generating function is the [[Geometric_series#Closed-form_formula|geometric series]] <math display="block">\sum_{n=0}^\infty x^n= \frac{1}{1-x}.</math> 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 {{math|1 − ''x''}}, and checking that the result is the constant power series 1 (in other words, that all coefficients except the one of {{math|''x''<sup>0</sup>}} 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 {{math|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 {{math|''x'' → ''ax''}} gives the generating function for the [[Geometric progression|geometric sequence]] {{math|1, ''a'', ''a''<sup>2</sup>, ''a''<sup>3</sup>, ...}} for any constant {{mvar|a}}: <math display="block">\sum_{n=0}^\infty(ax)^n= \frac{1}{1-ax}.</math> (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, <math display="block">\sum_{n=0}^\infty(-1)^nx^n= \frac{1}{1+x}.</math> One can also introduce regular gaps in the sequence by replacing {{mvar|x}} by some power of {{mvar|x}}, so for instance for the sequence {{nowrap|1, 0, 1, 0, 1, 0, 1, 0, ...}} (which skips over {{math|''x'', ''x''<sup>3</sup>, ''x''<sup>5</sup>, ...}}) one gets the generating function <math display="block">\sum_{n=0}^\infty x^{2n} = \frac{1}{1-x^2}.</math> By squaring the initial generating function, or by finding the derivative of both sides with respect to {{mvar|x}} and making a change of running variable {{math|''n'' → ''n'' + 1}}, one sees that the coefficients form the sequence {{nowrap|1, 2, 3, 4, 5, ...}}, so one has <math display="block">\sum_{n=0}^\infty(n+1)x^n= \frac{1}{(1-x)^2},</math> and the third power has as coefficients the [[triangular number]]s {{nowrap|1, 3, 6, 10, 15, 21, ...}} whose term {{mvar|n}} is the [[binomial coefficient]] {{math|{{pars|s=150%|{{su|p=''n'' + 2|b=2|a=c}}}}}}, so that <math display="block">\sum_{n=0}^\infty\binom{n+2}2 x^n= \frac{1}{(1-x)^3}.</math> More generally, for any non-negative integer {{mvar|k}} and non-zero real value {{mvar|a}}, it is true that <math display="block">\sum_{n=0}^\infty a^n\binom{n+k}k x^n= \frac{1}{(1-ax)^{k+1}}\,.</math> Since <math display="block">2\binom{n+2}2 - 3\binom{n+1}1 + \binom{n}0 = 2\frac{(n+1)(n+2)}2 -3(n+1) + 1 = n^2,</math> one can find the ordinary generating function for the sequence {{nowrap|0, 1, 4, 9, 16, ...}} of [[square number]]s by linear combination of binomial-coefficient generating sequences: <math display="block">G(n^2;x) = \sum_{n=0}^\infty n^2x^n = \frac{2}{(1-x)^3} - \frac{3}{(1-x)^2} + \frac{1}{1-x} = \frac{x(x+1)}{(1-x)^3}.</math> 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: <math display="block">\begin{align} G(n^2;x) & = \sum_{n=0}^\infty n^2x^n \\[4px] & = \sum_{n=0}^\infty n(n-1) x^n + \sum_{n=0}^\infty n x^n \\[4px] & = x^2 D^2\left[\frac{1}{1-x}\right] + x D\left[\frac{1}{1-x}\right] \\[4px] & = \frac{2 x^2}{(1-x)^3} + \frac{x}{(1-x)^2} =\frac{x(x+1)}{(1-x)^3}. \end{align}</math> By induction, we can similarly show for positive integers {{math|''m'' ≥ 1}} that<ref>{{cite journal|first1= Michael Z. | last1=Spivey | title=Combinatorial Sums and Finite Differences | year=2007 |journal = Discrete Math. |doi = 10.1016/j.disc.2007.03.052 | volume=307|number=24|pages=3130–3146|mr=2370116|doi-access=free }}</ref><ref>{{cite arXiv|first1=R. J. |last1=Mathar|year=2012|eprint=1207.5845|title=Yet another table of integrals|class=math.CA}} v4 eq. (0.4)</ref> <math display="block">n^m = \sum_{j=0}^m \begin{Bmatrix} m \\ j \end{Bmatrix} \frac{n!}{(n-j)!}, </math> where {{math|{{resize|150%|{}}{{su|p=''n''|b=''k''}}{{resize|150%|}<nowiki/>}}}} denote the [[Stirling numbers of the second kind]] and where the generating function <math display="block">\sum_{n = 0}^\infty \frac{n!}{ (n-j)!} \, z^n = \frac{j! \cdot z^j}{(1-z)^{j+1}},</math> so that we can form the analogous generating functions over the integral {{mvar|m}}th powers generalizing the result in the square case above. In particular, since we can write <math display="block">\frac{z^k}{(1-z)^{k+1}} = \sum_{i=0}^k \binom{k}{i} \frac{(-1)^{k-i}}{(1-z)^{i+1}},</math> we can apply a well-known finite sum identity involving the [[Stirling numbers]] to obtain that<ref>{{harvnb|Graham|Knuth|Patashnik|1994|loc=Table 265 in §6.1}} for finite sum identities involving the Stirling number triangles.</ref> <math display="block">\sum_{n = 0}^\infty n^m z^n = \sum_{j=0}^m \begin{Bmatrix} m+1 \\ j+1 \end{Bmatrix} \frac{(-1)^{m-j} j!}{(1-z)^{j+1}}. </math> === Rational functions === {{Main|Linear recursive sequence}} 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 <ref name="GFLECT">{{harvnb|Lando|2003|loc=§2.4}}</ref> <math display="block">f_n = p_1(n) \rho_1^n + \cdots + p_\ell(n) \rho_\ell^n, </math> where the reciprocal roots, <math>\rho_i \isin \mathbb{C}</math>, are fixed scalars and where {{math|''p''<sub>''i''</sub>(''n'')}} is a polynomial in {{mvar|n}} for all {{math|1 ≤ ''i'' ≤ ''ℓ''}}. In general, [[Generating function transformation#Hadamard products and diagonal generating functions|Hadamard products]] of rational functions produce rational generating functions. Similarly, if <math display="block">F(s, t) := \sum_{m,n \geq 0} f(m, n) w^m z^n</math> is a bivariate rational generating function, then its corresponding ''diagonal generating function'', <math display="block">\operatorname{diag}(F) := \sum_{n = 0}^\infty f(n, n) z^n,</math> is ''algebraic''. For example, if we let<ref>Example from {{cite book |chapter=§6.3 |first1=Richard P. |last1=Stanley |first2=Sergey |last2=Fomin |title=Enumerative Combinatorics: Volume 2 |url=https://books.google.com/books?id=zg5wDqT6T-UC |year=1997 |publisher=Cambridge University Press |isbn=978-0-521-78987-5 |series=Cambridge Studies in Advanced Mathematics |volume=62}}</ref> <math display="block">F(s, t) := \sum_{i,j \geq 0} \binom{i+j}{i} s^i t^j = \frac{1}{1-s-t}, </math> then this generating function's diagonal coefficient generating function is given by the well-known OGF formula <math display="block">\operatorname{diag}(F) = \sum_{n = 0}^\infty \binom{2n}{n} z^n = \frac{1}{\sqrt{1-4z}}. </math> This result is computed in many ways, including [[Cauchy's integral formula]] or [[contour integration]], taking complex [[residue (complex analysis)|residue]]s, or by direct manipulations of [[formal power series]] in two variables. === Operations on generating functions === ==== Multiplication yields convolution ==== {{Main|Cauchy product}} 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]]) <math display="block">(a_0, a_0 + a_1, a_0 + a_1 + a_2, \ldots)</math> of a sequence with ordinary generating function {{math|''G''(''a<sub>n</sub>''; ''x'')}} has the generating function <math display="block">G(a_n; x) \cdot \frac{1}{1-x}</math> because {{math|{{sfrac|1|1 − ''x''}}}} is the ordinary generating function for the sequence {{nowrap|(1, 1, ...)}}. See also the [[#Convolution (Cauchy products)|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 {{math|''m'' ≥ 1}}, we have the following two analogous identities for the modified generating functions enumerating the shifted sequence variants of {{math|⟨ ''g''<sub>''n'' − ''m''</sub> ⟩}} and {{math|⟨ ''g''<sub>''n'' + ''m''</sub> ⟩}}, respectively: <math display="block">\begin{align} & z^m G(z) = \sum_{n = m}^\infty g_{n-m} z^n \\[4px] & \frac{G(z) - g_0 - g_1 z - \cdots - g_{m-1} z^{m-1}}{z^m} = \sum_{n = 0}^\infty g_{n+m} z^n. \end{align}</math> ==== 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: <math display="block">\begin{align} G'(z) & = \sum_{n = 0}^\infty (n+1) g_{n+1} z^n \\[4px] z \cdot G'(z) & = \sum_{n = 0}^\infty n g_{n} z^n \\[4px] \int_0^z G(t) \, dt & = \sum_{n = 1}^\infty \frac{g_{n-1}}{n} z^n. \end{align}</math> The differentiation–multiplication operation of the second identity can be repeated {{mvar|k}} times to multiply the sequence by {{math|''n''<sup>''k''</sup>}}, but that requires alternating between differentiation and multiplication. If instead doing {{mvar|k}} differentiations in sequence, the effect is to multiply by the {{mvar|k}}th [[falling factorial]]: <math display="block"> z^k G^{(k)}(z) = \sum_{n = 0}^\infty n^\underline{k} g_n z^n = \sum_{n = 0}^\infty n (n-1) \dotsb (n-k+1) g_n z^n \quad\text{for all } k \in \mathbb{N}. </math> Using the [[Stirling numbers of the second kind]], that can be turned into another formula for multiplying by <math>n^k</math> as follows (see the main article on [[Generating function transformation#Derivative transformations|generating function transformations]]): <math display="block"> \sum_{j=0}^k \begin{Bmatrix} k \\ j \end{Bmatrix} z^j F^{(j)}(z) = \sum_{n = 0}^\infty n^k f_n z^n \quad\text{for all } k \in \mathbb{N}. </math> A negative-order reversal of this sequence powers formula corresponding to the operation of repeated integration is defined by the [[Generating function transformation#Derivative transformations|zeta series transformation]] and its generalizations defined as a derivative-based [[generating function transformation|transformation of generating functions]], or alternately termwise by and performing an [[Generating function transformation#Polylogarithm series transformations|integral transformation]] on the sequence generating function. Related operations of performing [[fractional calculus|fractional integration]] on a sequence generating function are discussed [[Generating function transformation#Fractional integrals and derivatives|here]]. ==== Enumerating arithmetic progressions of sequences ==== In this section we give formulas for generating functions enumerating the sequence {{math|{''f''<sub>''an'' + ''b''</sub>}<nowiki/>}} given an ordinary generating function {{math|''F''(''z'')}}, where {{math|''a'' ≥ 2}}, {{math|0 ≤ ''b'' < ''a''}}, and {{math|''a''}} and {{math|''b''}} are integers (see the [[generating function transformation|main article on transformations]]). For {{math|''a'' {{=}} 2}}, this is simply the familiar decomposition of a function into [[even and odd functions|even and odd parts]] (i.e., even and odd powers): <math display="block">\begin{align} \sum_{n = 0}^\infty f_{2n} z^{2n} &= \frac{F(z) + F(-z)}{2} \\[4px] \sum_{n = 0}^\infty f_{2n+1} z^{2n+1} &= \frac{F(z) - F(-z)}{2}. \end{align}</math> More generally, suppose that {{math|''a'' ≥ 3}} and that {{math|''ω<sub>a</sub>'' {{=}} exp {{sfrac|2''πi''|''a''}}}} denotes the {{mvar|a}}th [[root of unity|primitive root of unity]]. Then, as an application of the [[discrete Fourier transform]], we have the formula<ref name="TAOCPV1">{{harvnb|Knuth|1997|loc=§1.2.9}}</ref> <math display="block">\sum_{n = 0}^\infty f_{an+b} z^{an+b} = \frac{1}{a} \sum_{m=0}^{a-1} \omega_a^{-mb} F\left(\omega_a^m z\right).</math> For integers {{math|''m'' ≥ 1}}, another useful formula providing somewhat ''reversed'' floored arithmetic progressions — effectively repeating each coefficient {{mvar|m}} times — are generated by the identity<ref>Solution to {{harvnb|Graham|Knuth|Patashnik|1994|p=569, exercise 7.36}}</ref> <math display="block">\sum_{n = 0}^\infty f_{\left\lfloor \frac{n}{m} \right\rfloor} z^n = \frac{1-z^m}{1-z} F(z^m) = \left(1 + z + \cdots + z^{m-2} + z^{m-1}\right) F(z^m).</math> ==={{math|''P''}}-recursive sequences and holonomic generating functions=== ====Definitions==== A formal power series (or function) {{math|''F''(''z'')}} is said to be '''holonomic''' if it satisfies a linear differential equation of the form<ref>{{harvnb|Flajolet|Sedgewick|2009|loc=§B.4}}</ref> <math display="block">c_0(z) F^{(r)}(z) + c_1(z) F^{(r-1)}(z) + \cdots + c_r(z) F(z) = 0, </math> where the coefficients {{math|''c<sub>i</sub>''(''z'')}} are in the field of rational functions, <math>\mathbb{C}(z)</math>. Equivalently, <math>F(z)</math> is holonomic if the vector space over <math>\mathbb{C}(z)</math> 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, {{math|''c<sub>i</sub>''(''z'')}} are polynomials in {{mvar|z}}. Thus we can see an equivalent condition that a generating function is holonomic if its coefficients satisfy a '''{{mvar|P}}-recurrence''' of the form <math display="block">\widehat{c}_s(n) f_{n+s} + \widehat{c}_{s-1}(n) f_{n+s-1} + \cdots + \widehat{c}_0(n) f_n = 0,</math> for all large enough {{math|''n'' ≥ ''n''<sub>0</sub>}} and where the {{math|''ĉ<sub>i</sub>''(''n'')}} are fixed finite-degree polynomials in {{mvar|n}}. In other words, the properties that a sequence be ''{{mvar|P}}-recursive'' and have a holonomic generating function are equivalent. Holonomic functions are closed under the [[Generating function transformation#Hadamard products and diagonal generating functions|Hadamard product]] operation {{math|⊙}} on generating functions. ====Examples==== The functions {{math|''e''<sup>''z''</sup>}}, {{math|log ''z''}}, {{math|cos ''z''}}, {{math|arcsin ''z''}}, <math>\sqrt{1 + z}</math>, the [[dilogarithm]] function {{math|Li<sub>2</sub>(''z'')}}, the [[generalized hypergeometric function]]s {{math|''<sub>p</sub>F<sub>q</sub>''(...; ...; ''z'')}} and the functions defined by the power series <math display="block">\sum_{n = 0}^\infty \frac{z^n}{(n!)^2}</math> and the non-convergent <math display="block"> \sum_{n = 0}^\infty n! \cdot z^n </math> are all holonomic. Examples of {{mvar|P}}-recursive sequences with holonomic generating functions include {{math|''f''<sub>''n''</sub> ≔ {{sfrac|1|''n'' + 1}} {{pars|s=150%|{{su|p=2''n''|b=''n''|a=c}}}}}} and {{math|''f''<sub>''n''</sub> ≔ {{sfrac|2<sup>''n''</sup>|''n''<sup>2</sup> + 1}}}}, where sequences such as <math>\sqrt{n}</math> and {{math|log ''n''}} are ''not'' {{mvar|P}}-recursive due to the nature of singularities in their corresponding generating functions. Similarly, functions with infinitely many singularities such as {{math|tan ''z''}}, {{math|sec ''z''}}, and [[Gamma function|{{math|Γ(''z'')}}]] are ''not'' holonomic functions. ====Software for working with ''{{mvar|P}}''-recursive sequences and holonomic generating functions==== Tools for processing and working with {{mvar|P}}-recursive sequences in ''[[Mathematica]]'' include the software packages provided for non-commercial use on the [https://www.risc.jku.at/research/combinat/software/ RISC Combinatorics Group algorithmic combinatorics software] site. Despite being mostly closed-source, particularly powerful tools in this software suite are provided by the <code>'''Guess'''</code> package for guessing ''{{mvar|P}}-recurrences'' for arbitrary input sequences (useful for [[experimental mathematics]] and exploration) and the <code>'''Sigma'''</code> package which is able to find P-recurrences for many sums and solve for closed-form solutions to {{mvar|P}}-recurrences involving generalized [[harmonic number]]s.<ref>{{cite journal|last1=Schneider|first1=C.|title=Symbolic Summation Assists Combinatorics|journal=Sém. Lothar. Combin.|date=2007|volume=56|pages=1–36 |url=http://www.emis.de/journals/SLC/wpapers/s56schneider.html}}</ref> Other packages listed on this particular RISC site are targeted at working with holonomic ''generating functions'' specifically. <!--Depending on how in depth this article gets on the topic, there are many, many other examples of useful software tools that can be listed here or on this page in another section, or most appropriately, on a dedicated webpage of its own.--> === Relation to discrete-time Fourier transform === {{Main|Discrete-time Fourier transform}} When the series [[Absolute convergence|converges absolutely]], <math display="block">G \left ( a_n; e^{-i \omega} \right) = \sum_{n=0}^\infty a_n e^{-i \omega n}</math> is the discrete-time Fourier transform of the sequence {{math|''a''<sub>0</sub>, ''a''<sub>1</sub>, ...}}. === 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 analysis|asymptotic growth]] of the underlying sequence. For instance, if an ordinary generating function {{math|''G''(''a''<sub>''n''</sub>; ''x'')}} that has a finite radius of convergence of {{mvar|r}} can be written as <math display="block">G(a_n; x) = \frac{A(x) + B(x) \left (1- \frac{x}{r} \right )^{-\beta}}{x^\alpha}</math> where each of {{math|''A''(''x'')}} and {{math|''B''(''x'')}} is a function that is [[analytic function|analytic]] to a radius of convergence greater than {{mvar|r}} (or is [[Entire function|entire]]), and where {{math|''B''(''r'') ≠ 0}} then <math display="block">a_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1}\left(\frac{1}{r}\right)^n \sim \frac{B(r)}{r^{\alpha}} \binom{n+\beta-1}{n}\left(\frac{1}{r}\right)^n = \frac{B(r)}{r^\alpha} \left(\!\!\binom{\beta}{n}\!\!\right)\left(\frac{1}{r}\right)^n\,,</math> using the [[gamma function]], a [[binomial coefficient]], or a [[multiset coefficient]]. Note that limit as {{mvar|n}} goes to infinity of the ratio of {{math|''a''{{sub|''n''}}}} to any of these expressions is guaranteed to be 1; not merely that {{math|''a''{{sub|''n''}}}} is proportional to them. Often this approach can be iterated to generate several terms in an asymptotic series for {{math|''a''<sub>''n''</sub>}}. In particular, <math display="block">G\left(a_n - \frac{B(r)}{r^\alpha} \binom{n+\beta-1}{n}\left(\frac{1}{r}\right)^n; x \right) = G(a_n; x) - \frac{B(r)}{r^\alpha} \left(1 - \frac{x}{r}\right)^{-\beta}\,.</math> The asymptotic growth of the coefficients of this generating function can then be sought via the finding of {{mvar|A}}, {{mvar|B}}, {{mvar|α}}, {{mvar|β}}, and {{mvar|r}} to describe the generating function, as above. Similar asymptotic analysis is possible for exponential generating functions; with an exponential generating function, it is {{math|{{sfrac|''a''<sub>''n''</sub>|''n''!}}}} 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: <math display="block">G(n^2; x) = \frac{x(x+1)}{(1-x)^3}.</math> With {{math|1=''r'' = 1}}, {{math|1=''α'' = −1}}, {{math|1=''β'' = 3}}, {{math|1=''A''(''x'') = 0}}, and {{math|1=''B''(''x'') = ''x'' + 1}}, we can verify that the squares grow as expected, like the squares: <math display="block">a_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1} \left (\frac{1}{r} \right)^n = \frac{1+1}{1^{-1}\,\Gamma(3)}\,n^{3-1} \left(\frac1 1\right)^n = n^2.</math> ==== Asymptotic growth of the Catalan numbers ==== {{Main|Catalan number}} The ordinary generating function for the [[Catalan number]]s is <math display="block">G(C_n; x) = \frac{1-\sqrt{1-4x}}{2x}.</math> With {{math|1=''r'' = {{sfrac|1|4}}}}, {{math|1=''α'' = 1}}, {{math|1=''β'' = −{{sfrac|1|2}}}}, {{math|1=''A''(''x'') = {{sfrac|1|2}}}}, and {{math|1=''B''(''x'') = −{{sfrac|1|2}}}}, we can conclude that, for the Catalan numbers: <math display="block">C_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1} \left(\frac{1}{r} \right)^n = \frac{-\frac12}{\left(\frac14\right)^1 \Gamma\left(-\frac12\right)} \, n^{-\frac12-1} \left(\frac{1}{\,\frac14\,}\right)^n = \frac{4^n}{n^\frac32 \sqrt\pi}.</math> === 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 {{math|''a''<sub>''m'',''n''</sub>}} (where {{mvar|n}} and {{mvar|m}} are natural numbers) is: <math display="block">G(a_{m,n};x,y)=\sum_{m,n=0}^\infty a_{m,n} x^m y^n.</math>For instance, since {{math|(1 + ''x'')<sup>''n''</sup>}} is the ordinary generating function for [[binomial coefficients]] for a fixed {{mvar|n}}, one may ask for a bivariate generating function that generates the binomial coefficients {{math|{{pars|s=150%|{{su|p=''n''|b=''k''|a=c}}}}}} for all {{mvar|k}} and {{mvar|n}}. To do this, consider {{math|(1 + ''x'')<sup>''n''</sup>}} itself as a sequence in {{mvar|n}}, and find the generating function in {{mvar|y}} that has these sequence values as coefficients. Since the generating function for {{math|''a''<sup>''n''</sup>}} is: <math display="block">\frac{1}{1-ay},</math>the generating function for the binomial coefficients is: <math display="block">\sum_{n,k} \binom{n}{k} x^k y^n = \frac{1}{1-(1+x)y}=\frac{1}{1-y-xy}.</math>Other examples of such include the following two-variable generating functions for the [[binomial coefficients]], the [[Stirling numbers]], and the [[Eulerian numbers]], where {{math|''ω''}} and {{math|''z''}} denote the two variables:<ref>See the usage of these terms in {{harvnb|Graham|Knuth|Patashnik|1994|loc=§7.4}} on special sequence generating functions.</ref> <math display="block">\begin{align} e^{z+wz} & = \sum_{m,n \geq 0} \binom{n}{m} w^m \frac{z^n}{n!} \\[4px] e^{w(e^z-1)} & = \sum_{m,n \geq 0} \begin{Bmatrix} n \\ m \end{Bmatrix} w^m \frac{z^n}{n!} \\[4px] \frac{1}{(1-z)^w} & = \sum_{m,n \geq 0} \begin{bmatrix} n \\ m \end{bmatrix} w^m \frac{z^n}{n!} \\[4px] \frac{1-w}{e^{(w-1)z}-w} & = \sum_{m,n \geq 0} \left\langle\begin{matrix} n \\ m \end{matrix} \right\rangle w^m \frac{z^n}{n!} \\[4px] \frac{e^w-e^z}{w e^z-z e^w} &= \sum_{m,n \geq 0} \left\langle\begin{matrix} m+n+1 \\ m \end{matrix} \right\rangle \frac{w^m z^n}{(m+n+1)!}. \end{align}</math> ==== 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 {{mvar|r}} rows and {{mvar|c}} columns; the row sums are {{math|''t''<sub>1</sub>, ''t''<sub>2</sub> ... ''t<sub>r</sub>''}} and the column sums are {{math|''s''<sub>1</sub>, ''s''<sub>2</sub> ... ''s<sub>c</sub>''}}. Then, according to [[I. J. Good]],<ref name="Good 1986">{{cite journal |last=Good |first=I. J. |year=1986 |title=On applications of symmetric Dirichlet distributions and their mixtures to contingency tables |journal=[[Annals of Statistics]] |volume=4 |issue=6 |pages=1159–1189 |doi=10.1214/aos/1176343649 |doi-access=free}}</ref> the number of such tables is the coefficient of: <math display="block">x_1^{t_1}\cdots x_r^{t_r}y_1^{s_1}\cdots y_c^{s_c}</math>in:<math display="block">\prod_{i=1}^{r}\prod_{j=1}^c\frac{1}{1-x_iy_j}.</math> === Representation by continued fractions (Jacobi-type ''{{mvar|J}}''-fractions) === ==== Definitions ==== Expansions of (formal) ''Jacobi-type'' and ''Stieltjes-type'' [[generalized continued fraction|continued fractions]] (''{{mvar|J}}-fractions'' and ''{{mvar|S}}-fractions'', respectively) whose {{mvar|h}}th rational convergents represent [[Order of accuracy|{{math|2''h''}}-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 fraction]]s ({{mvar|J}}-fractions) are expanded as in the following equation and have the next corresponding power series expansions with respect to {{mvar|z}} for some specific, application-dependent component sequences, {{math|{ab<sub>''i''</sub>}<nowiki/>}} and {{math|{''c''<sub>''i''</sub>}<nowiki/>}}, where {{math|''z'' ≠ 0}} denotes the formal variable in the second power series expansion given below:<ref>For more complete information on the properties of {{mvar|J}}-fractions see: *{{cite journal |first=P. |last=Flajolet |title=Combinatorial aspects of continued fractions |journal=Discrete Mathematics |volume=32 |issue=2 |pages=125–161 |year=1980 |doi=10.1016/0012-365X(80)90050-3 |url=http://algo.inria.fr/flajolet/Publications/Flajolet80b.pdf}} *{{cite book |first=H.S. |last=Wall |title=Analytic Theory of Continued Fractions |url=https://books.google.com/books?id=86ReDwAAQBAJ&pg=PR7 |date=2018 |orig-year=1948 |publisher=Dover |isbn=978-0-486-83044-5}}</ref> <math display="block">\begin{align} J^{[\infty]}(z) & = \cfrac{1}{1-c_1 z-\cfrac{\text{ab}_2 z^2}{1-c_2 z-\cfrac{\text{ab}_3 z^2}{\ddots}}} \\[4px] & = 1 + c_1 z + \left(\text{ab}_2+c_1^2\right) z^2 + \left(2 \text{ab}_2 c_1+c_1^3 + \text{ab}_2 c_2\right) z^3 + \cdots \end{align}</math> The coefficients of <math>z^n</math>, denoted in shorthand by {{math|''j<sub>n</sub>'' ≔ [''z<sup>n</sup>''] ''J''<sup>[∞]</sup>(''z'')}}, in the previous equations correspond to matrix solutions of the equations: <math display="block">\begin{bmatrix}k_{0,1} & k_{1,1} & 0 & 0 & \cdots \\ k_{0,2} & k_{1,2} & k_{2,2} & 0 & \cdots \\ k_{0,3} & k_{1,3} & k_{2,3} & k_{3,3} & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix} = \begin{bmatrix}k_{0,0} & 0 & 0 & 0 & \cdots \\ k_{0,1} & k_{1,1} & 0 & 0 & \cdots \\ k_{0,2} & k_{1,2} & k_{2,2} & 0 & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix} \cdot \begin{bmatrix}c_1 & 1 & 0 & 0 & \cdots \\ \text{ab}_2 & c_2 & 1 & 0 & \cdots \\ 0 & \text{ab}_3 & c_3 & 1 & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix}, </math> where {{math|''j''<sub>0</sub> ≡ ''k''<sub>0,0</sub> {{=}} 1}}, {{math|''j<sub>n</sub>'' {{=}} ''k''<sub>0,''n''</sub>}} for {{math|''n'' ≥ 1}}, {{math|''k''<sub>''r'',''s''</sub> {{=}} 0}} if {{math|''r'' > ''s''}}, and where for all integers {{math|''p'', ''q'' ≥ 0}}, we have an ''addition formula'' relation given by: <math display="block">j_{p+q} = k_{0,p} \cdot k_{0,q} + \sum_{i=1}^{\min(p, q)} \text{ab}_2 \cdots \text{ab}_{i+1} \times k_{i,p} \cdot k_{i,q}. </math> ==== Properties of the ''{{mvar|h}}''th convergent functions ==== For {{math|''h'' ≥ 0}} (though in practice when {{math|''h'' ≥ 2}}), we can define the rational {{mvar|h}}th convergents to the infinite {{mvar|J}}-fraction, {{math|''J''<sup>[∞]</sup>(''z'')}}, expanded by: <math display="block">\operatorname{Conv}_h(z) := \frac{P_h(z)}{Q_h(z)} = j_0 + j_1 z + \cdots + j_{2h-1} z^{2h-1} + \sum_{n = 2h}^\infty \widetilde{j}_{h,n} z^n</math> component-wise through the sequences, {{math|''P<sub>h</sub>''(''z'')}} and {{math|''Q<sub>h</sub>''(''z'')}}, defined recursively by: <math display="block">\begin{align} P_h(z) & = (1-c_h z) P_{h-1}(z) - \text{ab}_h z^2 P_{h-2}(z) + \delta_{h,1} \\ Q_h(z) & = (1-c_h z) Q_{h-1}(z) - \text{ab}_h z^2 Q_{h-2}(z) + (1-c_1 z) \delta_{h,1} + \delta_{0,1}. \end{align}</math> Moreover, the rationality of the convergent function {{math|Conv<sub>''h''</sub>(''z'')}} for all {{math|''h'' ≥ 2}} implies additional finite difference equations and congruence properties satisfied by the sequence of {{math|''j<sub>n</sub>''}}, ''and'' for {{math|''M<sub>h</sub>'' ≔ ab<sub>2</sub> ⋯ ab<sub>''h'' + 1</sub>}} if {{math|''h'' ‖ ''M''<sub>''h''</sub>}} then we have the congruence <math display="block">j_n \equiv [z^n] \operatorname{Conv}_h(z) \pmod h, </math> for non-symbolic, determinate choices of the parameter sequences {{math|{ab<sub>''i''</sub>}<nowiki/>}} and {{math|{''c''<sub>''i''</sub>}<nowiki/>}} when {{math|''h'' ≥ 2}}, that is, when these sequences do not implicitly depend on an auxiliary parameter such as {{mvar|q}}, {{mvar|x}}, or {{mvar|R}} 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<ref>See the following articles: *{{cite arXiv |first=Maxie D. |last=Schmidt |eprint=1612.02778 |title=Continued Fractions for Square Series Generating Functions |year=2016 |class=math.NT }} *{{cite journal |author-mask= 1 |first=Maxie D. |last=Schmidt |title=Jacobi-Type Continued Fractions for the Ordinary Generating Functions of Generalized Factorial Functions |journal=Journal of Integer Sequences |volume=20 |id=17.3.4 |year=2017 |arxiv=1610.09691 |url=https://cs.uwaterloo.ca/journals/JIS/VOL20/Schmidt/schmidt14.html}} *{{cite arXiv |author-mask= 1 |first=Maxie D. |last=Schmidt |eprint=1702.01374 |title=Jacobi-Type Continued Fractions and Congruences for Binomial Coefficients Modulo Integers ''h'' ≥ 2|year=2017|class=math.CO }} </ref>) in several special cases of the prescribed sequences, {{math|''j<sub>n</sub>''}}, generated by the general expansions of the {{mvar|J}}-fractions defined in the first subsection. Here we define {{math|0 < {{abs|''a''}}, {{abs|''b''}}, {{abs|''q''}} < 1}} and the parameters <math>R, \alpha \isin \mathbb{Z}^+</math> and {{mvar|x}} to be indeterminates with respect to these expansions, where the prescribed sequences enumerated by the expansions of these {{mvar|J}}-fractions are defined in terms of the [[q-Pochhammer symbol|{{mvar|q}}-Pochhammer symbol]], [[Pochhammer symbol]], and the [[binomial coefficients]]. {| class="wikitable" |- ! <math>j_n</math> !! <math>c_1</math> !! <math>c_i (i \geq 2)</math> !! <math>\mathrm{ab}_i (i \geq 2)</math> |- | <math>q^{n^2}</math> || <math>q</math> || <math>q^{2h-3}\left(q^{2h}+q^{2h-2}-1\right)</math> || <math>q^{6h-10}\left(q^{2h-2}-1\right)</math> |- | <math>(a; q)_n</math> || <math>1-a</math> || <math>q^{h-1} - a q^{h-2} \left(q^{h} + q^{h-1} - 1\right)</math> || <math>a q^{2h-4} \left(a q^{h-2}-1\right)\left(q^{h-1}-1\right)</math> |- | <math>\left(z q^{-n}; q\right)_n</math> || <math>\frac{q-z}{q}</math> || <math>\frac{q^h - z - qz + q^h z}{q^{2h-1}}</math> || <math>\frac{\left(q^{h-1}-1\right) \left(q^{h-1}-z\right) \cdot z}{q^{4h-5}}</math> |- | <math>\frac{(a; q)_n}{(b; q)_n}</math> || <math>\frac{1-a}{1-b}</math> || <math>\frac{q^{i-2}\left(q+ab q^{2i-3}+a(1-q^{i-1}-q^i)+b(q^{i}-q-1)\right)}{\left(1-bq^{2i-4}\right)\left(1-bq^{2i-2}\right)}</math> || <math>\frac{q^{2i-4}\left(1-bq^{i-3}\right)\left(1-aq^{i-2}\right)\left(a-bq^{i-2}\right)\left(1-q^{i-1}\right)}{\left(1-bq^{2i-5}\right)\left(1-bq^{2i-4}\right)^2\left(1-bq^{2i-3}\right)}</math> |- | <math>\alpha^n \cdot \left(\frac{R}{\alpha}\right)_n</math> || <math>R</math> || <math>R+2\alpha (i-1)</math> || <math>(i-1)\alpha\bigl(R+(i-2)\alpha\bigr)</math> |- | <math>(-1)^n \binom{x}{n}</math> || <math>-x</math> || <math>-\frac{(x+2(i-1)^2)}{(2i-1)(2i-3)}</math> ||<math>\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}</math> |- | <math>(-1)^n \binom{x+n}{n}</math> || <math>-(x+1)</math> || <math>\frac{\bigl(x-2i(i-2)-1\bigr)}{(2i-1)(2i-3)}</math> ||<math>\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}</math> |} The radii of convergence of these series corresponding to the definition of the Jacobi-type {{mvar|J}}-fractions given above are in general different from that of the corresponding power series expansions defining the ordinary generating functions of these sequences. ==Examples== <!-- this is a self-redirect {{Main|Examples of generating functions}}--> ===Square numbers=== Generating functions for the sequence of [[square number]]s {{math|''a''<sub>''n''</sub> {{=}} ''n''<sup>2</sup>}} are: {| class="wikitable" ! Generating function type !! Equation |- |Ordinary generating function||<math>G(n^2;x)=\sum_{n=0}^\infty n^2x^n = \frac{x(x+1)}{(1-x)^3}</math> |- |Exponential generating function||<math>\operatorname{EG}(n^2;x)=\sum _{n=0}^\infty \frac{n^2x^n}{n!}=x(x+1)e^x</math> |- |Bell series||<math>\operatorname{BG}_p\left(n^2;x\right)=\sum_{n=0}^\infty \left(p^{n}\right)^2x^n=\frac{1}{1-p^2x}</math> |- |Dirichlet series||<math>\operatorname{DG}\left(n^2;s\right)=\sum_{n=1}^\infty \frac{n^2}{n^s}=\zeta(s-2)</math> |} where {{math|''ζ''(''s)''}} 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 number#Generating function|Fibonacci numbers]]. * Find [[recurrence relation]]s 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 polynomial]]s 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 {{math|''s<sub>n</sub>'' {{=}} Σ{{su|b=''k'' {{=}} 0|p=''n''}} ''a<sub>k</sub>''}}. We then know that {{math|''S''(''z'') {{=}} {{sfrac|''A''(''z'')|1 − ''z''}}}} for the corresponding ordinary generating functions. For example, we can manipulate <math display="block">s_n=\sum_{k=1}^{n} H_{k}\,,</math> where {{math|''H<sub>k</sub>'' {{=}} 1 + {{sfrac|1|2}} + ⋯ + {{sfrac|1|''k''}}}} are the [[harmonic number]]s. Let <math display="block">H(z) = \sum_{n = 1}^\infty{H_n z^n}</math> be the ordinary generating function of the harmonic numbers. Then <math display="block">H(z) = \frac{1}{1-z}\sum_{n = 1}^\infty \frac{z^n}{n}\,,</math> and thus <math display="block">S(z) = \sum_{n = 1}^\infty{s_n z^n} = \frac{1}{(1-z)^2}\sum_{n = 1}^\infty \frac{z^n}{n}\,.</math> Using <math display="block">\frac{1}{(1-z)^2} = \sum_{n = 0}^\infty (n+1)z^n\,,</math> [[#Convolution (Cauchy products)|convolution]] with the numerator yields <math display="block">s_n = \sum_{k = 1}^{n} \frac{n+1-k}{k} = (n+1)H_n - n\,,</math> which can also be written as <math display="block">\sum_{k = 1}^{n}{H_k} = (n+1)(H_{n+1} - 1)\,.</math> ====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 {{math|⟨ ''f<sub>n</sub>'' ⟩}} we define the two sequences of sums <math display="block">\begin{align} s_n &:= \sum_{m=0}^n \binom{n}{m} f_m 3^{n-m} \\[4px] \tilde{s}_n &:= \sum_{m=0}^n \binom{n}{m} (m+1)(m+2)(m+3) f_m 3^{n-m}\,, \end{align}</math> for all {{math|''n'' ≥ 0}}, 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 <math display="block">S(z) = \frac{1}{1-3z} F\left(\frac{z}{1-3z}\right). </math> Since the generating function for the sequence {{math|⟨ (''n'' + 1)(''n'' + 2)(''n'' + 3) ''f<sub>n</sub>'' ⟩}} is given by <math display="block">6 F(z) + 18z F'(z) + 9z^2 F''(z) + z^3 F'''(z)</math> we may write the generating function for the second sum defined above in the form <math display="block">\tilde{S}(z) = \frac{6}{(1-3z)} F\left(\frac{z}{1-3z}\right)+\frac{18z}{(1-3z)^2} F'\left(\frac{z}{1-3z}\right)+\frac{9z^2}{(1-3z)^3} F''\left(\frac{z}{1-3z}\right)+\frac{z^3}{(1-3z)^4} F'''\left(\frac{z}{1-3z}\right). </math> In particular, we may write this modified sum generating function in the form of <math display="block">a(z) \cdot S(z) + b(z) \cdot z S'(z) + c(z) \cdot z^2 S''(z) + d(z) \cdot z^3 S'''(z), </math> for {{math|''a''(''z'') {{=}} 6(1 − 3''z'')<sup>3</sup>}}, {{math|''b''(''z'') {{=}} 18(1 − 3''z'')<sup>3</sup>}}, {{math|''c''(''z'') {{=}} 9(1 − 3''z'')<sup>3</sup>}}, and {{math|''d''(''z'') {{=}} (1 − 3''z'')<sup>3</sup>}}, where {{math|(1 − 3''z'')<sup>3</sup> {{=}} 1 − 9''z'' + 27''z''<sup>2</sup> − 27''z''<sup>3</sup>}}. Finally, it follows that we may express the second sums through the first sums in the following form: <math display="block">\begin{align} \tilde{s}_n & = [z^n]\left(6(1-3z)^3 \sum_{n = 0}^\infty s_n z^n + 18 (1-3z)^3 \sum_{n = 0}^\infty n s_n z^n + 9 (1-3z)^3 \sum_{n = 0}^\infty n(n-1) s_n z^n + (1-3z)^3 \sum_{n = 0}^\infty n(n-1)(n-2) s_n z^n\right) \\[4px] & = (n+1)(n+2)(n+3) s_n - 9 n(n+1)(n+2) s_{n-1} + 27 (n-1)n(n+1) s_{n-2} - (n-2)(n-1)n s_{n-3}. \end{align}</math> ====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 {{math|''U<sub>n</sub>''}}) to tile a 3-by-{{mvar|n}} rectangle with unmarked 2-by-1 domino pieces. Let the auxiliary sequence, {{math|''V<sub>n</sub>''}}, be defined as the number of ways to cover a 3-by-{{mvar|n}} rectangle-minus-corner section of the full rectangle. We seek to use these definitions to give a [[Closed-form expression|closed form]] formula for {{math|''U<sub>n</sub>''}} 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: <math display="block">\begin{align} U(z) = 1 + 3z^2 + 11 z^4 + 41 z^6 + \cdots, \\ V(z) = z + 4z^3 + 15 z^5 + 56 z^7 + \cdots. \end{align}</math> If we consider the possible configurations that can be given starting from the left edge of the 3-by-{{mvar|n}} rectangle, we are able to express the following mutually dependent, or ''mutually recursive'', recurrence relations for our two sequences when {{math|''n'' ≥ 2}} defined as above where {{math|''U''<sub>0</sub> {{=}} 1}}, {{math|''U''<sub>1</sub> {{=}} 0}}, {{math|''V''<sub>0</sub> {{=}} 0}}, and {{math|''V''<sub>1</sub> {{=}} 1}}: <math display="block">\begin{align} U_n & = 2 V_{n-1} + U_{n-2} \\ V_n & = U_{n-1} + V_{n-2}. \end{align}</math> Since we have that for all integers {{math|''m'' ≥ 0}}, the index-shifted generating functions satisfy{{noteTag|Incidentally, we also have a corresponding formula when {{math|''m'' < 0}} given by <math display="block">\sum_{n = 0}^\infty g_{n+m} z^n = \frac{G(z) - g_0 -g_1 z - \cdots - g_{m-1} z^{m-1}}{z^m}\,.</math>}} <math display="block">z^m G(z) = \sum_{n = m}^\infty g_{n-m} z^n\,,</math> 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 <math display="block">\begin{align} U(z) & = 2z V(z) + z^2 U(z) + 1 \\ V(z) & = z U(z) + z^2 V(z) = \frac{z}{1-z^2} U(z), \end{align}</math> which then implies by solving the system of equations (and this is the particular trick to our method here) that <math display="block">U(z) = \frac{1-z^2}{1-4z^2+z^4} = \frac{1}{3-\sqrt{3}} \cdot \frac{1}{1-\left(2+\sqrt{3}\right) z^2} + \frac{1}{3 + \sqrt{3}} \cdot \frac{1}{1-\left(2-\sqrt{3}\right) z^2}. </math> 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 {{math|''U''<sub>2''n'' + 1</sub> ≡ 0}} and that <math display="block">U_{2n} = \left\lceil \frac{\left(2+\sqrt{3}\right)^n}{3-\sqrt{3}} \right\rceil\,, </math> for all integers {{math|''n'' ≥ 0}}. We also note that the same shifted generating function technique applied to the second-order [[recurrence relation|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]]). #Consider {{math|''A''(''z'')}} and {{math|''B''(''z'')}} are ordinary generating functions. <math display="block">C(z) = A(z)B(z) \Leftrightarrow [z^n]C(z) = \sum_{k=0}^{n}{a_k b_{n-k}}</math> #Consider {{math|''A''(''z'')}} and {{math|''B''(''z'')}} are exponential generating functions. <math display="block">C(z) = A(z)B(z) \Leftrightarrow \left[\frac{z^n}{n!}\right]C(z) = \sum_{k=0}^n \binom{n}{k} a_k b_{n-k}</math> #Consider the triply convolved sequence resulting from the product of three ordinary generating functions <math display="block">C(z) = F(z) G(z) H(z) \Leftrightarrow [z^n]C(z) = \sum_{j+k+ l=n} f_j g_k h_ l</math> #Consider the {{mvar|m}}-fold convolution of a sequence with itself for some positive integer {{math|''m'' ≥ 1}} (see the example below for an application) <math display="block">C(z) = G(z)^m \Leftrightarrow [z^n]C(z) = \sum_{k_1+k_2+\cdots+k_m=n} g_{k_1} g_{k_2} \cdots g_{k_m}</math> 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 {{mvar|Z}} is denoted by {{math|''G<sub>Z</sub>''(''z'')}}, then we can show that for any two random variables <ref>{{harvnb|Graham|Knuth|Patashnik|1994|loc=§8.3}}</ref> <math display="block">G_{X+Y}(z) = G_X(z) G_Y(z)\,, </math> if {{mvar|X}} and {{mvar|Y}} are independent. ====Example: The money-changing problem==== The number of ways to pay {{math|''n'' ≥ 0}} 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), where we distinguish instances based upon the total number of each coin but not upon the order in which the coins are presented, is given by the ordinary generating function <math display="block">\frac{1}{1-z} \frac{1}{1-z^5} \frac{1}{1-z^{10}} \frac{1}{1-z^{25}} \frac{1}{1-z^{50}}\,.</math> When we also distinguish based upon the order in which the coins are presented (e.g., one penny then one nickel is distinct from one nickel then one penny), the ordinary generating function is <math display=block>\frac{1}{1-z-z^5-z^{10}-z^{25}-z^{50}}\,.</math> If we allow the {{mvar|n}} cents to be paid in coins of ''any'' positive integer denomination, we arrive at the [[partition function (mathematics)|partition function]] ordinary generating function expanded by an infinite [[q-Pochhammer symbol|{{mvar|q}}-Pochhammer symbol]] product, <math display="block">\prod_{n = 1}^\infty \left(1 - z^n\right)^{-1}\,.</math> When the order of the coins matters, the ordinary generating function is <math display=block>\frac{1}{1-\sum_{n=1}^\infty z^n} = \frac{1-z}{1-2z}\,.</math> ====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]], {{math|''C<sub>n</sub>''}}. In particular, this sequence has the combinatorial interpretation as being the number of ways to insert parentheses into the product {{math|''x''<sub>0</sub> · ''x''<sub>1</sub> ·⋯· ''x<sub>n</sub>''}} so that the order of multiplication is completely specified. For example, {{math|''C''<sub>2</sub> {{=}} 2}} which corresponds to the two expressions {{math|''x''<sub>0</sub> · (''x''<sub>1</sub> · ''x''<sub>2</sub>)}} and {{math|(''x''<sub>0</sub> · ''x''<sub>1</sub>) · ''x''<sub>2</sub>}}. It follows that the sequence satisfies a recurrence relation given by <math display="block">C_n = \sum_{k=0}^{n-1} C_k C_{n-1-k} + \delta_{n,0} = C_0 C_{n-1} + C_1 C_{n-2} + \cdots + C_{n-1} C_0 + \delta_{n,0}\,,\quad n \geq 0\,, </math> and so has a corresponding convolved generating function, {{math|''C''(''z'')}}, satisfying <math display="block">C(z) = z \cdot C(z)^2 + 1\,.</math> Since {{math|''C''(0) {{=}} 1 ≠ ∞}}, we then arrive at a formula for this generating function given by <math display="block">C(z) = \frac{1-\sqrt{1-4z}}{2z} = \sum_{n = 0}^\infty \frac{1}{n+1}\binom{2n}{n} z^n\,.</math> Note that the first equation implicitly defining {{math|''C''(''z'')}} above implies that <math display="block">C(z) = \frac{1}{1-z \cdot C(z)} \,, </math> 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 {{mvar|n}}'' is defined to be a graph on the vertices {{math|{0, 1, ..., ''n''}<nowiki/>}} with {{math|2''n'' − 1}} edges connected according to the following rules: Vertex 0 is connected by a single edge to each of the other {{mvar|n}} vertices, and vertex <math>k</math> is connected by a single edge to the next vertex {{math|''k'' + 1}} for all {{math|1 ≤ ''k'' < ''n''}}.<ref>{{harvnb|Graham|Knuth|Patashnik|1994|loc=Example 6 in §7.3}} 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.</ref> 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 {{math|''f<sub>n</sub>''}} of a fan of order {{mvar|n}} are possible for each {{math|''n'' ≥ 1}}. As an observation, we may approach the question by counting the number of ways to join adjacent sets of vertices. For example, when {{math|''n'' {{=}} 4}}, we have that {{math|''f''<sub>4</sub> {{=}} 4 + 3 · 1 + 2 · 2 + 1 · 3 + 2 · 1 · 1 + 1 · 2 · 1 + 1 · 1 · 2 + 1 · 1 · 1 · 1 {{=}} 21}}, which is a sum over the {{mvar|m}}-fold convolutions of the sequence {{math|''g<sub>n</sub>'' {{=}} ''n'' {{=}} [''z<sup>n</sup>''] {{sfrac|''z''|(1 − ''z'')<sup>2</sup>}}}} for {{math|''m'' ≔ 1, 2, 3, 4}}. More generally, we may write a formula for this sequence as <math display="block">f_n = \sum_{m > 0} \sum_{\scriptstyle k_1+k_2+\cdots+k_m=n\atop\scriptstyle k_1, k_2, \ldots,k_m > 0} g_{k_1} g_{k_2} \cdots g_{k_m}\,, </math> from which we see that the ordinary generating function for this sequence is given by the next sum of convolutions as <math display="block">F(z) = G(z) + G(z)^2 + G(z)^3 + \cdots = \frac{G(z)}{1-G(z)} = \frac{z}{(1-z)^2-z} = \frac{z}{1-3z+z^2}\,,</math> 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=== {{expand section|This section needs to be added to the list of techniques with generating functions|date=April 2017}} One often encounters generating functions specified by a functional equation, instead of an explicit specification. For example, the generating function {{math|''T(z)''}} for the number of binary trees on {{math|''n''}} nodes (leaves included) satisfies <math display="block">T(z) = z\left(1+T(z)^2\right)</math> The [[Lagrange inversion theorem]] is a tool used to explicitly evaluate solutions to such equations. {{math theorem|Lagrange inversion formula|Let <math display = "inline"> \phi(z) \in C[[z]]</math> be a formal power series with a non-zero constant term. Then the functional equation <math display = "block">T(z) = z \phi(T(z))</math> admits a unique solution in <math display = "inline">T(z) \in C[[z]]</math>, which satisfies <math mode = "block"> [z^n] T(z) = [z^{n-1}] \frac{1}{n} (\phi(z))^n </math> where the notation <math mode = "inline">[z^n] F(z)</math> returns the coefficient of <math mode = "inline">z^n</math> in <math mode = "\inline">F(z)</math>. }} Applying the above theorem to our functional equation yields (with <math display="inline">\phi(z) = 1+z^2</math>): <math display="block"> [z^n]T(z) = [z^{n-1}] \frac{1}{n} (1+z^2)^n </math> Via the binomial theorem expansion, for even <math mode="inline">n</math>, the formula returns <math mode="inline">0</math>. 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 <math mode="inline">n</math>, however, we get <math mode="block">[z^{n-1}] \frac{1}{n} (1+z^2)^n = \frac{1}{n} \dbinom{n}{\frac{n+1}{2}} </math> The expression becomes much neater if we let <math mode="inline">n</math> be the number of internal nodes: Now the expression just becomes the <math mode="inline">n</math><sup>th</sup> Catalan number. ===Introducing a free parameter (snake oil method)=== Sometimes the sum {{math|''s<sub>n</sub>''}} 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 {{mvar|n}} as limit in the summation. When n does not appear explicitly in the summation, we may consider {{mvar|n}} as a "free" parameter and treat {{math|''s<sub>n</sub>''}} as a coefficient of {{math|''F''(''z'') {{=}} Σ ''s<sub>n</sub>'' ''z<sup>n</sup>''}}, change the order of the summations on {{mvar|n}} and {{mvar|k}}, and try to compute the inner sum. For example, if we want to compute <math display="block">s_n = \sum_{k = 0}^\infty{\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1}}\,, \quad m,n \in \mathbb{N}_0\,,</math> we can treat {{mvar|n}} as a "free" parameter, and set <math display="block">F(z) = \sum_{n = 0}^\infty{\left( \sum_{k = 0}^\infty{\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1}}\right) }z^n\,.</math> Interchanging summation ("snake oil") gives <math display="block">F(z) = \sum_{k = 0}^\infty{\binom{2k}{k}\frac{(-1)^k}{k+1} z^{-k}}\sum_{n = 0}^\infty{\binom{n+k}{m+2k} z^{n+k}}\,.</math> Now the inner sum is {{math|{{sfrac|''z''<sup>''m'' + 2''k''</sup>|(1 − ''z'')<sup>''m'' + 2''k'' + 1</sup>}}}}. Thus <math display="block">\begin{align} F(z) &= \frac{z^m}{(1-z)^{m+1}}\sum_{k = 0}^\infty{\frac{1}{k+1}\binom{2k}{k}\left(\frac{-z}{(1-z)^2}\right)^k} \\[4px] &= \frac{z^m}{(1-z)^{m+1}}\sum_{k = 0}^\infty{C_k\left(\frac{-z}{(1-z)^2}\right)^k} &\text{where } C_k = k\text{th Catalan number} \\[4px] &= \frac{z^m}{(1-z)^{m+1}}\frac{1-\sqrt{1+\frac{4z}{(1-z)^2}}}{\frac{-2z}{(1-z)^2}} \\[4px] &= \frac{-z^{m-1}}{2(1-z)^{m-1}}\left(1-\frac{1+z}{1-z}\right) \\[4px] &= \frac{z^m}{(1-z)^m} = z\frac{z^{m-1}}{(1-z)^m}\,. \end{align}</math> Then we obtain <math display="block">s_n = \begin{cases} \displaystyle\binom{n-1}{m-1} & \text{for } m \geq 1 \,, \\ {} [n = 0] & \text{for } m = 0\,. \end{cases}</math> It is instructive to use the same method again for the sum, but this time take {{mvar|m}} as the free parameter instead of {{mvar|n}}. We thus set <math display="block">G(z) = \sum_{m = 0}^\infty\left( \sum_{k = 0}^\infty \binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1} \right) z^m\,.</math> Interchanging summation ("snake oil") gives <math display="block">G(z) = \sum_{k = 0}^\infty \binom{2k}{k}\frac{(-1)^k}{k+1} z^{-2k} \sum_{m = 0}^\infty \binom{n+k}{m+2k} z^{m+2k}\,.</math> Now the inner sum is {{math|(1 + ''z'')<sup>''n'' + ''k''</sup>}}. Thus <math display="block">\begin{align} G(z) &= (1+z)^n \sum_{k = 0}^\infty \frac{1}{k+1}\binom{2k}{k}\left(\frac{-(1+z)}{z^2}\right)^k \\[4px] &= (1+z)^n \sum_{k = 0}^\infty C_k \,\left(\frac{-(1+z)}{z^2}\right)^k &\text{where } C_k = k\text{th Catalan number} \\[4px] &= (1+z)^n \,\frac{1-\sqrt{1+\frac{4(1+z)}{z^2}}}{\frac{-2(1+z)}{z^2}} \\[4px] &= (1+z)^n \,\frac{z^2-z\sqrt{z^2+4+4z}}{-2(1+z)} \\[4px] &= (1+z)^n \,\frac{z^2-z(z+2)}{-2(1+z)} \\[4px] &= (1+z)^n \,\frac{-2z}{-2(1+z)} = z(1+z)^{n-1}\,. \end{align}</math> Thus we obtain <math display="block">s_n = \left[z^m\right] z(1+z)^{n-1} = \left[z^{m-1}\right] (1+z)^{n-1} = \binom{n-1}{m-1}\,,</math> for {{math|''m'' ≥ 1}} as before. ===Generating functions prove congruences=== We say that two generating functions (power series) are congruent modulo {{mvar|m}}, written {{math|''A''(''z'') ≡ ''B''(''z'') (mod ''m'')}} if their coefficients are congruent modulo {{mvar|m}} for all {{math|''n'' ≥ 0}}, i.e., {{math|''a<sub>n</sub>'' ≡ ''b<sub>n</sub>'' (mod ''m'')}} for all relevant cases of the integers {{mvar|n}} (note that we need not assume that {{mvar|m}} is an integer here—it may very well be polynomial-valued in some indeterminate {{mvar|x}}, for example). If the "simpler" right-hand-side generating function, {{math|''B''(''z'')}}, is a rational function of {{mvar|z}}, then the form of this sequence suggests that the sequence is [[periodic function|eventually periodic]] modulo fixed particular cases of integer-valued {{math|''m'' ≥ 2}}. For example, we can prove that the [[Euler numbers]], <math display="block">\langle E_n \rangle = \langle 1, 1, 5, 61, 1385, \ldots \rangle \longmapsto \langle 1,1,2,1,2,1,2,\ldots \rangle \pmod{3}\,,</math> satisfy the following congruence modulo 3:<ref>{{harvnb|Lando|2003|loc=§5}}</ref> <math display="block">\sum_{n = 0}^\infty E_n z^n = \frac{1-z^2}{1+z^2} \pmod{3}\,. </math> One useful method of obtaining congruences for sequences enumerated by special generating functions modulo any integers (i.e., not only prime powers {{math|''p<sup>k</sup>''}}) is given in the section on continued fraction representations of (even non-convergent) ordinary generating functions by {{mvar|J}}-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: {{math theorem | name = Theorem: congruences for series generated by expansions of continued fractions | math_statement = Suppose that the generating function {{math|''A''(''z'')}} is represented by an infinite [[continued fraction]] of the form <math display="block">A(z) = \cfrac{1}{1-c_1z - \cfrac{p_1z^2}{1-c_2z - \cfrac{p_2 z^2}{1-c_3z - {\ddots}}}}</math> and that {{math|''A<sub>p</sub>''(''z'')}} denotes the {{mvar|p}}th convergent to this continued fraction expansion defined such that {{math|''a<sub>n</sub>'' {{=}} [''z<sup>n</sup>''] ''A<sub>p</sub>''(''z'')}} for all {{math|0 ≤ ''n'' < 2''p''}}. Then: # the function {{math|''A<sub>p</sub>''(''z'')}} is rational for all {{math|''p'' ≥ 2}} where we assume that one of divisibility criteria of {{math|''p'' {{!}} ''p''<sub>1</sub>, ''p''<sub>1</sub>''p''<sub>2</sub>, ''p''<sub>1</sub>''p''<sub>2</sub>''p''<sub>3</sub>}} is met, that is, {{math|''p'' {{!}} ''p''<sub>1</sub>''p''<sub>2</sub>⋯''p''<sub>''k''</sub>}} for some {{math|''k'' ≥ 1}}; and # if the integer {{mvar|p}} divides the product {{math|''p''<sub>1</sub>''p''<sub>2</sub>⋯''p''<sub>''k''</sub>}}, then we have {{math|''A''(''z'') ≡ ''A<sub>k</sub>''(''z'') (mod ''p'')}}. }} 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 {{math|''p''(''n'')}}]] which show the versatility of generating functions in tackling problems involving [[integer sequences]]. ====The Stirling numbers modulo small integers==== The [[Stirling numbers of the first kind#Congruences|main article]] on the Stirling numbers generated by the finite products <math display="block">S_n(x) := \sum_{k=0}^n \begin{bmatrix} n \\ k \end{bmatrix} x^k = x(x+1)(x+2) \cdots (x+n-1)\,,\quad n \geq 1\,, </math> 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 <math display="block">S_n(x) = [x(x+1)] \cdot [x(x+1)] \cdots = x^{\left\lceil \frac{n}{2} \right\rceil} (x+1)^{\left\lfloor \frac{n}{2} \right\rfloor}\,, </math> which implies that the parity of these [[Stirling numbers]] matches that of the binomial coefficient <math display="block">\begin{bmatrix} n \\ k \end{bmatrix} \equiv \binom{\left\lfloor \frac{n}{2} \right\rfloor}{k - \left\lceil \frac{n}{2} \right\rceil} \pmod{2}\,, </math> and consequently shows that {{math|{{resize|150%|[}}{{su|p=''n''|b=''k''|a=c}}{{resize|150%|]}}}} is even whenever {{math|''k'' < ⌊ {{sfrac|''n''|2}} ⌋}}. 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 <math display="block">\begin{align} \begin{bmatrix} n \\ m \end{bmatrix} & \equiv [x^m] \left( x^{\left\lceil \frac{n}{3} \right\rceil} (x+1)^{\left\lceil \frac{n-1}{3} \right\rceil} (x+2)^{\left\lfloor \frac{n}{3} \right\rfloor} \right) && \pmod{3} \\ & \equiv \sum_{k=0}^{m} \begin{pmatrix} \left\lceil \frac{n-1}{3} \right\rceil \\ k \end{pmatrix} \begin{pmatrix} \left\lfloor \frac{n}{3} \right\rfloor \\ m-k - \left\lceil \frac{n}{3} \right\rceil \end{pmatrix} \times 2^{\left\lceil \frac{n}{3} \right\rceil + \left\lfloor \frac{n}{3} \right\rfloor -(m-k)} && \pmod{3}\,. \end{align}</math> ====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 (number theory)|partition function]] {{math|''p''(''n'')}} is generated by the reciprocal infinite [[q-Pochhammer symbol|{{mvar|q}}-Pochhammer symbol]] product (or {{mvar|z}}-Pochhammer product as the case may be) given by <math display="block">\begin{align} \sum_{n = 0}^\infty p(n) z^n & = \frac{1}{\left(1-z\right)\left(1-z^2\right)\left(1-z^3\right) \cdots} \\[4pt] & = 1 + z + 2z^2 + 3 z^3 + 5z^4 + 7z^5 + 11z^6 + \cdots. \end{align}</math> This partition function satisfies many known [[Ramanujan's congruences|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:<ref>{{harvnb|Hardy|Wright|Heath-Brown|Silverman|2008|loc=§19.12}}</ref> <math display="block">\begin{align} p(5m+4) & \equiv 0 \pmod{5} \\ p(7m+5) & \equiv 0 \pmod{7} \\ p(11m+6) & \equiv 0 \pmod{11} \\ p(25m+24) & \equiv 0 \pmod{5^2}\,. \end{align}</math> 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 <math display="block">\frac{1}{(1-z)^5} = \sum_{i=0}^\infty \binom{4+i}{4}z^i\,,</math> all of the coefficients are divisible by 5 except for those which correspond to the powers {{math|1, ''z''<sup>5</sup>, ''z''<sup>10</sup>, ...}} and moreover in those cases the remainder of the coefficient is 1 modulo 5. Thus, <math display="block">\frac{1}{(1-z)^5} \equiv \frac{1}{1-z^5} \pmod{5}\,,</math> or equivalently <math display="block"> \frac{1-z^5}{(1-z)^5} \equiv 1 \pmod{5}\,.</math> It follows that <math display="block">\frac{\left(1-z^5\right)\left(1-z^{10}\right)\left(1-z^{15}\right) \cdots }{\left((1-z)\left(1-z^2\right)\left(1-z^3\right) \cdots \right)^5} \equiv 1 \pmod{5}\,. </math> Using the infinite product expansions of <math display="block">z \cdot \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{\left(1-z\right)\left(1-z^2\right) \cdots } = z \cdot \left((1-z)\left(1-z^2\right) \cdots \right)^4 \times \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{\left(\left(1-z\right)\left(1-z^2\right) \cdots \right)^5}\,,</math> it can be shown that the coefficient of {{math|''z''<sup>5''m'' + 5</sup>}} in {{math|''z'' · ((1 − ''z'')(1 − ''z''<sup>2</sup>)⋯)<sup>4</sup>}} is divisible by 5 for all {{mvar|m}}.<ref>{{cite book |last1=Hardy |first1=G.H. |last2=Wright |first2=E.M.|title=An Introduction to the Theory of Numbers}} p.288, Th.361</ref> Finally, since <math display="block">\begin{align} \sum_{n = 1}^\infty p(n-1) z^n & = \frac{z}{(1-z)\left(1-z^2\right) \cdots} \\[6px] & = z \cdot \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{(1-z)\left(1-z^2\right) \cdots } \times \left(1+z^5+z^{10}+\cdots\right)\left(1+z^{10}+z^{20}+\cdots\right) \cdots \end{align}</math> we may equate the coefficients of {{math|''z''<sup>5''m'' + 5</sup>}} in the previous equations to prove our desired congruence result, namely that {{math|''p''(5''m'' + 4) ≡ 0 (mod 5)}} for all {{math|''m'' ≥ 0}}. ===Transformations of generating functions=== There are a number of transformations of generating functions that provide other applications (see the [[generating function transformation|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 [[Generating function transformation#Integral Transformations|integral transformations]]) or weighted sums over the higher-order derivatives of these functions (see [[Generating function transformation#Derivative Transformations|derivative transformations]]). Generating function transformations can come into play when we seek to express a generating function for the sums <math display="block">s_n := \sum_{m=0}^n \binom{n}{m} C_{n,m} a_m, </math> in the form of {{math|''S''(''z'') {{=}} ''g''(''z'') ''A''(''f''(''z''))}} involving the original sequence generating function. For example, if the sums are <math display="block">s_n := \sum_{k = 0}^\infty \binom{n+k}{m+2k} a_k \,</math> then the generating function for the modified sum expressions is given by<ref>{{harvnb|Graham|Knuth|Patashnik|1994|p=535, exercise 5.71}}</ref> <math display="block">S(z) = \frac{z^m}{(1-z)^{m+1}} A\left(\frac{z}{(1-z)^2}\right)</math> (see also the [[binomial transform]] and the [[Stirling transform]]). There are also integral formulas for converting between a sequence's OGF, {{math|''F''(''z'')}}, and its exponential generating function, or EGF, {{math|''F̂''(''z'')}}, and vice versa given by <math display="block">\begin{align} F(z) &= \int_0^\infty \hat{F}(tz) e^{-t} \, dt \,, \\[4px] \hat{F}(z) &= \frac{1}{2\pi} \int_{-\pi}^\pi F\left(z e^{-i\vartheta}\right) e^{e^{i\vartheta}} \, d\vartheta \,, \end{align}</math> provided that these integrals converge for appropriate values of {{mvar|z}}. == Tables of special generating functions == An initial listing of special mathematical series is found [[List of mathematical series|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.<ref>See also the ''1031 Generating Functions'' found in {{cite thesis |first=Simon |last=Plouffe |title=Approximations de séries génératrices et quelques conjectures |trans-title=Approximations of generating functions and a few conjectures |year=1992 |type=Masters |publisher=Université du Québec à Montréal |language=fr |arxiv=0911.4975}}</ref> {{expand section|Lists of special and special sequence generating functions. The next table is a start|date=April 2017}} {| class="wikitable" |- ! Formal power series !! Generating-function formula !! Notes |- | <math>\sum_{n = 0}^\infty \binom{m+n}{n} \left(H_{n+m}-H_m\right) z^n</math> || <math>\frac{1}{(1-z)^{m+1}} \ln \frac{1}{1-z}</math> || <math>H_n</math> is a first-order [[harmonic number]] |- | <math>\sum_{n = 0}^\infty B_n \frac{z^n}{n!}</math> || <math>\frac{z}{e^z-1}</math> || <math>B_n</math> is a [[Bernoulli number]] |- | <math>\sum_{n = 0}^\infty F_{mn} z^n</math> || <math>\frac{F_m z}{1-(F_{m-1}+F_{m+1})z+(-1)^m z^2}</math> || <math>F_n</math> is a [[Fibonacci number]] and <math>m \in \mathbb{Z}^{+}</math> |- | <math>\sum_{n = 0}^\infty \left\{\begin{matrix} n \\ m \end{matrix} \right\} z^n</math> || <math>(z^{-1})^{\overline{-m}} = \frac{z^m}{(1-z)(1-2z)\cdots(1-mz)}</math> || <math>x^{\overline{n}}</math> denotes the [[rising factorial]], or [[Pochhammer symbol]] and some integer <math>m \geq 0</math> |- | <math>\sum_{n = 0}^\infty \left[\begin{matrix} n \\ m \end{matrix} \right] z^n</math> || <math>z^{\overline{m}} = z(z+1) \cdots (z+m-1)</math> |- | <math>\sum_{n = 1}^\infty \frac{(-1)^{n-1}4^n (4^n-2) B_{2n} z^{2n}}{(2n) \cdot (2n)!}</math> || <math>\ln \frac{\tan(z)}{z}</math> |- | <math>\sum_{n = 0}^\infty \frac{(1/2)^{\overline{n}} z^{2n}}{(2n+1) \cdot n!}</math> || <math>z^{-1} \arcsin(z)</math> |- | <math>\sum_{n = 0}^\infty H_n^{(s)} z^n</math> || <math>\frac{\operatorname{Li}_s(z)}{1-z}</math> || <math>\operatorname{Li}_s(z)</math> is the [[polylogarithm]] function and <math>H_n^{(s)}</math> is a generalized [[harmonic number]] for <math>\Re(s) > 1</math> |- | <math>\sum_{n = 0}^\infty n^m z^n</math> || <math>\sum_{0 \leq j \leq m} \left\{\begin{matrix} m \\ j \end{matrix} \right\} \frac{j! \cdot z^j}{(1-z)^{j+1}}</math> || <math>\left\{\begin{matrix} n \\ m \end{matrix} \right\}</math> is a [[Stirling number of the second kind]] and where the individual terms in the expansion satisfy <math>\frac{z^i}{(1-z)^{i+1}} = \sum_{k=0}^{i} \binom{i}{k} \frac{(-1)^{k-i}}{(1-z)^{k+1}}</math> |- | <math>\sum_{k < n} \binom{n-k}{k} \frac{n}{n-k} z^k</math> || <math>\left(\frac{1+\sqrt{1+4z}}{2}\right)^n + \left(\frac{1-\sqrt{1+4z}}{2}\right)^n</math> || |- | <math>\sum_{n_1, \ldots, n_m \geq 0} \min(n_1, \ldots, n_m) z_1^{n_1} \cdots z_m^{n_m}</math> || <math>\frac{z_1 \cdots z_m}{(1-z_1) \cdots (1-z_m) (1-z_1 \cdots z_m)}</math> || The two-variable case is given by <math>M(w, z) := \sum_{m,n \geq 0} \min(m, n) w^m z^n = \frac{wz}{(1-w)(1-z)(1-wz)}</math> |- | <math>\sum_{n = 0}^\infty \binom{s}{n} z^n</math> || <math>(1+z)^s</math> || <math>s \in \mathbb{C}</math> |- | <math>\sum_{n = 0}^\infty \binom{n}{k} z^n</math> || <math>\frac{z^k}{(1-z)^{k+1}}</math> || <math>k \in \mathbb{N}</math> |- |<math>\sum_{n = 1}^\infty \log{(n)} z^n</math>||<math>\left.-\frac{\partial}{\partial s}\operatorname{{Li}_s(z)}\right|_{s=0}</math> |} ==See also== * [[Moment-generating function]] * [[Probability-generating function]] * [[Generating function transformation]] * [[Stanley's reciprocity theorem]] * [[Integer partition]] * [[Combinatorial principles]] * [[Cyclic sieving]] * [[Z-transform]] * [[Umbral calculus]] * [[Coins in a fountain]] ==Notes== {{noteFoot}} ==References== {{reflist}} ===Citations=== *{{cite book |first=Martin |last=Aigner |title=A Course in Enumeration |url=https://books.google.com/books?id=pPEJcu93dzAC |date=2007 |publisher=Springer |isbn=978-3-540-39035-0 |series=Graduate Texts in Mathematics |volume=238 }} * {{cite journal |title=On the foundations of combinatorial theory. VI. The idea of generating function |last1=Doubilet |first1=Peter |last2=Rota | first2=Gian-Carlo | author2-link=Gian-Carlo Rota | last3=Stanley | first3=Richard | author3-link=Richard P. Stanley | journal=Proceedings of the Sixth Berkeley Symposium on Mathematical Statistics and Probability |volume=2 |pages=267–318 |year=1972 | zbl=0267.05002 | url=http://projecteuclid.org/euclid.bsmsp/1200514223 }} Reprinted in {{cite book | last=Rota | first=Gian-Carlo | author-link=Gian-Carlo Rota | others=With the collaboration of P. Doubilet, C. Greene, D. Kahaner, [[Andrew Odlyzko|A. Odlyzko]] and [[Richard P. Stanley|R. Stanley]] | title=Finite Operator Calculus | chapter=3. The idea of generating function | pages=83–134 | publisher=Academic Press | year=1975 | isbn=0-12-596650-4 | zbl=0328.05007 }} * {{cite book | last1 = Flajolet | first1 = Philippe | author-link1 = Philippe Flajolet | last2 = Sedgewick | first2 = Robert | author-link2 = Robert Sedgewick (computer scientist) | title = Analytic Combinatorics | title-link= Analytic Combinatorics | year = 2009 | publisher = Cambridge University Press | isbn = 978-0-521-89806-5 | zbl=1165.05001 }} * {{cite book | last1 = Goulden | first1 = Ian P. | last2 = Jackson | first2 = David M. | author-link2 = David M. Jackson | title = Combinatorial Enumeration | year = 2004 | publisher = [[Dover Publications]] | isbn = 978-0486435978 }} * {{cite book |title=[[Concrete Mathematics|Concrete Mathematics. A foundation for computer science]] |edition=2nd |year=1994 |publisher=Addison-Wesley |isbn=0-201-55802-5 |chapter=Chapter 7: Generating Functions |pages=320–380| zbl=0836.00001 |first1 = Ronald L. |last1=Graham |first2 = Donald E. |last2=Knuth |first3=Oren |last3=Patashnik |author-link1=Ronald Graham |author-link2=Donald Knuth |author-link3=Oren Patashnik }} *{{cite book |first=Sergei K. |last=Lando |title=Lectures on Generating Functions |url=https://books.google.com/books?id=A6_4AwAAQBAJ |date=2003 |publisher=American Mathematical Society |isbn=978-0-8218-3481-7 }} * {{cite book | last=Wilf | first=Herbert S. | author-link=Herbert Wilf | title=Generatingfunctionology | edition=2nd | publisher=Academic Press | year=1994 | isbn=0-12-751956-4 | zbl=0831.05001 | url=http://www.math.upenn.edu/%7Ewilf/DownldGF.html }} ==External links== * [http://garsia.math.yorku.ca/~zabrocki/MMM1/MMM1Intro2OGFs.pdf "Introduction To Ordinary Generating Functions"] by Mike Zabrocki, York University, Mathematics and Statistics * {{springer|title=Generating function|id=p/g043900}} * [http://www.cut-the-knot.org/ctk/GeneratingFunctions.shtml Generating Functions, Power Indices and Coin Change] at [[cut-the-knot]] * [http://demonstrations.wolfram.com/GeneratingFunctions/ "Generating Functions"] by [[Ed Pegg Jr.]], [[Wolfram Demonstrations Project]], 2007. {{Authority control}} {{DEFAULTSORT:Generating Function}} [[Category:1730 introductions]] [[Category:Generating functions| ]] [[Category:Abraham de Moivre]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Apostol IANT
(
edit
)
Template:Authority control
(
edit
)
Template:Block quote
(
edit
)
Template:Cite arXiv
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite thesis
(
edit
)
Template:Cite web
(
edit
)
Template:Expand section
(
edit
)
Template:Harvnb
(
edit
)
Template:Main
(
edit
)
Template:Main article
(
edit
)
Template:Math
(
edit
)
Template:Math theorem
(
edit
)
Template:Mvar
(
edit
)
Template:NoteFoot
(
edit
)
Template:NoteTag
(
edit
)
Template:Nowrap
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Springer
(
edit
)