Straightening a Power Law

On log-log axes the slope is n itself.

Which power?

A power law is a model y = a × xⁿ, where the power n is a fixed number and x is the base. It is not an exponential model: in y = a × bˣ the variable is the exponent, and in y = a × xⁿ the variable is the thing being raised to the power.

Take y = 2x³. At x = 1, 2, 3, 4 and 5, y is 2, 16, 54, 128 and 250. Plotted, the points sweep up in a curve, but so would the points of 5x² or of x⁴ over the same range. Looking at the curve does not tell you whether the power is 2, 3 or 4.

xy

y = 2x³ through (1, 2), (2, 16), (3, 54), (4, 128) and (5, 250). The curve steepens, but its shape does not show the power 3.

Take logs of both sides

Take the common logarithm of both sides of y = a × xⁿ. The product law gives log y = log a + log(xⁿ), and the power law of logarithms brings n to the front: log y = log a + n log x.

This is a straight line, but not in x. Write X for log x and Y for log y: the equation is Y = nX + log a. So the points of log y against log x lie on a straight line, with gradient n and intercept log a. Both axes carry logarithms, which is why such a graph is called a log–log plot.

Plot log y against log x

For y = 2x³, work out both logarithms. At x = 1, 2, 3, 4 and 5, log x is 0, 0.301, 0.477, 0.602 and 0.699, and log y is 0.301, 1.204, 1.732, 2.107 and 2.398, to 3 decimal places.

The gradient from the first point to the second is (1.204 − 0.301) ÷ (0.301 − 0) = 0.903 ÷ 0.301 = 3. From the second point to the fourth it is (2.107 − 1.204) ÷ (0.602 − 0.301) = 0.903 ÷ 0.301 = 3 again, and from the first point to the last it is 2.097 ÷ 0.699 = 3. The points lie on one straight line.

The reason is in the model. Doubling x multiplies y = 2x³ by 2³ = 8. So when log x goes up by log 2, log y goes up by log 8 = 3 log 2, three times as much. That ratio, 3, is the gradient.

12345log x00.3010.4770.6020.699y21654128250log y0.3011.2041.7322.1072.398

The columns are x = 1 to 5. Doubling x, from 1 to 2 or from 2 to 4, adds 0.301 to log x and 0.903 to log y.

log xlog y

The five points with log x across and log y up. They lie on the gold line log y = 0.301 + 3 log x, which meets the vertical axis at 0.301 and rises 3 for every 1 across.

Read the rule off

The gradient is n itself: n = 3. Nothing needs undoing, because n multiplies log x directly in log y = log a + n log x.

The intercept is log a, so log a = 0.301 and a = 10^0.301 = 2. The intercept is where log x = 0, which is at x = 1, and there y = a × 1ⁿ = a. So a is the value of y at x = 1: here y = 2 × 1³ = 2. The rule y = 2x³ is recovered.

A power law from measurements

A student times a pendulum of length L meters. For L = 0.25, 0.5, 1 and 2 the time T for one swing there and back is 1.00, 1.42, 2.01 and 2.84 seconds. Lengths below 1 have negative logarithms: log L is −0.602, −0.301, 0 and 0.301, and log T is 0, 0.152, 0.303 and 0.453, to 3 decimal places.

The points of log T against log L lie on a straight line, so T follows a power law. Its gradient, from the first point to the last, is (0.453 − 0) ÷ (0.301 − (−0.602)) = 0.453 ÷ 0.903 = 0.50, to 2 decimal places, so n = 0.5. The line crosses log L = 0 at 0.303, so a = 10^0.303 = 2.0, to 1 decimal place.

The model is T = 2.0 × L^0.5, which is T = 2.0√L. The power 0.5 says that doubling the length multiplies the time by 2^0.5 = √2, about 1.41, and the table agrees: 1.42 ÷ 1.00, 2.01 ÷ 1.42 and 2.84 ÷ 2.01 are all close to 1.41.

log Llog T

The four measurements with log L across and log T up, on the gold line log T = 0.303 + 0.5 log L. The two points left of the vertical axis are the lengths shorter than 1 meter.

Which axes make the points straight

Straightening Growth with Logarithms plotted log y against x, and that straightens an exponential, y = a × bˣ. A log–log plot straightens a power law, y = a × xⁿ. Given data and no model, try both plots: the one that makes the points straight names the model.

Test it on the two sets of values at x = 1, 2, 3 and 4. For the power law y = 2x³, log y is 0.301, 1.204, 1.732 and 2.107. Against x, its steps up are 0.903, 0.528 and 0.375, shrinking, so that plot bends. Against log x, it is the straight line with gradient 3.

For the exponential y = 3 × 2ˣ, log y is 0.778, 1.079, 1.380 and 1.681. Against x, the steps up are all 0.301, so that plot is straight. Against log x, the gradients between neighboring points are 1.00, 1.71 and 2.41, rising, so the log–log plot bends upward.

The rule behind the test: both plots take the logarithm of y, and x is logged as well only when it is the base. In an exponential, x is the exponent, and it stays on the axis as it is. In a power law, x is the base, so its logarithm goes on the axis.

log xlog y

One log–log plot, two models. The power law y = 2x³ lies on the gold straight line. The white curve is the exponential y = 3 × 2ˣ on the same axes, and it bends upward: a log–log plot does not straighten an exponential.

The usual mistakes

Turning the gradient back with a power of 10. On a log–log plot the gradient is n itself, so a gradient of 3 means n = 3, not 10³ = 1000. Only the intercept, log a, is turned back into a.

Plotting log y against x for a power law. That plot bends, because x is the base in y = a × xⁿ, not the exponent.

Reading a as the intercept. The intercept is log a; here 0.301, which gives a = 2.

Swapping the two numbers. A log–log line with gradient 2 and intercept 0.7 gives n = 2 and a = 10^0.7 = 5, so y = 5x², not y = 2x⁵.

A power law against an exponential

The next problem sets a power law against an exponential. A weather model on a grid k times finer takes k⁴ times as long to run. That is a power law with n = 4: log T = 4 log k, a line of gradient 4 on a log–log plot, so doubling k multiplies the time by 2⁴ = 16.

The computers, meanwhile, double in speed every 2 years, so after y years they are 2^(y/2) times as fast: an exponential, straight when its logarithm is plotted against y. The model runs in time when the speed has caught up with the extra work.

Equations like k⁴ = 4096 are solved with the same logarithms. Take logs: 4 log k = log 4096 = 3.612, so log k = 3.612 / 4 = 0.903, to 3 decimal places, and k = 10^0.903 = 8.00, to 2 decimal places. Check: 8⁴ = 4096.

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 Straightening a Power Law in the app