0% found this document useful (0 votes)
39 views15 pages

Recurrences

Uploaded by

bit001224
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)
39 views15 pages

Recurrences

Uploaded by

bit001224
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/ 15

RECURSION AND RECURRENCES

h. Chikalamo

February 5, 2025

1 / 14
Overview

1. Recurrence Relations

2. Solving Recurence Relations

2 / 14
Definition

• A recurrence relation for the sequence {an } is an equation that express an , in terms
of one or more of the previous terms of the sequence a0 , a1 , · · · an−1 , for all integers
n with n ≥ n0 .
• A sequence is called a solution to the recurrence relation if its terms satisfy the
recurrence relation.
Note: Recurrence relation is also called Difference Equation

3 / 14
Many solutions can be a solution for the same recurrence relation.
For example the recurrence relation

an = 2an−1 − an−2 for n ≥ 2,

it can be checked that the following are solutions:

an = 3n, for all n ≥ 0


an = 5, for all n ≥ 0

4 / 14
The initial conditions for a sequence specify the terms before the recurrence relation takes
off.
The initial conditions together with the initial conditions uniquely determines the
sequence. For example above, the initial conditions are a0 = 0, a1 = 3 and
a0 = 5, a1 = 5

5 / 14
Solving Recurrence Relation

There are three methods of solving recurrence relations:


a. Substitution
b. Generating functions
c. characteristic roots

6 / 14
By substition

In this method the recurrence relation for an is used repeatedly to solve for a general
expression for an in terms of n

7 / 14
• Let an be the sequence that satisfies the recurrence relation an = an−1 + 3 for n ≥ 1
with initial conditions a0 = 2. Use iteration method involving substitution to solve
for an

• Solve the recurrence relation an = an−1 + n2 where a0 = 7 by substitution method.


8 / 14
solutions

a0 = 2 then we have

a1 = a0 + 3 = 2 + 3
a2 = a1 + 3 = 2 + 3 + 3 = 2 + 2.3
a3 = a2 + 3 = 2 + 3.3 + 3 = 2 + 3.3
.
.
.
an = 2 + n.3 = 2 + 3n

8 / 14
solutions

a0 = 2 then we have

a1 = a0 + 12 = 7 + 12
a2 = a1 + 22 = 7 + 12 + 22
a3 = a2 + 32 = 7 + 12 + 22 + 32
.
.
.
an = 7 + (12 + 22 + 32 + · · · + n2 )
n(n + 1)(2n + 1)
=7+
6

9 / 14
Solve the following recurrence relations by substitution.
1
(i) an = an−1 + n(n+1) where a0 = 1
(ii) an = an−1 + 3n where a0 = 1
(iii) an = an−1 + n3n with a0 = 1

10 / 14
Solutions
(i) a0 = 1 then we have
1 1
a1 = a0 + =1+
1.2 1.2
1 1 1
a2 = a1 + =1+ +
2.3 1.2 2.3
1 1 1 1
a3 = a2 + =1+ + +
3.4 1.2 2.3 3.4
.
.
.
1 1 1 1
an = 1 + + + + ··· +
1.2 2.3 3.4 n(n + 1)
       
1 1 1 1 1 1 1 1
=1+ 1− + − + − + ··· + − =2−
2 2 3 3 4 n n+1 n+1
11 / 14
solutions
(ii) a0 = 1 then we have

a1 = a0 + 31 = 1 + 3
a2 = a1 + 32 = 1 = 3 + 32
a3 = a2 + 33 = 1 + 3 = 32 + 33
.
.
.
an = 1 + 3 + 32 + 33 + · · · + 3n
3n+1 − 1
=
3−1
3n+1 − 1
=
2
12 / 14
solutions

a0 = 1 then we have

a1 = a0 + 1.31 = 1 + 1.3
a2 = a1 + 2.32 = 1 + 1.3 + 2.32
.
.
.
n
X
2 3 n
an = 1 + 1.3 + 2.3 + 3.3 = · · · + n3 = 1 + r .3r
r =1

13 / 14
The End

14 / 14

You might also like