1

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

Anthony O
  • 363

1 Answers1

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

Anna SdTC
  • 894
  • 4
  • 9