Orders of growth

Level UniversityDifficulty ★★★★★Concept⌖ Open in the map

What is it?

The hierarchy of how fast functions grow: logarithms ≪ powers ≪ exponentials ≪ factorials. It is the language in which we compare algorithms.

Formulas

log⁡n≪nε≪nk≪an≪n!≪nn(ε>0, a>1)\log n \ll n^{\varepsilon} \ll n^k \ll a^n \ll n! \ll n^n \qquad (\varepsilon > 0,\ a > 1)
n!∼2πn (ne)nn! \sim \sqrt{2\pi n}\,\left(\frac{n}{e}\right)^n
Stirling's formula

Where it shows up in computing

  • Algorithm analysis and complexity★★★★★fundamentalScientific computing and algorithms

    Choosing between an O(n2)O(n^2) and an O(nlog⁡n)O(n \log n) algorithm is a comparison of orders of growth.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

This page has the essentials. A fuller treatment (intuition, formal definition, worked example) is on the way.

↑ ↓ to navigate · ↵ · Esc