Method For Solving Recurence Relations
Updated Feb 09, 20251 min read
There are several methods for solving recurrence relations, each suited to different types of recurrences. Here are the most common methods:
1. Substitution Method
Substitution is opposite of induction .We start at n and move backward. A substitution method is one, in which we guess a bound and then use mathematical induction to prove whether our guess is correct or not?. It comprises two steps:
Step1: Guess the asymptotic bound of the Solution.
Step2: Prove the correctness of the guess using Mathematical Induction.
Example 1. Solve the following recurrence by using substitution method.
T(n)=2T(2n)+n
Solution: step1: The given recurrence is quite similar to that of Merge Sort algorithm,Therefore, our guess to the solution is (𝑛) = 𝑂 (𝑛𝑙𝑜𝑔𝑛)
Or (𝑛) ≤ 𝑐. 𝑛𝑙𝑜𝑔𝑛
Step2: Now we use mathematical Induction.
Here our guess does not hold for n=1 because (1) ≤ 𝑐. 1𝑙𝑜𝑔1𝑖. 𝑒. (𝑛) ≤ 0 𝑤ℎ𝑖𝑐ℎ 𝑖𝑠 𝑐𝑜𝑛𝑡𝑟𝑎𝑑𝑖𝑐𝑡𝑖𝑜𝑛 𝑤𝑖𝑡ℎ (1) = 1
Now for n=2(2) ≤ 𝑐. 2𝑙𝑜𝑔2 2
2T(22)+2≤c.2
2(1) + 2 ≤ 𝑐. 2
0 + 2 ≤ 𝑐. 2
2 ≤ 𝑐. 2 which is true. So (2) ≤ 𝑐. 𝑛𝑙𝑜𝑔𝑛 is True for n = 2
So(2) ≤ 𝑐. 𝑛𝑙𝑜𝑔𝑛 is True form = 2
