Now that you learned Master Theorem that could help you with solving recursions. However, keep in mind that it doesn't apply to all cases: you may need to carefully check the applicability of Master Theorem. Also, it's still important to know how to solve some recurrences directly, e.g., using the expansion tree. Let's have some exercises. Solve the recurrences below. If you use Master Theorem, please show how you know that Master Theorem is applicable, and which case are you using (case 1, 2, and 3 as shown in class slides). Use (.) to present your answer. Note that not all of them can be solved using Master Theorem. Please provide some details about your calculation instead of just giving you final answer. Of course you can use any other approaches to solve them (e.g., substitution). For the last question, please first solve it without using Master Theorem, and then check the cor- rectness of your answer using Master Theorem (in other words, please solve it twice, with or without using Master Theorem). For all of them, you can assume the base case is when n is a constant, T(n) is also a constant. Use (-) to present your answer. (1) (3pts) T(n) = T(n − 1) + n² (2) (3pts) T(n) = 3T(n/2) +n³ (3) (3pts) T(n) = 2T (n/6) + log log n (4) (6pts) T(n) = 2T(n/2) + n logn [For this question, please provide two solutions (with and without using Master Theorem)]
Please do either iterative solution or recursive tree when trying to solve without master theorem
Format of Master's theorem Question is : T(n) = aT(n/b) + f(n)
In Question 1 there is no denominator in the T(n) function so master theorem cannot be applied there.
I had Solved it using Recurrence Relation Method.
Question 2,3 and 4 can be solved using Master's Theorem as the Format is matching with the master's theorem format.
In Question's related to Master's theorem first, we find nlogab.
If nlogab < f(n) , then \theta(f(n)) is the Complexity of the relation.
If nlogab = f(n) , then \theta(nlogab.log(n)) is the Complexity of the relation.
If nlogab > f(n) , then \theta(nlogab) is the Complexity of the relation.
Step by step
Solved in 6 steps with 6 images