Problem understanding Master theorem

150 Views Asked by At

I'm studying the Master theorem (for the analysis of recursive algorithms) and I perfectly understand why a binary search is of order $\log_2(n)$.

I also understand that if we formulate it as $T(n) ≤ aT(\frac{n}{b}) + cn^d$ the recursive term is $O(a^{\log_b(n)})$ and $cn^d$ is $O(n^d)$.

What I don't understand is where the $e = \log_b(a)$ used in the comparison with $d$ comes from. In the comparison between the runtime term and recursive term we compare $n^d$ against $n^{\log_ba}$ and this latter term I don't understand:

How can we transform $a^{\log_b(n)}$ into $n^{\log_ba}$ ?

1

There are 1 best solutions below

3
On BEST ANSWER

$$a^{\log_bn}=a^{\log n/\log b}=\exp\left(\log a\cdot\frac{\log n}{\log b}\right)=n^{\log a/\log b}=n^{\log_ba}$$