You are on page 1of 16

L

Recurrence Relation
P
U
Many counting problems cannot be solved easily using the simple
counting techniques

L How many bit strings of length n do not contain two consecutive zeros?
P
U

L
P
U

L
P
U

L
P
U
Recurrence relations play important roles in the study of algorithms.

L For example, suppose that the number of CORONA VIRUS in a colony


P doubles every hour. If a colony begins with 2 VIRUS, how many will be
U
present in n hours?

L let an be the number of CORONA VIRUS at the end of n hours.


P
U
whenever n is a positive integer

L
P
U

L
P
U

L
P
U

Modeling With Recurrence Relations

UNIT 2 Page 1
L
P A pair of rabbits does not breed until they are 2 months old. After
U
they are 2 months old, each pair of rabbits produces another Links
pair each month
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 2
L
P
U

L
P
U

L
P
U

L
P
U

The Tower of Hanoi Puzzle


L
P
U

L
P
U

L
P
U Solving Linear Recurrence Relations
A linear homogeneous recurrence relation of degree k with constant
coefficients is a recurrence relation of the form
L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 3
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U
UNIT 2 Page 4
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U Solution of Linear Homogeneous
Recurrence Relations with CC
L Solution of Linear Non-homogeneous
P Recurrence Relations with CC
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 5
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 6
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L Solve the recurrence relation Fn =5 Fn−1−6 Fn−2 where


P F0=1 and F1=4
U

L
P
U

L
P
U

UNIT 2 Page 7
L
P
U

L
P
U

L Solve the recurrence relation − an+2=10an+1−25an


P
U

L
P
U

L
P
U

L
P
U

Solve an=2an-1 a
-- 2 n-2
L
P
U

L
P
U

L
P
U

L
P
U

L
Exercises:
P
U
1.Determine which of these are linear homogeneous recurrence relations
with constant coefficients. Also, find the degree of those that are.

UNIT 2 Page 8
L
P
U

L
P
U

2. Determine which of these are linear homogeneous recurrence relations


with constant coefficients. Also, find the degree of those that are.
L
P
U

L
P
U

L 3. Solve these recurrence relations together with the initial conditions


P given.
U

L
P
U

L
P
U
Solution of Linear Non-homogeneous Recurrence Relations
with Constant Coefficients
L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 9
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U
UNIT 2 Page 10
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 11
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 12
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 13
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 14
L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

L
P
U

UNIT 2 Page 15
L
P
U

UNIT 2 Page 16

You might also like