Bölüm 1.2 · Simülatör

Asymptotic Growth Explorer

← Bölüm 1.2

Values at n = 1000 (log scale up to n³)

fgotherstriped = off the scale

Crossover

Asymptotic Growth Explorer

Compare common growth rates at the same input size and inspect when one function overtakes another.

How to use

  • Enter an input size n (2 to 1,000,000) and press Compare.
  • The left panel shows log₂ n, n, n log₂ n, n², n³ and 2ⁿ evaluated at n. Bar lengths use a logarithmic scale whose right end is n³. When 2ⁿ is larger than n³ its bar is cut off and drawn striped (off the scale); otherwise every other bar would shrink to almost nothing.
  • Pick two functions f and g. The right panel reports the first sampled integer (searched from 2 up to 100,000) where f(n) > g(n), together with both values at your n.
  • Values that exceed the floating-point range (2ⁿ for n > 1023) are shown as ∞.

Why it matters

Asymptotic notation compares long-run growth, not one measured input size. A function with a larger growth rate may still be smaller for small n; the crossover point shows where the long-run ordering takes over. Constant factors move the crossover but never change the eventual winner.

Typical ordering

log n ≪ n ≪ n log n ≪ n² ≪ n³ ≪ 2ⁿ for sufficiently large n.