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 following recurrences  using the recursion tree method T(n) = 4 T(n/4) + n, where T(1)...
Solve the following recurrences  using the recursion tree method T(n) = 4 T(n/4) + n, where T(1) = 0
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
Design a Full Recursion Tree: T(n) = 8T(n/2) + Theta(n^2)
Design a Full Recursion Tree: T(n) = 8T(n/2) + Theta(n^2)
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
Let H(n) = H(n/2) + log(n). Give matching upper and lower bounds for H(n) with the...
Let H(n) = H(n/2) + log(n). Give matching upper and lower bounds for H(n) with the following techniques: 1. Using a recursion tree 2. By substitution 3. Using the master theorem
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT