Lesson 5 of 8 · 16 min
Modelling with piece-wise functions
Build piece-wise models for charges, tariffs and comparisons, then use them to answer questions in context, with and without technology.
What you will be able to do
- Write a piece-wise rule from a description of a real situation, with a domain for each piece.
- Use the model to calculate an output, and to find the input that gives a required output.
- Check that answers lie in the right piece and make sense in context.
- Compare a piece-wise model with another model, with and without technology.
Many real charges change at a threshold. Water and electricity are often billed in blocks — one price per unit up to a limit, a higher price beyond it. Parking, postage, phone data and income tax work the same way. Each block is a piece with its own rule, so the whole charge is a piece-wise function.
Building a piece-wise model
Define the variables
Name the input and output, with units: "Let be the charge in dollars for kL of water."
Find the thresholds
The values where the rule changes become the boundaries of the pieces' domains.
Write the rule for each piece
For a charge, a later piece is usually "the charge at the threshold, plus the new rate times the amount above the threshold".
Check the boundaries
Make sure every input belongs to exactly one piece, and check whether the pieces should join at each threshold.
Answer in context
Check each answer lies in the domain of the piece you used, then finish with a sentence, with units.
Worked example
Model a two-block water charge
A council charges households for water each quarter. There is a fixed access charge of $60, plus $2.50 per kilolitre (kL) for the first 50 kL used and $4 per kL for any water used beyond 50 kL.
(a) Write a piece-wise rule for the quarterly charge dollars when kL of water is used. (b) Calculate the charge for 80 kL. (c) One household's charge is $365. How much water did it use?
Step 1: Define the variables and the threshold
Let be the charge in dollars for kL, with . The price changes at .
Step 2: Write the first piece
Up to 50 kL: for .
Step 3: Find the charge at the threshold
Every later piece starts from the charge already reached at the threshold.
Step 4: Write the second piece
Beyond 50 kL, each extra kL costs $4: for .
Step 5: (b) Use the second piece
, so . The charge is $305.
Step 6: (c) Decide which piece gives $365
The first piece reaches at most , and , so the household is on the second piece.
Step 7: (c) Solve and check the domain
. Since , the answer lies in the second piece's domain.
Try it yourself first, then check the working one step at a time.
Answer
for and for . The charge for 80 kL is $305, and a $365 charge means 95 kL was used.
Method
Define variables with units and find the thresholds.
Later piece = value at the threshold + new rate × amount above the threshold.
Compare a given output with the threshold values to choose the piece.
Check the answer lies in that piece's domain, then answer in context.
Watch out for
Charging the higher rate on all the water: instead of .
Solving with the first piece: gives , which is not in .
The water charge model. The graph gets steeper at , where the price per kilolitre rises from $2.50 to $4. Reading across from $365 meets the steeper piece at .
Using the water charge model , calculate the charge, in dollars, for a household that uses 30 kL.
With the same water charge model, another household's charge is $245. How much water did it use?
Tip
Is the answer in the right piece?
An answer is only valid if it lies in the domain of the piece that produced it. If you don't know which piece to use, find the output at each threshold first, or try each piece and keep only the solutions that land in their own domain.
Without technology
Work out the output at each threshold, use it to decide which piece applies, then solve a linear equation. For linear pieces this is quick and exact.
With technology
Enter each piece with its domain restriction (most graphics calculators let you add a condition such as after a rule, or offer a piece-wise template). Graph the model with the horizontal line and use the intersect tool. This is useful for checking, and for pieces that are not linear.
The gradient of each piece is a rate: $2.50 per kL, then $4 per kL. This makes piece-wise models good for comparing plans. Where the graphs of two plans cross, they cost the same; between crossings, the lower graph is the cheaper plan. Because one plan has two pieces, you may need to compare the plans piece by piece.
Worked example
When is the flat-rate rideshare cheaper?
Two rideshare companies price trips differently.
- Company A: a $3.60 booking fee, then $2.20 per km for the first 10 km and $1.50 per km for each km beyond that.
- Company B: a $5 booking fee, then $2 per km.
For what lengths of trip is Company B cheaper?
Step 1: Model Company A as a piece-wise function
For : . At this is , so for : .
Step 2: Model Company B
for .
Step 3: Compare on the first piece
For , B is cheaper when , that is, , so . B is cheaper for .
The two models must be compared separately on each piece of A, because A has a different rule on each.
Step 4: Compare on the second piece
For , B is cheaper when , that is, , so . B is cheaper for .
Step 5: Combine the two results
B is cheaper for . The fares are equal at (both $19) and at (both $27.40).
Step 6: Check the answer is reasonable
At : and , so B is cheaper. At : and , so A is cheaper. A graphics calculator shows the same two crossing points.
Try it yourself first, then check the working one step at a time.
Answer
Company B is cheaper for trips longer than 7 km and shorter than 11.2 km. For shorter or longer trips, Company A is cheaper.
Method
Write each pricing scheme as a function of distance, piece by piece.
Compare the models separately on each piece's domain.
Keep only the solutions that lie in each piece's domain, then combine them.
Check one distance in each region, and answer in context.
Watch out for
Using $1.50 per km for the whole trip once it passes 10 km, instead of only for the kilometres beyond 10.
Comparing only the first pieces and concluding that B is cheaper for every trip over 7 km.
A plumber charges a $90 call-out fee, which covers the first 30 minutes, and then $2 per minute after that. Which rule gives the charge dollars for a job lasting minutes?
Exam tip
Communicating a model
Define your variables with units, give the domain of every piece, and show which piece you used and why ("since , use the second piece"). Finish with a sentence that answers the question in context. In Paper 2, a graph from your calculator is a good check, but write down the equation you solved.
Summary
Thresholds in a real situation become the boundaries of the pieces.
A later piece of a charge is often "charge at the threshold + rate × amount above the threshold".
To find an input from an output, compare the output with the values at the thresholds to pick the right piece.
Every answer must lie in the domain of the piece that produced it, and should be stated in context with units.
Where the graphs of two models cross, they give the same output; between crossings, the lower graph is cheaper.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.