Level Up Your Graphing: Piecewise Functions in Video Games
Materials Needed
- Paper or graph paper
- Pencil and colored pencils or highlighters
- Calculator, optional
- Ruler, optional
- Timer
Lesson Overview
Time: 15 minutes
Standard: MA.912.AR.9.10 — Solve and graph mathematical and real-world problems modeled with piecewise functions. Interpret key features and determine constraints in terms of the context.
Learning Target: I can graph piecewise functions.
Learning Objectives
By the end of the lesson, the learner will be able to:
- Identify the rule and domain for each part of a piecewise function.
- Graph each piece using open and closed circles correctly.
- Interpret key features, such as domain, range, slope, and endpoints, in a video-game context.
Success Criteria
I can:
- Graph each equation only over its stated interval.
- Use a closed circle for an included endpoint and an open circle for an excluded endpoint.
- Explain what the graph means in the video-game situation.
Introduction: Hook and Bell Work — 2 Minutes
Hook: Ask: “What might happen in a video game if the reward changes after a player reaches a certain level? Could one equation describe the reward for every level?”
Bell Work: Reinforce Prior Knowledge
Complete the following on paper:
- Evaluate y = 3x + 2 when x = 2.
- What is the slope of y = 3x + 2?
- Plot the point (1, 4).
Quick answers: 1. 8; 2. 3; 3. Move right 1 and up 4.
Transition: “You already know how to evaluate and graph a linear equation. A piecewise function uses more than one linear rule, but each rule is used only during a specific part of the game.”
Body: I Do, We Do, You Do
I Do: Teacher or Parent Modeling — 4 Minutes
Use this video-game example:
Game reward function: A player earns coins based on the number of hours, h, played during a weekend event.
- For the first 2 hours, the player earns 100 coins per hour.
- After 2 hours and through 5 hours, the player earns 50 additional coins per hour.
Represent the situation with the piecewise function:
C(h) =
100h, 0 ≤ h ≤ 2
200 + 50(h − 2), 2 < h ≤ 5
Model these steps:
- Read the restrictions. The first rule is used from 0 through 2 hours. The second rule is used after 2 hours through 5 hours.
- Choose points for the first rule. For C(h) = 100h, use:
- (0, 0)
- (1, 100)
- (2, 200)
- Choose points for the second rule. For C(h) = 200 + 50(h − 2), use:
- At h = 2, the output would be 200, but 2 is not included in this rule.
- At h = 3, C(3) = 250.
- At h = 5, C(5) = 350.
- Graph only the allowed parts. Draw the first segment from 0 to 2 hours. Draw the second segment from just after 2 hours to 5 hours.
- Use endpoint symbols. Use a closed circle when the endpoint is included and an open circle when it is not included.
Important graphing note: At (2, 200), the first rule has a closed circle because h = 2 is included. The second rule would have an open circle at the same point because its condition is 2 < h.
Interpretation:
- Domain: 0 ≤ h ≤ 5, because the event lasts no more than 5 hours.
- Range: 0 ≤ C(h) ≤ 350 coins.
- At 5 hours: The player earns 350 coins.
- Slopes: The first segment increases by 100 coins per hour; the second increases by 50 coins per hour.
We Do: Guided Practice — 4 Minutes
Work through this example together. Encourage the learner to explain each step aloud.
Game challenge points: A player earns points based on the number of completed challenges, x.
- For 0 through 3 challenges, the player earns 10 points per challenge.
- For more than 3 through 6 challenges, the player earns 20 points per challenge after the first 3 challenges.
P(x) =
10x, 0 ≤ x ≤ 3
30 + 20(x − 3), 3 < x ≤ 6
Complete together:
- Make a table of values for each rule.
- Identify the endpoint at x = 3.
- Plot the points and connect only the points within each rule’s domain.
- Determine the maximum number of points.
| Rule | Useful Points | Endpoint Information |
|---|---|---|
| 10x, 0 ≤ x ≤ 3 | (0, 0), (1, 10), (3, 30) | Closed at (0, 0) and (3, 30) |
| 30 + 20(x − 3), 3 < x ≤ 6 | (4, 50), (5, 70), (6, 90) | Open at (3, 30); closed at (6, 90) |
Answer: The maximum is 90 points at 6 completed challenges. The graph has a closed point at (3, 30) from the first rule and an open point at (3, 30) for the second rule.
You Do: Independent Application — 3 Minutes
Choose one of the following video-game challenges.
Option A: XP Boost
A player earns experience points, E(t), during a timed quest.
- For the first 4 minutes, the player earns 25 XP per minute.
- After 4 minutes and through 8 minutes, the player earns 40 XP per additional minute.
E(t) =
25t, 0 ≤ t ≤ 4
100 + 40(t − 4), 4 < t ≤ 8
Graph the function and answer:
- What points should be plotted for the first rule?
- What points should be plotted for the second rule?
- Which endpoints are open or closed?
- How much XP has the player earned after 8 minutes?
Option B: Create Your Own Game Function
Create a two-part piecewise function for a video-game situation, such as coins, XP, damage, health, score, or level rewards. Include:
- Two linear rules
- A restriction for each rule
- At least two points for each segment
- A labeled graph
- One sentence explaining the meaning of the endpoint and domain
Conclusion: Closure and Recap — 2 Minutes
Ask the learner to complete this verbal or written exit check:
- A piecewise function uses one rule for the entire graph. True or false?
- What does a closed circle mean?
- Why must each piece be graphed only over its stated domain?
- In a video-game context, what could the domain represent?
Expected responses:
- False. A piecewise function uses different rules over different intervals.
- A closed circle means the endpoint is included.
- The restrictions describe when that rule applies in the real-world situation.
- The domain could represent time played, number of challenges, player level, or another input.
Final takeaway: “To graph a piecewise function, graph each rule only where it is allowed, use open and closed circles correctly, and explain what the graph means in the context.”
Assessment
Formative Assessment
- Check bell-work responses for understanding of evaluating linear functions, slope, and plotting points.
- Ask the learner to explain why each endpoint is open or closed.
- Observe whether the learner graphs only within each stated interval.
- Use the guided-practice table to check calculations before independent work.
Summative Assessment
The learner successfully completes the independent graph if the response includes:
- Correctly calculated points: 2 points
- Correctly graphed line segments: 2 points
- Correct open and closed circles: 2 points
- Correct domain and contextual interpretation: 2 points
- Accurate final answer and clear explanation: 2 points
Differentiation and Adaptations
- Support: Provide a partially completed table, label the axes, and use colored pencils to show each rule in a different color.
- Additional support: Begin with whole-number inputs and use a calculator for evaluating the rules.
- Auditory option: Have the learner explain each graphing step aloud or record a brief explanation.
- Digital option: Use an online graphing calculator or spreadsheet to plot the points and compare the graph with the hand-drawn version.
- Extension: Create a piecewise function with a jump, such as a game reward that suddenly increases at a new level. Explain how the jump appears on the graph.
- Real-world connection: Replace game points with a household situation, such as chore rewards, workout minutes, savings, or delivery fees.