LOGBOOK

HELP

Quiz Entry - updated: 2026.12.01

A nightly batch job takes 1 second in a test with 1,000 accounts. Production has 2 million accounts. How long will it run if the job is linear, and how long if it is quadratic?

Linear: 2,000 s, about 33 minutes. Quadratic: $2000^2 = 4$ million seconds, about 46 days.

Production holds 2,000 times as many records as the test, so the only question is what a factor of 2,000 in $n$ does to the time:

Growth class Time scales by Production run
$O(n)$ $2000$ 2,000 s ≈ 33 min
$O(n^2)$ $2000^2 = 4{,}000{,}000$ 4,000,000 s ≈ 46.3 days

Same test result, same machine, same code quality. The only difference is the exponent, and it decides between "fits in the overnight slot" and "runs for more than six weeks". Banks and insurers run hundreds of such jobs at year end, and each one has to be scheduled in advance, so the growth class is a planning number, not a theoretical nicety.

The calculation is only valid because 1,000 records is already large enough for the leading term to dominate the running time. From a test with ten records, where constant set-up costs still dominate, the same scaling would give a wrong answer.

Tip: scale the ratio, never the raw numbers: time × (factor)^exponent. A factor of 2,000 is harmless at exponent 1 and catastrophic at exponent 2.

From Quiz: ADS / Asymptotic Analysis, O-Notation and Recursion | Updated: Dec 01, 2026