Question

In: Computer Science

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

Use a recursion tree to determine a good asymptotic upper bound on the recurrence ?(?) = 3?(?/3) + ?. Use the substitution method to verify your answer.

Solutions

Expert Solution

Solution:

Given,

=>T(n) = 3T(n/3) + n

Explanation:

Solving recurrence relation using recursion tree:

=>Cost at each level of tree is presented.

=>Total cost can be found by summing up the costs of all the levels of recursion tree.

Verification using substitution method:

=>T(n) = 3T(n/3) + n...(1)

=>T(n/3) = 3T*n/3^2) + n/3...(2)

From (1) and (2)

=>T(n) = 3^2T(n/3^2) + n + n

and so on.

=>T(n) = 3^kT(n/3^k) + n + n + .....k times

=>T(n) = 3^kT(n/3^k) + n*k...(3)

=>Let say T(1) = 1

=>n/3^k = 1

=>n = 3^k

Taking log both sides on base 3

=>k = log3(n)..(4)

From (3) and (4)

=>T(n) = 3^log3(n)*1 + n*log3(n)

=>T(n) = n + n*log3(n)

=>Hence T(n) = O(n*log(n))

I have explained each and every part with the help of statements as well as image attached to it.


Related Solutions

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) + 2n. Use the substitution method to verify your answer
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...
Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer. T(n) = 3T(n/2) + n. T(n) = T(n/2) + n2.
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n)...
Solve the following recurrence relations: (find an asymptotic upper bound O(?) for each one) a. T(n) = T(2n/3)+T(n/3) + n^2 b. T(n) = √nT(√n) + n c. T(n) = T(n-1)+T(n/2) + n The base case is that constant size problems can be solved in constant time (O(1)). You can use the induction, substitution or recursion tree method
Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your...
Derive a Θ-bound on the solution to the following recurrence. using iterative recursion and check your answer with master theorem result T(n) = T (1/3 n) + log n
Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree. a....
Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree. a. T(n) = 2T(n − 1) + 1 b. T(n) = t(n − 1) + n c. T(n) = 2T (n/4) + √n
Use recursion tree to solve the recurrence: T(n) = T(n/15) + T(n/10) + 2T(n/6) + n^(1/2)
Use recursion tree to solve the recurrence: T(n) = T(n/15) + T(n/10) + 2T(n/6) + n^(1/2)
Use recursion function to derive computation time for Binary Search by drawing a recursion tree diagram...
Use recursion function to derive computation time for Binary Search by drawing a recursion tree diagram and using algebra calculation.
Given the integral 1/x dx upper bound 2 lower bound 1 (a) use simpson's rule to...
Given the integral 1/x dx upper bound 2 lower bound 1 (a) use simpson's rule to approximate the answer with n=4 Formula:f(x)=1/3[f(x0)+4f(x1)+2f(x2)+...+f(xn)]Δx(keep answer to 6 decimals) b)how large is n in order for the error of Simpsons rule for the given integral is no more than 0.000001 Formula: |Es|=(k)(b-a)^5/(180 n^4), where |f^4(x)≤k| please show all work and steps
Recall the following theorem, phrased in terms of least upper bounds. Theorem (The Least Upper Bound...
Recall the following theorem, phrased in terms of least upper bounds. Theorem (The Least Upper Bound Property of R). Every nonempty subset of R that has an upper bound has a least upper bound. A consequence of the Least Upper Bound Property of R is the Archimedean Property. Theorem (Archimedean Property of R). For any x; y 2 R, if x > 0, then there exists n 2 N so that nx > y. Prove the following statements by using...
Write a program in JAVA that prompts the user for a lower bound and an upper...
Write a program in JAVA that prompts the user for a lower bound and an upper bound. Use a loop to output all of the even integers within the range inputted by the user on a single line.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT