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
course: Introduction to Algorithms   Give asymptotic upper and lower bounds for T(n) in each of the following recurrences. Assume that T(n) is constant for n ≤ 10. Make your bounds as tight as possible, and justify your answers. a. T (n) = 2T (n) + n log n
3. Solving RecurrencesGive asymptotic upper and lower bounds for T(n) in each of the following recurrences.Assume that T(n) is constant for n ≤ 2. Make your bounds as tight as possible, andjustify your answers. (1) T(n) = 4T(n/4) + 5n(2) T(n) = 5T(n/4) + 4n(3) T(n) = 25T(n/5) + n2
Give asymptotic upper and lower bounds for T(n) in each of the following recurrences. Assume that T(n) is constant for n ≤ 2. Make your bounds as tight as possible, and justify your answers. T(n)=9 T(n/5)+n^2=θ(n^2) T(n)=T(√n)+4
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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning