Upload
others
View
30
Download
0
Embed Size (px)
Citation preview
Page 1 of 15
Math 3336 Recurrence Relations
Definition: A recurrence relation for the sequence {ππππ} is an equation that expresses ππππ in terms of one or more of the previous terms of the sequence, namely, ππ0, ππ1, β¦ ,ππππβ1, for all integers ππ with ππ β₯ ππ0, where ππ0 is a nonnegative integer.
β’ A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.
β’ The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect.
Rabbits and the Fibonacci Numbers
Example: A young pair of rabbits (one of each gender) is placed on an island. A pair of rabbits does not breed until they are 2 months old. After they are 2 months old, each pair of rabbits produces another pair each month. Find a recurrence relation for the number of pairs of rabbits on the island after n months, assuming that rabbits never die.
This is the original problem considered by Leonardo Pisano (Fibonacci) in the thirteenth century.
Page 2 of 15
Solution:
Page 3 of 15
The Tower of Hanoi
In the late nineteenth century, the French mathematician EΓ douard Lucas invented a puzzle consisting of three pegs on a board with disks of different sizes. Initially all of the disks are on the first peg in order of size, with the largest on the bottom.
Rules: You are allowed to move the disks one at a time from one peg to another as long as a larger disk is never placed on a smaller. oal: Using allowable moves, end up with all the disks on the second peg in order of size with largest on the bottom. Solution:
Page 4 of 15
β’ There was a myth created with the puzzle. Monks in a tower in Hanoi are transferring 64 gold disks from one peg to another following the rules of the puzzle. They move one disk each day. When the puzzle is finished, the world will end.
β’ Using this formula for the 64 gold disks of the myth,
264 β1 = 18,446, 744,073, 709,551,615 days are needed to solve the puzzle, which is more than 500 billion years.
β’ Reveβs puzzle (proposed in 1907 by Henry Dudeney) is similar but has 4 pegs. There is a well-known unsettled conjecture for the minimum number of moves needed to solve this puzzle.
Page 5 of 15
Counting Bit Strings Example: Find a recurrence relation and give initial conditions for the number of bit strings of length n without two consecutive 0s. How many such bit strings are there of length five? Solution:
Page 6 of 15
Linear Homogeneous Recurrence Relations Definition: A linear homogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form a
n = c
1a
nβ1 + c
2a
nβ2 + β¦.. + c
k a
nβk , where c
1, c
2, β¦.,c
k are
real numbers, and ck β 0
Examples of Recurrence Relations 1. Pn = (1.11)Pnβ1
2. ππππ = ππππβ1 + ππππβ2
3. ππππ = ππππβ1 + ππππβ22
4. π»π»ππ = 2π»π»ππβ1 + 1
5. ππππ = ππππππβ1
6. ππππ = 3ππππβ1 + 4ππππβ2 + 5ππππβ3
Page 7 of 15
Solving Linear Homogeneous Recurrence Relations Solving Linear Homogeneous Recurrence Relations of Degree Two
Theorem 1: Let ππ1 and ππ2 be real numbers. Suppose that ππ2 β ππ1ππ β ππ2 = 0 has two distinct roots ππ1 and ππ2. Then the sequence {ππππ} is a solution to the recurrence relation ππππ =ππ1ππππβ1 + ππ2ππππβ2 if and only if ππππ = πΌπΌ1ππ1ππ + πΌπΌ2ππ2ππ for ππ = 0,1,2, β¦ , where πΌπΌ1 and πΌπΌ2 are constants. Example: What is the solution of the recurrence relation ππππ = ππππβ1 + 2ππππβ2? Step 1: Write a characteristic equation of a recurrence relation (CERR). If aππ = ππ1ππππβ1 + ππ2ππππβ2 + β―+ ππππππππβππ, then
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 is the characteristic equation of ππππ. Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌ1 and πΌπΌ2 from initial conditions.
Page 8 of 15
Step 5: Write the solution. Example: What is the solution of the recurrence relation ππππ = ππππβ1 + 6ππππβ2? Step 1: Write a characteristic equation of a recurrence relation (CERR). If aππ = ππ1ππππβ1 + ππ2ππππβ2 + β―+ ππππππππβππ, then
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 is the characteristic equation of ππππ. Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌ1 and πΌπΌ2 from initial conditions.
Page 9 of 15
Step 5: Write the solution Example: Find an explicit formula for the Fibonacci numbers. Step 1: Write a characteristic equation of a recurrence relation (CERR). If aππ = ππ1ππππβ1 + ππ2ππππβ2 + β―+ ππππππππβππ, then
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 is the characteristic equation of ππππ. Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌ1 and πΌπΌ2 from initial conditions.
Page 10 of 15
Step 5: Write the solution
Theorem 2: Let ππ1 and ππ2 be real numbers with ππ2 β 0 . Suppose that ππ2 β ππ1ππ β ππ2 = 0 has only one root ππ0. A sequence {ππππ} is a solution of the recurrence relation ππππ = ππ1ππππβ1 +ππ2ππππβ2 if and only if ππππ = πΌπΌ1ππ0ππ + πΌπΌ2ππππ0ππ for ππ = 0,1,2, β¦ , where πΌπΌ1 and πΌπΌ2 are constants.
Example: What is the solution of the recurrence relation ππππ = 6ππππβ1 β 9ππππβ2 with initial conditions ππ0 = 1 and ππ1 = 6? Step 1: Write a characteristic equation of a recurrence relation (CERR).
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌ1 and πΌπΌ2 from initial conditions.
Page 11 of 15
Step 5: Write the solution Theorem 3: Let ππ1, ππ2, β¦ , ππππ be real numbers. Suppose that the characteristic equation
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0
Has k distinct roots ππ1, ππ2, β¦ , ππππ. Then a sequence {ππππ} is a solution of the recurrence relation ππππ = ππ1ππππβ1 + ππ2ππππβ2 + β―ππππππππβππ if and only if ππππ = πΌπΌ1ππ0ππ + πΌπΌ2ππ0ππ + β―+ ππππππππππ for ππ = 0,1,2, β¦ , where πΌπΌ1,πΌπΌ2, β¦ ,πΌπΌππ are constants.
Example: Find the solution to the recurrence relation ππππ = 6ππππβ1 β 11ππππβ2 + 6ππππβ3. Step 1: Write a characteristic equation of a recurrence relation (CERR).
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌ1 and πΌπΌ2 from initial conditions.
Page 12 of 15
Step 5: Write the solution Theorem 4: Let c1, c2 ,β¦, ck be real numbers. Suppose that the characteristic equation
rk β c1r
kβ1 ββ― β ck = 0
has t distinct roots r1, r2, β¦, rt with multiplicities m1, m2, β¦, mt, respectively so that mi β₯ 1 for i = 0, 1, 2, β¦,t and m1 + m2 + β¦ + mt = k. Then a sequence {an} is a solution of the recurrence relation
an = c
1a
nβ1 + c
2a
nβ2 + β¦.. + c
k a
nβk
if and only if
for n = 0, 1, 2, β¦, where Ξ±
i,j are constants for 1β€ i β€ t and 0β€ j β€ m
iβ1.
Example: Suppose that the roots of the characteristic equation of a linear homogeneous recurrence relation are 2, 2, 2, 5, 5, and 9. What is the form of the general solution?
Page 13 of 15
Example: Find the solution to the recurrence relation ππππ = β3ππππβ1 β 3ππππβ2 β ππππβ3 with initial conditions ππ0 = 1, ππ1 = β2, and ππ2 = β1. Step 1: Write a characteristic equation of a recurrence relation (CERR).
ππππ β ππ1ππππβ1 β ππ2ππππβ2 β β―β ππππβ1ππ β ππππ = 0 Step 2: Solve CERR Step 3: Write solution in terms of πΌπΌs. Step 4: Find πΌπΌπ π from initial conditions.
Page 14 of 15
Step 5: Write the solution
Linear Nonhomogeneous Recurrence Relations with Constant Coefficients. Definition: A linear nonhomogeneous recurrence relation with constant coefficients is a
recurrence relation of the form: a
n = c
1a
nβ1 + c
2a
nβ2 + β¦.. + c
k a
nβk + F(n)
,
where c1, c
2, β¦.,c
k are real numbers, and F(n) is a function not identically zero depending
only on n. The recurrence relation a
n = c
1a
nβ1 + c
2a
nβ2 + β¦.. + c
k a
nβk ,
is called the associated homogeneous recurrence relation.
Example: The following are linear nonhomogeneous recurrence relations with constant coefficients:
an = a
nβ1 + 2
n
,
an = a
nβ1 + a
nβ2 + n
2 + n + 1,
an = 3a
nβ1 + n3
n ,
an = a
nβ1 + a
nβ2 + a
nβ3 + n!
Theorem 5: If {an
(p)} is a particular solution of the nonhomogeneous linear recurrence
relation with constant coefficients
an = c
1a
nβ1 + c
2a
nβ2 + β― + c
k a
nβk + F(n)
,
Page 15 of 15
then every solution is of the form {an
(p) + a
n
(h)}, where {a
n
(h)} is a solution of the associated
homogeneous recurrence relation
an = c
1a
nβ1 + c
2a
nβ2 + β― + c
k a
nβk .
Example: Find all solutions of the recurrence relation an = 3anβ1 + 2n.
What is the solution with a1 = 3?