Generating Functions ITT9131 Konkreetne Matemaatika

Generating Functions ITT9131 Konkreetne Matemaatika

Generating Functions ITT9131 Konkreetne Matemaatika Chapter Seven Domino Theory and Change Basic Maneuvers Solving Recurrences Special Generating Functions Convolutions Exponential Generating Functions Dirichlet Generating Functions Contents 1 Convolutions Fibonacci convolution m-fold convolution Catalan numbers 2 Exponential generating functions Next section 1 Convolutions Fibonacci convolution m-fold convolution Catalan numbers 2 Exponential generating functions Convolutions Given two sequences: hf0;f1;f2;:::i = hfni and hg0;g1;g2;:::i = hgni The convolution of hfni and hgni is the sequence * + * + f g f g f g f g f g f g f g f g h 0 0; 0 1 + 1 0; 0 2 + 1 1 + 2 0;:::i = ∑ k n−k = ∑ k ` : k k+`=n If F (z) and G(z) are generating functions on the sequences hfni and hgni, then their convolution has the generating function F (z) · G(z). Three or more sequences can be convolved analogously, for example: * + f g h f g h h nih nih ni = ∑ j k ` j+k+`=n and the generating function of this three-fold convolution is the product F (z) · G(z) · H(z). Convolutions Given two sequences: hf0;f1;f2;:::i = hfni and hg0;g1;g2;:::i = hgni The convolution of hfni and hgni is the sequence * + * + f g f g f g f g f g f g f g f g h 0 0; 0 1 + 1 0; 0 2 + 1 1 + 2 0;:::i = ∑ k n−k = ∑ k ` : k k+`=n If F (z) and G(z) are generating functions on the sequences hfni and hgni, then their convolution has the generating function F (z) · G(z). Three or more sequences can be convolved analogously, for example: * + f g h f g h h nih nih ni = ∑ j k ` j+k+`=n and the generating function of this three-fold convolution is the product F (z) · G(z) · H(z). Convolutions Given two sequences: hf0;f1;f2;:::i = hfni and hg0;g1;g2;:::i = hgni The convolution of hfni and hgni is the sequence * + * + f g f g f g f g f g f g f g f g h 0 0; 0 1 + 1 0; 0 2 + 1 1 + 2 0;:::i = ∑ k n−k = ∑ k ` : k k+`=n If F (z) and G(z) are generating functions on the sequences hfni and hgni, then their convolution has the generating function F (z) · G(z). Three or more sequences can be convolved analogously, for example: * + f g h f g h h nih nih ni = ∑ j k ` j+k+`=n and the generating function of this three-fold convolution is the product F (z) · G(z) · H(z). Next subsection 1 Convolutions Fibonacci convolution m-fold convolution Catalan numbers 2 Exponential generating functions Fibonacci convolution To compute ∑k fk fn−k use Fibonacci generating function (in the form given by Theorem 1 and considering that n 1 zn 1 ): ∑( + ) = (1−z)2 1 1 1 2 F 2 z p ( ) = 1 z − 5 − Φ 1 − Φbz 1 1 2 1 ! = − + 5 1 z 2 2 ( − Φ ) (1 − Φz)(1 − Φbz) (1 − Φbz) 1 2 1 n 1 nzn f zn n 1 nzn = 5 ∑ ( + )Φ − 5 ∑ n+1 + 5 ∑ ( + )Φb n>0 n>0 n>0 1 2 n 1 n n zn f zn = 5 ∑ ( + )(Φ + Φb ) − 5 ∑ n+1 n>0 n>0 1 2 n 1 2f f zn f zn = 5 ∑ ( + )( n+1 − n) − 5 ∑ n+1 n>0 n>0 1 2nf n 1 f zn = 5 ∑ ( n+1 − ( + ) n) n>0 Hence 2nf n 1 f f f n+1 − ( + ) n ∑ k n−k = 5 k Fibonacci convolution (2) On the previous slide the following was used: Property For any n 0: n n 2f f > Φ + Φb = n+1 − n Proof n n 1 n n 1 The equalities ∑n Φ z = 1 z , ∑n Φb z = , and Φ + Φb = 1 are used in the −Φ 1−Φbz following derivation: 1 1 1 z 1 z n n zn − Φb + − Φ ∑(Φ + Φb ) = 1 z + = = n − Φ 1 − Φbz (1 − Φz)(1 − Φbz) 2 − z 2 z z = = · − = 1 − z − z2 z 1 − z − z2 1 − z − z2 2 n n n−1 n = ∑fnz − ∑fnz = 2∑fnz − ∑fnz = z n n n n 2 f zn f zn = ∑ n+1 − ∑ n = n n 2f f zn = ∑( n+1 − n) n Q.E.D. Fibonacci convolution (2) On the previous slide the following was used: Property For any n 0: n n 2f f > Φ + Φb = n+1 − n Proof (alternative) We know from Exercise 6.28 that n n Φ + Φb = Ln = fn+1 + fn−1 ; with the convention f−1 = 1, is the nth Lucas number, which is the solution to the recurrence: L0 = 2; L1 = 1; L L L n 2 n = n−1 + n−2 8 > : By writing the recurrence relation for Fibonacci numbers in the form fn−1 = fn+1 − fn (which, incidentally, yields f−1 = 1), we get precisely Ln = 2fn+1 − fn. Q.E.D. Next subsection 1 Convolutions Fibonacci convolution m-fold convolution Catalan numbers 2 Exponential generating functions Spanning trees for fan Example: the fan of order 5: Spanning trees: Spanning trees for fan Example: the fan of order 5: Spanning trees: Spanning trees for fan (2) How many spanning trees can we make? We need to connect 0 to each of the four blocks: two ways to join 0 with f9;10g, one way to join 0 with f8g, four ways to join 0 with f4;5;6;7;g, three ways to join 0 with f1;2;3g, There is altogether 2 · 1 · 4 · 3 = 24 ways for that. In general: sn = ∑ ∑ k1k2 ···km m 0 > k1 + k2 + ··· + km = n k1;k2;:::;km > 0 Spanning trees for fan (2) How many spanning trees can we make? We need to connect 0 to each of the four blocks: two ways to join 0 with f9;10g, one way to join 0 with f8g, four ways to join 0 with f4;5;6;7;g, three ways to join 0 with f1;2;3g, There is altogether 2 · 1 · 4 · 3 = 24 ways for that. In general: sn = ∑ ∑ k1k2 ···km m 0 > k1 + k2 + ··· + km = n k1;k2;:::;km > 0 For example f4 = 4 + 3 · 1 + 2 · 2 + 1 · 3+2 · 1 · 1 + 1 · 2 · 1 + 1 · 1 · 2+1 · 1 · 1 · 1 = 21 | {z } | {z } Spanning trees for fan (2) How many spanning trees can we make? We need to connect 0 to each of the four blocks: two ways to join 0 with f9;10g, one way to join 0 with f8g, four ways to join 0 with f4;5;6;7;g, three ways to join 0 with f1;2;3g, There is altogether 2 · 1 · 4 · 3 = 24 ways for that. In general: sn = ∑ ∑ k1k2 ···km m 0 > k1 + k2 + ··· + km = n k1;k2;:::;km > 0 This is the sum of m-fold convolutions of the sequence h0;1;2;3;:::i. Spanning trees for fan (3) Generating function for the number of spanning trees: The sequence h0;1;2;3;:::i has the generating function z G(z) = : (1 − z)2 Hence the generating function forhfni is G(z) S(z) = G(z) + G 2(z) + G 3(z) + ··· = 1 − G(z) z = 1 z 2 1 z ( − ) ( − (1−z)2 ) z = (1 − z)2 − z z = : 1 − 3z + z2 Spanning trees for fan (3) Generating function for the number of spanning trees: The sequence h0;1;2;3;:::i has the generating function z G(z) = : (1 − z)2 Hence the generating function forhfni is G(z) S(z) = G(z) + G 2(z) + G 3(z) + ··· = 1 − G(z) z = 1 z 2 1 z ( − ) ( − (1−z)2 ) z = (1 − z)2 − z z = : 1 − 3z + z2 Consequently sn = f2n Next subsection 1 Convolutions Fibonacci convolution m-fold convolution Catalan numbers 2 Exponential generating functions Dyck language Denition The Dyck language is the language consisting of balanced strings of parentheses '[' and ']'. Another denition If X = fx;xg is the alphabet, then the Dyck language is the subset D of words u of X ∗ which satisfy 1 ujx = jujx , where jujx is the number of letters x in the word u, and ∗ 2 if u is factored as vw, where v and w are words of X , then jvjx > jvjx . Dyck language (2) Let Cn be the number of words in the Dyck language D having exactly n pairs of parentheses. If u = vw for u 2 D, then the prex v 2 D i the sux w 2 D Then every word u 2 D of length > 2 has a unique writing u = [v]w such that v;w 2 D (possibly empty) but [p 62 D for every prex p of u (including u itself). Hence, for any n > 0 Cn = C0Cn−1 + C1Cn−2 + ··· + Cn−1C0 The number series hCni is called Catalan numbers, from the Belgian mathematician Eugène Catalan. Let us derive the closed formula for Cn in the following slides. Catalan numbers Step 1 The recurrent equation of Catalan numbers for all integers C C C n 0 n = ∑ k n−1−k + [ = ]: k n Step 2 Write down C(z) = ∑n Cnz : C z C zn C C zn n 0 zn ( ) = ∑ n = ∑ k n−1−k + ∑[ = ] n k;n n C zk z C zn−1−k 1 = ∑ k ∑ n−1−k + k n k n = ∑Ck z z ∑Cnz + 1 k n = zC 2(z) + 1 Catalan numbers Step 1 The recurrent equation of Catalan numbers for all integers C C C n 0 n = ∑ k n−1−k + [ = ]: k n Step 2 Write down C(z) = ∑n Cnz : C z C zn C C zn n 0 zn ( ) = ∑ n = ∑ k n−1−k + ∑[ = ] n k;n n C zk z C zn−1−k 1 = ∑ k ∑ n−1−k + k n k n = ∑Ck z z ∑Cnz + 1 k n = zC 2(z) + 1 Catalan numbers (2) Step 3 Solving the quadratic equation zC 2(z) − C(z) + 1 = 0 for C(z) yields directly: p 1 1 4z C z ± − ( ) = 2z : (Solution with "+" isn't proper as it leads to C0 = C(0) = ¥.) Step 4 From the binomial theorem we get: p 1=2 k 1 −1=2 k 1 − 4z = (−4z) = 1 + (−4z) ∑ k ∑ 2k k − 1 k>0 k>1 −1=2 n2n Using the equality for binomials n = (−1=4) n we nally get p 1 − 1 − 4z 1 −1=2 k 1 C(z) = = (−4z) − 2z ∑ k k − 1 k>1 n −1=2 (−4z) = ∑ n n + 1 n>0 2n zn = ∑ n n + 1 n>0 Catalan numbers (2) Step 3 Solving the quadratic equation zC 2(z) − C(z) + 1 = 0 for C(z) yields directly: p 1 1 4z C z ± − ( ) = 2z : (Solution with "+" isn't proper as it leads to C0 = C(0) = ¥.) Step 4 From the binomial theorem we get: p 1=2 k 1 −1=2 k 1 − 4z = (−4z) = 1 + (−4z) ∑ k ∑ 2k k − 1 k>0 k>1 −1=2 n2n Using the equality for binomials n = (−1=4) n we nally get p 1 − 1 − 4z 1 −1=2 k 1 C(z) = = (−4z) − 2z ∑ k k − 1 k>1 n −1=2 (−4z) = ∑ n n + 1 n>0 2n zn = ∑ n n + 1 n>0 −1=2 n2n Proof that n = (−1=4) n We prove a bit more: for every r 2 R and k > 0, k 2k 1 (2r) r k · r − = 2 22k −1=2 n2n Proof that n = (−1=4) n We prove a bit more: for every r 2 R and k > 0, k 2k 1 (2r) r k · r − = 2 22k Indeed, 1 k 1 3 1 r k r r r r 1 r r k 1 r k 1 · − 2 = · − 2 · ( − ) · − 2 ···( − − ) · − 2 − + 2r 2r − 1 2r − 2 2r − 3 2r − 2k − 2 2r − 2k + 1 = 2 · 2 · 2 · 2 ··· 2 · 2 2k (2r) = 22k −1=2 n2n Proof that n = (−1=4) n We prove a bit more: for every r 2 R and k > 0, k 2k 1 (2r) r k · r − = 2 22k Indeed, 1 k 1 3 1 r k r r r r 1 r r k 1 r k 1 · − 2 = · − 2 · ( − ) · − 2 ···( − − ) · − 2 − + 2r 2r − 1 2r − 2 2r − 3 2r − 2k − 2 2r − 2k + 1 = 2 · 2 · 2 · 2 ··· 2 · 2 2k (2r) = 22k Then for r = k = n, dividing by (n!)2 and using nn = n!, n n − 1=2 1 2n n = 4 n : k k and as r k = (−1)k (−r) = (−1)k (−r + k − 1) , −1=2 n − (n − 1=2) − 1 (−1)n 2n n = n = 4n n Q.E.D.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    46 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us