Modeling with linear relationships
Something in the world changes at a steady rate. How do you turn the story into an equation that predicts, and how do you know when to stop trusting it?
Where you are 11 in Linear relationships
When you reach for it
An ice sculpture melts at a winter festival. A timber yard prices fence posts by length. A runner’s split times are recorded on the way up a tower. Each time somebody wants a number nobody has measured: the sculpture’s mass at midnight, the price of a post not on the list, the time to the top floor. A model is an equation that stands in for the situation, so a question about the world becomes a question about the equation.
A linear model fits when the quantity changes at a constant rate: the same amount for every hour, every centimeter, every floor. Then the graph is a straight line, y = mx + b, with the rate as the slope m and the starting value as b. Modeling also means checking that a line really fits, reading the slope and intercept back into the story, and saying where the equation stops describing anything real. Day 1 builds a model and predicts with it. Day 2 reads and sketches graphs made of straight pieces, and marks where a model stops.
The procedure
Day 1: building a model and using it
Name the two quantities, with units. Write each as a full description, not a bare letter: “t, the number of hours since the sculpture was unveiled”, “m, its mass in kilograms”. A slope is a change in output divided by a change in input, so its unit is the output’s unit per the input’s unit, here kilograms per hour. The description also fixes where the input starts counting: from the unveiling, the starting mass sits at t = 0, exactly the intercept b. The input is usually the quantity you know or control, the output the one you want to predict.
Decide whether a line fits. A line has the same slope between any two of its points, which is what the slope formula measures, so a situation is linear exactly when its rate of change is constant. In a story, listen for “every hour”, “per centimeter”, “a steady pace”. In a table, work out
between each pair of neighboring rows. If every rate is the same, the points lie on one line. If even one differs, no line passes through them all. With evenly spaced inputs you may compare the changes in output directly; otherwise compare rates, since a gap twice as wide should give twice the change.
Build the equation. From a rate and a start, write it down at once: the rate is the slope m, negative if the quantity falls, and the start (the output at input 0) is the intercept b. That is slope-intercept form read as a story, and when the start is 0 it is a direct variation. From two data points, find the slope as the change in output over the change in input, then substitute it and either point into y = mx + b; b is the only unknown left, so a two-step equation finds it. Point-slope form gives the same line.
Say what the slope and intercept mean. The slope is the change in output for one unit of input, with units: “the sculpture loses 6 kilograms each hour”. The intercept is the output at input 0: “it weighed 150 kilograms when unveiled”. It has a direct meaning only if input 0 is a real case; otherwise it can often be read as the part of the output that does not depend on the input (Example 2).
Predict. Given an input, substitute it. Given an output, set the expression equal to it and solve. Then read the answer back into the story, with units, and ask whether it is sensible.
Day 2: reading the shape, and the edges of a model
Reading the shape of a graph. A piece of a graph is increasing if it rises from left to right, decreasing if it falls, and constant if it is flat. A steeper piece means the output changes faster. A corner is where the rate changes, and between corners each straight piece is a linear model with its own slope. This is reading a graph as a story. To sketch a graph from a story, get right what the story fixes: the order of the pieces, whether each rises, falls or stays level, which is steeper, and that pieces join up when the quantity cannot jump. An axis the story gives no numbers for needs no scale.
Where a model stops. The domain of a model is the set of inputs for which it describes the situation. The equation accepts every number, so the domain comes from the story. The usual edges:
- The input counts from a start, so it cannot be negative.
- The output runs out. A mass or a price that falls steadily reaches 0; past that, the equation gives a negative mass or price.
- The data stops. A rate measured over floors 5 to 35 is known to be constant only there. Predicting inside the range of the data is interpolation; beyond it is extrapolation, and the further beyond, the less a prediction is worth. See Where a model holds: domain, interpolation and extrapolation and A reasonable domain for a real situation.
A domain is written with inequalities, such as 0 \le t \le 25, or as a list when only whole numbers make sense.
Worked examples
Day 1: a model from a rate and a start
An ice sculpture weighs 150 kilograms when it is unveiled, and it melts at a steady rate of 6 kilograms an hour. Write a model for its mass, and find (a) its mass after 8 hours, (b) when its mass will be 60 kilograms.
SolutionLet t be the number of hours since the unveiling and m the mass in kilograms. “A steady rate” means a line fits. The mass falls, so the slope is -6 kilograms per hour, and the start is 150:
The slope says the sculpture loses 6 kilograms each hour; the intercept says it weighed 150 kilograms at the unveiling.
(a) m = 150 - 6(8) = 150 - 48 = 102. After 8 hours it weighs 102 kilograms.
(b) Set the mass equal to 60. Subtract 150 from both sides, then divide both sides by -6:
The mass is 60 kilograms 15 hours after the unveiling. Check: 150 - 6(15) = 60.
Day 1: a model from a price list
A timber yard cuts fence posts to length and prices them by that length.
| length (cm) | 60 | 90 | 150 | 180 |
|---|---|---|---|---|
| price (dollars) | 14 | 20 | 32 | 38 |
Decide whether a linear model fits. If it does, write it, say what the slope and intercept mean, and price a 120 cm post.
SolutionLet L be the length in centimeters (the input) and p the price in dollars. The lengths are not evenly spaced, so compare rates, not changes:
Every rate is 0.2, so the points lie on one line; the change of 12 dollars only looks out of step because its gap is twice as wide. Put the slope and (60, 14) into p = 0.2L + b: 14 = 12 + b, so b = 2.
Each extra centimeter adds 0.2 dollars, that is 20 cents. The intercept is the price of a post of length 0, which is not sold; read it as the 2 dollars in every price that does not depend on length, perhaps a cutting charge.
For 120 cm, p = 0.2(120) + 2 = 24 + 2 = 26 dollars. Check: 120 is halfway between 90 and 150, and 26 is halfway between 20 and 32, as it must be on a line.
Day 1: when a line does not fit
Water is boiled in a kettle and left to cool. The readings below are made up for illustration, but they behave like real cooling: fast at first, then slower as the water nears room temperature.
| time (minutes) | 0 | 4 | 8 | 12 | 16 |
|---|---|---|---|---|---|
| temperature (degrees Celsius) | 95 | 75 | 61 | 51 | 44 |
Does a linear model fit? What does a line through the first two readings predict at 16 and at 20 minutes?
SolutionThe times are evenly spaced, so compare changes: over each 4 minutes the temperature changes by -20, -14, -10 and -7 degrees. They are not equal, so no line passes through all five points.
The line through the first two readings has slope \displaystyle \frac{75 - 95}{4} = -5 degrees per minute, so it is T = 95 - 5t. At 16 minutes it predicts 95 - 5(16) = 15 degrees; the water was at 44.
At 20 minutes it predicts -5 degrees, water on a kitchen counter freezing, though cooling water never falls below the room’s temperature. The unequal changes had already said a line was the wrong model. Cooling needs a curve; see Linear and nonlinear functions.
Day 1: split times in a stair race
In a race up the stairs of a 50-floor tower, Montserrat passes timing mats on four floors.
| floor | 5 | 15 | 25 | 35 |
|---|---|---|---|---|
| time since the start (seconds) | 38 | 98 | 158 | 218 |
Build a model, interpret it, and predict (a) her time at the top floor, (b) the floor she had reached 2 minutes after the start.
SolutionLet f be the floor and T the time in seconds. Every 10 floors takes 60 seconds, so the rate is a constant 6 seconds per floor. Put the slope and (5, 38) into T = 6f + b: 38 = 30 + b, so b = 8.
Each floor takes her 6 seconds. At floor 0, the bottom of the stairs, the model gives 8 seconds: the run from the start line to the first step.
(a) T = 6(50) + 8 = 308 seconds, which is 5 minutes 8 seconds.
(b) Two minutes is 120 seconds: 6f + 8 = 120, so 6f = 112 and \displaystyle f = 18\frac{2}{3}. She was two thirds of the way from floor 18 to floor 19.
Solving for f gives \displaystyle f = \frac{T - 8}{6}, the same race with time as the input; choose the form whose input you will be given.
Day 2: reading a tour bus’s day
The graph shows a tour bus’s distance from its garage during one day. Describe each piece in words, with its rate.
- 8 a.m. to 9 a.m., increasing: 40 km in 1 hour, 40 kilometers per hour.
- 9 a.m. to 10:30, constant at 40 km.
- 10:30 to 11:30, increasing from 40 to 70 km: 30 kilometers per hour, less steep than the first piece.
- 11:30 to 12:00, constant at 70 km, the farthest it gets.
- 12:00 to 2 p.m., decreasing from 70 to 0 km: \displaystyle \frac{0 - 70}{2} = -35, so it drives back at 35 kilometers per hour.
A flat piece says only that the distance from the garage did not change. The bus is probably parked, but a bus circling the garage on a ring road would draw the same flat line.
Day 2: sketching a graph from a story
An ice sculpture is kept in a cold room until 10 a.m., then put outside in the sun, where it melts steadily. At 4 p.m. the sun sets and it melts more slowly, still steadily, until midnight. Sketch its mass from 8 a.m. to midnight.
SolutionThe story gives no masses, so the mass axis needs no scale, but it fixes the shape. Until 10 a.m. the mass is constant. From 10 a.m. to 4 p.m. it is decreasing along a straight piece. After 4 p.m. it decreases more slowly, so this piece is less steep. Mass cannot jump, so the pieces join, and nothing says the sculpture melted away, so the graph ends above zero.
Any graph with these features is correct; a steeper evening piece tells a different story.
Day 2: where three models stop
Give a sensible domain for each model, and say what goes wrong outside it.
(a) The sculpture of Example 1, m = 150 - 6t.
(b) A bird box priced at 24 dollars is reduced by 1.50 dollars each week it stays unsold, so after w weeks its price is p = 24 - 1.5w.
(c) Montserrat’s race, T = 6f + 8, built from mats on floors 5 to 35.
Solution(a) Hours count from the unveiling, so t \ge 0; before it, the sculpture sat in a cold room, not melting. And 150 - 6t = 0 at t = 25, after which the mass would be negative. The domain is 0 \le t \le 25.
(b) w \ge 0, and 24 - 1.5w = 0 at w = 16; after that the price would be negative, as if the shop paid people to take bird boxes. The price drops once a week, so the domain is w = 0, 1, 2, \ldots, 16.
(c) The constant rate was measured only from floor 5 to 35. Example 4(b) interpolates and is trustworthy. The 308 seconds for floor 50 extrapolates 15 floors past the last mat, and climbers often slow near the top: an estimate, not a measurement.
Boundaries
A linear model needs a constant rate. If equal steps of the input give unequal changes in the output, no line fits the data, however good a line through two of the points looks.
The equation accepts every number; the situation does not. A model holds only on its domain, and a prediction outside the range of the data assumes a rate the data never showed.
The intercept may lie outside the domain. It is always the output at input 0, but if input 0 is not a real case it has no direct meaning.
A graph shows only what it measures. A flat distance from the garage does not prove the bus stood still, and a sketch is right about shape, not exact numbers.
Where this goes next
Real data is rarely exactly on a line, and the question becomes which line comes closest: the work of Scatter plots and the Line of best fit. Linear functions in context reads slope and intercept in function notation, and Piecewise functions in context turns a graph like the bus’s day into one rule with a formula per piece. When the rate is not constant, Modeling with functions chooses another family. For the kettle it is an exponential, applied not to the temperature but to how far the water sits above room temperature.
Exercises
Day 1: from a rate and a start
- A swan carved in ice weighs 84 kilograms when it is unveiled and melts at a steady 3.5 kilograms an hour. Write a model for its mass m after t hours. What is its mass after 6 hours, and when will it weigh 49 kilograms?
- A timber yard charges 3 dollars to cut any post plus 0.15 dollars for each centimeter of length. Write a model for the price p of a post L cm long. What does an 80 cm post cost, and how long a post costs exactly 24 dollars?
Day 1: does a line fit?
Decide whether a linear model fits each table. If it does, write it.
- An ice sculpture’s mass m in kilograms, t hours after unveiling:
| t | 0 | 2 | 4 | 6 |
|---|---|---|---|---|
| m | 90 | 82 | 74 | 66 |
- The temperature T, in degrees Celsius, of tea in a mug t minutes after it is poured (illustrative readings):
| t | 0 | 3 | 6 | 9 |
|---|---|---|---|---|
| T | 88 | 70 | 58 | 50 |
- A timber yard’s price p, in dollars, for a post L cm long:
| L | 40 | 60 | 100 | 120 |
|---|---|---|---|---|
| p | 13 | 18 | 28 | 33 |
- Another timber yard’s price p, in dollars, for a post L cm long:
| L | 50 | 75 | 125 |
|---|---|---|---|
| p | 12 | 17 | 26 |
Day 1: from two points, in words, and predicting
- In a stair race Ludmila passes floor 8 at 70 seconds and floor 20 at 166 seconds, at a steady pace. Write her time T as a model in the floor f, say what the slope and intercept mean, and predict her time at floor 40.
- A sculpture melting at a steady rate weighs 118 kilograms at 2 p.m. and 93 kilograms at 7 p.m. With t the hours after noon, write a model for its mass, and find its mass at noon and at 10 p.m.
- A timber yard’s prices follow p = 0.35L + 4, with p in dollars and L in centimeters. Say in words what 0.35 and 4 mean. How much more does a post 20 cm longer cost?
- After its last stop, a tour bus’s distance from its garage is d = 52 - 48t kilometers, t hours after leaving. Say what the slope and intercept mean, and find how many minutes the bus takes to reach the garage.
- In a stair race Oriane passes floor 12 at 90 seconds and floor 30 at 216 seconds, at a steady pace. Write the floor f as a model in the time t in seconds. Which floor has she reached at 3 minutes, and when did she reach floor 0, the bottom of the stairs?
Day 2: graphs and stories
Exercises 12 and 13 use the graph of Kasimir’s stair race.
- Over which intervals of time is the graph increasing, decreasing and constant?
- On which piece is Kasimir climbing fastest, and at how many floors per minute? What was his rate over the whole race?
- A minibus leaves its garage at 9:00 and drives away at a steady speed, reaching a hotel 25 km away at 9:30. It waits 20 minutes, then drives straight back at a steady speed, arriving at 10:40. Sketch its distance from the garage against minutes after 9:00. Give the corner points and the speed on each moving piece.
- A 200 kg block of ice is carved at a steady rate into a 140 kg sculpture over 3 hours, kept in a freezer overnight, then put on display, where it melts slowly at a steady rate. Sketch its mass against time and describe each piece.
- One graph shows a bus’s distance from its garage through a day; another shows the total distance it has driven since the morning. Explain why only the first can have decreasing pieces.
Day 2: where the model stops
- An ice sculpture’s mass is m = 96 - 4t kilograms, t hours after unveiling. Give a sensible domain, and say what the model gives at t = 30.
- An unsold lamp’s price after w weeks is p = 18 - 0.75w dollars, reduced once a week. Give a sensible domain, and say what the model gives at w = 30.
- Nils-Erik’s split times on floors 10 to 30 of a 100-floor tower fit T = 9f + 15, in seconds. What does the model predict for the top floor, and why should that not be trusted?
- Water in a kettle reads 92 degrees at 0 minutes and 72 degrees at 5 minutes. A line through these readings is used as a model. What does it predict at 30 minutes, and what has gone wrong?
Reasoning
- Explain why the units of a slope are always the output’s unit per the input’s unit, using the sculpture of Example 1.
- Teodor says the table in Example 2 is not linear, because the prices rise by 6, then 12, then 6. Explain what is wrong with his test and what to compute instead.
- The intercept of p = 0.2L + 2 is the price of a post of length 0, which is not sold. Explain why it is still worth reading, and name a model in this lesson whose intercept is a real moment in the story.
Answers
- m = 84 - 3.5t. After 6 hours, m = 84 - 3.5(6) = 63 kilograms. 84 - 3.5t = 49 gives 3.5t = 35, so t = 10 hours.
- p = 0.15L + 3. An 80 cm post costs 0.15(80) + 3 = 15 dollars. 0.15L + 3 = 24 gives 0.15L = 21, so L = 140 cm.
- Yes: m = 90 - 4t. Every 2 hours the mass falls by 8 kilograms, a rate of -4 kilograms per hour each time, starting at 90.
- No. Over equal 3-minute steps the temperature changes by -18, -12 and -8 degrees.
- Yes: p = 0.25L + 3. The rates \displaystyle \frac{5}{20}, \displaystyle \frac{10}{40} and \displaystyle \frac{5}{20} are all 0.25, and 13 = 0.25(40) + b gives b = 3.
- No. The rates are \displaystyle \frac{5}{25} = 0.2 and \displaystyle \frac{9}{50} = 0.18 dollars per centimeter.
- T = 8f + 6. The slope \displaystyle \frac{166 - 70}{20 - 8} = \frac{96}{12} = 8: 8 seconds a floor. 70 = 8(8) + b gives b = 6: she reaches the stairs 6 seconds after the start. At floor 40, T = 8(40) + 6 = 326 seconds.
- m = 128 - 5t. The slope is \displaystyle \frac{93 - 118}{7 - 2} = -5 kilograms per hour, and 118 = -5(2) + b gives b = 128. At noon, 128 kilograms; at 10 p.m., t = 10 and m = 128 - 50 = 78 kilograms.
- Each extra centimeter adds 0.35 dollars (35 cents), and 4 dollars is charged whatever the length. 20 cm longer costs 0.35 \times 20 = 7 dollars more.
- The slope -48: the bus drives toward the garage at 48 km per hour. The intercept 52: the last stop is 52 km from the garage. 52 - 48t = 0 gives \displaystyle t = \frac{13}{12} hours, which is 65 minutes.
- \displaystyle f = \frac{t - 6}{7}. The slope is \displaystyle \frac{30 - 12}{216 - 90} = \frac{18}{126} = \frac{1}{7} floor per second, and \displaystyle 12 = \frac{90}{7} + b gives \displaystyle b = -\frac{6}{7}. At t = 180, \displaystyle f = \frac{174}{7} \approx 24.9, just short of floor 25. f = 0 when t = 6 seconds.
- Increasing from 0 to 2, 2 to 5 and 6 to 8 minutes; constant from 5 to 6 minutes; never decreasing, since the floor reached can only rise or stay put.
- The first piece, 0 to 2 minutes, at \displaystyle \frac{20}{2} = 10 floors per minute (the others are 5, 0 and 7.5). Over the whole race, \displaystyle \frac{50}{8} = 6.25 floors per minute.
- Corner points (0, 0), (30, 25), (50, 25) and (100, 0), joined by straight pieces. Out: 25 km in 30 minutes, 50 km per hour. Back: 25 km in 50 minutes, 30 km per hour, a less steep piece.
- Three joined pieces: a steep fall from 200 to 140 kg while carving (-20 kg per hour), a flat piece overnight, then a gentle fall on display, whose rate the story does not give.
- Distance from the garage falls whenever the bus heads back. Total distance driven adds every kilometer in any direction, so it only grows, or stays level while the bus is parked.
- 0 \le t \le 24: hours count from the unveiling, and 96 - 4t = 0 at t = 24. At t = 30 the model gives 96 - 120 = -24 kilograms, a negative mass.
- w = 0, 1, 2, \ldots, 24: 18 - 0.75w = 0 at w = 24, and only whole weeks count. At w = 30 it gives 18 - 22.5 = -4.5 dollars, a negative price.
- T = 9(100) + 15 = 915 seconds. The data covers floors 10 to 30, so floor 100 is 70 floors beyond it, and nothing shows the pace holds that long.
- T = 92 - 4t, which gives 92 - 120 = -28 degrees at 30 minutes, below room temperature. Cooling slows down, so a line was the wrong model, and extrapolating far made the error huge.
- A slope divides a change in output by a change in input: for the sculpture, kilograms by hours, so kilograms per hour. Every model does the same division.
- The lengths are not evenly spaced (gaps of 30, 60 and 30 cm), and a line gives twice the change over a gap twice as wide. The rates \displaystyle \frac{6}{30}, \displaystyle \frac{12}{60} and \displaystyle \frac{6}{30} are all 0.2, so the table is linear.
- It is the part of every price that does not depend on length: 2 dollars is fixed, and 0.2L comes from length. In Example 1, the intercept 150 is the mass at the unveiling.