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
(section)
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!
==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}}.
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)