Is there a function thats not in Big O and not in Big Omega?

3.4k Views Asked by At

I've been thinking about this problem for a while now but I can't fully come up with an example. It would make sense that this would exist and the only way I think it would work is if the functions were oscillating up and down and you could never find a point where f(n) is always bigger than c * g(n) and you could never find a point where f(n) is always less than c * g(n)

3

There are 3 best solutions below

0
On

$f(x) = x$ if $x$ is not prime, $f(x) = x^3$ if $x$ is prime.

$f$ is neither $O(x^2)$ nor $\Omega(x^2)$.

0
On

Or if you want continuous, $f(x) = x\sin(x)$ is neither $O(1)$ or $\Omega(1)$.

0
On

Here is a continuous and strictly increasing example: Let $g(y) = \sin^2(y)+y$ and $$ f(x)= e^{\textstyle e^{g(\log \log x)}} $$ for $x>1$. Then $g$ and therefore $f$ is strictly increasing, and $$ x = e^{\textstyle e^{\log\log x}} \le f(x) \le e^{\textstyle e^{1+\log\log x}} = e^{e \log x} = x^e $$ where for each of the inequalities there are arbitrarily large $x$ that makes it $=$, and therefore $f$ is neither $O(x^2)$ nor $\Omega(x^2)$.