Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
bartleby

Concept explainers

Question
Book Icon
Chapter 4, Problem 1P

(a)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(a)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=2T(n/2)+n4 .

Explanation:

For a divide and conquer recurrence of the form T(n)=aT(n/b)+f(n) where a1,b>1 and f(n)>0, the following three cases can happen:

Case 1: If f(n)=O(n logbaε) for some constant ε>0 then T(n)=Θ(n lgba) .

Case 2: If f(n)=Θ(n lgba) then T(n)=Θ(n lgbalogn) .

Case 3: If f(n)=Ω(n logba+ε) for some constant ε>0 and if af(n/b)cf(n) for some constants c>1 and sufficiently large n then T(n)=Θ(f(n)) .

The values of a,b and f(n) are 2, 2 and n4 respectively.

Therefore, nlogba=nlog22=n and f(n)=1 . Here, f(n)=Ω(n log22+ε) where ε=3 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n4) .

(b)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(b)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=T(7n/10)+n .

Explanation:

The values of a,b and f(n) are 1, 10/7 and n respectively.

Therefore, nlogba=nlog10/71=n0=1 and f(n)=n . Here, f(n)=Ω(n log42+ε) where ε=1/2 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n) .

(c)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(c)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=16T(n/4)+n2 .

Explanation:

The values of a,b and f(n) are 16, 4 and n2 respectively.

Therefore, nlogba=nlog416=n2 and f(n)=Θ(n logba)=Θ(n2) .

So, case 2 of the master method applies.

Hence, T(n)=Θ(nclgn)=Θ(n2lgn) .

(d)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(d)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=7T(n/3)+n2 .

Explanation:

The values of a,b and f(n) are 7, 3 and n2 respectively.

Therefore, nlogba=nlog37 and f(n)=n2 . Here, f(n)=Ω(n log42+ε) where ε=3/2 .

So, case 3 of the master method applies.

Hence, T(n)=Θ(f(n))=Θ(n2) .

(e)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(e)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=7T(n/2)+n2 .

Explanation:

The values of a,b and f(n) are 7, 2 and n2 respectively.

Therefore, nlogba=nlog27 and f(n)=n2 . Here, f(n)=O(n log27ε) where ε>0 .

So, case 1 of the master method applies.

Hence, T(n)=Θ(n logba)=Θ(n log27) .

(f)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(f)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=2T(n/4)+n .

Explanation:

The values of a,b and f(n) are 2, 4 and n respectively.

Therefore, nlogba=nlog42=n and f(n)=Θ(n logba)=Θ(n) .

So, case 2 of the master method applies.

Hence, T(n)=θ(n lg42lgn)=θ(nlgn) .

(g)

Program Plan Intro

To determine the asymptotic bounds for the recurrence relation using master method.

(g)

Expert Solution
Check Mark

Explanation of Solution

Given Information: The recurrence relation is T(n)=T(n2)+n2 .

Explanation:

The recurrence relation is not in the form of master theorem. Therefore, it cannot be solve by master theorem.

Solve the recurrence relation T(n)=T(n2)+n2

as follows:

  T(n)=T(n2)+n2=n2+(n2)2+T(n4)=n2i=0n/21+4i=0n/2i24ni=0n/2i=n2n2+413(2n3+6n2+4n)+4n12(n3+2n2)=2n33+n2+43n=Θ(n3)

Therefore, the asymptotic notation of the recurrence T(n)=T(n2)+n2 is Θ(n3) .

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Solve the recurrence relation: T (n) = T (n/2) + T (n/4) + T (n/8) + n. Use the substitution method, guess that the solution is T (n) = 0 (n log n). Solve the recurrence relation T (n) = T ( √n) + c. n > 4 Derive the runtime of the below code
Please solve using iterative method: Solve the following recurrences and compute the asymptotic upper bounds. Assume that T(n) is a constant for sufficiently small n. Make your bounds as tight as possible. a. T(n) = T(n − 2) + √n b.T(n) = 2T(n − 1) + c
Use the master method to give tight asymptotic bounds for the following recurrence T(n) = 2T(n/4) + nº.5 (nº.5Ign) e(nº.5) e(n) ○ e(n²)
Knowledge Booster
Background pattern image
Computer Science
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.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education