Search code examples
algorithmtheoryrate

Rates in algorithm analysis?


WHY do logarithms grow slower than any polynomial? What is the (understandable) proof for this?

Similarly,

WHY do exponentials always grow faster than any polynomial?


Solution

  • EDIT: This answer is essentially doing what PengOne said.

    We take the limit of

    log_2(x) / x^p
    

    for constant p > 0 and show that the limit is zero. Since both log_2(x) and x^p go to infinity as x grows without bound, we apply l'Hopital's rule. This means our limit is the same as the limit of

    1/(x*ln2) / p*x^(p-1)
    

    Using simple rules of fractions, we reduce this to

    1 / (p * x^p * ln2)
    

    Since the denominator goes to infinity while the numerator is constant, we can evaluate the limit - it's zero, which means that log_2(x) grows asymptotically more slowly than x^p, regardless of the (positive) value of p.

    EDIT2:

    By the way, if you are interested in this question and the posted answers, consider showing support for the new Computer Science StackExchange site by following this link and committing to the movement:

    http://area51.stackexchange.com/proposals/35636/computer-science-non-programming?referrer=rpnXA1_2BNYzXN85c5ibxQ2