PPT: Recurrence Relations | Algorithms - Computer Science Engineering (CSE) PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 1


Recurrence 
Relations
Page 2


Recurrence 
Relations
Introduction 
Definition
A recurrence relation is an 
equation that defines a 
sequence recursively, where 
each term is expressed in terms 
of previous terms. 
Purpose
These relations are fundamental 
in algorithm analysis, helping us 
model the running time or 
space complexity of recursive 
algorithms.
General Form
The general form is 
T(n) = a * T(n/b) + f(n), 
Where T(n) represents the total 
running time for input size n, a is 
the number of subproblems, n/b 
is the size of each subproblem, 
and f(n) is the cost of non-
recursive work.
Recurrence relations are particularly useful for analyzing divide-and-conquer, recursive, and iterative 
algorithms. 
Page 3


Recurrence 
Relations
Introduction 
Definition
A recurrence relation is an 
equation that defines a 
sequence recursively, where 
each term is expressed in terms 
of previous terms. 
Purpose
These relations are fundamental 
in algorithm analysis, helping us 
model the running time or 
space complexity of recursive 
algorithms.
General Form
The general form is 
T(n) = a * T(n/b) + f(n), 
Where T(n) represents the total 
running time for input size n, a is 
the number of subproblems, n/b 
is the size of each subproblem, 
and f(n) is the cost of non-
recursive work.
Recurrence relations are particularly useful for analyzing divide-and-conquer, recursive, and iterative 
algorithms. 
Types of Recurrence Relations
Recurrence relations come in various forms, each suited to different algorithmic patterns. Understanding these 
types helps in selecting the appropriate solution method and analyzing algorithm efficiency accurately.
Linear recurrence relations can be homogeneous (without non-recursive terms) or non-homogeneous (including 
non-recursive terms). Divide-and-conquer recurrences follow the form T(n) = a * T(n/b) + f(n), while decreasing 
function recurrences involve subtraction in recursive terms.
Linear Recurrence Relations
Homogeneous: T(n) = 2T(n-1)
Non-Homogeneous: T(n) = T(n-1) + n
Divide-and-Conquer
Form: T(n) = a * T(n/b) + f(n)
Example: T(n) = 2T(n/2) + n
Other Forms
Decreasing: T(n) = T(n-1) + 1
Logarithmic: T(n) = T(n-1) + log n
Root Function: T(n) = T(:n) + 1
Page 4


Recurrence 
Relations
Introduction 
Definition
A recurrence relation is an 
equation that defines a 
sequence recursively, where 
each term is expressed in terms 
of previous terms. 
Purpose
These relations are fundamental 
in algorithm analysis, helping us 
model the running time or 
space complexity of recursive 
algorithms.
General Form
The general form is 
T(n) = a * T(n/b) + f(n), 
Where T(n) represents the total 
running time for input size n, a is 
the number of subproblems, n/b 
is the size of each subproblem, 
and f(n) is the cost of non-
recursive work.
Recurrence relations are particularly useful for analyzing divide-and-conquer, recursive, and iterative 
algorithms. 
Types of Recurrence Relations
Recurrence relations come in various forms, each suited to different algorithmic patterns. Understanding these 
types helps in selecting the appropriate solution method and analyzing algorithm efficiency accurately.
Linear recurrence relations can be homogeneous (without non-recursive terms) or non-homogeneous (including 
non-recursive terms). Divide-and-conquer recurrences follow the form T(n) = a * T(n/b) + f(n), while decreasing 
function recurrences involve subtraction in recursive terms.
Linear Recurrence Relations
Homogeneous: T(n) = 2T(n-1)
Non-Homogeneous: T(n) = T(n-1) + n
Divide-and-Conquer
Form: T(n) = a * T(n/b) + f(n)
Example: T(n) = 2T(n/2) + n
Other Forms
Decreasing: T(n) = T(n-1) + 1
Logarithmic: T(n) = T(n-1) + log n
Root Function: T(n) = T(:n) + 1
Methods to Solve Recurrence Relations
Several methods exist for solving recurrence relations, each with its strengths and suitable applications. The choice 
of method depends on the structure and complexity of the recurrence relation at hand.
Substitution 
Method
Guess solution and 
prove it using 
induction. Suitable 
for simple 
recurrences.
Recursion Tree 
Method
Visualize recursion 
as a tree; sum costs 
at each level. 
Useful for divide-
and-conquer.
Master 
Theorem
Formula for 
recurrences of the 
form T(n) = a * 
T(n/b) + f(n). Fast 
for standard 
problems.
Iteration 
Method
Expand recurrence 
iteratively and sum 
terms. Works well 
for linear 
recurrences.
Page 5


Recurrence 
Relations
Introduction 
Definition
A recurrence relation is an 
equation that defines a 
sequence recursively, where 
each term is expressed in terms 
of previous terms. 
Purpose
These relations are fundamental 
in algorithm analysis, helping us 
model the running time or 
space complexity of recursive 
algorithms.
General Form
The general form is 
T(n) = a * T(n/b) + f(n), 
Where T(n) represents the total 
running time for input size n, a is 
the number of subproblems, n/b 
is the size of each subproblem, 
and f(n) is the cost of non-
recursive work.
Recurrence relations are particularly useful for analyzing divide-and-conquer, recursive, and iterative 
algorithms. 
Types of Recurrence Relations
Recurrence relations come in various forms, each suited to different algorithmic patterns. Understanding these 
types helps in selecting the appropriate solution method and analyzing algorithm efficiency accurately.
Linear recurrence relations can be homogeneous (without non-recursive terms) or non-homogeneous (including 
non-recursive terms). Divide-and-conquer recurrences follow the form T(n) = a * T(n/b) + f(n), while decreasing 
function recurrences involve subtraction in recursive terms.
Linear Recurrence Relations
Homogeneous: T(n) = 2T(n-1)
Non-Homogeneous: T(n) = T(n-1) + n
Divide-and-Conquer
Form: T(n) = a * T(n/b) + f(n)
Example: T(n) = 2T(n/2) + n
Other Forms
Decreasing: T(n) = T(n-1) + 1
Logarithmic: T(n) = T(n-1) + log n
Root Function: T(n) = T(:n) + 1
Methods to Solve Recurrence Relations
Several methods exist for solving recurrence relations, each with its strengths and suitable applications. The choice 
of method depends on the structure and complexity of the recurrence relation at hand.
Substitution 
Method
Guess solution and 
prove it using 
induction. Suitable 
for simple 
recurrences.
Recursion Tree 
Method
Visualize recursion 
as a tree; sum costs 
at each level. 
Useful for divide-
and-conquer.
Master 
Theorem
Formula for 
recurrences of the 
form T(n) = a * 
T(n/b) + f(n). Fast 
for standard 
problems.
Iteration 
Method
Expand recurrence 
iteratively and sum 
terms. Works well 
for linear 
recurrences.
Iteration Method
The iteration method expands the recurrence iteratively and sums the terms to find a closed-form solution. This 
approach is particularly effective for linear recurrences with constant or simple non-recursive terms.
The process involves writing T(n) in terms of previous terms, identifying a pattern, and expressing the sum in closed 
form. For example, with T(n) = T(n-1) + 1 and T(1) = 1, we can expand to T(n) = T(n-1) + 1 = T(n-2) + 1 + 1 = ... = T(1) + (n-1)*1, 
which simplifies to T(n) = n with O(n) time complexity.
Write Recursive 
Expansion
Express T(n) in terms of 
T(n-1), T(n-2), etc.
Identify Pattern
Recognize the pattern 
in the expanded terms
Sum the Series
Calculate the sum of all 
terms in the expansion
Express in Closed 
Form
Simplify to a non-
recursive mathematical 
expression
Read More
81 videos|113 docs|34 tests

FAQs on PPT: Recurrence Relations - Algorithms - Computer Science Engineering (CSE)

1. What are recurrence relations and why are they important in mathematics?
Ans. Recurrence relations are equations that define a sequence of values based on previous terms in that sequence. They are important in mathematics because they provide a way to express complex sequences, such as those that arise in combinatorics, algorithm analysis, and various branches of science and engineering. By solving recurrence relations, one can predict future values in the sequence, analyze the growth of algorithms, and model real-world phenomena.
2. How can I solve a simple recurrence relation?
Ans. To solve a simple recurrence relation, one can use methods such as iteration, substitution, or characteristic equations. For example, if given a relation like a(n) = 2a(n-1) + 1 with a(0) = 1, one would substitute values step by step to find a few initial terms, then look for a pattern or use a characteristic equation to find a closed-form solution. This process helps in understanding the behavior of the sequence.
3. What are some common types of recurrence relations?
Ans. Common types of recurrence relations include linear recurrence relations, non-linear recurrence relations, homogeneous and non-homogeneous relations, as well as those with constant or variable coefficients. Linear relations are often easier to solve and frequently appear in algorithm analysis, while non-linear relations can model more complex behaviors in systems.
4. Can you provide examples of real-world applications of recurrence relations?
Ans. Recurrence relations have various real-world applications, such as in computer science for analyzing the time complexity of algorithms, in finance for modeling interest computations, and in biology for population growth models. They help in making predictions and optimizing processes based on past behavior, making them valuable tools in many fields.
5. What are the differences between homogeneous and non-homogeneous recurrence relations?
Ans. The main difference between homogeneous and non-homogeneous recurrence relations lies in the presence of a constant or function term. In a homogeneous relation, all terms depend solely on previous terms (e.g., a(n) = 2a(n-1)), while a non-homogeneous relation includes an additional term that is independent of the sequence (e.g., a(n) = 2a(n-1) + 3). This distinction affects the methods used to solve them and the complexity of their solutions.
Related Searches

video lectures

,

Exam

,

pdf

,

past year papers

,

ppt

,

Summary

,

mock tests for examination

,

MCQs

,

Objective type Questions

,

PPT: Recurrence Relations | Algorithms - Computer Science Engineering (CSE)

,

practice quizzes

,

Previous Year Questions with Solutions

,

shortcuts and tricks

,

Semester Notes

,

Free

,

study material

,

PPT: Recurrence Relations | Algorithms - Computer Science Engineering (CSE)

,

Viva Questions

,

Sample Paper

,

Extra Questions

,

PPT: Recurrence Relations | Algorithms - Computer Science Engineering (CSE)

,

Important questions

;