Why Recursion tree method is best than the Substitution method for solving a recurrence relation?  Find the asymptotic upper bound of the following recurrence relation with the help of recursion tree method.

T(n)=T(n/4)+T(n/2)+Θ(n2)

Ans

Recursion tree method is best than the Substitution method for solving a recurrence relation because in recursion tree method, we draw a recurrence tree and calculate the time taken by every level of tree. Finally, we sum the work done at all levels. To draw the recurrence tree, we start from the given recurrence and keep drawing till we find a pattern among levels. The pattern is typically a arithmetic or geometric series but in substitution method we make a guess for the solution and then we use mathematical induction to prove the guess is correct or incorrect.

 

Asymptotic Analysis of Recurrence Relation

Recurrence Relation:

T(n)=T(n4)+T(n2)+Θ(n2)

Solution Using Recursion Tree Method

Step 1: Recursion Tree Structure

The recursion tree has:

  • Root node cost: Θ(n2)
  • Two child nodes: T(n4) and T(n2)
  • This pattern continues until reaching small subproblems

Step 2: Cost at Each Level

Level 0 (Root):

Cost=n2

Level 1:

Left child=(n4)2=n216

Right child=(n2)2=n24

Total cost=n216+n24=5n216

Level 2:

Left-left=(n16)2=n2256

Left-right=(n8)2=n264

Right-left=(n8)2=n264

Right-right=(n4)2=n216

Total cost=21n2256

General Pattern:

Cost at level k=n2(516)k

Step 3: Summing Over All Levels

The total cost is an infinite geometric series:

T(n)=n2+5n216+25n2256+

With first term a=n2 and common ratio r=516

Since |r|<1, the series converges to:

T(n)=a1r=n21516=16n211

Step 4: Asymptotic Upper Bound

The root cost (n2) dominates the entire series:

T(n)=O(n2)

Final Answer

The asymptotic upper bound of the recurrence relation is:

O(n2)



Related Questions