Why does the Big O notation of summation give log

asymptoticscomputer sciencelogarithmsreal-analysissummation

I’m not understanding the following line in a proofenter image description here

I believe it should be $O(h^2\psi(2h))$ since $\sum_{j=1}^{h}\frac{1}{j}\leqslant h\cdot1=h$

Best Answer

The notation $=O$ needs to be discouraged; it should be $\in O$. It's also important to note $o(f(h))\subseteq O(f(h))$, so very different looking arguments can go in the $O$. In this example,$$\sum_{j=1}^h\frac1j\sim\int_1^h\frac1JdJ=\ln h\in O(\ln h)\subseteq o(h)\subseteq O(h).$$

Related Question