0% found this document useful (0 votes)
2 views

lecture_40_generating_functions

The document discusses generating functions, particularly the z-transform, which transforms sequences into a single function to facilitate analysis. It explains how to manipulate and invert generating functions to recover original sequences, using examples such as geometric series and rational functions. The document emphasizes the importance of these transformations in combinatorics and probability, providing methods for adding transforms and inverting them to derive sequence terms.

Uploaded by

taiyamxx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

lecture_40_generating_functions

The document discusses generating functions, particularly the z-transform, which transforms sequences into a single function to facilitate analysis. It explains how to manipulate and invert generating functions to recover original sequences, using examples such as geometric series and rational functions. The document emphasizes the importance of these transformations in combinatorics and probability, providing methods for adding transforms and inverting them to derive sequence terms.

Uploaded by

taiyamxx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CS 547 Lecture 40: Generating Functions

Daniel Myers

Transformations
Generating functions are an important tool in combinatorics, probability, and modeling applications. In
general, a generating function is a transformation of some mathematical object, such as a sequence, into
an alternate form. By changing the form, we may be able to learn things about an object that would be
impossible to discover by working with the original form.

The z-Transform
Consider a sequence
f0 , f1 , f2 , f3 , . . .
More technically, we may think of f as function of discrete time that can only take non-zero values at
non-negative time steps.

Define the z-transform of the sequence to be a function of the parameter z given by

F (z) = f0 + f1 z + f2 z 2 + f3 z 3 + . . .
X∞
= fk z k
k=0

The transformation “compresses” the sequence into a single function of the argument, z. Technically, it’s
possible to evaluate the function for particular values of z – provided that the infinite sum converges – but
in practice this is rarely necessary. For the most part, we’ll treat z as a placeholder and obtain our results
by algebraically manipulating the transform.

When the term “generating function” is used without further qualification, it refers to the z-transform.

Examples
Let’s start with a sequence with a single non-zero value.

0, 0, 1, 0, 0, . . .

The z-transform of this sequence is

F (z) = 0 · z 0 + 0 · z 1 + 1 · z 2 + 0 · z 3 + . . . = z 2

Having a zero in any position in the sequence eliminates that term from the transform polynomial.

If we multiply the sequence by a constant, we also multiply its transform

0, 0, a, 0, 0, . . .

1
F (z) = 0 · z 0 + 0 · z 1 + a · z 2 + 0 · z 3 + . . . = az 2

The follwing sequence of ones is important.

1, 1, 1, 1, 1, . . .

Its transform has the form of a geometric series.



X 1
F (z) = zk =
1−z
k=0

Since we’ll encounter lots of infinite sums, it’s important to say a word about convergence. Technically, the
1
geometric series only converges to 1−z for z < 1. Because we’re only using z as a placeholder, though, we
won’t worry about convergence issues. Instead, we’ll just treat the summation as if it converges, without
ever specifying a valid range of values for z. It turns out all of the manipulations we need to solve problems
with generating functions can be justified using other concepts (i.e. formal power series), so we don’t need
to obsess over convergence issues.

The following transform is key to several of our applications.

A, Aα, Aα2 , Aα3 , . . .

Its transform is a variation of the geometric series.



X A
F (z) = Aαk z k =
1 − αz
k=0

This result will be the key to inverting transforms, which we’ll apply in the next lecture.

Adding Transforms
The transform of the sum of two sequences is the sum of their individual transforms. For example,

A, Aα, Aα2 , Aα3 , . . .


B, Bβ, Bβ 2 , Bβ 3 , . . .

Adding the two sequences and taking the transform,



X
H(z) = (Aαk + Bβ k )z k
k=0
X∞ ∞
X
= Aαk z k + Bβ k z k
k=0 k=0
A B
= +
1 − αz 1 − βz

Inverting
Given the z-transform of a sequence, we can invert the transform to recover the original generating sequence.
At this point, this may not seem helpful, since we’ve only seen the generating functions of trivial sequences.
Inversion becomes powerful when we don’t know how to calculate the terms of a sequence, but we know how
to get its generating function by some other method. Inverting the generating function then gives a way of
calculating the terms of the unknown sequence.

2
There are multiple ways to invert a generating function, but the simplest method (and only one we’ll use in
this course) is inspection. Just manipulate the generating function into a combination of simpler functions
of known form, then invert the simpler functions individually. The power series is by far the most commonly
used form for this type of inversion. For example,
1 1
F (z) = +
1 − 3z 1 − 2z
This has the form of the summed series from the previous section. Rewriting,

X
F (z) = (3k + 2k )z k
k=0

Therefore, the individual terms of the original sequence can be calculated using fk = 3k + 2k .

How about this function?


1
F (z) =
1 − 3z + 2z 2
It doesn’t have the basic power series form. We could examine a table of transforms looking for a similar
function, but we won’t find anything. In order to invert this function, we need to get it into a form more
like the sum of power series from the previous example.

First, we can factor the denominator.


1
F (z) =
(1 − z)(1 − 2z)
This looks promising, as the terms in the denominator have the right form, but we need to split this single
rational function into a sum in order to complete the inversion. Our goal is to find numerators A and B,
such that
1 A B
F (z) = = +
(1 − z)(1 − 2z) 1−z 1 − 2z
Once this is done, we’ll have the sum of two power series, just like in the previous example, and we can
invert it easily by inspection.

The general technique for simplifying rational functions is partial fractions. In these examples, we’ll use
a simplified technique that works when the denominator is a second-degree polynomial. First, factor the
A B
polynomial, which we’ve already done. Next, imagine combining 1−z and 1−2z over a common denominator.
The numerator of that combined fraction must equal the original numerator.

(1 − 2z)A + (1 − z)B = 1

Setting z = 1 and solving, we obtain A = −1. Setting z = 12 , we obtain B = 2. The factored generating
function is
−1 2
F (z) = +
1−z 1 − 2z
Using the power series formula to simplify,

X ∞
X
k
F (z) = (−1)z + 2 2k z k
k=0 k=0

The nth term of the corresponding sequence is fn = 2n+1 − 1.

You might also like