edited by
1,602 views
3 votes
3 votes
Solve Recurrence

A) T(n) = T( √ n) + Θ(lg lg n)

B) T(n) = T(n/2 + √ n) + √ 6046

C) T(n) = T(n − 2) + lg n

D) T(n) = √ n T( √ n) + 100n
edited by

1 Answer

0 votes
0 votes
a) T(n) = T(√n) + Θ(lg lg n)

Solution: Change of variables: let m = lg n. Recurrence becomes

S(m) = S(m/2) + Θ(lg m).

Case 2 of master’s theorem applies, so T(n) = Θ((lg lg n)^2).

 

b) T(n) = T(n -2) + lg n

Solution: T(n) = Θ(n log n). This is T(n) = Pn/2

i=1 lg 2i ≥

Pn/2

i=1 lg i ≥ (n/4)(lg n/4) =

Ω(n lg n). For the upper bound, note that T(n) ≤ S(n), where S(n) = S(n-1)+lg n,

which is clearly O(n lg n).

 

 

d) T(n) = √n T(√n) + 100n

Solution: Master’s theorem doesn’t apply here directly. Pick S(n) = T(n)/n. The

recurrence becomes

S(n) = S(√n) + 100. The solution of this recurrece is S(n) = Θ(lg lg n).

(You can do this by a recursion tree, or by substituting m = lg n again.)

Therefore, T(n) = Θ(n lg lg n).

Related questions

0 votes
0 votes
0 answers
1
rexritz asked Aug 13, 2023
301 views
$T\left ( n \right )= 8T\left ( \frac{n}{2} \right )+\left ( n\cdot logn \right )^{2.99}$Also can $\mathcal{O}(n^{3})$ be an upper bound to above recurrence relation?
1 votes
1 votes
1 answer
2
1 votes
1 votes
2 answers
3
mdboi asked Oct 28, 2022
779 views
how do i apply master theorem to this? T(n)=2T(n/2)−n^3n
0 votes
0 votes
1 answer
4
lucasbbs asked Feb 28, 2022
6,806 views
How do I apply the master theorem in the above recurrence? Please give details about which case and on hiow to solve the asymptotic analysis...