Recurrence Relation
Recurrence Relation A recurrence is an equation or inequality that describes a function in terms of its values on smaller inputs. To solve a Recurrence Relation means to obtain a function defined on the natural numbers that satisfy the recurrence. For Example , the Worst Case Running Time T(n) of the MERGE SORT Procedures is described by the recurrence. T (n) = θ (1) if n=1 2T + θ (n) if n>1 There are four methods for solving Recurrence: Substitution Method Iteration Method Recursion Tree Method Master Method 1. Substitution Method: The Substitution Method Consists of two main steps: Guess the Solution. Use the mathematical induction to find the boundary condition and shows that the guess is correct. For Example1 Solve the equation by Substitution Method. T (n) = T + n We have to show that it is asymptotically bound by O (log n). Solution: For T (n) = O (log n) We have to show that for some constant c T (n) ≤c logn. Put this in given Recurrence Equation. T (n) ≤c log + 1
Comments
Post a Comment