Big-O Example question

125 Views Asked by At

Could you please give an example that disproves the following Big-O comparison:

$$f(n)^2=O(g(n)^2)\qquad\text{implies}\qquad constant^f=O(constant^g)$$

1

There are 1 best solutions below

0
On

Just take $f(n) = 2n$ and $g(n) = n$. Then $c^{f} = c^{2n}$ is not $O(c^g) = O(c^n)$ when $c > 1$. To see this, you can note that $\lim_{n \to \infty} c^{2n}/c^{n} = \infty$.