Applications of Linear Models
1. Modeling with Linear Equations
Learning outcomes
- I can identify situations that can be modeled linearly.
- I can define variables and relationships in a model.
- I can create linear equations from real-world data.
- I can use models to make predictions.
- I can evaluate the accuracy of a linear model.
Modeling with Linear Equations
A mathematical model is a mathematical representation of a real-world situation. Models allow us to describe relationships, make predictions, compare possibilities, and understand how changing one quantity affects another.
A linear model is appropriate when two variables have a constant or approximately constant rate of change.
Linear models are commonly written in the form:
y = mx + b
where:
- x = independent variable
- y = dependent variable
- m = rate of change
- b = initial or starting value
For example, suppose a bicycle rental costs $12 to begin and $5 for each hour.
The model is:
C = 5h + 12
where:
C = total cost in dollars
h = number of hours
The slope, 5, represents the hourly charge, while the intercept, 12, represents the starting fee.
What Is Mathematical Modeling?
Mathematical modeling involves translating a real situation into mathematics.
A typical modeling process is:
real situation → variables → relationship → equation → prediction → evaluation
A model simplifies reality so that important patterns can be studied.
Models are not necessarily perfect descriptions of reality. They are useful representations based on assumptions.
For example, a model might assume that:
- a car travels at constant speed
- a worker earns the same hourly wage
- water enters a tank at a constant rate
- a product has a constant cost per item
- temperature changes steadily over a limited period
If those assumptions change, the model may become less accurate.
Recognizing Linear Situations
A situation can be modeled linearly when the dependent variable changes by a constant amount for equal changes in the independent variable.
Suppose a worker earns:
$18/hour
If there is no starting bonus, earnings might be:
| Hours | Earnings ($) |
|---|---|
| 0 | 0 |
| 1 | 18 |
| 2 | 36 |
| 3 | 54 |
| 4 | 72 |
The earnings increase by:
$18
for every additional hour.
The constant rate means the relationship is linear.
The model is:
E = 18h
Linear Models with a Starting Value
Many situations have both:
- a starting value
- a constant rate of change
Suppose a person already has $100 and saves $25 each week.
The model is:
S = 25w + 100
where:
S = total savings
w = number of weeks
Here:
m = 25 dollars/week
and:
b = 100 dollars
The starting value does not need to be zero for a relationship to be linear.
Recognizing Non-Linear Situations
Not every real-world relationship is linear.
A situation is probably not linear if its rate of change continually changes.
Examples include:
- compound interest
- population growing by a constant percentage
- an accelerating vehicle
- the area of a square as side length changes
- the height of a projectile over time
Consider:
| x | y |
|---|---|
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
| 5 | 25 |
The y-values do not change by a constant amount.
This relationship is:
y = x²
It is not linear.
Constant Difference vs Constant Ratio
A useful way to distinguish linear patterns from some non-linear patterns is to examine how values change.
A linear pattern often has a constant difference.
Example:
10, 15, 20, 25, 30
Difference:
+5 each time
An exponential pattern often has a constant ratio.
Example:
10, 20, 40, 80, 160
Each value is:
2 times the previous value
This is not linear.
Defining Variables
Before creating an equation, clearly define the variables.
Suppose a taxi charges $4 per kilometre plus a $7 starting fee.
We might define:
d = distance travelled in kilometres
C = total cost in dollars
Then:
C = 4d + 7
Defining variables makes the model easier to understand and prevents confusion.
Independent and Dependent Variables
The independent variable is the quantity we choose or control.
The dependent variable changes in response.
For the taxi model:
C = 4d + 7
distance d is the independent variable.
Cost C is the dependent variable.
The cost depends on the distance travelled.
Choosing Appropriate Variable Names
Variables do not always have to be x and y.
Using meaningful letters often makes models easier to understand.
Examples:
d = distance
t = time
C = cost
n = number of items
T = temperature
V = volume
P = population
S = savings
For example:
d = 60t
is often easier to interpret than:
y = 60x
when modeling distance and time.
Identifying the Rate of Change
The slope represents the rate of change.
It can be calculated using:
m = Δy/Δx
Suppose a delivery vehicle travels:
| Time |
Distance (km) |
|---|---|
| 1 | 70 |
| 2 | 130 |
| 3 | 190 |
| 4 | 250 |
The distance increases by:
60 km
each hour.
Therefore:
m = 60 km/h
Finding the Initial Value
The initial value is the value of the dependent variable when the independent variable equals zero.
Using the previous data, work backward:
At t = 1:
d = 70
Since the vehicle adds 60 km each hour:
At t = 0:
d = 10
Therefore:
b = 10
The model is:
d = 60t + 10
The vehicle began 10 km from the reference point.
Creating a Model from a Table
Consider:
| Time (min) | Volume (L) |
|---|---|
| 0 | 100 |
| 2 | 140 |
| 4 | 180 |
| 6 | 220 |
| 8 | 260 |
Calculate slope:
m = (140 − 100)/(2 − 0)
m = 40/2
m = 20 L/min
The initial value is:
100 L
Therefore:
V = 20t + 100
Checking the Model
Use another point from the table.
At:
t = 6
the model predicts:
V = 20(6) + 100
V = 120 + 100
V = 220
The table also gives:
220 L
The model matches the data.
Creating a Model When x = 0 Is Missing
Consider:
| x | y |
|---|---|
| 2 | 13 |
| 5 | 25 |
| 8 | 37 |
| 11 | 49 |
Calculate slope:
m = (25 − 13)/(5 − 2)
m = 12/3
m = 4
Now use:
y = 4x + b
Substitute:
(2, 13)
13 = 4(2) + b
13 = 8 + b
b = 5
Therefore:
y = 4x + 5
Creating a Model from Two Points
Suppose a machine has produced:
120 items after 2 hours
and:
300 items after 5 hours.
Represent these as:
(2, 120)
and:
(5, 300)
Calculate slope:
m = (300 − 120)/(5 − 2)
m = 180/3
m = 60 items/hour
Now determine b:
120 = 60(2) + b
120 = 120 + b
b = 0
Therefore:
P = 60t
Interpreting the Model
For:
P = 60t
the slope means:
The machine produces 60 items per hour.
The intercept means:
At t = 0, zero items have been produced.
A model should always be interpreted in the context of the original situation.
Creating a Model from a Verbal Description
Suppose a streaming service charges:
- $10 monthly base fee
- $2 for each premium rental
Define:
r = number of premium rentals
C = total monthly cost
The constant rate is:
$2/rental
The initial value is:
$10
Therefore:
C = 2r + 10
Translating Common Language
Certain phrases often indicate the rate of change.
| Phrase | Possible Meaning |
|---|---|
| per hour | rate for each hour |
| each kilometre | rate per kilometre |
| every week | weekly rate |
| per item | cost or change per item |
| increases by | positive rate |
| decreases by | negative rate |
Other phrases often indicate the intercept.
| Phrase | Possible Meaning |
|---|---|
| starting amount | initial value |
| initial fee | intercept |
| begins with | initial value |
| fixed charge | intercept |
| at time zero | intercept |
Positive Linear Models
Consider:
S = 40w + 250
where:
S = savings
w = weeks
Slope:
40 dollars/week
Intercept:
250 dollars
The positive slope means savings increase as time increases.
Negative Linear Models
Suppose a candle is initially:
30 cm
tall and burns down at:
2 cm/hour
Define:
h = candle height
t = time
The model is:
h = −2t + 30
The negative slope represents a decrease.
Predicting with a Linear Model
Once a model has been created, substitute an input value to predict the output.
Using:
h = −2t + 30
predict the candle height after 6 hours.
h = −2(6) + 30
h = −12 + 30
h = 18 cm
The model predicts that the candle will be 18 cm tall after 6 hours.
Predicting an Input
Sometimes the output is known and we need to determine the input.
Using:
h = −2t + 30
when will the candle be 10 cm tall?
Substitute:
10 = −2t + 30
Subtract 30:
−20 = −2t
Divide by −2:
t = 10
The model predicts a height of 10 cm after:
10 hours
Finding a Realistic Domain
The candle model:
h = −2t + 30
cannot remain realistic forever.
Find when:
h = 0
0 = −2t + 30
2t = 30
t = 15
The candle reaches zero height after 15 hours.
Therefore, a reasonable domain is:
0 ≤ t ≤ 15
Values after 15 hours would produce negative candle heights, which are not physically meaningful.
Models Have Limits
Mathematical equations can continue indefinitely.
Real situations usually cannot.
For example:
P = 500 + 100t
might model a population increasing by 100 organisms each month.
Mathematically, the equation can be evaluated for:
t = 10
t = 100
t = 10,000
But real populations are affected by:
- food
- space
- disease
- predators
- environmental conditions
The linear model may only be useful over a limited interval.
Interpolation
Interpolation uses a model to estimate a value within the range of observed data.
Suppose data was collected from:
t = 0 to t = 10 hours
Predicting at:
t = 7 hours
is interpolation.
Because the prediction lies within the observed range, it is often relatively reliable if the model fits the data well.
Extrapolation
Extrapolation uses a model to predict beyond the observed data.
If data was collected from:
t = 0 to t = 10 hours
predicting at:
t = 30 hours
is extrapolation.
This prediction assumes the existing pattern continues.
That assumption may or may not be reasonable.
Why Predictions Become Less Certain
Suppose a company's sales increase approximately:
$8,000/month
for six months.
A linear model might predict next month's sales reasonably well.
Using the same model to predict sales 20 years later would be much less reliable.
Many conditions could change:
- prices
- customer demand
- competition
- population
- technology
- economic conditions
The farther a prediction moves beyond observed data, the more carefully it should be evaluated.
Exact Linear Data
Some relationships are designed to be exactly linear.
For example, a worker earns exactly:
$20/hour
with no bonus.
The model:
P = 20h
may accurately describe the relationship whenever the same wage applies.
Similarly, buying identical items at a fixed unit price may produce an exact linear relationship.
Approximate Linear Data
Measured real-world data is often not perfectly linear.
Consider:
| Time |
Temperature (°C) |
|---|---|
| 0 | 12 |
| 1 | 14 |
| 2 | 15 |
| 3 | 18 |
| 4 | 19 |
| 5 | 22 |
The increases are:
+2, +1, +3, +1, +3
The rate is not exactly constant.
However, the data may still show an approximately linear increasing trend.
A linear model might provide a useful approximation.
Line of Best Fit
When data is approximately linear, a line of best fit can represent the overall trend.
The line does not need to pass through every data point.
Instead, it should pass through the middle of the overall pattern, with data points reasonably distributed around it.
Residuals
One way to evaluate the accuracy of a model is to compare:
observed value − predicted value
This difference is called a residual.
Suppose the actual value is:
52
and the model predicts:
49
Then:
residual = 52 − 49
residual = 3
The model underestimated the actual value by 3 units.
Positive and Negative Residuals
Using:
residual = observed − predicted
a positive residual means:
actual value > predicted value
The model predicted too low.
A negative residual means:
actual value < predicted value
The model predicted too high.
A residual of zero means:
actual value = predicted value
Evaluating Model Accuracy
Suppose a model predicts:
| x | Actual y | Predicted y | Residual |
|---|---|---|---|
| 1 | 12 | 11 | 1 |
| 2 | 15 | 15 | 0 |
| 3 | 19 | 19 | 0 |
| 4 | 24 | 23 | 1 |
| 5 | 26 | 27 | −1 |
The residuals are small.
This suggests that the model fits these observations reasonably well.
However, model accuracy should also be evaluated using context.
Large Residuals
Suppose a model predicts:
50
but the actual value is:
85
Residual:
85 − 50 = 35
A residual of 35 may indicate that the model is inaccurate at that point.
Possible reasons include:
- unusual conditions
- measurement error
- an outlier
- an inappropriate model
- changing conditions
Residual Size Depends on Context
A residual of:
5
might be tiny when predicting a population of 1,000,000.
The same residual could be very important when predicting the number of available hospital beds or buses needed for a group.
Accuracy must be evaluated relative to the situation.
Outliers
An outlier is a data point that differs substantially from the general pattern.
An outlier may result from:
- measurement error
- data-entry error
- unusual circumstances
- genuine natural variation
An outlier should not automatically be removed.
First ask:
Why might this value be different?
Evaluating the Pattern of Errors
A useful model should not consistently overestimate or underestimate the data.
Suppose nearly every actual value is above the predicted line.
This suggests that the model may be systematically predicting values that are too low.
If the errors become larger as x increases, this may suggest that the relationship is not truly linear.
Linear vs Curved Data
Suppose data points form a clear curve.
A straight line might still be drawn through them, but that does not make it a good model.
If the residuals show a systematic pattern such as:
positive → near zero → negative → near zero → positive
the underlying relationship may be curved.
A different mathematical model may be more appropriate.
Correlation Does Not Prove Causation
A linear relationship between two variables does not automatically mean that one variable causes the other.
For example, suppose data shows that:
ice cream sales increase as sunscreen sales increase
The variables may be strongly related.
However, buying ice cream does not cause people to buy sunscreen.
A third variable—such as hot weather—may influence both.
Models describe relationships. They do not automatically establish causes.
Evaluating the Data Source
A model can only be as useful as the data used to create it.
Before trusting a model, consider:
- How much data was collected?
- Was the sample representative?
- Were measurements accurate?
- Were there unusual conditions?
- Is the data current?
- Is the range of data large enough?
- Are important variables missing?
A mathematically well-constructed model can still be unreliable if the underlying data is poor.
Comparing Two Linear Models
Suppose two delivery companies charge:
Company A: C = 3d + 10
Company B: C = 2d + 18
where d is distance in kilometres.
Company A:
slope = 3 dollars/km
intercept = 10 dollars
Company B:
slope = 2 dollars/km
intercept = 18 dollars
Company A starts cheaper.
Company B increases more slowly.
Finding the Break-Even Point
Set the models equal:
3d + 10 = 2d + 18
Subtract 2d:
d + 10 = 18
Subtract 10:
d = 8
Find the cost:
C = 3(8) + 10
C = 24 + 10
C = 34
The models intersect at:
(8, 34)
This means:
At 8 km, both companies charge $34.
Using Models for Decision-Making
From the delivery models:
A: C = 3d + 10
B: C = 2d + 18
For short distances below 8 km, Company A is cheaper.
At 8 km, the costs are equal.
For distances above 8 km, Company B is cheaper.
Linear models therefore help us make decisions, not just calculate values.
Modeling Discrete Quantities
Suppose a bus holds:
45 students
A calculation determines that a school requires:
4.3 buses
Mathematically, 4.3 may be the result.
Practically, the school needs:
5 buses
because part of a bus cannot transport the remaining students.
Models must be interpreted according to the type of quantity involved.
Modeling Continuous Quantities
Quantities such as:
- time
- mass
- distance
- temperature
- volume
can often take decimal values.
A prediction of:
4.3 hours
or:
4.3 L
may be completely reasonable.
Understanding whether a variable is discrete or continuous affects how the result should be interpreted.
Assumptions in Linear Models
Every model relies on assumptions.
For:
d = 80t
we are assuming that:
- speed remains 80 km/h
- the object begins at the chosen reference position
- there are no stops
- the direction does not change
If the car stops for 30 minutes, the simple model no longer describes the entire journey accurately.
A Model Is a Simplification
Real systems can be extremely complicated.
A linear model deliberately ignores some details to focus on an important relationship.
For example, fuel consumption may depend on:
- speed
- traffic
- vehicle mass
- wind
- road slope
- engine efficiency
A simple linear model may ignore many of these variables.
This does not automatically make the model useless.
The important question is:
Is the model accurate enough for its intended purpose?
A Complete Modeling Example
Suppose a tank contains:
180 L
of water initially.
Water enters at a constant rate of:
12 L/min
Define:
t = time in minutes
V = water volume in litres
Initial value:
b = 180 L
Rate:
m = 12 L/min
Model:
V = 12t + 180
Using the Tank Model
Predict the volume after 15 minutes:
V = 12(15) + 180
V = 180 + 180
V = 360 L
The model predicts that the tank contains 360 L after 15 minutes.
Adding a Realistic Constraint
Suppose the tank has a maximum capacity of:
420 L
Find when it reaches capacity:
420 = 12t + 180
240 = 12t
t = 20
The tank reaches capacity after:
20 minutes
The linear model describes the amount inside the tank only while:
0 ≤ t ≤ 20
After that, the tank may overflow.
Evaluating the Tank Model
The equation:
V = 12t + 180
predicts:
V = 12(30) + 180
V = 540 L
But the tank can hold only:
420 L
Therefore, 540 L is mathematically consistent with the equation but physically impossible as the amount contained inside the tank.
The model has been used outside its meaningful domain.
This demonstrates why every prediction should be evaluated.
A Reliable Modeling Process
When creating a linear model:
- Understand the real-world situation.
- Identify the important quantities.
- Define the variables and units.
- Decide which variable is independent.
- Decide which variable is dependent.
- Determine whether the relationship appears linear.
- Find the rate of change.
- Determine the initial value.
- Write an equation in the form y = mx + b.
- Check the equation against known data.
- Use the model to make a prediction.
- Interpret the prediction in context.
- Identify domain restrictions.
- Consider whether the prediction is interpolation or extrapolation.
- Compare predictions with observed values when possible.
- Evaluate whether the model is accurate enough for its intended purpose.
Questions to Ask About Any Model
Before accepting a linear model, ask:
- Is the rate approximately constant?
- Does a straight line fit the data reasonably well?
- What do the slope and intercept represent?
- Are the units correct?
- What assumptions are being made?
- Is the prediction inside or outside the observed data range?
- Are there natural minimum or maximum values?
- Are any predicted values impossible?
- Are the variables discrete or continuous?
- Are there important outliers?
- How large are the prediction errors?
- Is a different type of model likely to work better?
These questions help move mathematical modeling beyond simply finding an equation.
Common Mistakes
Assuming every relationship is linear
Check for an approximately constant rate of change before choosing a linear model.
Failing to define variables
An equation is much clearer when the quantities and units are identified.
Confusing slope with intercept
Slope represents the rate of change.
Intercept represents the value when the input is zero.
Ignoring units
A slope of 12 should be interpreted as something meaningful, such as:
12 L/min
Using only one point to create a model
One point alone does not determine a unique linear equation. Additional information about the slope or another point is required.
Assuming a model is exact
Many real-world models are approximations.
Extrapolating too far
Patterns can change beyond the observed data.
Ignoring physical limits
A model should not be trusted when it predicts impossible quantities such as negative populations or volumes above a fixed capacity.
Ignoring discrete variables
A model predicting 6.2 buses does not mean 6.2 buses can actually be used.
Removing outliers automatically
Investigate unusual values before deciding how they should be treated.
Assuming correlation proves causation
A relationship between variables does not necessarily mean that one causes the other.
Judging accuracy without considering context
The same numerical error may be insignificant in one situation and unacceptable in another.
Key Terms
Mathematical model — mathematical representation used to describe or predict a real-world situation.
Linear model — model with a constant or approximately constant rate of change.
Variable — quantity that can change.
Independent variable — input variable used to predict or explain another quantity.
Dependent variable — output variable whose value depends on the independent variable.
Slope — rate of change in a linear model.
y-intercept — value of the dependent variable when the independent variable equals zero.
Initial value — starting value of a relationship, often represented by the y-intercept.
Prediction — value estimated using a mathematical model.
Interpolation — prediction made within the observed data range.
Extrapolation — prediction made outside the observed data range.
Domain — set of possible input values.
Domain restriction — limitation on input values based on mathematical or real-world conditions.
Residual — difference between an observed value and the value predicted by a model.
Line of best fit — line representing the overall linear trend of data.
Outlier — observation that differs substantially from the general data pattern.
Correlation — statistical relationship between variables.
Assumption — condition accepted when constructing or applying a model.
Accuracy — how closely a model's predictions agree with observed values.
Discrete variable — variable with separate countable values.
Continuous variable — variable that can take any value within an interval.
Key Takeaways
- Mathematical models use mathematics to represent real-world relationships.
- Linear models are appropriate when the rate of change is constant or approximately constant.
- Linear models are commonly written as y = mx + b.
- The slope represents the rate of change.
- The y-intercept often represents the initial value.
- Variables should always be clearly defined and include appropriate units.
- Linear models can be created from tables, graphs, points, or verbal descriptions.
- Data should be checked for an approximately linear pattern before a linear model is chosen.
- A model can be used to predict both inputs and outputs.
- Interpolation occurs within the observed data range.
- Extrapolation occurs outside the observed data range.
- Extrapolation is generally less reliable than interpolation.
- Real-world data does not need to be perfectly linear for a linear model to be useful.
- A line of best fit can approximate data with an overall linear trend.
- Residuals measure differences between observed and predicted values.
- Smaller residuals generally indicate a closer fit, but their importance depends on context.
- Outliers should be investigated rather than automatically removed.
- A mathematical model is a simplification of reality.
- Every model depends on assumptions.
- Physical and practical restrictions can limit the useful domain of a model.
- Discrete and continuous quantities must be interpreted differently.
- Correlation between variables does not automatically demonstrate causation.
- A mathematically correct prediction can still be unrealistic.
- The quality of a model depends on both mathematical fit and real-world reasonableness.
- The purpose of modeling is not merely to produce an equation, but to describe, predict, interpret, and evaluate a real situation.
Check Your Understanding
- Explain what makes a real-world relationship suitable for a linear model.
- A worker receives a $40 starting payment plus $18 for every hour worked. Define appropriate variables and create a linear model.
- A tank contains 250 L initially and loses 15 L every minute. Write a linear model for its volume after t minutes. Identify and interpret both the slope and intercept.
- Consider the data:
| x | y |
|---|---|
| 0 | 8 |
| 2 | 18 |
| 4 | 28 |
| 6 | 38 |
Determine whether a linear model is appropriate. Find the equation of the model.
- Consider:
| x | y |
|---|---|
| 1 | 5 |
| 2 | 10 |
| 3 | 20 |
| 4 | 40 |
| 5 | 80 |
Explain why a linear model would not be appropriate for this relationship.
- A delivery vehicle is 20 km from a warehouse at t = 0 and travels away at a constant speed of 65 km/h. Create a model and predict its distance from the warehouse after 4.5 hours.
- A candle is initially 36 cm tall and burns down at 3 cm/hour. Create a linear model, determine when the candle reaches zero height, and state a reasonable domain for the model.
- Explain the difference between interpolation and extrapolation. Why is extrapolation generally less reliable?
- A model predicts a value of 84, while the actual observed value is 79. Calculate the residual using observed − predicted and explain what its sign means.
- A company has observed approximately linear growth for four months. A manager uses the model to predict the company's size 50 years later. Explain why this prediction should be treated cautiously.
- Two delivery services use the models:
A: C = 4d + 8
B: C = 2d + 20
Determine the distance at which their costs are equal. Explain which service is cheaper before and after this point.
- A school calculation predicts that 7.3 buses are required for an excursion. Explain how the result should be interpreted and why simply rounding to 7 could create a problem.
- Data points lie close to a straight line except for one point that lies far above the others. Give at least three possible explanations for this outlier and explain why it should not automatically be removed.
- A linear model consistently predicts values below the actual measurements, and the differences become larger as x increases. What might this tell you about the quality of the model?
- A tank initially contains 200 L, fills at 16 L/min, and has a maximum capacity of 600 L. Define the variables, create a linear model, determine when the tank reaches capacity, state an appropriate domain, make a prediction for t = 40 minutes, and explain why the mathematical prediction may not represent the actual amount of water inside the tank.