1

Consider the following recurrence: $$ T(n) = 2T(n/2)+n\lg n$$

Let’s use a base-case $T (2) = 2$ and let’s assume $n$ is a power of $2$.

(a) “guess and prove by induction” method, considering the following steps.

i. Try to prove by induction that $T (n) \le cn \lg n$. (assume inductively that $T(n′) ≤ cn'\lg n'$ for all $n′ < n$ and try to show it holds for $n$. This guess is incorrect and so your proof should fail.) Point out where this proof fails.

ii. Use the way the above proof failed to suggest a better guess $g(n)$. Explain this guess and prove by induction that $T (n) ≤ g(n)$ as desired.

iii. give a proof by induction to show that $T(n) ≥ c′g(n)$ where $c′ > 0$ is some constant and $g(n)$ is your guess from (b). Combining this with (b), this implies that $T = Θ(g)$.

(b) Solve the recurrence using the recursion trees method.

martini
  • 84,101
werwfds
  • 11

0 Answers0