1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Big-Oh algebra with logarithms that I don't get?

  1. May 10, 2012 #1
    My textbook says O(3log2 n) can be written as O(nlog2 3). Why is that?

    Thank you.
     
  2. jcsd
  3. May 10, 2012 #2

    I like Serena

    User Avatar
    Homework Helper

    Welcome to PF, Nishiura_high! :smile:

    One of the log rules is that ##\log a^b = b \log a##.

    So:
    $$\log_2(3^{\log_2 n}) = \log_2 n \cdot \log_2 3$$
    and also:
    $$\log_2(n^{\log_2 3}) = \log_2 3 \cdot \log_2 n$$
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook