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

1. May 10, 2012

### Nishiura_high

My textbook says O(3log2 n) can be written as O(nlog2 3). Why is that?

Thank you.

2. May 10, 2012

### I like Serena

Welcome to PF, Nishiura_high!

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$$