If $f(n)$ is $\mathcal{O}(g(n))$, then prove sum of $f(x)$ is not $\mathcal{O}(n\cdot g(n))$

111 Views Asked by At

Given that sum of $f(n)$ is $f(1)+f(2)+\dots+f(n)$, where $n$ is natural number.

I am stuck with this problem. I tried to use the definition of $\mathcal{O}$, then $$f(1)+f(2)+\cdots+f(n) \le c(g(1)+g(2)+\cdots+g(n))$$ but this seems to be going nowhere. And it seems that I should use $\log$ and the property $\displaystyle\sum_{i=1}^{2^n}\frac{1}{i}\ge \frac{n}{2}.$ Any help, thanks.

1

There are 1 best solutions below

1
On

If you know that the harmonic series is divergent you don't have to use the inequality in the hint. [ You can use it to prove divergence, if you don't know it already]. Let $f(n)=\frac 1 n$ and $g(n)=\frac 1n$. Then $f(n)=\mathcal O (g(n))$ But $f(1)+f(2)+...+f(n)=1+\frac 1 2+...+\frac 1 n$ is no $\mathcal O (ng(n))$ because $f(1)+f(2)+...+f(n) \to \infty$.