Choosing a function family for data
You have a table of measurements and no rule. Is the rule behind it a line, a quadratic or an exponential, and can the numbers themselves tell you which?
Where you are 5 in Modeling with functions
When you reach for it
Before you can write a rule for data you have to know what kind of rule to write. Lines, quadratics and exponentials are three different families, and the work of fitting one (a line of best fit, a quadratic model, an exponential from a table) is wasted on the wrong one. Each family leaves a fingerprint in a table: something that stays the same from row to row. Reach for this move whenever you have a table or a scatter plot and no rule yet.
The procedure
What stays the same in each family
Take a table whose inputs go up in equal steps of size h. For a linear function f(x) = mx + b, subtract each output from the next:
These first differences are all mh, the same number every time. That is the fact behind a constant rate of change.
For a quadratic f(x) = ax^2 + bx + c (with a \ne 0) the first differences are
which still contains x, so they change from row to row. But they change linearly, and by the first fact the differences of a linear expression are constant. So take differences of the differences, the second differences: every one equals 2ah \cdot h = 2ah^2.
For an exponential f(x) = a \cdot b^x, subtraction is the wrong tool. Divide each output by the one before:
These ratios are all b^h, the growth or decay factor for one step. With h = 1 the ratio is b itself.
| x | 2x + 3 | x^2 + 1 | 3 \cdot 2^x |
|---|---|---|---|
| 0 | 3 | 1 | 3 |
| 1 | 5 | 2 | 6 |
| 2 | 7 | 5 | 12 |
| 3 | 9 | 10 | 24 |
| 4 | 11 | 17 | 48 |
The linear column has first differences 2, 2, 2, 2. The quadratic column has first differences 1, 3, 5, 7 and second differences 2, 2, 2, which is 2ah^2 with a = 1 and h = 1. The exponential column has ratios 2, 2, 2, 2, while its first differences 3, 6, 12, 24 are never constant: they are themselves doubled every step. An exponential’s change in one step is a fixed multiple of its current size, which is what “grows in proportion to itself” means.
So with equal steps in x: constant first differences point to a line, constant non-zero second differences to a quadratic, constant ratios to an exponential. A line’s second differences are all 0, which is why the quadratic test asks for a non-zero constant; with that, no non-constant table passes two tests (Exercise 18 shows it for lines and exponentials).
Why the steps in x must be equal
The first difference of a line is mh, so it depends on the step h. If a table jumps from x = 1 to x = 3, that difference is twice the others and the line looks broken. The cure is to divide each change in output by its change in input, the rate per unit
which is the same for every pair of rows exactly when the table is linear. Ratios have a matching cure: over a step of h the factor is b^h, so a ratio across a two-unit step is the square of the one-unit factor, and its square root recovers it. Second differences have no such quick repair, so for a quadratic with uneven steps lean on the scatter plot.
Real data is never exact
A reading taken a second late, a scale that rounds: measurements wobble. So “constant” becomes nearly constant, values that wander a little above and below one number with no direction. A steady drift, each value a little bigger (or smaller) than the last, is a pattern, and a pattern in the differences or ratios means that family is the wrong one. Judge the wobble against the size of the numbers: a wobble of 3 around 120 is small, a wobble of 3 around 5 is not.
The scatter plot shows the same thing at a glance.
A straight band says linear. A bend with a turning point says quadratic: a parabola is symmetric about its turning point, so it rises and falls at matching rates, though the data may show only one side of it. A curve that steepens and never turns says exponential growth; exponential decay falls steeply and then flattens toward zero, never reaching it. Describing a scatter plot covers the words for these shapes.
Context as a check
Ask what the situation allows. A quantity that cannot go negative cannot follow a falling line forever, since the line crosses zero; a linear model can only hold up to there. A quantity that grows in proportion to itself, such as animals that breed, points to an exponential. A quantity that is exactly 0 at some time cannot be exponential, because a \cdot b^x with a \ne 0 is never 0. When the numbers and the situation disagree, look again at both.
Worked examples
A trough emptied by a pump
Wolfram empties a cattle trough with a pump and reads the gauge every 5 minutes: W liters are left after t minutes. Which family fits?
| t | 0 | 5 | 10 | 15 | 20 |
|---|---|---|---|---|---|
| W | 1500 | 1381 | 1259 | 1142 | 1019 |
The times go up in equal steps of 5, so differences and ratios can be compared directly. Each first difference is a value minus the one before; each ratio is a value divided by the one before, rounded to three places.
| t | W | first difference | ratio |
|---|---|---|---|
| 0 | 1500 | ||
| 5 | 1381 | -119 | 0.921 |
| 10 | 1259 | -122 | 0.912 |
| 15 | 1142 | -117 | 0.907 |
| 20 | 1019 | -123 | 0.892 |
The differences wobble around -120, some above and some below, with no drift: nearly constant. The ratios fall every row, a steady drift, and that is how a line looks to the ratio test: the same 120 liters is a bigger share of a smaller amount each time. The family is linear, losing about 120 liters every 5 minutes, about 24 liters a minute. Context agrees: a pump removes water at a steady rate however full the trough is. Drawing the line itself is the work of Line of best fit.
Readings at uneven times
Next day Wolfram empties the trough again, but reads the gauge at uneven times. Is it linear?
| t | 0 | 2 | 3 | 6 | 10 |
|---|---|---|---|---|---|
| W | 1200 | 1152 | 1128 | 1056 | 960 |
The raw differences are -48, -24, -72, -96, nothing alike. But the steps in t are 2, 1, 3, 4, so compare rates per minute instead:
| step in t | change in W | rate \displaystyle \frac{\Delta W}{\Delta t} |
|---|---|---|
| 2 | -48 | -24 |
| 1 | -24 | -24 |
| 3 | -72 | -24 |
| 4 | -96 | -24 |
Every rate is -24 liters per minute, so the table is exactly linear, at the same rate as yesterday. Judged by raw differences, a perfect line would have been rejected.
A marble rolling down a ramp
Aoife lets a marble go from rest at the top of a long, straight ramp and measures the distance d in centimeters it has rolled after t seconds. The measurements are made up.
| t | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| d | 0 | 6.1 | 24.2 | 53.9 | 96.2 | 149.8 |
The steps are equal. The first differences are 6.1, 18.1, 29.7, 42.3, 53.6: far from constant, but they climb by about the same amount each time. Their differences, the second differences, are 12.0, 11.6, 12.6, 11.3, wobbling around 12 with no drift. That points to a quadratic.
Check the exponential test too. The first ratio is \displaystyle \frac{6.1}{0}, which does not exist, and the rest, 3.97, 2.23, 1.78, 1.56, drift steadily down. The curve steepens like an exponential, but it is the right half of a parabola whose turning point sits at t = 0, where the marble starts at rest. Context settles it: the distance is exactly 0 at the start, and an exponential is never 0. Finding the quadratic’s rule is the work of Fitting a quadratic to data.
Frogs in a new pond
Eulalia counts the frogs in a new pond each spring. The numbers are made up. Which family fits?
| n | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| F | 40 | 61 | 89 | 136 | 205 |
Here n is the spring number and F the number of frogs.
SolutionThe first differences, 21, 28, 47, 69, climb fast, and so do the second differences, 7, 19, 22: neither is steady. The ratios are
wobbling around 1.5 with no drift. The family is exponential, with a growth factor of about 1.5 each spring. Context agrees: frogs breed, so the number of new frogs each year is in proportion to the frogs already there. Finding the rule is the work of Writing an exponential function from a table or graph.
When a line and an exponential look alike
Greer counts frogs in an older, larger pond (made-up numbers): 200, 221, 241, 267, 292, 323 in springs 0 to 5. Linear or exponential?
SolutionThe first differences are 21, 20, 26, 25, 31, and the ratios, to three places, are 1.105, 1.090, 1.108, 1.094, 1.106. Both look roughly steady, so look for drift. The differences climb: the first two average 20.5 and the last two average 28. The ratios go down, up, down, up around 1.10 with no direction. Drift outweighs wobble, so the family is exponential, factor about 1.10. An exponential with a factor close to 1 is nearly straight over a short stretch, which is why the differences almost passed; over more springs the climb would become obvious.
A table that fits none of the three
Eulalia keeps counting the frogs in her pond from Example 4 for nine springs. The numbers are still made up.
| n | F | 1st diff. | 2nd diff. | ratio |
|---|---|---|---|---|
| 0 | 40 | |||
| 1 | 61 | 21 | 1.525 | |
| 2 | 89 | 28 | 7 | 1.459 |
| 3 | 136 | 47 | 19 | 1.528 |
| 4 | 205 | 69 | 22 | 1.507 |
| 5 | 280 | 75 | 6 | 1.366 |
| 6 | 330 | 50 | -25 | 1.179 |
| 7 | 352 | 22 | -28 | 1.067 |
| 8 | 360 | 8 | -14 | 1.023 |
Which family fits?
SolutionNo column is steady. The first differences rise to 75 and fall to 8, so not linear. The second differences change sign, so not quadratic. The ratios hold near 1.5 until spring 4, then slide toward 1, so not exponential. The shape agrees: the dots steepen, then flatten out without turning. A parabola that flattened at the top would turn and come back down.
Context explains it: a pond has food and room for only so many frogs, so growth slows as it fills. The honest answer is none of the three. An exponential describes springs 0 to 4; the whole S-shaped curve belongs to logistic growth, a family met later.
Boundaries
- Equal steps, or rates per unit. Differences and ratios compare only across equal steps in x.
- Ratios need outputs that are never 0 and never change sign. An exponential a \cdot b^x keeps the sign of a and never reaches 0. Data that hits 0 or crosses it is not exponential.
- Enough points. Any two points with different x values lie on a line, any two of those with positive outputs on an exponential, and any three on a line or a quadratic. A pattern only means something with points to spare beyond those.
- Only three families are tested. Passing a test says the family fits these data; it does not rule out every other rule, and Example 6 fits none of them.
- Inside the data only. A family that fits the data may fail outside it, as the trough’s line fails once the trough is empty. See Where a model holds: domain, interpolation and extrapolation.
Where this goes next
With the family chosen, the numbers come next: a Line of best fit, a quadratic model, an exponential from a table, or all three by calculator or spreadsheet. Then the numbers are read in context, and the fit is judged: plotting each gap between data and model and looking for drift is the same wobble-or-drift test, used after fitting. Since an exponential’s differences are themselves multiplied each step, it eventually outgrows any line, which is comparing rates of change across families. Sequences are tables with step 1: constant differences make an arithmetic sequence, constant ratios a geometric one. The same idea reaches further: higher-degree polynomials have constant differences further down.
Exercises
Differences and ratios
For each table, decide whether it is linear, quadratic, exponential or none of these, and give the constant you found.
- y = 6, 13, 20, 27, 34 at x = 0, 1, 2, 3, 4.
- y = 2, 10, 50, 250, 1250 at x = 0, 1, 2, 3, 4.
- y = 2, 3, 6, 11, 18 at x = 0, 1, 2, 3, 4.
- y = 64, 48, 36, 27, 20.25 at x = 1, 2, 3, 4, 5.
- y = 9, 4, 1, 0, 1 at x = 0, 1, 2, 3, 4.
- y = 2, 4, 8, 14, 22 at x = 0, 1, 2, 3, 4. The first two ratios are both 2; is that enough?
Uneven steps
- y = 10, 13, 19, 22, 34 at x = 0, 1, 3, 4, 8. Is the table linear? If so, give its rule.
- y = 5, 9, 11, 18 at x = 0, 2, 3, 6. Is the table linear?
- Clementine counts frogs in a pond in springs 0, 1, 3, 4 and finds 50, 70, 137, 192 (made-up numbers). Is the growth exponential, and with what factor per spring?
Real data
- Zoltan drains a trough and reads 900, 819, 742, 659, 581 liters at t = 0, 4, 8, 12, 16 minutes. Which family fits, and about how fast is it draining?
- A marble on a steeper ramp has rolled 0, 9.8, 40.3, 89.6, 160.5 cm after 0, 1, 2, 3, 4 seconds (made-up measurements). Which family fits?
- A third pond holds 30, 37, 47, 58, 71, 89 frogs in springs 0 to 5 (made-up numbers). Which family fits?
- Name the family each scatter plot suggests. (a) Dots in a straight band falling left to right. (b) Dots that rise, level off at a highest point, and fall again at a matching rate. (c) Dots that fall fast, then more and more slowly, staying above zero.
Context
- Which family would you expect, and why? (a) The money in a jar if Zoltan puts in the same amount every week. (b) The height of a ball thrown straight up, against time. (c) A savings balance that earns the same percentage every year.
- The line W = 1500 - 24t fits Wolfram’s trough from Example 1. What does it predict at t = 70 minutes, and up to what time can the model hold?
Reasoning
- Show that a linear function y = mx + b has the same first difference across every step of size h, and explain why the steps must be equal for the test to work.
- Show that y = a \cdot b^x has the same ratio b^h across every step of size h, and explain why its first differences cannot all be equal unless b = 1.
- A table with equal steps has non-zero outputs, constant first differences and constant ratios. Show that its outputs are all the same number.
Answers
- Linear, first difference 7. Each y is 7 more than the last.
- Exponential, ratio 5. The differences 8, 40, 200, 1000 are not constant.
- Quadratic, second difference 2. First differences 1, 3, 5, 7.
- Exponential, ratio 0.75, a decay factor. For example \displaystyle \frac{48}{64} = 0.75 and \displaystyle \frac{20.25}{27} = 0.75.
- Quadratic, second difference 2. First differences -5, -3, -1, 1; the turning point is at x = 3.
- No. The ratios are 2, 2, 1.75 and about 1.571, so not exponential. First differences 2, 4, 6, 8 give second differences 2: quadratic.
- Linear, y = 3x + 10. The changes 3, 6, 3, 12 over steps 1, 2, 1, 4 are all a rate of 3.
- No. The rates are \displaystyle \frac{4}{2} = 2, \displaystyle \frac{2}{1} = 2 and \displaystyle \frac{7}{3} \approx 2.33.
- Yes, about 1.4 per spring. \displaystyle \frac{70}{50} = 1.4 and \displaystyle \frac{192}{137} \approx 1.401; across the two-spring step \displaystyle \frac{137}{70} \approx 1.957, and \displaystyle \sqrt{1.957} \approx 1.399.
- Linear, about 20 liters a minute. The differences -81, -77, -83, -78 wobble around -80 per 4 minutes with no drift.
- Quadratic. First differences 9.8, 30.5, 49.3, 70.9; second differences 20.7, 18.8, 21.6 wobble around 20.
- Exponential, factor about 1.25. The ratios 1.233, 1.270, 1.234, 1.224, 1.254 wobble with no drift, while the first differences 7, 10, 11, 13, 18 climb.
- (a) Linear. (b) Quadratic: a turning point with matching sides. (c) Exponential decay: steep, then flattening toward zero.
- (a) Linear: the same amount added each week. (b) Quadratic: the height rises, turns at the top, and falls. (c) Exponential: each year’s interest is in proportion to the balance.
- W(70) = 1500 - 24 \cdot 70 = -180 liters, which is impossible. The trough is empty when 1500 - 24t = 0, at t = 62.5 minutes, so the model holds only from 0 to 62.5 minutes.
- m(x + h) + b - (mx + b) = mh, which does not depend on x, so every step of size h gives the same difference. It does depend on h: a step twice as long gives twice the difference, so with unequal steps a line’s differences differ and the test would wrongly reject it.
- \displaystyle \frac{a \cdot b^{x + h}}{a \cdot b^x} = b^h, which does not depend on x. The first difference is a \cdot b^{x + h} - a \cdot b^x = a \cdot b^x(b^h - 1). With a \ne 0 it changes with x unless b^h = 1, which for a positive b means b = 1.
- Call the first two outputs y_0 and y_1, the difference d and the ratio r. Then y_1 = y_0 + d = r y_0 and y_2 = y_1 + d = r y_1. Subtracting the two expressions for d, (r - 1)y_0 = (r - 1)y_1. If r \ne 1 then y_0 = y_1, so d = 0; if r = 1 then y_1 = y_0 and again d = 0. Either way every output equals y_0.