In one of the algorithms textbooks I was reading, it states that $O(3^{\log_2n})$ can be rewritten as $O(n^{\log_23})$. Why is this the case?
2026-04-03 15:42:08.1775230928
Big O / Logarithmic Equivalency
72 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
Recall the following log rule:
Now to prove that $3^{\log_2 n} = n^{\log_2 3}$, it suffices to prove that their logs (base $2$) are equal. Indeed, observe that: \begin{align*} \log_2(3^{\log_2 n}) &= (\log_2 n)(\log_2 3) &\text{by (1), where $x = 3$ and $k = \log_2 n$} \\ &= (\log_2 3)(\log_2 n) &\text{by the commutativity of multiplication} \\ &= \log_2(n^{\log_2 3}) &\text{by (1), where $x = n$ and $k = \log_2 3$} \\ \end{align*} as desired. $~~\blacksquare$