# Do not understand why log n = O(n^c) (for any c>0) [duplicate]

Can anyone help me understand this equation?

$\log (n) = O(n^c)$ (for any $c>0$)

Does it mean that $O(\log (n)) < O(n^c)$ (for any $c>0$)?

Please also prove that $\log (n) = O(n^c)$ is true.

• You just have to show that logarithms grow slower than polynomials. – Pål GD Apr 20 '15 at 8:28
• Attend the definition. – Raphael Apr 20 '15 at 8:51
• No, it means that, for any $c>0$, there's a constant $k$ such that, for large enough $n$, $\log n < kn^c$. Just like any other statement of the form $f(n)=O(g(n))$. – David Richerby Apr 20 '15 at 10:46

It's not actually an equation $f = O(g)$ is a lazy shorthand that should be written $f \in O(g)$. So if you look back at the definition of $O$, you should be able to see what $\log n \in O(n^{c})$ for any $c > 0$ means:
For every $c > 0$, there exists $n_{0} \geq 0$ and $k \geq 0$ such that $\log n \leq k\cdot n^{c}$ for all $n \geq n_{0}$.
Always remember that $O(\cdot)$ describes a set, $O(\log n) < O(n^{c})$ doesn't actually make sense (unless you make up a special meaning for $<$, but then no-one will know what you're talking about). You could say $O(\log n) = O(n^{c})$, as equality for sets has a understood meaning, though of course this statement in particular would be false.
As John Kugelman points out in the comments below, normal set relations do make sense, so $O(f) \subset O(g)$, $O(f) \subseteq O(g)$, etc., make sense.
• $O(\log n) \subset O(n^c)$ is sensible. – John Kugelman Apr 20 '15 at 14:31