1
$\begingroup$

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

  • 3
    Take $\log_n$ of both sides.2017-02-07

1 Answers 1

1

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)}$.