Why are $ a^{\log _{b} n} $ and $ n^{\log _{b} a} $ equivalent

logarithms

I am reading about master theorem and it says that the number of leaves is $a^{\log _{b} n}$, and this part I can understand.

But then it immediately concludes that $$ a^{\log _{b} n} = n^{\log _{b} a} $$ which I am not getting. I verified that it is true by plugging in some values and also I tried to prove it by looking up properties of logatirthms but that didn't seem to help.

Can someone provide an explanation to why this is true?

Best Answer

Take $\log_b$ of both: $$\log_b(a^{\log_bn})=\log_b(n)\log_b(a)$$ $$\log_b(n^{\log_ba})=\log_b(a)\log_b(n)$$

Related Question