Solution to recurrence relation T(n) = T(n - 1) + 2 is given by, where...
Concept:
Recurrence Relation:
A recurrence relation relates the nth term of a sequence to its predecessors. These relations are related to recursive algorithms.
Definition:
A recurrence relation for a sequence a0, a1, a2,.... is a formula (equation) that relates each term an to certain of its predecessors a0, a1, a2,...., an-1. The initial conditions for such a recurrence relation specify the values of a0, a1, a2,...., an-1. For example, the recursive formula for the sequence 3, 8, 13, 18, 23 is
a1 = 3, an = an-1 + 1, 2≤n<∞
Calculation:
Given:
The recurrence relation , T(n) = T(n - 1)+ 2
If n = 1 then T(n) = T(n-1)+ 2 = T(1) = T(1-1)+ 2 = T(0) + 2 =5 + 2 = 7 // Value of T(0) given in Question
If n= 2 then T(n) = T(n-1)+ 2 = T(1) = T(2-1)+ 2 = T(1) + 2 =7 + 2 = 9 // Value of T(1) is 7
If n= 3 then T(n) = T(n-1)+ 2 = T(1) = T(3-1)+ 2 = T(2) + 2 =9 + 2 = 11 // Value of T(2) is 9
Therefore, above pattern can be written in the form of
T(n) = 2n+ 5
If n= 1 then T(n) = 2n+ 5 = T(1) = 2(1)+ 5 = T(1) =7
Therefore Option 3 is the correct Answer