6
$\begingroup$

Are $\log_{10}(x)$ and $\log_{2}(x)$ in the same big-O class of functions? In other words, can one say that $\log_{10}(x)=O(\log x)$ and $\log_{2}(x)=O(\log x)$?

$\endgroup$
1
  • $\begingroup$ And x^$log(y)$ = y^$log(x)$. Magic. $\endgroup$ Oct 9, 2012 at 11:26

2 Answers 2

13
$\begingroup$

Yes. Because they differ only by a constant factor. Remember high school math:

$\log_2 x = \dfrac{\log_{10} x}{\log_{10}2}$.

$\endgroup$
2
$\begingroup$

Why?

$2^{\log_2 x} = x$

$\log_{10}(2^{\log_2 x}) = \log_{10} x$

$\log_2 x(\log_{10}2) = \log_{10} x$ $(*)$

$\log_2 x = \dfrac{\log_{10} x}{\log_{10}2}$

QED.

$(*) \log x^y = y*\log x$

$\endgroup$

Your Answer

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

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