Download Lecture 16 MATH1904 Generating Functions When faced with a

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Addition wikipedia , lookup

Ambiguity wikipedia , lookup

Abuse of notation wikipedia , lookup

Principia Mathematica wikipedia , lookup

Karhunen–Loève theorem wikipedia , lookup

History of the function concept wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Big O notation wikipedia , lookup

Large numbers wikipedia , lookup

Hyperreal number wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Functional decomposition wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Non-standard calculus wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Lecture 16 MATH1904
Generating Functions
When faced with a difficult counting
problem, such as finding a formula for the
n-th Catalan number cn, one of the most
powerful techniques is to consider the
numbers c0, c1, c2, . . . simultaneously and
to bundle them up into a single
mathematical object called a generating
function (otherwise known as a formal
power series).
Definition
Given a sequence
a0 , a 1 , a 2 , a 3 , . . . ,
its generating function is the power series
G(z) = a0 + a1z + a2z 2 + a3z 3 + · · · .
In Σ-notation we write this as
G(z) =
∞
X
ak z k .
k=0
1
Example. The generating function of the
Catalan numbers is
C(z) =
∞
X
cn z n =
n=0
1 + z + 2z 2 + 5z 3 + 14z 4 + 42z 5 + · · ·
The algebra of generating functions
Generating functions can be added and
multiplied just like polynomials. That is, if
G1(z) = a0 + a1z + a2z 2 + a3z 3 + · · ·
and
G2(z) = b0 + b1z + b2z 2 + b3z 3 + · · ·
then
G1 (z) + G2 (z) =
(a0 + b0 ) + (a1 + b1 )z + (a2 + b2 )z 2 + · · ·
and
G1 (z)G2 (z) = c0 + c1 z + c2 z 2 + c3 z 3 + · · · ,
where
ck = a0 bk + a1 bk−1 + a2 bk−2 + · · · + ak b0 .
2
Example.
The Vandermonde convolution
From the binomial theorem we have
w X
w k
w
(1 + z) =
z
k
k=0
and
(1 + z)m =
m X
m k
z
k=0
k
In this the case the generating functions
really are polynomials. In any case, when
we multiply them together we get
(1 + z)w (1 + z)m = (1 + z)w+m
On comparing coefficients of z n we see that
n X
w
m k=0
k
n−k
=
w + m
n
.
3
Closed forms
Generating functions are power series which
usually involve infinitely many terms. We
would like to find simpler expressions for
these series, using only a finite number of
mathematical operations. These simpler
expressions are called closed forms.
If the terms of the sequence an are 0 from
some point on, the generating function
G(z) is really an ordinary polynomial and it
is already a closed form, as was the case for
the previous example.
Fortunately, for many sequences, even those
with infinitely many non-zero terms, we can
still find closed forms.
Example.
The generating function of
1, 1, 1, 1, 1, 1, . . . is
G(z) = 1 + z + z 2 + · · · .
Multiplying by z and subtracting from G(z) we find
that G(z) − zG(z) = 1 and this allows us to write
1
.
1−z
This is a closed form for G(z).
G(z) =
4
Negative powers of 1 − z
It will often be useful to know the coefficient of z m
in (1 − z)−n.
From the previous example we have
(1 − z)−1 = 1 + z + z 2 + z 3 + · · ·
and therefore, for n ≥ 1,
(1 − z)−n =
(1 + z + z 2 + z 3 + · · · ) . . . (1 + z + z 2 + z 3 + · · · ).
|
{z
}
n factors
The coefficient of z m in this product is equal to the
number of ways one can form z m by multiplying
together n terms, one from each factor. That is, it
is the number of choices of d1 , d2 , . . . , dn such that
z d1 z d2 . . . z dn = z m .
This is the number of solutions to the equation
d1 + d2 + · · · + dn = m,
where each di is a non-negative integer. This is just
the number of ways to select m things from n things,
allowing repetition and therefore the number is
m + n − 1
.
m
Putting these observations together gives the
formula
(1 − z)
−n
∞ X
m + n − 1 m
=
z .
m
m=0
5
Some special cases
When n = 2 we have
m + n − 1
m + 1 =
= m + 1,
m
m
and so
(1 − z)−2 = 1 + 2z + 3z 2 + 4z 3 + · · · .
When n = 3 we have
m + n − 1
m + 2
=
= (m + 2)(m + 1)/2,
m
m
and so
(1 − z)−3 = 1 + 3z + 6z 2 + 10z 3 + · · · .
Derivatives
The derivative of
G(z) = a0 + a1z + a2z 2 + a3z 3 + · · ·
is
G0(z) = a1 + 2a2z + 3a3z 2 + · · · .
Using the derivative and mathematical induction we
can derive anew the formula for (1 − z)−n.
6