Check my short proof - asymptotic approximation, which function is bigger

59 Views Asked by At

The goal of this exercise is to show that $\ln(n+1)-\ln(n) = O(\frac{1}{n})$

what I did is: I used the fact that if $f=O(g)$ then $\frac{f}{g}=O(1)$.

$\ln(n+1)-\ln(n)=\ln(\frac{n+1}{n}) = \ln(O(1))$

$\ln(O(1))=O(\frac{1}{n})$ if and only if $O(1)=e^{O(\frac{1}{n})}$ which is true, since $e^{O(\frac{1}{n})}$ is an exponential function and $O(1)$ is not.

Is this correct? Or am I way off. at any rate I know we should use " $f=O(g)$ then $\frac{f}{g}=O(1)$" since it was given as a tip by the teacher.

1

There are 1 best solutions below

0
On BEST ANSWER

Try the series $\log(1-x)=-\sum_{k=1}^\infty\frac1kx^k$ so $$\log(n+1)-\log n=\log\left(1+\frac1n\right)=-\sum_{k=1}^\infty\frac{(-1)^k}{kn^k}=\frac1n+O(n^{-2})$$

Proof: $$\log(1-x)=-\int\frac1{1-x}\text dx=-\int\sum_{k=0}^\infty x^k\text dx=-\sum_{k=1}^\infty \frac1kx^k$$

Alternatives:

It is well known that $O(\log n)=O(H_n)$ where $H_n$ is the $n^{th}$ harmonic number, and $H_{n+1}-H_n=\frac1{n+1}$.

$\log(n+1)-\log n=\int \left(\frac{1}{n+1}-\frac1n\right)\text dn=-\int\frac{1}{n(n+1)}\text dn=O(\frac1n)$