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)]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Please do either iterative solution or recursive tree when trying to solve without master theorem

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 your 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 correctness** 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 \)
2. (3pts) \( T(n) = 3T(n/2) + n^3 \)
3. (3pts) \( T(n) = 2T(n/6) + \log \log n \)
4. (6pts) \( T(n) = 2T(n/2) + n \log n \) [For this question, please provide two solutions (with and without using Master Theorem)]
Transcribed Image Text: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 your 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 correctness** 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 \) 2. (3pts) \( T(n) = 3T(n/2) + n^3 \) 3. (3pts) \( T(n) = 2T(n/6) + \log \log n \) 4. (6pts) \( T(n) = 2T(n/2) + n \log n \) [For this question, please provide two solutions (with and without using Master Theorem)]
Expert Solution
Step 1

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.

steps

Step by step

Solved in 6 steps with 6 images

Blurred answer
Knowledge Booster
Recurrence Relation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education