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)=4T(n/3)+nlgn.
b.T(n)=3T(n/3)+n/lgn.
c.T(n)=4T(n/2)+n2n.
d.T(n)=3T(n/3−2)+n/2.
e.T(n)=2T(n/2)+n/lgn.
f.T(n)=T(n/2)+T(n/4)+T(n/8)+n.
g.T(n)=T(n−1)+1/n.
h.T(n)=T(n−1)+lgn.
i.T(n)=T(n−2)+1/lgn.
j.T(n)=nT(n)+n
a. By master theorem, T(n)=Θ(nlog34).
b.
By the recursion-tree method, we can guess that T(n)=Θ(nlog3log3n).
We start by proving the upper bound.
Suppose k<n⟹T(k)≤cklog3log3k−k, where we subtract a lower order term to strengthen our induction hypothesis.
d. It is Θ(nlgn). The subtraction occurring inside the argument to T won't change the asymptotics of the solution, that is, for large n the division is so much more of a change than the subtraction that it is the only part that matters. once we drop that subtraction, the solution comes by the master theorem.
e. By the same reasoning as part (b), the function is O(nlgn) and Ω(n1−ϵ) for every ϵ and so is O~(n), see Problem 3-5.
f. We guess T(n)≤cn,
T(n)=T(n/2)+T(n/4)+T(n/8)+n≤87cn+n≤cn.
where the last step holds for c≥8.
g. Recall that χA denotes the indicator function of A. We see that the sum is
T(0)+j=1∑nj1=T(0)+∫1n+1j=1∑n+1jχj,j+1(x)dx.
Since x1 is monatonically decreasing, we have that for every i∈Z+,
We deal with the error term by first chopping out the constant amount between 1 and 2 and then bound the error term by O(x(x−1)1) which has an anti-derivative (by method of partial fractions) that is O(n1),