Talk 7
Talk 7
1 Introduction
Generating functions are a powerful tool in number theory that can be used to
solve recurrence relations. In this talk, I will discuss the purpose of generating
functions and how they are used. I will begin with a basic definition of
generating functions, introduce four operations on generating functions, and
explain how to find both generating and closed functions using the Fibonacci
sequence. Lastly, I will talk about asymptotic approximations of the Fibonacci
Sequence.
2 Generating Functions
Generating Functions transforms problems about sequences into problems about
functions. They do this by coding the terms of a sequence of real numbers as
coefficients of powers of a variable (for example, x) in a formal power series.
This transformation allows us to compute different operations on the formal
power series and solve problems related to the infinite sequence.
P∞
[G(x) = n=0 an xn ]
Here are some basic examples of infinite series and their corresponding gener-
ating function.
1
Recall that the sum of an infinite geometric series is:
1
1 + x + z 2 + z 3 + ... = 1−z
This equation does not hold when the absolute value of z ≥1.This formula gives
closed-form generating functions for a whole range of sequences. For example:
1
⟨1, 1, 1, 1, ...⟩ ←→ 1 + x + x2 + x3 + ... = 1−x
2 3 4 1
⟨1, −1, 1, −1, ...⟩ ←→ 1 − x + x − x + x − ... = 1+x
2 4 6 1
⟨1, 0, 1, 0, 1, 0, ...⟩ ←→ 1 + x + x + x + ... = 1−x2
3.1 Scaling
2
Adding generating functions corresponds to adding the two sequences term by
term. For example, adding two of our earlier examples gives:
1
1, 1, 1, 1, 1, 1, ...⟩ ←→ 1−x
1
+⟨1, −1, 1, −1, 1, −1, ...⟩ ←→ 1+x
1 1 2
= ⟨2, 0, 2, 0, 2, 0, ...⟩ ←→ 1−x + 1+x = 1−x2
3
What happens when we take the derivative of a generating function? Let’s dif-
ferentiate the generating function for an infinite sequence of 1’s (as seen earlier):
d d 1
dx (1 + x + x2 + x3 + x4 + ...) = dx ( 1−x )
2 3 1
1 + 2x + 3x + 4x + ... = (1−x)2
1
⟨1, 2, 3, 4⟩ ←→ (1−x) 2
Above, we found the generating function for the sequence ⟨1, 2, 3, 4, ...⟩. In gen-
eral, differentiating a generating function has two effects on the corresponding
sequence: each term is multiplied by its index and the entire sequence is shifted
left one place.
Derivative Rule:
If
4 Fibonacci Sequence
Sometimes, we can find nice generating functions for more complicated se-
quences. For example, the Fibonacci numbers:
x
⟨0, 1, 1, 2, 3, 5, 8, 13, 21, ...⟩ ←→ 1−x−x2
We’re going to derive this generating function and then use it to find a closed
form for the n=Fibonacci number. The definition of a closed-form expression
is a mathematical process that can be completed in a finite number of operations.
4
Let’s begin with the definition of the Fibonacci numbers (using f):
f0 = 0
f1 = 1
fn = fn−1 + fn−2 (f orn ≥ 2)
We can expand the final clause into an infinite sequence of equation. Thus, the
Fibonacci numbers are defined by:
f0 = 0
f1 = 1
f2 = f1 + f0
f3 = f2 + f1
.
.
.
We want to define a function F(x) that generates the sequence on the left side
of the equality symbols, which are the Fibonacci numbers. Then, we can derive
a function that generates the sequence on the right.
First lets define F(x):
F (x) = f0 + f1 x + f2 x2 + f3 x3 + x4 x4 + ...
Now we need to derive a generating function for the sequence:
⟨0, 1, f1 + f0 , f2 + f1 , f3 + f2 , ...⟩
One approach is to break this into a sum of three sequences, which we can do
using three different generating functions and applying the Addition Rule
5
x A1 A2
1−x−x2 = 1−α1 x + 1−α2 x
Substituting into the equation above gives the partial fractions expansion of
F (x):
x √1 ( 1 1
1−x−x2 = 5 1−α1 x
− 1−α2 x )
Each term in the partial fractions expansion has a simple power series given by
the geometric sum formula:
1
( 1−α 1x
= 1 + α1 x + α12 x2 + ...
1
( 1−α2 x = 1 + α2 x + α22 x2 + ...
When we substitute the series from above into our generating function, we end
with:
√ √
F (x) = √1 (( 1+ 5 )n − ( 1−2 5 )n )
5 2
5 Asymptotic Approximations
Asymptotic approximations are a tool used to estimate the behavior of a func-
tion/sequence as a variable approaches a certain limit (usually infinity or 0).
It’s a way of examining the behavior of a function as it gets really close to a
certain value without evaluating it at that point. The Taylor series of a function
is a common example of how to obtain the asymptotic approximation.
x
For the Fibonacci numbers, we found that the generating series is 1−x−x 2 , and
from here, we can derive the exact formula for the Fibonacci numbers. However,
one could more easily make some analytic observations: 1 − x − x2 has zeros
at sqrt5±1
2 , so the generating function F(x) has poles at those two points. From
knowing about geometric series, we know that a simple function with a pole
1
at point c is c−x = 1c · 1−x/c
1
, which is the generating function of the sequence
( 1c , c12 , c13 ... i.e. the sequence an = c(−n) . This suggests that the nth Fibonacci
√
−n
number might be close to some combination of ( 5±1 2 ) . We only need to
observe that one of these zeros will give an increasing sequence. The first (+1)
tends to 0, while the second (-1) is increasing and will dominate, √so we expect
that asymptotically the n-th Fibonacci number should be about ( 5+1 n
2 ) up to
some scalar.
√
5+1
Note that 2 is the golden ratio.