I misunderstanding about some logarithm property in algorithm course:

is it correct that we say following three term is equivalent?

$O(\log a + \log b)$

$O(\log (ab))$

$O(\log (a+b))$

  • 1
    $\begingroup$ $\log(a)+\log(b)=\log(ab)$ is an elementary property of the logarithms. $\endgroup$
    – user16034
    May 4, 2022 at 15:54

1 Answer 1


Let $a>b>0$. From $\log(a+b)=\log(a)+\log\left(1+\dfrac ba\right)$, we draw

$$\log(a)\le\log(a+b)\le \log(a)+\log(2)$$ and similarly for $b>a$.

  • 1
    $\begingroup$ You may want to add the case when a = b. $\endgroup$
    – John L.
    May 4, 2022 at 23:45
  • $\begingroup$ @MaryamPanahi: what do you mean ? $\endgroup$
    – user16034
    May 5, 2022 at 11:32
  • $\begingroup$ @MaryamPanahi: did you read the first sentence ? $\endgroup$
    – user16034
    May 5, 2022 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.