Why does this equation hold true? I cannot seem to algebraically prove this.
$\displaystyle 2^{log n} = n^{log 2}$
thanks for the help in advance.
I do apologise, I misread your question. I thought the LHS was $\displaystyle \displaystyle \begin{align*} 2\log{(n)} \end{align*}$, not $\displaystyle \displaystyle \begin{align*} 2^{\log{(n)}} \end{align*}$, and the RHS was $\displaystyle \displaystyle \begin{align*} n\log{(2)} \end{align*}$, not $\displaystyle \displaystyle \begin{align*} n^{\log{(2)}} \end{align*}$.
Anyway, the best thing to do is to convert them to the same base
$\displaystyle \displaystyle \begin{align*} 2^{\log{(n)}} &\equiv e^{\log{\left[2^{\log{(n)}}\right]}} \\ &\equiv e^{\log{(n)}\log{(2)}} \\ &\equiv \left[e^{\log{(n)}}\right]^{\log{(2)}} \\ &\equiv n^{\log{(2)}} \end{align*}$
Q.E.D.
Hello, bakerconspiracy!
$\displaystyle \text{Prove: }\:2^{\log n} = n^{\log 2}$
$\displaystyle \text{Let }X \:=\:2^{\log n}$
$\displaystyle \text{Take logs: }\;\log X \:=\:\log\left(2^{\log n}\right) \:=\:\log n\cdot\log 2 \:=\:\log 2\cdot\log n $
. . . . . . . . $\displaystyle \log X \;=\;\log\left(n^{\log 2}\right) $
$\displaystyle \text{Exponentiate: }\;X \;=\;n^{\log 2}$
$\displaystyle \text{Therefore: }\;2^{\log n} \;=\;n^{\log 2}$