Big-O Comparator

Compare eight growth functions and their doubling factors, without treating them as measured runtimes.

About this tool

Compare representative growth functions for integer input sizes 1–100000. Choose curves to isolate a comparison. The table shows f(n) and the multiplier when n doubles. Logarithms use base 2.

The vertical axis is log₁₀(1 + f(n)): this compresses large values and includes zero. At n=1, log₂(n) and n log₂(n) are zero; their doubling ratio is undefined (—). Scientific notation is rounded to four significant digits. Exponential and factorial values are calculated in logarithmic space, without an artificial cap. The plot samples at most 161 integer sizes.

Big-O describes asymptotic bounds, not exact operation counts or seconds. These representative functions use coefficient 1; constants, hardware and input structure are omitted. For example, doubling n multiplies n² by 4 but 2ⁿ by 2ⁿ. Compare smaller ranges or hide fast-growing curves to inspect slower functions.

Choose curves before or after the first Compare / Enter action. After starting, valid changes to n update after a short typing pause without moving focus; invalid drafts hide old output. Reset restores 32 and all eight curves without calculating. Colored checkbox labels are the shared curve/table legend.

For n=1, the plot shows individual points because no interval exists. Uncheck 2ⁿ and n! to inspect slower growth with a rescaled vertical axis. When every function is unchecked, select one to restore the diagram.

For n=2, the values are 1, 1, 2, 2, 4, 8, 4 and 2. Doubling n gives factors 1, 2, 2, 4, 4, 8, 4 and 12 respectively. The table stays readable and can scroll locally for very large scientific exponents.

Only raw n and selected curves are saved, never completed comparisons or plots. Legacy v1 keeps these inputs and drops its computed flag. Reload/new views await Compare or Enter; mounted pinned views remain in RAM. Oversized drafts preserve the prior saved copy and can be downloaded as plain input TXT before reload. Plot width and height follow available space; large screens place values alongside it, mobile screens below it.

Choose Compressed under Y scale to separate slower curves alongside very large function values. It applies log₁₀(1 + y) to the standard axis values y. The table still shows the original values.