Question about $\Theta$

98 Views Asked by At

Can anyone give an example of a case where $f(n) = \Theta(g(n))$ for two positive functions and the limit $\lim\limits_{n \to \infty}\dfrac{f(n)}{g(n)}$ does not exist?

3

There are 3 best solutions below

4
On BEST ANSWER

Sure, $f(n) = \sin n + 2$ whereas $g\equiv 1$. The point is that if $f \in \Theta (g)$ then for $n$ large enough you have that $f(n)/g(n)$ is bounded. However, a bounded sequence does not have to have a limit. So actually, you can take any bounded sequence that does not have a limit and construct a new counterexample.

1
On

Take $f(x) = \sin x$ and $g(x) = \cos x$. the limit does not exist because of preriodicity, but both functions are always $\Theta(1)$.

0
On

Try $f(2n)=g(2n+1)=2$ and $f(2n+1)=g(n)=1$.

Then $g(n)/2\leqslant f(n)\leqslant2g(n)$ for every $n$ hence $f\in\Theta(g)$ but $f(2n)/g(2n)=2$ while $f(2n+1)/g(2n+1)=1/2$ hence the sequence $(f(n)/g(n))_n$ diverges.