This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 12 mcs-ftl 2010/9/8 0:40 page 355 #361 Generating Functions Generating Functions are one of the most surprising and useful inventions in Dis- crete Math. Roughly speaking, generating functions transform problems about se- quences into problems about functions . This is great because weve got piles of mathematical machinery for manipulating functions. Thanks to generating func- tions, we can then apply all that machinery to problems about sequences. In this way, we can use generating functions to solve all sorts of counting problems. They can also be used to find closed-form expressions for sums and to solve recurrences. In fact, many of the problems we addressed in Chapters 9 11 can be formulated and solved using generating functions. 12.1 Definitions and Examples The ordinary generating function for the sequence 1 h g ;g 1 ;g 2 ;g 3 ::: i is the power series: G.x/ D g C g 1 x C g 2 x 2 C g 3 x 3 C : There are a few other kinds of generating functions in common use, but ordinary generating functions are enough to illustrate the power of the idea, so well stick to them and from now on, generating function will mean the ordinary kind. A generating function is a formal power series in the sense that we usually regard x as a placeholder rather than a number. Only in rare cases will we actually evaluate a generating function by letting x take a real number value, so we generally ignore the issue of convergence. Throughout this chapter, well indicate the correspondence between a sequence and its generating function with a double-sided arrow as follows: h g ;g 1 ;g 2 ;g 3 ;::: i ! g C g 1 x C g 2 x 2 C g 3 x 3 C : For example, here are some sequences and their generating functions: h 0;0;0;0;::: i ! C 0x C 0x 2 C 0x 3 C D h 1;0;0;0;::: i ! 1 C 0x C 0x 2 C 0x 3 C D 1 h 3;2;1;0;::: i ! 3 C 2x C 1x 2 C 0x 3 C D 3 C 2x C x 2 1 In this chapter, well put sequences in angle brackets to more clearly distinguish them from the many other mathematical expressions oating around. 356 mcs-ftl 2010/9/8 0:40 page 356 #362 Chapter 12 Generating Functions The pattern here is simple: the i th term in the sequence (indexing from 0) is the coefficient of x i in the generating function. Recall that the sum of an infinite geometric series is: 1 z z : 1 C z C 2 C 3 C D 1 z This equation does not hold when j z j 1 , but as remarked, we wont worry about convergence issues for now. This formula gives closed form generating functions for a whole range of sequences. For example: 1 h 1;1;1;1;::: i ! 1 C x C x 2 C x 3 C x 4 C D x 1 1 h 1; 1;1; 1;::: i ! 1 x C x 2 x 3 C x 4 D 1 C x 1 1;a;a 2 ;a 3 ;::: ! 1 C ax C a 2 x 2 C a 3 x 3 C D ax 1 1 h 1;0;1;0;1;0;::: i ! 1 C x 2 C x 4 C x 6 C x 8 C D 1 2 x 12.2 Operations on Generating Functions The magic of generating functions is that we can carry out all sorts of manipulations on sequences by performing mathematical operations on their associated generating functions. Lets experiment with various operations and characterize their effects functions....
View Full Document
This note was uploaded on 01/19/2012 for the course CS 6.042J / 1 taught by Professor Tomleighton,dr.martenvandijk during the Fall '10 term at MIT.
- Fall '10
- Computer Science