Linear, piecewise and quadratic models

IB Math AI · Functions

Linear models: read the two numbers

In $y=mx+c$ the gradient $m$ is a rate of change with units — VND per kilometre, degrees per hour — and $c$ is the value when $x=0$. In Applications and Interpretation you are asked to state both with the units of the context, and a bare number scores nothing.

Piecewise models

Tariffs, tax bands and delivery charges are piecewise:

$$C(x)=\begin{cases}1900x,&0\le x\le50\\95\,000+2000(x-50),&50<x\le100\\195\,000+2500(x-100),&x>100\end{cases}$$

The function is continuous at each boundary: the constant in one branch is exactly the value the previous branch reached. Check continuity before using a piecewise model — if the two branches disagree at the boundary, one of them has been written down wrongly.

Quadratic models

$y=ax^{2}+bx+c$ has its vertex at $x=-\dfrac{b}{2a}$: a maximum when $a<0$ and a minimum when $a>0$. Revenue models arise as $R=p\times q(p)$, and if $q$ is linear in $p$ then $R$ is automatically quadratic.

Every model here has a valid domain set by the data. Extending a fitted line far beyond the observed range is extrapolation, and AI expects you to say so.

0 50 100 200 số kWh dùng trong tháng 95 nghìn 195 nghìn 445 nghìn 1 900 đ/kWh 2 000 đ/kWh 2 500 đ/kWh Cùng một hàm, ba độ dốc — gãy đúng tại 50 và 100 kWh
Three line segments, three unit prices, and one continuous function. The graph is not broken at $50$ and $100$ kWh: the bill does not jump when you pass a threshold, it just becomes steeper from there on. Reading this correctly avoids the most common error in tiered problems: multiplying the entire number of kWh by the unit price of the last tier. Anyone who uses $200\times2\,500=500\,000$ VND instead of $445\,000$ VND has dropped the cheaper rate on the first $100$ kWh.
There is one more thing to read out: the average unit price always lies between the lowest unit price and the unit price of the tier in use. At $200$ kWh, the average price is $445\,000\div200=2\,225$ VND per kWh, which does not match any number printed on the tariff. IB AI papers love to ask about exactly this gap between the average price and the price of the next kWh.

Worked example: electricity bill over three price tiers

Use the electricity tariff in the figure: $1\,900$ VND for each kWh in the first $50$ kWh, $2\,000$ VND for each kWh from $50$ to $100$, and $2\,500$ VND for each kWh above $100$.

(a) Calculate the bill for a household using $175$ kWh. (b) A household receives a bill of $320\,000$ VND; find the number of kWh used. (c) Calculate the average unit price in part (b) and explain why it does not match any tier.

Solution

(a) $175>100$ so use the third piece:

$$C(175)=195\,000+2\,500(175-100)=195\,000+187\,500=382\,500\ \text{VND}$$

(b) First determine the tier. The two thresholds are $C(50)=95\,000$ and $C(100)=195\,000$; since $320\,000>195\,000$, this household is in the third tier:

$$320\,000=195\,000+2\,500(x-100)\;\Rightarrow\;x-100=\frac{125\,000}{2\,500}=50\;\Rightarrow\;x=150\ \text{kWh}$$

(c) The average unit price:

$$\frac{320\,000}{150}=2\,133\ \text{VND per kWh}$$

This number does not match $1\,900$, $2\,000$ or $2\,500$ because it is a weighted average of all three tiers: $50$ kWh at the lowest price, $50$ kWh at the middle price, and only the last $50$ kWh at the highest price. It equals exactly $\frac{1\,900+2\,000+2\,500}{3}=2\,133$ in this particular case, because the three tiers happen to have the same number of kWh. The practical meaning to write in the solution: one more kWh costs $2\,500$ VND, not $2\,133$ VND; the average price is for looking back at the past, while the price of the tier in use is the number for making decisions.

Worked example: quadratic revenue model from a table of sales data

A bread stall records sales at four different prices ($p$ in thousand VND, $q$ is the number of loaves sold per day).

$p$$10$$14$$18$$22$
$q$$180$$148$$116$$84$

(a) Find a linear model for $q$ in terms of $p$. (b) Find the price that gives the greatest revenue.

Solution

(a) Each time $p$ rises by $4$ thousand, $q$ falls by exactly $32$ loaves, so the gradient is $\dfrac{-32}{4}=-8$ and the linear model fits all four points exactly:

$$q=180-8(p-10)=260-8p$$

Meaning of the gradient: raising the price by $1$ thousand VND loses $8$ loaves sold per day.

(b) Revenue (thousand VND per day):

$$R=pq=p(260-8p)=260p-8p^{2}$$

This is a downward-opening parabola ($a=-8<0$), with vertex at

$$p=-\frac{b}{2a}=-\frac{260}{2(-8)}=16.25\ \text{thousand VND}$$$$q=260-8(16.25)=130\ \text{loaves},\qquad R=16.25\times130=2\,112.5\ \text{thousand VND}$$

Mandatory comment. Real prices are usually set in multiples of $1$ thousand VND. At $p=16$, $R=16(132)=2\,112$; at $p=17$, $R=17(124)=2\,108$. Choosing $16$ thousand loses only $500$ VND of revenue per day compared with the theoretical optimum, a difference so small that it is not worth trading for an odd price list. The vertex of a parabola is rather “flat”, and recognizing that is a conclusion of more practical value than the figure $16.25$ itself.

Common mistake

First trap: multiplying the entire usage by the unit price of the last tier. A tiered bill is not a single multiplication. For $200$ kWh, $200\times2\,500=500\,000$ VND is the figure for a flat tariff that does not exist; the correct answer is $445\,000$ VND. This error gives a result of the same order of magnitude, so it is very hard to notice by yourself.
Second trap: confusing the average price with the price of the next unit. At $150$ kWh, the average price is $2\,133$ VND but using one more kWh still costs $2\,500$ VND. The question “should we save electricity?” must be answered with the second number, not the first.
Third trap: extending the model beyond the data range. The model $q=260-8p$ fits perfectly in the price range $10$ to $22$ thousand. At $p=35$ it gives $q=-20$ loaves per day, a meaningless number. A linear model does not know where it stops being valid; the user must know when to replace it.

Key takeaway

The three function types in this lesson differ in what is held constant: linear keeps the amount of change constant for each unit, piecewise keeps that amount constant within each segment and then changes it, and quadratic has the amount of change itself varying steadily. Recognizing the signs in a data table is choosing the right model: constant first differences give linear, constant second differences give quadratic. And always end with a sentence about the valid domain; that is a mark the AI paper reserves and few people write.

← Matrices, Markov chains and systems of equations · All IB Math AI lessons · Practice IB Math AI questions (free, instant scoring) · Exponential and logarithmic models →