what is wrong with this proof? (proving the transitive property of Big O)

171 Views Asked by At

So the problem is if $f(n) \in O(g(n))$,and $g(n) \in O(h(n))$ then $f(n) \in O(h(n))$

Assume $f(n) \geq 0, g(n) \geq 0, h(n) \geq 0$

Proof:

From assumptions, $\displaystyle\lim_{n\to\infty}\frac{f(n)}{g(n)}$ and $\displaystyle\lim_{n\to\infty}\frac{g(n)}{h(n)}$ exists and are finite hence:

$\left(\displaystyle\lim_{n\to\infty}\frac{f(n)}{g(n)}\right) \left(\displaystyle\lim_{n\to\infty}\frac{g(n)}{h(n)}\right) = \displaystyle\lim_{n\to\infty}\frac{f(n)g(n)}{g(n)h(n)} = \lim_{n\to\infty}\frac{f(n)}{h(n)}$ exists and is finite

therefore $f(n) \in O(h(n))$

I was told that this is incorrect...why?

1

There are 1 best solutions below

2
On BEST ANSWER

If $f(n) = |\sin n|$ and $g(n) = 1$, then it's true that $f(n) = O(g(n))$, but $\lim_{n \to +\infty} \frac{f(n)}{g(n)}$ doesn't exist.