# Necessary conditions for proving If f(n) = O(g(n)), then is log(f(n)) = O(log(g(n)))

I am learning about algorithmic complexities and I read that if f(n) and g(n) are asymptotically positive functions and if $$f(n) =O(g(n))$$ then the relationship $$log(f(n)) = O(log(g(n)))$$ holds.

I would like to know what are the necessary and sufficient conditions for this relation to hold?

It's obviously wrong. As an example take f(n) = 2, g(n) = $$1 + e^{-n}$$.
log f(n) = 1, log g(n) ≈ $$e^{-n} / \log e$$.
• @Jyotish Robin: $f(n)\leq 2*g(n)$ so $f$ is indeed $O(g)$ – eru-cs Oct 22 at 20:37