big-olittle-o

O notation and o notation


If f(n) = Θ(g(n)) then I know f(n) = O(n) and f(n) = Ω(g(n)), then I would say there should exist c1 and c2 ≥ 0, n1 ≥ 0, for all n > n1, there exists c1*g(n) ≤ f(n) ≤ c2*g(n).

Prove f(n) = c*g(n) + o(g(n)) for some c > 0. My point is f(n) ≤ c2*g(n) ==> we have f(n) < c2*g(n) + c*g(n) ==> fn ≤ c2*g(n) < (c2 + c)*g(n). Hence, I would like to say f(n) = c*g(n) + O(g(n)) is correct for some c > 0. Is that correct?

And can I also say f(n) = cg(n) + o(g(n)), for some c > 0?


Solution

  • f(n) = Θ(g(n)) then I know f(n) = O(n) and f(n) = Ω(g(n)).

    Well, absolutely not. Look, when f(n) = Θ(g(n)) it means that f(n) is a set of functions that grow asymptotically not faster than g. When g is n^2, f(n) becomes a set of functions that grow not faster than n^2 which definitelly isn't equal to a set of functions that grow not faster than n^2. It's because there exists an element which is in in the second set and is not it the first one. It's h(n) = n^2.

    Quod erat demonstrandum