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 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.
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 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.
Give asymptotic upper and lower bounds for T(n). Assume that T(n) is constant for n <=...
Give asymptotic upper and lower bounds for T(n). Assume that T(n) is constant for n <= 2. Make your bounds as tight as possible, and justify your answers. T(n) = T(n-2) + n^2
Given that α (alpha) is an upper bound of a given set of S of real...
Given that α (alpha) is an upper bound of a given set of S of real numbers, prove the following are equivalent: α = sup(S) α ∈ cl(A)
Given the data listed in the table, calculate the lower and upper bound for the 95%...
Given the data listed in the table, calculate the lower and upper bound for the 95% confidence interval for the mean at X = 7. The regression equation is given by y^ = b0 + b1x. Regression Statistics Statistic Value b0 4.3 b1 0.50 x 5.36 se 3.116 SSX 25.48 SST 58.25 n 40 Give your answers to 2 decimal places. You may find this Student's t distribution table useful. a) Lower bound = b)Upper bound =
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT