Linear Models
Theory
A linear model uses a straight-line equation, such as \(C=95h+70\), to describe a real situation. This Year 11 Standard maths page shows how to write a model from words, use it to make predictions, explain what the gradient and intercept mean, find a model from two data points, write it as a spreadsheet formula, and decide whether a prediction is an interpolation or an extrapolation.
A linear model is a straight-line equation \(y=mx+c\) used to describe a real situation in which one quantity changes at a constant rate. The letters match the situation: \(C=40n+15\) could give the cost \(C\) dollars of a plan after \(n\) months. Some questions write the intercept as \(b\), as in \(V=mt+b\).
The gradient \(m\) is the rate of change: how much \(y\) changes when \(x\) goes up by \(1\). It has units, such as dollars per hour, litres per minute or centimetres per year. A positive gradient means the quantity is increasing. A negative gradient means it is decreasing, like a candle burning down, a tank draining or a car losing value.
The intercept is the value of \(y\) when \(x=0\). It is the starting value or fixed cost: a call-out fee, a flagfall, a set-up fee, or the amount in a tank at the start.
A model built from data is most reliable close to that data. A prediction inside the range of the data is an interpolation. A prediction outside the range is an extrapolation, which is much less reliable because the pattern may not continue.
Every model has limitations. It only makes sense for some values, and it can give impossible answers, such as a negative height, a negative volume or a 3-metre-tall adult. A direct variation model \(y=kx\), such as a currency conversion, is a linear model with intercept \(0\).
A linear model, with gradient \(m\) and intercept \(c\) (sometimes written \(b\)):
Building a model from words:
The gradient from two data points \((x_1,\,y_1)\) and \((x_2,\,y_2)\):
Reading a model in context:
| Model | Gradient means | Intercept means |
|---|---|---|
| \(C=95h+70\), electrician's charge for \(h\) hours | \(\$95\) per hour | \(\$70\) call-out fee |
| \(V=24\,000-2500t\), car value after \(t\) years | loses \(\$2500\) per year | worth \(\$24\,000\) when new |
| \(H=6w+4\), plant height (cm) after \(w\) weeks | grows \(6\) cm per week | \(4\) cm tall when planted |
Using a linear model
- Read the model: the number multiplying the variable is the gradient (a rate), and the number on its own is the intercept (the starting value).
- Predict an output: substitute the input value and calculate. Multiply before you add.
- Find an input: substitute the output value, subtract the intercept from both sides (or move the variable term), then divide by the gradient.
- Answer with a \(\therefore\) statement and units, and check that the answer is sensible.
Writing a linear model
- From words: the fixed amount is the intercept (add all the fixed fees together). The amount per unit is the gradient. Change its units to match the variable if needed.
- From two data points: find \(m=\dfrac{y_2-y_1}{x_2-x_1}\), then substitute one point into \(y=mx+b\) and solve for \(b\).
- From a graph: the intercept is where the line meets the vertical axis, and the gradient is \(\dfrac{\text{rise}}{\text{run}}\) between two clear points. To read a value, go up from the input on the horizontal axis to the line, then across to the vertical axis. Where two model lines cross, both models give the same value.
Judging a prediction
- Compare the input with the range of the data: inside is interpolation, outside is extrapolation.
- Find the limits: set a height, volume or value to \(0\) to find where the model stops making sense, and give the values of the input for which it works.
- Comment: say whether the answer is realistic and why, using the situation (growth slows down, a tank cannot hold a negative amount).
(i) What do the \(95\) and the \(70\) represent?
(ii) Find the charge for a \(2.5\)-hour job.
(iii) A job cost \(\$497.50\). How many hours did it take?
(i) \(95\) is the gradient: the charge is \(\$95\) per hour. \(70\) is the intercept: \(\$70\) is charged even when \(h=0\), so it is a call-out fee.
(ii) Substitute \(h=2.5\).
| \(C\) | \(=\) | \(95\times 2.5+70\) |
| \(\) | \(=\) | \(237.5+70\) |
| \(\) | \(=\) | \(307.5\) |
\(\therefore\) the charge is \(\mathbf{\$307.50}\).
(iii) Substitute \(C=497.50\) and solve for \(h\).
| \(497.50\) | \(=\) | \(95h+70\) |
| \(427.50\) | \(=\) | \(95h\) |
| \(h\) | \(=\) | \(\dfrac{427.50}{95}\) |
| \(\) | \(=\) | \(4.5\) |
\(\therefore\) the job took \(\mathbf{4.5}\) hours. Check: \(95\times 4.5+70=497.50\).
(i) Write a linear model for the cost \(C\) dollars of hiring a bike for \(h\) hours.
(ii) In a spreadsheet the hours are in column A, starting in cell A2. What formula goes in cell B2 to give the cost?
(iii) Find the cost of a \(3\)-hour hire.
(i) The time is in hours, so change the rate to dollars per hour first.
| \(\$0.35\text{ per min}\) | \(=\) | \(\$0.35\times 60\text{ per h}\) |
| \(\) | \(=\) | \(\$21\text{ per h}\) |
Cost \(=\) rate \(\times\) hours \(+\) fixed fee:
| \(C\) | \(=\) | \(21h+15\) |
(ii) Replace \(h\) with the cell A2: =15+21*A2.
(iii) Substitute \(h=3\).
| \(C\) | \(=\) | \(21\times 3+15\) |
| \(\) | \(=\) | \(78\) |
\(\therefore\) a \(3\)-hour hire costs \(\mathbf{\$78}\).
| Age, \(w\) (weeks) | \(8\) | \(10\) | \(12\) | \(14\) |
| Mass, \(M\) (kg) | \(1.00\) | \(1.24\) | \(1.48\) | \(1.72\) |
(i) What does the gradient tell you about the kitten?
(ii) Predict the mass at \(11\) weeks. Is this interpolation or extrapolation?
(iii) Predict the mass at \(104\) weeks (\(2\) years), and comment on your answer.
(i) Gradient from the table:
| \(m\) | \(=\) | \(\dfrac{1.24-1.00}{10-8}\) |
| \(\) | \(=\) | \(0.12\) |
The kitten gains about \(0.12\) kg (\(120\) g) per week.
(ii)
| \(M\) | \(=\) | \(0.12\times 11+0.04\) |
| \(\) | \(=\) | \(1.32+0.04\) |
| \(\) | \(=\) | \(1.36\) |
\(\therefore\) about \(\mathbf{1.36}\) kg. \(11\) weeks lies between \(8\) and \(14\) weeks, so this is an interpolation.
(iii)
| \(M\) | \(=\) | \(0.12\times 104+0.04\) |
| \(\) | \(=\) | \(12.48+0.04\) |
| \(\) | \(=\) | \(12.52\) |
The model predicts \(12.52\) kg. This is an extrapolation: \(104\) weeks is far outside the data (\(8\) to \(14\) weeks). A cat's growth slows and stops as it becomes an adult, so a \(12.5\) kg cat is unrealistic and the prediction is not reliable.
(i) Find \(m\) and \(b\).
(ii) What do \(m\) and \(b\) represent?
(iii) When will the tank be empty?
(iv) For which values of \(t\) does the model make sense?
(i) Find the gradient from \((3,\,2160)\) and \((8,\,1360)\).
| \(m\) | \(=\) | \(\dfrac{1360-2160}{8-3}\) |
| \(\) | \(=\) | \(\dfrac{-800}{5}\) |
| \(\) | \(=\) | \(-160\) |
Find \(b\) by substituting \((3,\,2160)\):
| \(2160\) | \(=\) | \(-160\times 3+b\) |
| \(2160\) | \(=\) | \(-480+b\) |
| \(b\) | \(=\) | \(2640\) |
Model: \(V=-160t+2640\).
(ii) \(m=-160\): the tank loses \(160\) L of water each hour. \(b=2640\): the tank held \(2640\) L at the start (\(t=0\)).
(iii) The tank is empty when \(V=0\).
| \(0\) | \(=\) | \(-160t+2640\) |
| \(160t\) | \(=\) | \(2640\) |
| \(t\) | \(=\) | \(\dfrac{2640}{160}\) |
| \(\) | \(=\) | \(16.5\) |
\(\therefore\) the tank is empty after \(\mathbf{16.5}\) hours (\(16\) hours \(30\) minutes).
(iv) For \(t>16.5\) the model gives a negative volume, which is impossible. \(\therefore\) the model only makes sense for \(0\le t\le 16.5\).
Common pitfalls
Frequently asked questions
What is a linear model?
A linear model is a straight-line equation, such as \(C=95h+70\), that describes a real situation where one quantity changes at a constant rate. You use it to make predictions.
What do the gradient and intercept mean in a linear model?
The gradient is the rate of change: how much the output changes for each 1 unit of input, such as dollars per hour. The intercept is the value when the input is \(0\): a starting amount or a fixed fee.
How do you find a linear model from two points?
Find the gradient with \(m=\dfrac{y_2-y_1}{x_2-x_1}\). Then substitute one of the points and \(m\) into \(y=mx+b\) and solve for the intercept \(b\).
What is the difference between interpolation and extrapolation?
Interpolation is a prediction inside the range of the data used to build the model. Extrapolation is a prediction outside that range. Interpolation is usually reliable; extrapolation often is not.
Why is extrapolation unreliable?
Outside the data you have no evidence that the pattern continues. Growth slows down, tanks run empty and sales level off, so a straight line taken too far can give impossible answers.
What are the limitations of a linear model?
A model only makes sense for some input values. It may predict a negative height or volume, or a result far outside real life. State the values for which the model makes sense, such as \(0\le t\le 16.5\).