Question

Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) =...

Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) = 2T(n/3) + n

Use the substitution method to verify your answer.

Homework Answers

Answer #1
  • The subproblem size for a node at depth ii is n / 3^in/3
    i
    .

    Thus, the tree has \lg n + 1lgn+1 levels and 2^{\lg n} = n^{\lg 2}2
    lgn
    =n
    lg2
    leaves.

    The total cost over all nodes at depth ii, for i = 0, 1, 2, \ldots, \lg n - 1i=0,1,2,…,lgn−1, is 2^i(n / 3^i) = (2 / 3)^i n2
    i
    (n/3
    i
    )=(2/3)
    i
    n.

    \begin{aligned} T(n) & = n + \frac{2}{3}n + \Big(\frac{2}{3}\Big)^3 n + \cdots + \Big(\frac{2}{3}\Big)^{\lg n - 1} n + \Theta(n^{\lg 2}) \\ & = \sum_{i = 0}^{\lg n - 1} \Big(\frac{2}{3}\Big)^i n + \Theta(n^{\lg 2}) \\ & = \frac{(2 / 3)^{\lg n} - 1}{(2 / 3) - 1}n + \Theta(n^{\lg 2}) \\ & = 3[(2 / 3)^{\lg n} - 1]n + \Theta(n^{\lg 2}) \\ & = 3[n^{\lg(2 / 3)} - 1]n + \Theta(n^{\lg 2}) \\ & = 3[n^{\lg 2 - \lg 3} - 1]n + \Theta(n^{\lg 2}) \\ & = 3[n^{\lg 2 - 1 + 1} - n] + \Theta(n^{\lg 2}) \\ & = O(n^{\lg 2}). \end{aligned}
    T(n)
    ​  
      
    =n+
    3
    2
    ​  
    n+(
    3
    2
    ​  
    )
    3
    n+⋯+(
    3
    2
    ​  
    )
    lgn−1
    n+Θ(n
    lg2
    )
    =
    i=0

    lgn−1
    ​  
    (
    3
    2
    ​  
    )
    i
    n+Θ(n
    lg2
    )
    =
    (2/3)−1
    (2/3)
    lgn
    −1
    ​  
    n+Θ(n
    lg2
    )
    =3[(2/3)
    lgn
    −1]n+Θ(n
    lg2
    )
    =2[n
    lg(2/3)
    −1]n+Θ(n
    lg2
    )
    =3[n
    lg2−lg3
    −1]n+Θ(n
    lg2
    )
    =3[n
    lg2−1+1
    −n]+Θ(n
    lg2
    )
    =O(n
    lg2
    ).
    ​  

    We guess T(n) \le cn^{\lg 2} - dnT(n)≤cn
    lg2
    −dn,

    \begin{aligned} T(n) & = 2T(\lfloor n / 3 \rfloor) + n \\ & \le 2 \cdot (c(n / 3)^{\lg 2} - d(n / 3)) + n \\ & = (2 / 3^{\lg 2})cn^{\lg 2} - (2d / 3)n + n \\ & = cn^{\lg 2} + (1 - 2d / 3)n, \end{aligned}
    T(n)
    ​  
      
    =2T(⌊n/3⌋)+n
    ≤2⋅(c(n/3)
    lg2
    −d(n/3))+n
    =(2/3
    lg2
    )cn
    lg2
    −(2d/3)n+n
    =cn
    lg2
    +(1−2d/3)n,
    ​  

    where the last step holds for d \ge 3d≥3.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Use a recursive tree method to compute a tight asymptotic upper bound for recurrence function T(n)=...
Use a recursive tree method to compute a tight asymptotic upper bound for recurrence function T(n)= 3T(n/4)+n . then use substitution method to verify your answer.
Find an asymptotic upper bound on T(N) using the iterative method: T(n)=4T(n/2)+n2
Find an asymptotic upper bound on T(N) using the iterative method: T(n)=4T(n/2)+n2
Solve this recurrence using recursion tree : 1)T(n)=T(n/2)+2^n 2)T(n)=16(n/4)+n
Solve this recurrence using recursion tree : 1)T(n)=T(n/2)+2^n 2)T(n)=16(n/4)+n
Solve the recurrence relation using the substitution method: 1. T(n) = T(n/2) + 2n, T(1) =...
Solve the recurrence relation using the substitution method: 1. T(n) = T(n/2) + 2n, T(1) = 1, n is a 2’s power 2. T(n) = 2T(n/2) + n^2, T(1) = 1, n is a 2’s power
Consider the recurrence relation T(1) = 0, T(n) = 25T(n/5) + 5n. (a) Use the Master...
Consider the recurrence relation T(1) = 0, T(n) = 25T(n/5) + 5n. (a) Use the Master Theorem to find the order of magnitude of T(n) (b) Use any of the various tools from class to find a closed-form formula for T(n), i.e. exactly solve the recurrence. (c) Verify your solution for n = 5 and n = 25.
Solve the Recurrence Relation T(n) = 2T(n/3) + 2, T(1) = 1
Solve the Recurrence Relation T(n) = 2T(n/3) + 2, T(1) = 1
Give asymptotic upper and lower bounds for T .n/ in each of the following recurrences. Assume...
Give asymptotic upper and lower bounds for T .n/ in each of the following recurrences. Assume that T .n/ is constant for sufficiently small n. Make your bounds as tight as possible, and justify your answers. a) T(n) = T(n/2) +T(n/4)+T(n/8)+n b) T(n) = T(n-1) +1/n c) T(n)= T(n-1) +lg n d) T(n) = T(n-2) +1/lgn
1. y=∫upper bound is sqrt(x) lower bound is 1, cos(2t)/t^9 dt using the appropriate form of...
1. y=∫upper bound is sqrt(x) lower bound is 1, cos(2t)/t^9 dt using the appropriate form of the Fundamental Theorem of Calculus. y′ = 2. Use part I of the Fundamental Theorem of Calculus to find the derivative of F(x)=∫upper bound is 5 lower bound is x, tan(t^4)dt F′(x) = 3. If h(x)=∫upper bound is 3/x and lower bound is 2, 9arctan t dt , then h′(x)= 4. Consider the function f(x) = {x if x<1, 1/x if x is >_...
Master Theorem: Let T(n) = aT(n/b) + f(n) for some constants a ≥ 1, b >...
Master Theorem: Let T(n) = aT(n/b) + f(n) for some constants a ≥ 1, b > 1. (1). If f(n) = O(n logb a− ) for some constant > 0, then T(n) = Θ(n logb a ). (2). If f(n) = Θ(n logb a ), then T(n) = Θ(n logb a log n). (3). If f(n) = Ω(n logb a+ ) for some constant > 0, and af(n/b) ≤ cf(n) for some constant c < 1, for all large n,...
***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem,...
***Only Complete the Bolded Part of the Question*** Complete the asymptotic time complexity using Master theorem, then use the "Elimination Method" to validate your solution. 1. T(n)= 2T(n/4) + √n