I am trying to understand algorithms and especially the Big-O notation and I came across this question that included logs:

The question wants me to prove that the Big-O notations for $\log_3 x$ is $\log_2 x$. I know how to solve the ones with no logs, but I am very confused on how to approach the ones with logs. Thank you so much in advance!

Do I start by breaking it down?

$\log_3 x$ is $O(\log_2 x)$, where $3$ and $2$ are the log bases.


Hint: Use the change of base formula for logs \begin{align} \frac{\log_2 y}{\log_2 3} = \log_3 y. \end{align}

  • $\begingroup$ I don't really understand what you mean :( @JackyChong $\endgroup$ – Emily Mar 7 '17 at 2:26
  • 1
    $\begingroup$ Since $\frac{1}{\log_2(3)}$ is a constant ... $\endgroup$ – gue Mar 7 '17 at 6:32

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.