0

I'm studying a post https://math.stackexchange.com/a/2203293/673047 which gives a nice proof for $H_n = \Theta( \log n)$

I understand most of the proof except for the part which rewrites $\frac{1}{2}k +\frac{1}{2^k}\leq H_{2^k} \leq k + \frac{1}{2^k}$ as $\frac{1}{2} \log_2 n \leq H_n \leq \log_2n + 1$

I know $2^{\log_2 n}=n$. How do I get $\frac{1}{2} \log_2 n \leq H_n \leq \log_2n + 1$ from $\frac{1}{2}k +\frac{1}{2^k}\leq H_{2^k} \leq k + \frac{1}{2^k}$?

JJJohn
  • 1,436

1 Answers1

1

Putting in $n = 2^k$, or equivalently $k = \log_2 n$, leads to $\frac{1}{2} \log_2 n + \frac{1}{n} \leq H_n \leq \log_2 n + \frac{1}{n}$. This is already good enough, but to simplify to the stated bound we can simply use the bound $0 \leq \frac{1}{n} \leq 1$ ($n \geq 1$) for the lower and upper bounds respectively.

JKL
  • 2,139