2

I'm reading a proof on the time complexity of MergeSort which makes this statement without any justification. I've tried to show it myself but I'm not getting far; these are my steps so far.

$\sum\limits_{i=0}^{\lg(n)-1} \theta(\frac{n}{2^i}) =\theta(n\sum\limits_{i=0}^{\lg(n)-1}\frac{1}{2^i})$

Now $\sum\limits_{i=0}^{\infty}\frac{1}{2^i} = 2$, so $\sum\limits_{i=0}^{\lg(n)-1}\frac{1}{2^i} \leq 2$. This means that $\theta(n\sum\limits_{i=0}^{\lg(n)-1}\frac{1}{2^i}) = \theta(2n) = \theta(n)$, but surely not. Where is my logic wrong?

Raphael
  • 73,212
  • 30
  • 182
  • 400
user30362
  • 21
  • 1

0 Answers0