Subsection Late parking ticket
Mallory is having a miserable time. A few weeks back she forgot to pay the parking meter and the city issued a parking ticket. The parking ticket was for $45 and was due within 30 days. After that, the city imposes a late fee of $10. Bummer.
But Mallory is curious β how can she write an equation to describe the cost of her parking ticket when it changes like that? She knows variables are
\begin{align*}
D \amp= \text{ time since she got the ticket (days) }\sim \text{ indep}\\
C \amp= \text{ cost of parking ticket (\$) }\sim \text{ dep}
\end{align*}
The starting amount (intercept) is $45. Whatβs the rate of change (slope)? During the first 30 days, the price does not change. Since that rate of change is constant, we have a linear equation and the slope is $0/day. The equation for the first 30 days is
\begin{equation*}
C = 45 + 0D
\end{equation*}
But \(0D = 0\text{,}\) so really
\begin{equation*}
C = 45
\end{equation*}
By the way, there is a name for this type of function. Itβs called a
constant function. Meaning the value of the ticket is constant, at least during those first 30 days.
Now, after 30 days, the price jumps to \(45+10 = \$55\text{.}\) The equation for the price then is
\begin{equation*}
P = 55
\end{equation*}
another constant function.
Thereβs a notation we can use to describe \(C\) as a function of \(D\) that includes both values. We write
\begin{equation*}
C = \left\{ \begin{array}{cl}45 \amp \text{if } 0 \le D \le 30 \\ 55 \amp \text{if } D \gt 30\end{array} \right.
\end{equation*}
The way we read this notation is: if the number of days
\(D\) is between 0 and 30, then the ticket costs
\(P=\) $45 but if the number of days is over 30, then the ticket costs
\(C=\) $55.
Subsection Piecewise-linear functions and their graphs
When our equation has two (or more) pieces, itβs called a
piecewise-defined function. In this type of situation where both pieces are linear, itβs called a
piecewise-linear function.
What does the graph of a piecewise-linear function look like? Letβs make a table of values. Notice any value of \(D\) over 30 days is gonna cost Mallory $55. Even if sheβs 2 minutes late, itβs gonna cost $55. Note that 2 minutes late is 30.0014 days since
\begin{equation*}
2 \text{ min}= \frac{2 \text{ min}}{1}\times \frac{1 \text{ hour}}{60 \text{ min}}\times \frac{1 \text{ day}}{24 \text{ hours}}= 2 \div 60 \div 24 = .001388\ldots \approx .0014 \text{ days}
\end{equation*}
Here are the values we know.
| \(D\) |
0 |
10 |
20 |
30 |
30.0014 |
40 |
50 |
| \(C\) |
45 |
45 |
45 |
45 |
55 |
55 |
55 |
When we draw the graph and connect the dots into lines, we notice two things. First, the lines are horizontal. That always happens when the function is constant and the slope is 0. Second, thereβs a jump at 30 days where the graph isnβt connected, which makes sense because the cost of the ticket jumps up after 30 days.
Notice how we indicate the values corresponding to
\(D=30\text{.}\) We use a solid dot at
\((30,45)\) because thatβs a point on the graph: at 30 days the parking ticket costs $45. We use an open dot at
\((30,55)\) because thatβs not a point on the graph: at 30 days the parking ticket is not yet $55.
Subsection Late rent
Malloryβs troubles arenβt over. Sheβs also behind on the rent. She normally owes
\(900\) and thereβs a one week grace period, meaning she can pay up to one week late without any late fees. For the next week, the late fee is $10/day. After that, the late fee jumps to $25/day.
Letβs measure time in days. We have
\begin{align*}
L \amp= \text{ how late the rent is (days)}\sim \text{ indep}\\
R \amp= \text{ rent plus any late fees (\$)}\sim \text{ dep}
\end{align*}
What happens during the first week? For example, when
\(L=0\) days, the rent is $900. When
\(L=4\) days, weβre within the grace period (
\(0 \le L \le 7\) ) so the rent is still $900. The equation during this week is
\(R = 900\text{.}\)
What happens during the second week? For example, when \(L = 10\) days, sheβs \(10-7=3\) days late and weβre during the week where it costs an extra $10/day ( \(7\lt L\le14\) ), so the rent is now
\begin{align*}
R \amp = 900 + (10-7) \times 10 \\
\amp = 900 + 3 \times 10 \\
\amp = 900 + 30\\
\amp = \$930
\end{align*}
The number of days late after the 7 day grace period is \(L-7\text{.}\) The equation is
\begin{equation*}
R = 900 + (L-7)10
\end{equation*}
We can use the distributive property to multiply out to get
\begin{align*}
R \amp = 900 + (L-7) \times 10 \\
\amp = 900 + 10L - 70 \\
\amp = 830 + 10L
\end{align*}
What happens during the third week? For example, when \(L=20\) days, she pays $900 rent plus $10/day for the first 7 days late plus $25/day for the next \(20-14=6\) days late, so thatβs a total of
\begin{align*}
R \amp = 900 + 7 \times 10 + (20-14) \times 25\\
\amp = 900 + 70 + 6 \times 25\\
\amp = 970 + 150\\
\amp = \$1120
\end{align*}
Ouch! The number of days where sheβs gonna pay an extra $25/day is \(L -14\text{.}\) The equation is
\begin{equation*}
R = 900 + 10\times7 + 25(L-14)
\end{equation*}
Again, we can use the distributive property to multiply out to get
\begin{align*}
R \amp = 900 + 10 \times 7 + 25(L - 14)\\
\amp = 900 + 70 + 25L -25\times 14 \\
\amp = 970 + 25L - 350\\
\amp = 620 + 25L
\end{align*}
When we put everything together we get
\begin{equation*}
R = \left\{ \begin{array}{cl}900 \amp \text{if } 0 \le L \le 7\\ 830 + 10L \amp \text{if } 7 \lt L \le 14\\ 620+25L\amp \text{if } L \gt 14\end{array} \right.
\end{equation*}
In case you were wondering about part days, Malloryβs apartment complex prorates the late fees are prorated by the hour (or even by the minute). So, for example, if Mallory pays her rent 9 days and 6 hours late, we would pay $10/day for those 2 days and 6 hours after the grace period which is
\begin{align*}
2 \text{ days} + 6 \text{ hours} \amp = 2 \text{ days} + \dfrac{6 \text{ hours}}{1} \times \frac{1 \text{ day}}{24 \text{ hours}}\\
\amp 2+6 \div 24\\
\amp 2 + 0.25 = 2.25 \text{ days}
\end{align*}
and so the late fee would be prorated at \(2.25 \times 10 = \$22.50\) for a total of \(900 + 22.50 = \$922.50\text{.}\)
Letβs summarize our examples and a few more values in a table.
| \(L\) |
0 |
4 |
7 |
10 |
14 |
15 |
20 |
| \(R\) |
0 |
900 |
900 |
930 |
970 |
995 |
1120 |
Now we can draw the graph.
Notice that there are no jumps in the graph this time. Thatβs because when
\(L=7\) we know
\(R=900\) but if we were to use the equation
\(R=830+10L\) when
\(L=7\) instead, we would get
\(R = 830+10 \times 7 = 900\) again. That tells us that the second line starts where the first horizontal line ends. Similarly, when
\(L=14\) we use the equation
\(R = 830+10L\) to get
\(R = 830+10*14=970\) but if we were to use the equation
\(R=620+25L\) when
\(L = 14\) instead, then we would get
\(R=620+25 \times 14 = 970\) again. This tells us that the third line starts where the second line ends. Sometimes we put closed dots to emphasize where the formula changes.