Lesson 5: Modelling with piece-wise functions
When is the flat-rate rideshare cheaper?
SkillPiece-wise models
Worked example
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.
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.
Try a similar one
A fresh question of the same kind, checked as you answer, with hints and a full solution.
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.