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$ May 4 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 at 23:45
  • $\begingroup$ @MaryamPanahi: what do you mean ? $\endgroup$ May 5 at 11:32
  • $\begingroup$ @MaryamPanahi: did you read the first sentence ? $\endgroup$ May 5 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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