You are on page 1of 43

LECTURE

Recurrence relations,
Solving recurrence relations
Q: What is a recurrence relation ?

Ans: A recurrence relation is a rule supplemented with one or more initial terms to
generate a sequence. The solution of a recurrence relation is a sequence, where each term
of the sequence satisfies the recurrence relation.
For example, is a recurrence relation while its solution is the sequence
The Tower of Hanoi Puzzle

(n-1)-steps

(n-1)-steps
1 step
Solving the recurrence relation for the Tower of Hanoi puzzle

Inhomogeneous recurrence relation

2𝑛 − 1
=2𝑛 − 1 +2𝑛 − 2+ ⋯ + 2+1
2− 1

Exercise: Prove the above formula using mathematical induction.


Handshake Problem
Q: In a party, there are n
guests. How many
handshakes are possible
among n persons assuming
each member has a
handshake with everyone
else only once ?

Note: Multiple handshakes


with the same person/s are
not allowed/counted.
Handshake Problem

Explanation: Let us say there are 30 students in a classroom. These 30 students shake hands
with each other, and the total number of handshakes are now.
A teacher enters the classroom and shakes hand with all 30 students. Hence there are 31
persons in the classroom and 30 new handshakes are added. Now, the total number of
handshakes will be
Using recursive
functions to create
recursive relations
Example: Counting the number of bit strings
Case of distinct roots
Case of k number of distinct roots
Example:
Case of two repeated roots

Exercise: Prove Theorem-2


Note: We use Gauss elimination method to solve the above linear system.
Exercises:
General solution of a non-homogeneous linear
recurrence relation
Choosing a particular solution
Exercises: Solve the given problems:
Exercises:

You might also like