## Discrete Mathematics with Applications 4th Edition

Prove $n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n}$ is $\Theta(n)$. By theorem 5.2.3: $n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n} = n(1+ \frac{1}{2} + \frac{1}{4} + \cdots + \frac{1}{2^n}) = n(\frac{(\frac{1}{2})^{n+1}-1}{\frac{1}{2}-1}) = n(\frac{1-2^{n+1}}{-2^n})$ (multiply numerator and denominator by $2^{n+1}$) $=n(\frac{2^{n+1}-1}{2^n}) = n(2-\frac{1}{2^n})$. For $n>1$, $1 \leq (2-\frac{1}{2^n}) \leq 2$ so $1(n) \leq n(2-\frac{1}{2^n}) \leq 2(n)$. By the transitive property: $1(n) \leq n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n} \leq 2(n)$. Because all terms are positive: $1|(n)| \leq |n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n}| \leq 2|(n)|$. Thus for A=1, B=2, k=1, $A|(n)| \leq |n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n}| \leq B|(n)|$ for all $x>k$. Thus $n+ \frac{n}{2} + \frac{n}{4} + \cdots + \frac{n}{2^n}$ is $\Theta(n)$.
Recall the definition of $\Theta$-notation: $f(x)$ is $\Theta(g(x))$ iff there exist positive real numbers A, B, k, such that $A|g(x)| \leq |f(x)| \leq B|g(x)|$ for all $x>k$. Recall theorem 5.2.3: sum of a geometric sequence: For any real number $r$ except 1, and any integer $n \geq 0$, $\sum_{i=0}^{n}r^i = \frac{r^{n+1}-1}{r-1}$. In this case $r=\frac{1}{2}$.