How is $\ a^{\log_nb} = b^{\log_na} $?

142 Views Asked by At

How is $\ a^{\log_nb} = b^{\log_na} $ ?

I know this is likely a trivial identity but I don't see how the statements are equivalent.

I came across this equivalence in Chapter 4.4 of Introduction to Algorithms, CLRS

1

There are 1 best solutions below

0
On

Rewrite $a$ as $n^{log_n(a)}$, then $a^{log_n(b)}=n^{log_n(a)log_n(b)}$. Same for the right hand side, $b^{log_n(a)}=n^{log_n(b)log_n(a)}$.