Polynomial, Exponential and Logarithmic Growth

Which of three families wins in the end.

Three families in one table

Three kinds of function grow without limit: logarithms such as log₂n, powers such as n², and exponentials such as 2ⁿ. For small n it is hard to tell them apart, and the order can even change.

At n = 4, n² = 16 and 2ⁿ = 16, while log₂n = 2. At n = 8 the three are 3, 64 and 256. At n = 16 they are 4, 256 and 65536. Doubling n adds 1 to log₂n, multiplies n² by 4, and squares 2ⁿ.

Before n = 4 the two are not in this order everywhere. At n = 3, n² = 9 is larger than 2³ = 8, and they are equal at n = 2, where both are 4. From n = 5 on, 2ⁿ is ahead and stays ahead: 32 against 25, then 64 against 36.

xy(2, 4)(4, 16)

The gold curve is y = 2ˣ and the plain curve is y = x². They meet at x = 2 and at x = 4. Between them x² is higher, 9 against 8 at x = 3; beyond x = 4, 2ˣ pulls away, 64 against 36 at x = 6.

One order, in the long run

The three families rank in one order once n is large enough: every logarithm is below every power nᵏ with k > 0, and every power is below every exponential aⁿ with a > 1. No choice of constants changes that order. A constant in front, such as 1000n², only moves the point where the order takes over.

The words "large enough" carry the meaning. Compare √n, the power with k = 1/2, with log₂n. They are equal at n = 4, where both are 2, and at n = 16, where both are 4. Between those two the logarithm is ahead: at n = 8, log₂n = 3 and √8 is about 2.83. From n = 17 on, √n is ahead for good.

A small power can take a very long time. The tenth root of x is below ln x from about x = 3.06 until x is about 3.4 × 10¹⁵, and above it from there on.

A small base also only delays the crossing. 1.1ⁿ grows by just a tenth each step, yet it passes n² for good at n = 96: 1.1⁹⁶ is about 9412, and 96² = 9216.

xy(4, 2)(16, 4)

The gold curve is y = √x and the plain curve is y = log₂x. They cross at x = 4 and at x = 16; between the two crossings the logarithm is higher, and after x = 16 the square root stays above it.

A large power only delays the crossing

Raising the power pushes the crossing point further out. 2ⁿ passes n² for good at n = 5, n³ at n = 10, where 2¹⁰ = 1024 and 10³ = 1000, and n¹⁰ at n = 59.

Even n¹⁰⁰ is overtaken. At n = 996, n¹⁰⁰ is still the larger, by a hair; from n = 997 on, 2ⁿ is ahead and never falls behind again. The crossing is late, but it comes.

2ⁿ ahead fromn²n = 5n³n = 10n¹⁰n = 59n¹⁰⁰n = 997

The first n from which 2ⁿ is larger than each power for every n after it. The power goes up fifty-fold from n² to n¹⁰⁰, and the crossing moves from 5 to 997.

Why the exponential must win

Compare what one step does to each. Going from n to n + 1 multiplies 2ⁿ by 2, always. It multiplies nᵏ by (n + 1)ᵏ/nᵏ = (1 + 1/n)ᵏ, and that factor falls toward 1 as n grows, because 1/n falls toward 0.

For k = 100, the factor (1 + 1/n)¹⁰⁰ is below 1.5 from n = 247 on. From there, each step multiplies the ratio n¹⁰⁰/2ⁿ by less than 1.5 ÷ 2 = 0.75. A number cut by at least a quarter at every step falls toward 0, however large it starts, so the ratio drops below 1, and then 2ⁿ is the larger.

The same argument works for any power k and any base a > 1. In the end (1 + 1/n)ᵏ falls below any number larger than 1, so it falls below a number c between 1 and a, and from then on each step multiplies the ratio nᵏ/aⁿ by less than c/a, which is less than 1.

Written as limits

The order can be written with limits: nᵏ/aⁿ → 0 as n → ∞ for every k and every a > 1, and log₂n/n → 0 as well. A ratio that tends to 0 says the bottom outgrows the top.

The fall need not start at once. The ratio n³/2ⁿ is 0.5 at n = 1, rises to 4 at n = 4, and only then falls: about 0.98 at n = 10 and about 0.0076 at n = 20.

The logarithm limit is the same fact in disguise. Put n = 2ᵐ. Then log₂n = m, so log₂n/n = m/2ᵐ, which is a power over an exponential with k = 1, and it tends to 0.

ny(4, 4)

The ratio n³/2ⁿ. At the whole numbers its largest value is 4, at n = 4; after that it sinks toward 0, and by n = 20 it is below 0.01.

The usual mistakes

Reading the order as true for every n. 2ⁿ is not larger than n² at n = 3, and log₂n is larger than √n at n = 8. The order says what happens from some point on.

Trusting a large power. n¹⁰⁰ is ahead of 2ⁿ for a long stretch, from n = 2 up to n = 996, and is still overtaken.

Treating a faster computer as a fix for exponential work. A machine 64 times as fast lets a job of 2ⁿ steps grow by only 6, because 64 = 2⁶, while a job of n² steps grows 8 times, because 64 = 8².

Sorting, searching and forecasting

In the first application, 32n log₂n and n² steps are compared at powers of 2, where the logarithm is a whole number, and they are equal at n = 256. The second sets computers that double in speed every 2 years against a model whose running time grows as a fourth power.

Worked example: Two Sorting Programs and a Search Through Every Group on a Sensor Chip: Where One Program Overtakes the Other, and the Largest Job Each Finishes in a Second

Question A sensor chip carries out one million basic steps per second. To sort a list of n readings, program A takes 32nlog2 n steps and program B takes n2 steps. A third task, choosing the best group of readings by checking every possible group, takes 2n steps for n readings. (a) For which list lengths n ≥ 2 does B take fewer steps than A, and for which n do the two take the same number? (b) What is the largest n that B can sort, and the largest n for which the group search finishes, in no more than one second? What are these two numbers on a chip 64 times as fast?

  1. 1.B takes fewer steps than A when n2 < 32nlog2 n. Divide both sides by n: n < 32log2 n, which compares n with a multiple of its logarithm.

    B: n2A: 32 n log nreadings nB fewer when n < 32 log n
    B: n2A: 32 n log nreadings nB fewer when n < 32 log n
    Dividing by n, B takes fewer steps than A when n < 32log2 n.
  2. 2.Try powers of 2, where log2 n is a whole number. At n = 128: 32 × 7 = 224, more than 128. At n = 256: 32 × 8 = 256, equal. At n = 512: 32 × 9 = 288, less than 512.

    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288
    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288
    At powers of 2 the logarithm is a whole number: 32log2 n is 224, 256 and 288 at n = 128, 256 and 512.
  3. 3.(a) The ratio nlog2 n is 2 at n = 2 and rises for every n ≥ 3, so it reaches 32 only once, at n = 256. B takes fewer steps for 2 ≤ n < 256, the two take the same number, 65536, at n = 256, and A takes fewer from then on.

    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A above
    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A above
    (a) The curves meet once, at n = 256, with 65536 steps each. B takes fewer steps below 256 and A above it.
  4. 4.One second is 1000000 steps. For B, n2 ≤ 1000000 gives n ≤ 1000. For the group search, 2n ≤ 1000000 gives n ≤ log2 1000000 ≈ 19.9, so n ≤ 19: 219 = 524288 and 220 = 1048576.

    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19
    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19
    In one second of a million steps B sorts up to 1000 readings, and the group search handles up to 19.
  5. 5.A chip 64 times as fast carries out 64000000 steps in a second. For B, n2 ≤ 64000000 gives n ≤ 8000. For the group search, 64 = 26 adds 6 to the logarithm: n ≤ 19.9 + 6 = 25.9, so n ≤ 25, since 225 = 33554432 and 226 = 67108864.

    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19n2≤ 64000000: n ≤ 80002n≤ 64000000: n ≤ 25
    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19n2≤ 64000000: n ≤ 80002n≤ 64000000: n ≤ 25
    On a chip 64 times as fast, B sorts 8 times as many readings, but 64 = 26 adds only 6 to the group search.
  6. 6.(b) In one second B sorts up to 1000 readings and the group search handles up to 19. On the faster chip these become 8000 and 25: eight times as many readings for B, but only 6 more for the group search.

    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19n2≤ 64000000: n ≤ 80002n≤ 64000000: n ≤ 25B: 1000, then 8000; the search: 19, then 25
    B: n2A: 32 n log n128256512readings nB fewer when n < 32 log nn = 128, 256, 512: 32 log n = 224, 256, 288equal at n = 256; B fewer below it, A aboven2≤ 1000000: n ≤ 10002n≤ 1000000: n ≤ 19n2≤ 64000000: n ≤ 80002n≤ 64000000: n ≤ 25B: 1000, then 8000; the search: 19, then 25
    (b) In one second: 1000 and 19. On the faster chip: 8000 and 25.

Answer: (a) B takes fewer steps for 2 ≤ n < 256, the same number at n = 256, and more for n > 256; (b) B sorts up to 1000 readings and the group search handles up to 19; on the faster chip, 8000 and 25

Common mistakes

  • Concluding from small lists that B is always faster: at n = 16, B takes 256 steps and A takes 32 × 16 × 4 = 2048. The logarithm grows more slowly than n, so 32log2 n falls behind n in the end.
  • Multiplying the group search's 19 by 64, or by 8 as for B. Each extra reading doubles its steps, so a chip 64 = 26 times as fast buys only 6 more readings.

More named inequalities problems, worked step by step →

Worked example: A Weather Model on a Finer Grid and Computers That Double in Speed: How Long Until It Runs in Time

Question A weather service runs its forecast model on a grid of points 10 km apart, and one run takes 1 hour. Making the spacing k times finer multiplies the running time by k4: there are k times as many points in each of three directions, and k times as many time steps. The service's computers double in speed every 2 years. (a) After how many years does the model with a spacing of 5 km first run in 1 hour? (b) What is the finest spacing at which the model runs in 1 hour after 24 years? A rival model's running time grows as k6 instead. What is the finest spacing at which it runs in 1 hour after 24 years?

  1. 1.The speed doubles once every 2 years, so after y years the computers are 2y/2 times as fast. A model k times finer runs in 1 hour when 2y/2 ≥ k4.

    Speedafter y years: 2y/2times as fast
    Speed2 yr2 yr2 yr2 yrafter y years: 2y/2times as fast
    The speed doubles once every 2 years, so after y years it has grown 2y/2 times.
  2. 2.A spacing of 5 km is k = 2 times finer, so the run takes 24 = 16 times as long. The computers must be 16 = 24 times as fast: 2y/2 ≥ 24, so y2 ≥ 4.

    SpeedCost, 5 km×2×2×2×216 timesafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 16
    Speed2 yr2 yr2 yr2 yrCost, 5 km×2×2×2×216 timesafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 16
    Halving the spacing multiplies the running time by 24 = 16.
  3. 3.(a) The 5 km model first runs in 1 hour after 8 years. Check: 8 years hold 4 doublings, and 24 = 16.

    Speed8 yearsCost, 5 km×2×2×2×216 timesafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 8
    Speed2 yr2 yr2 yr2 yr8 yearsCost, 5 km×2×2×2×216 timesafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 8
    (a) Four doublings make 16 times the speed: 8 years.
  4. 4.After 24 years there are 12 doublings, so the computers are 212 = 4096 times as fast. The model needs k4 ≤ 4096, and 4096 = 212 = 84, so k ≤ 8. The finest spacing is 10 ÷ 8 = 1.25 km.

    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km
    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km
    After 24 years the speed has grown 212 = 4096 = 84 times, so the grid can be 8 times finer.
  5. 5.The rival model needs k6 ≤ 4096, and 4096 = 212 = 46, so k ≤ 4. Its finest spacing is 10 ÷ 4 = 2.5 km.

    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmRival, k = 4×4×4×4×4×4×42.5 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km4096 = 4 × 4 × 4 × 4 × 4 × 4, so k = 410 km divided by 4 = 2.5 km
    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmRival, k = 4×4×4×4×4×4×42.5 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km4096 = 4 × 4 × 4 × 4 × 4 × 4, so k = 410 km divided by 4 = 2.5 km
    For the rival, 4096 = 46, so its grid can be only 4 times finer.
  6. 6.(b) After 24 years the model runs at a spacing of 1.25 km and the rival at 2.5 km. Both keep improving: k4 = 2y/2 gives k = 2y/8, and k6 = 2y/2 gives k = 2y/12, so a higher power only slows the exponential growth in k and never stops it.

    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmRival, k = 4×4×4×4×4×4×42.5 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km4096 = 4 × 4 × 4 × 4 × 4 × 4, so k = 410 km divided by 4 = 2.5 kmk = 2y/8and k = 2y/12: both keep growing
    Speed, 24 yr×2×2×2×2×2×2×2×2×2×2×2×24096k = 8×8×8×8×81.25 kmRival, k = 4×4×4×4×4×4×42.5 kmafter y years: 2y/2times as fast5 km: k = 2, time × 2 × 2 × 2 × 2 = 162y/2= 16: y/2 = 4, so y = 824 years: 12 doublings, 4096 times4096 = 8 × 8 × 8 × 8, so k = 810 km divided by 8 = 1.25 km4096 = 4 × 4 × 4 × 4 × 4 × 4, so k = 410 km divided by 4 = 2.5 kmk = 2y/8and k = 2y/12: both keep growing
    (b) After 24 years: 1.25 km for the model and 2.5 km for the rival.

Answer: (a) 8 years; (b) 1.25 km for the model, and 2.5 km for the rival

Common mistakes

  • Taking the running time as twice as long when the spacing is halved. There are twice as many points in each of three directions and twice as many time steps, so the run takes 24 = 16 times as long.
  • Taking the computers as 2 × 12 = 24 times as fast after 24 years. Twelve doublings multiply the speed by 212 = 4096, not by 24.

More named inequalities problems, worked step by step →

Practice Polynomial, Exponential and Logarithmic Growth in the app