1Computer Sciences
2 GROWTH OF FUNCTIONS 3.2 STANDARD NOTATIONS AND COMMON FUNCTIONS
Standard notations and common functions Logarithms. Exponential. Factorials. Objective
Computer Sciences6 RECURRENCES TUTORIAL 3
Recurrences. Substitution method, Recursion-tree method, Master method. Objective
Exercise 1: Use the substitution method to show that T(n) = O(n 2 lg (n/2)) if : T (n) = 2 T (n/2) + n Solution : T(n) ≤ 2 T((n 2 /2) lg (n/4)) +n ≤ 2 c (n 2 /2) lg (n/4) +n = cn 2 lg (n/4) + n = cn 2 lg n - 2 cn 2 +n ≤ cn 2 lg n :. T(n) = O(n 2 lg n )
Draw the recursion tree for the recurrence : T(n) = 2 T(n/3) + T(n/4) + n 2 Exercise 2:
Exercise 3: For each of the following recurrences, give an expression for the runtime T (n) if the recurrence can be solved with the Master Theorem. T (n) = 3T (n/2) + n^2 T (n) = 4T (n/2) + n^2 T (n) = 16T (n/4) + n
Standard notations and common functions. Substitution method, Guess the form of the solution. Use mathematical induction to find the constants and show that the solution works. Recursion-tree method, Using recursion trees to generate good guesses. Master method. T(n) = a T(n/b) + f(n).