Your monthly budget for food is $120. There are dozens of ways to spend it — some that work, many that don’t. The question isn’t “what exactly do I spend?” It’s “what combinations are even possible?”
A shelf is rated to hold 50 kg. The boxes you’re stacking weigh 8 kg each. You don’t need the exact weight — you need to know how many boxes you can put on before it becomes unsafe.
A password field requires between 8 and 20 characters. No single length is the answer. Any length in that range works.
These are all inequalities. An equation gives you one answer. An inequality gives you a whole region of answers — and the boundary that separates “works” from “doesn’t work.”
12.1 What this chapter helps you do
Symbols to keep handy
These are the bits of notation you'll see a lot. If a line of symbols feels like a fence, read it out loud once, then keep going.
a < x < b: x is between a and b, not including the endpoints
Here is the main move this chapter is making, in plain terms. You do not need to be fast. You just need to keep the thread.
Coming in: You know how to find the exact value that satisfies an equation. But many real situations don’t have one right answer — they have a range of acceptable answers, and the question is which ones work.
Leaving with: An inequality describes a constraint, not a fixed value. Solving it means finding every number in the range that satisfies the constraint — not just one, but all of them.
12.2 What the notation is saying
Start with an everyday rule: “your spending must stay below $120.” That rule does not ask for one exact value. It allows many values and blocks others.
An equation uses = to say two things are exactly equal. An inequality uses a different symbol to say one thing is bigger or smaller than another.
This means an inequality describes a limit or range.
The four symbols:
Symbol
Reads as
Example
<
is less than
3 < 7
>
is greater than
12 > 5
\leq
is less than or equal to
x \leq 10
\geq
is greater than or equal to
n \geq 4
The pointy end of the symbol always faces the smaller value. So 3 < 7 reads “3 is less than 7” — the small end points at 3, the open end opens toward 7. If you forget which way round it goes, just picture the symbol as an arrow squishing the smaller number.
The difference between < and \leq matters. If a shelf holds at most 50 kg, exactly 50 kg is fine — so you’d write w \leq 50. If something must be strictly less than 50, exactly 50 is not fine — so you’d write w < 50.
This means the boundary may or may not be included.
A compound inequality combines two conditions into one statement using the notation a < x < b. This reads: “x is between a and b” — meaning x has to be bigger than a and smaller than b at the same time. Both conditions must be true for the same value.
For example: 8 \leq n \leq 20 reads “n is at least 8 and at most 20.” A password with length n must satisfy both: it can’t be 7 characters (too short) and it can’t be 21 characters (too long). It must be 8, 9, 10… up to 20. Pick any of those lengths and both conditions are satisfied.
This means one value must satisfy both sides at the same time.
12.3 The method
Solving an inequality is almost identical to solving an equation. You do the same things: add, subtract, multiply, divide — keeping both sides balanced until the unknown is isolated.
This means most of the method is familiar from the last chapter.
There is one exception. It’s the only genuinely surprising thing in this chapter. It deserves its own section.
12.3.1 The sign-flip rule
When you multiply or divide both sides of an inequality by a negative number, the direction of the inequality reverses.
Here’s why, shown directly. Start with something you know is true:
3 < 5
Three is less than five. Now think about what happens when you multiply both numbers by -1. On a number line, multiplying by -1 flips every point across zero — to the opposite side. The number 3 becomes -3 (flipped to the left), and the number 5 becomes -5 (flipped further left). But since 5 was further right than 3, after flipping, -5 is now further left than -3.
So the left-right order has reversed:
-3 > -5
The original said “3 is less than 5.” After multiplying by -1, it becomes “-3 is greater than -5.” The smaller number on the right is now the smaller number on the left.
This isn’t a rule someone invented. It’s a consequence of how negatives work on the number line.
Code
{const k =-1.5;const points = [3,5];const W =560, H =250;const PAD =40;const AXIS_Y1 =80, AXIS_Y2 =200;const domainMin =-8, domainMax =8;const scale = (v) => PAD + (v - domainMin) / (domainMax - domainMin) * (W -2* PAD);const svg = d3.create("svg").attr("viewBox",`0 0 ${W}${H}`).attr("width","100%").attr("style",`max-width:${W}px; font-family:inherit;`);// Helper: draw number linefunctiondrawNumberLine(svg, y, label, domain, isReflected) {// Axis line svg.append("line").attr("x1", PAD).attr("y1", y).attr("x2", W - PAD).attr("y2", y).attr("stroke","#9ca3af").attr("stroke-width",2);// Arrows svg.append("polygon").attr("points",`${W - PAD},${y}${W - PAD -8},${y -4}${W - PAD -8},${y +4}`).attr("fill","#9ca3af"); svg.append("polygon").attr("points",`${PAD},${y}${PAD +8},${y -4}${PAD +8},${y +4}`).attr("fill","#9ca3af");// Ticks and labelsfor (let v =Math.ceil(domain.min); v <=Math.floor(domain.max); v +=2) {const x =scale(v); svg.append("line").attr("x1", x).attr("y1", y -5).attr("x2", x).attr("y2", y +5).attr("stroke","#9ca3af").attr("stroke-width",1.5); svg.append("text").attr("x", x).attr("y", y +18).attr("text-anchor","middle").attr("font-size","11px").attr("fill","#6b7280").text(v); }// Label svg.append("text").attr("x",16).attr("y", y -15).attr("font-size","12px").attr("fill","#374151").attr("font-weight","600").text(label); }// Draw original number linedrawNumberLine(svg, AXIS_Y1,"Original: x", { min: domainMin,max: domainMax },false);// Draw reflected number linedrawNumberLine(svg, AXIS_Y2,"After ×(-1.5): x' = -1.5x", { min: domainMin,max: domainMax },true);// Draw points and arrowsconst colors = ["#0284c7","#dc2626"]; points.forEach((p, i) => {const x1 =scale(p);const reflected =-1.5* p;const x2 =scale(reflected);// Original point svg.append("circle").attr("cx", x1).attr("cy", AXIS_Y1).attr("r",6).attr("fill", colors[i]).attr("stroke", colors[i]).attr("stroke-width",2); svg.append("text").attr("x", x1).attr("y", AXIS_Y1 -20).attr("text-anchor","middle").attr("font-size","13px").attr("fill", colors[i]).attr("font-weight","600").text(p);// Reflected point svg.append("circle").attr("cx", x2).attr("cy", AXIS_Y2).attr("r",6).attr("fill", colors[i]).attr("stroke", colors[i]).attr("stroke-width",2); svg.append("text").attr("x", x2).attr("y", AXIS_Y2 -20).attr("text-anchor","middle").attr("font-size","13px").attr("fill", colors[i]).attr("font-weight","600").text(reflected.toFixed(1));// Arrow connecting themconst arrowX = (x1 + x2) /2-20; svg.append("path").attr("d",`M ${x1}${AXIS_Y1 +12} Q ${(x1 + x2) /2}${120}${x2}${AXIS_Y2 -12}`).attr("fill","none").attr("stroke", colors[i]).attr("stroke-width",1.5).attr("stroke-dasharray","4,4").attr("opacity",0.5); });// Sign reversal note svg.append("text").attr("x", W /2).attr("y", H -10).attr("text-anchor","middle").attr("font-size","11px").attr("fill","#6b7280").text("Multiplying by negative k flips all points across zero — ordering reverses");return svg.node();}
The sign-flip rule
Multiplying or dividing both sides of an inequality by a negative number reverses the direction of the inequality sign.
3 < 5 \implies -3 > -5
If you forget to flip, your answer will point the wrong way — and every value in your “solution” will actually be wrong.
12.3.2 Solving a linear inequality, step by step
2x - 3 < 7
Add 3 to both sides (adding is safe — no sign flip):
2x < 10
Divide both sides by 2 (dividing by a positive number — no flip needed):
x < 5
The solution is every number less than 5. Not just one number: all of them. This includes 4, 3, 0, -10, 4.5, 4.99, and infinitely many others — anything you can name that’s less than 5 works.
This means the answer to an inequality is usually an infinite set of numbers, not one single answer.
Now compare with one that triggers the flip:
-3x + 1 \geq 10
Subtract 1 from both sides:
-3x \geq 9
Divide both sides by -3. This is negative — flip the sign:
x \leq -3
The solution is every number less than or equal to -3. Check: try x = -4. Then -3(-4) + 1 = 12 + 1 = 13, and 13 \geq 10. Yes. Try x = 0. Then -3(0) + 1 = 1, and 1 \geq 10. No — and x = 0 is not in our solution set, so that’s correct.
This means checking a value inside and outside the solution helps you see whether the answer makes sense.
Why solving inequalities works
An inequality is a statement about the relationship between two quantities. Doing the same operation to both sides preserves that relationship — as long as the operation doesn’t reverse the ordering. Addition and subtraction never reverse ordering. Multiplication and division by a positive number preserve ordering. Multiplication or division by a negative number reverses it. That’s the whole story.
12.3.3 Reading the solution on a number line
A number line makes the solution visible. You mark the boundary value and shade the region that satisfies the inequality.
Open circle (\circ) at the boundary: the boundary value is not included. Use this for strict inequalities (< and >).
Closed circle (\bullet) at the boundary: the boundary value is included. Use this for \leq and \geq.
For x < 5: draw an open circle at 5, shade to the left.
For x \leq 5: draw a closed circle at 5, shade to the left.
For x > -3: draw an open circle at -3, shade to the right.
For a compound inequality like -2 < x \leq 4: open circle at -2, closed circle at 4, shade the segment between them.
12.3.4 Writing the solution as a set
Sometimes instead of a number line, we write the solution as a set — a list of all the numbers that work.
We use curly braces \{\,\} to show a set. For example, if n must be a whole number from 8 to 23, we write:
n \in \{8, 9, 10, 11, \ldots, 23\}
The symbol \in means “is a member of” — so this reads: “n is a member of the set 8, 9, 10, …, 23.”
If the solution is all real numbers (any decimal or integer) in a range, we sometimes write it using interval notation with parentheses or brackets: - (a, b) means all numbers strictly between a and b (not including a or b) - [a, b] means all numbers from a to b, including both endpoints - (a, b] means all numbers from a to b, not including a but including b
For now, you’ll mostly use number lines and inequality notation. Set notation will become important when solutions must be whole numbers.
Try it: Number line inequality explorer. Use the slider to set the boundary value. Choose the inequality direction and whether the boundary is included. The shaded region and circle type update live.
viewof nlSymbol = Inputs.select(["<","≤",">","≥"], {label:"Inequality symbol (x __ boundary)",value:"<"})
Code
{const boundary = nlBoundary;const sym = nlSymbol;const inclusive = sym ==="≤"|| sym ==="≥";const shadedLeft = sym ==="<"|| sym ==="≤";const W =560, H =110;const PAD =40;const AXIS_Y =60;const TICK_H =8;const domainMin =-5, domainMax =20;const scale = (v) => PAD + (v - domainMin) / (domainMax - domainMin) * (W -2* PAD);const svg = d3.create("svg").attr("viewBox",`0 0 ${W}${H}`).attr("width","100%").attr("style",`max-width:${W}px; font-family:inherit;`);// Axis line svg.append("line").attr("x1", PAD).attr("y1", AXIS_Y).attr("x2", W - PAD).attr("y2", AXIS_Y).attr("stroke","#9ca3af").attr("stroke-width",2);// Arrow heads svg.append("polygon").attr("points",`${W - PAD},${AXIS_Y}${W - PAD -8},${AXIS_Y -4}${W - PAD -8},${AXIS_Y +4}`).attr("fill","#9ca3af"); svg.append("polygon").attr("points",`${PAD},${AXIS_Y}${PAD +8},${AXIS_Y -4}${PAD +8},${AXIS_Y +4}`).attr("fill","#9ca3af");// Tick marks and labels for integers in domainfor (let v = domainMin; v <= domainMax; v +=5) {const x =scale(v); svg.append("line").attr("x1", x).attr("y1", AXIS_Y - TICK_H /2).attr("x2", x).attr("y2", AXIS_Y + TICK_H /2).attr("stroke","#9ca3af").attr("stroke-width",1.5); svg.append("text").attr("x", x).attr("y", AXIS_Y +22).attr("text-anchor","middle").attr("font-size","11px").attr("fill","#6b7280").text(v); }// Shaded regionconst bx =scale(boundary);const shadeColor ="#0d9488";if (shadedLeft) { svg.append("rect").attr("x", PAD).attr("y", AXIS_Y -6).attr("width",Math.max(0, bx - PAD)).attr("height",12).attr("fill", shadeColor).attr("opacity",0.25);// Arrow showing infinite extent to the left svg.append("polygon").attr("points",`${PAD},${AXIS_Y}${PAD +8},${AXIS_Y -4}${PAD +8},${AXIS_Y +4}`).attr("fill", shadeColor).attr("opacity",0.6); } else { svg.append("rect").attr("x", bx).attr("y", AXIS_Y -6).attr("width",Math.max(0, W - PAD - bx)).attr("height",12).attr("fill", shadeColor).attr("opacity",0.25);// Arrow showing infinite extent to the right svg.append("polygon").attr("points",`${W - PAD},${AXIS_Y}${W - PAD -8},${AXIS_Y -4}${W - PAD -8},${AXIS_Y +4}`).attr("fill", shadeColor).attr("opacity",0.6); }// Boundary circleif (inclusive) { svg.append("circle").attr("cx", bx).attr("cy", AXIS_Y).attr("r",7).attr("fill", shadeColor).attr("stroke", shadeColor).attr("stroke-width",2); } else { svg.append("circle").attr("cx", bx).attr("cy", AXIS_Y).attr("r",7).attr("fill","#fff").attr("stroke", shadeColor).attr("stroke-width",2.5); }// Boundary label svg.append("text").attr("x", bx).attr("y", AXIS_Y -18).attr("text-anchor","middle").attr("font-size","12px").attr("fill", shadeColor).attr("font-weight","600").text(boundary %1===0? boundary : boundary.toFixed(1));// Inequality statementconst circleDesc = inclusive ?"closed circle (boundary included)":"open circle (boundary excluded)"; svg.append("text").attr("x", W /2).attr("y", H -6).attr("text-anchor","middle").attr("font-size","11px").attr("fill","#6b7280").text(`x ${sym}${boundary %1===0? boundary : boundary.toFixed(1)} — ${circleDesc}`);return svg.node();}
12.4 Worked examples
Example 1 — Budgeting. You have $120 to spend on food this month. You’ve already spent $47. You want to buy some items that cost $8 each. How many can you buy without going over budget?
Let n = number of items.
47 + 8n \leq 120
Subtract 47 from both sides:
8n \leq 73
Divide both sides by 8 (positive — no flip):
n \leq 9.125
Since n must be a whole number, the answer is n \leq 9. You can buy at most 9 items.
This means real-world inequalities often need one more step: interpreting the algebra in whole numbers.
Example 2 — Shelf load. A wall-mounted shelf is rated to hold at most 50 kg. Each box you place on it weighs 8 kg.
How many boxes can the shelf safely hold?
The shelf load rating tells you how much weight the shelf can carry on top of it. The brackets that mount the shelf to the wall bear their own weight separately — they don’t count against the shelf’s carrying capacity.
Example 3 — Password validation. A website requires passwords to be at least 8 characters long but no longer than 20 characters. A user types a password. The code checks whether its length n is acceptable.
The valid range is:
8 \leq n \leq 20
Any value of n satisfying both conditions is acceptable. n = 7? Too short. n = 8? Fine — the lower boundary is included. n = 20? Fine. n = 21? Too long.
This is a compound inequality. In code, you’d check both conditions at once: 8 <= n && n <= 20 (or the equivalent in whatever language you’re using). The mathematics and the code are the same structure.
This means inequalities are a direct way to describe allowed ranges.
Code
{const W =560, H =300;const PAD =50;const LINE_Y = [80,160,240];const domainMin =0, domainMax =30;const scale = (v) => PAD + (v - domainMin) / (domainMax - domainMin) * (W -2* PAD);const TICK_H =6;const a =8;// Lower boundconst b =20;// Upper boundconst svg = d3.create("svg").attr("viewBox",`0 0 ${W}${H}`).attr("width","100%").attr("style",`max-width:${W}px; font-family:inherit;`);// Draw three number linesconst lineLabels = [`n ≥ ${a} (at least 8 characters)`,`n ≤ ${b} (at most 20 characters)`,`${a} ≤ n ≤ ${b} (both conditions satisfied)` ];const lineConfigs = [ { min: domainMin,max: domainMax,boundary: a,inclusive:true,shadedLeft:false,label: lineLabels[0] }, { min: domainMin,max: domainMax,boundary: b,inclusive:true,shadedLeft:true,label: lineLabels[1] }, { min: domainMin,max: domainMax,boundary_low: a,boundary_high: b,inclusive:true,compound:true,label: lineLabels[2] } ];functiondrawLine(svg, idx, config) {const y = LINE_Y[idx];// Axis svg.append("line").attr("x1", PAD).attr("y1", y).attr("x2", W - PAD).attr("y2", y).attr("stroke","#9ca3af").attr("stroke-width",2);// Arrows svg.append("polygon").attr("points",`${W - PAD},${y}${W - PAD -8},${y -4}${W - PAD -8},${y +4}`).attr("fill","#9ca3af"); svg.append("polygon").attr("points",`${PAD},${y}${PAD +8},${y -4}${PAD +8},${y +4}`).attr("fill","#9ca3af");// Ticksfor (let v =0; v <=30; v +=5) {const x =scale(v); svg.append("line").attr("x1", x).attr("y1", y - TICK_H /2).attr("x2", x).attr("y2", y + TICK_H /2).attr("stroke","#9ca3af").attr("stroke-width",1); svg.append("text").attr("x", x).attr("y", y +18).attr("text-anchor","middle").attr("font-size","10px").attr("fill","#6b7280").text(v); }// Shading and markersconst shadeColor = idx ===2?"#10b981":"#0d9488";if (config.compound) {// Compound: shade between a and bconst xa =scale(a), xb =scale(b); svg.append("rect").attr("x", xa).attr("y", y -5).attr("width", xb - xa).attr("height",10).attr("fill", shadeColor).attr("opacity",0.3);// Boundaries svg.append("circle").attr("cx", xa).attr("cy", y).attr("r",5).attr("fill", shadeColor).attr("stroke", shadeColor).attr("stroke-width",2); svg.append("circle").attr("cx", xb).attr("cy", y).attr("r",5).attr("fill", shadeColor).attr("stroke", shadeColor).attr("stroke-width",2); } else {const bx =scale(config.boundary);if (config.shadedLeft) {// Shade left svg.append("rect").attr("x", PAD).attr("y", y -5).attr("width", bx - PAD).attr("height",10).attr("fill", shadeColor).attr("opacity",0.25); } else {// Shade right svg.append("rect").attr("x", bx).attr("y", y -5).attr("width", W - PAD - bx).attr("height",10).attr("fill", shadeColor).attr("opacity",0.25); }// Boundary circleif (config.inclusive) { svg.append("circle").attr("cx", bx).attr("cy", y).attr("r",5).attr("fill", shadeColor).attr("stroke", shadeColor).attr("stroke-width",2); } else { svg.append("circle").attr("cx", bx).attr("cy", y).attr("r",5).attr("fill","#fff").attr("stroke", shadeColor).attr("stroke-width",2); } }// Label svg.append("text").attr("x",16).attr("y", y +3).attr("font-size","11px").attr("fill","#374151").attr("font-weight","500").text(config.label); } lineConfigs.forEach((config, idx) =>drawLine(svg, idx, config));// Title svg.append("text").attr("x", W /2).attr("y",25).attr("text-anchor","middle").attr("font-size","13px").attr("fill","#1f2937").attr("font-weight","600").text("Compound Inequality: Password Length Validation");return svg.node();}
Example 3b — Solving a compound inequality. A recipe requires between 1.5 and 3 cups of flour. You’re using a scale that measures in grams. You know that 1 cup of flour ≈ 120 grams. How many grams should you measure?
Let g = grams of flour.
In cups, the requirement is: 1.5 \leq \dfrac{g}{120} \leq 3
To solve, do the same operation to all three parts of the compound inequality:
Multiply all three parts by 120:
1.5 \times 120 \leq g \leq 3 \times 120
180 \leq g \leq 360
So you should measure between 180 and 360 grams. Exactly 180 grams is acceptable (the lower boundary is included). Exactly 360 grams is acceptable (the upper boundary is included).
Check: 180 / 120 = 1.5 ✓ and 360 / 120 = 3 ✓
This means solving a compound inequality requires the same steps on each part — keep all three pieces balanced.
Example 4 — An inequality with a negative coefficient. The temperature in a storage room must be kept strictly below 5°\text{C}. The thermostat setting t (in °C) satisfies:
-2t + 14 > 4
Subtract 14 from both sides:
-2t > -10
Divide by -2 — negative, so flip:
t < 5
The thermostat must be set below 5°C. The sign flip was necessary here: if you forgot it and wrote t > 5, you’d be saying temperatures above 5°C are acceptable, which is exactly wrong.
This means the sign-flip rule is not a small detail. It changes the meaning of the answer completely.
Interactive: Inequality explorer. Set the coefficients a and b, choose the constant c and the inequality direction. The solution is shown algebraically and on a number line. The sign-flip warning lights up when a is negative.
Code
viewof ieA = Inputs.range([-5,5], { label:"a (coefficient of x)",step:1,value:2 })
Code
viewof ieB = Inputs.range([-10,10], { label:"b (constant, left side)",step:1,value:-3 })
{const a =Math.round(ieA), b =Math.round(ieB), c =Math.round(ieC), sym = ieSym;// Solve: ax + b sym c → ax sym c - b → x sym' (c-b)/a// If a < 0, sym flips.const rhs = c - b;const needsFlip = a <0;const flipped = { "<":">","≤":"≥",">":"<","≥":"≤" };const solvedSym = needsFlip ? flipped[sym] : sym;const W =560, H =200;const PAD =40;const AXIS_Y =150;const TICK_H =8;const leftStr = a ===1?`x + ${b}`: a ===-1?`-x + ${b}`:`${a}x + ${b}`;const lhsClean = b >=0? (a ===1?`x + ${b}`: a ===-1?`-x + ${b}`:`${a}x + ${b}`): (a ===1?`x - ${Math.abs(b)}`: a ===-1?`-x - ${Math.abs(b)}`:`${a}x - ${Math.abs(b)}`);const svg = d3.create("svg").attr("viewBox",`0 0 ${W}${H}`).attr("width","100%").attr("style",`max-width:${W}px; font-family:inherit;`);// Step labelsconst steps = [`Original: ${lhsClean}${sym}${c}`,`Subtract ${b} from both sides: ${a ===1?"x": a ===-1?"-x":`${a}x`}${sym}${rhs}`, a ===0? (rhs >0&& (sym ==="<"|| sym ==="≤") ?"No solution (0x = 0, always)":"All real numbers satisfy this"): needsFlip?`Divide by ${a} (negative — flip sign): x ${solvedSym}${rhs / a}`:`Divide by ${a}: x ${solvedSym}${rhs / a}` ]; steps.forEach((txt, i) => {const isFlipStep = i ===2&& needsFlip; svg.append("text").attr("x",16).attr("y",24+ i *28).attr("font-size","12px").attr("fill", isFlipStep ?"#b45309": i === steps.length-1?"#0d9488":"#374151").attr("font-weight", isFlipStep || i === steps.length-1?"600":"400").text(txt); });if (needsFlip) { svg.append("text").attr("x",16).attr("y",24+ steps.length*28).attr("font-size","11px").attr("fill","#b45309").text("⚠ Sign flip applied — dividing by a negative number reverses the inequality."); }if (a !==0) {const solution = rhs / a;const domainMin =Math.floor(solution) -8;const domainMax =Math.ceil(solution) +8;const scale = (v) => PAD + (v - domainMin) / (domainMax - domainMin) * (W -2* PAD);const bx =scale(solution);const shadedLeft = solvedSym ==="<"|| solvedSym ==="≤";const inclusive = solvedSym ==="≤"|| solvedSym ==="≥";const shadeColor ="#0d9488";// Axis svg.append("line").attr("x1", PAD).attr("y1", AXIS_Y).attr("x2", W - PAD).attr("y2", AXIS_Y).attr("stroke","#9ca3af").attr("stroke-width",2);// Arrows svg.append("polygon").attr("points",`${W - PAD},${AXIS_Y}${W - PAD -8},${AXIS_Y -4}${W - PAD -8},${AXIS_Y +4}`).attr("fill","#9ca3af"); svg.append("polygon").attr("points",`${PAD},${AXIS_Y}${PAD +8},${AXIS_Y -4}${PAD +8},${AXIS_Y +4}`).attr("fill","#9ca3af");// Ticksfor (let v =Math.ceil(domainMin); v <=Math.floor(domainMax); v +=Math.ceil((domainMax - domainMin) /8)) {const x =scale(v); svg.append("line").attr("x1", x).attr("y1", AXIS_Y - TICK_H /2).attr("x2", x).attr("y2", AXIS_Y + TICK_H /2).attr("stroke","#9ca3af").attr("stroke-width",1.5); svg.append("text").attr("x", x).attr("y", AXIS_Y +20).attr("text-anchor","middle").attr("font-size","10px").attr("fill","#6b7280").text(v); }// Shadeif (shadedLeft) { svg.append("rect").attr("x", PAD).attr("y", AXIS_Y -5).attr("width",Math.max(0, bx - PAD)).attr("height",10).attr("fill", shadeColor).attr("opacity",0.25); } else { svg.append("rect").attr("x", bx).attr("y", AXIS_Y -5).attr("width",Math.max(0, W - PAD - bx)).attr("height",10).attr("fill", shadeColor).attr("opacity",0.25); }// Boundary circleif (inclusive) { svg.append("circle").attr("cx", bx).attr("cy", AXIS_Y).attr("r",6).attr("fill", shadeColor).attr("stroke", shadeColor).attr("stroke-width",2); } else { svg.append("circle").attr("cx", bx).attr("cy", AXIS_Y).attr("r",6).attr("fill","#fff").attr("stroke", shadeColor).attr("stroke-width",2.5); } svg.append("text").attr("x", bx).attr("y", AXIS_Y -14).attr("text-anchor","middle").attr("font-size","11px").attr("fill", shadeColor).attr("font-weight","600").text(Number.isInteger(solution) ? solution : solution.toFixed(2)); }return svg.node();}
12.5 Where this goes
This chapter takes the solving method from equations and turns it into a method for handling limits and allowed ranges.
An equation pins down one value. An inequality describes a boundary — everything on one side is feasible, everything on the other isn’t.
The most direct continuation is linear programming — how to find the best point within a region defined by multiple inequalities at once. That’s in the Optimisation chapter in Volume 7. A manufacturer choosing how much of two products to make, subject to labour and material constraints, is solving a linear programme. The feasible region is defined entirely by inequalities like the ones in this chapter.
The second direction is systems of inequalities and their role in applied linear algebra. When a machine learning model classifies data, it’s often drawing a boundary in a high-dimensional space — one side satisfies the classification condition, the other doesn’t. That boundary is expressed as an inequality. The linear equations you learned in the previous chapter define the boundary; the inequality says which side is which. That thread runs from here through linear algebra (Volume 4) all the way to optimisation and machine learning.
Where this shows up
A financial analyst building a budget model sets upper and lower bounds on each line of spending — those bounds are inequalities.
A structural engineer checks that the load on every beam stays within its rated capacity — an inequality checked against the design at every point.
A software developer writing input validation checks that every user-entered value lies in an acceptable range — a compound inequality executed in code.
A supply chain planner ensures stock levels stay between a minimum (to avoid running out) and a maximum (to avoid overflow) — two inequalities, applied simultaneously.
12.6 Exercises
Each problem has a clean answer. The work is in translating the situation into the notation before you solve it.
You can spend at most $50 per month on streaming services. You already pay $14.97 for two services. How many additional services at $9.99 per month can you add and still stay within your budget?
Code
makeStepperHTML(1, [ { op:"Write the inequality",eq:"14.97 + 9.99s \\leq 50" }, { op:"Subtract 14.97 from both sides",eq:"9.99s \\leq 35.03" }, { op:"Divide both sides by 9.99",eq:"s \\leq 3.506\\ldots" }, { op:"Round down (whole services only)",eq:"s \\leq 3" }, { op:"Check",eq:"14.97 + 9.99 \\times 3 = 14.97 + 29.97 = 44.94 \\leq 50 \\checkmark" }])
A lift (elevator) has a maximum capacity of 630 kg. A group of adults with an average weight of 78 kg wants to use it. What is the largest number of people who can ride together safely?
Code
makeStepperHTML(2, [ { op:"Write the inequality",eq:"78p \\leq 630" }, { op:"Divide both sides by 78",eq:"p \\leq 8.076\\ldots" }, { op:"Round down (whole people only)",eq:"p \\leq 8" }, { op:"Check",eq:"78 \\times 8 = 624 \\leq 630 \\checkmark;\\quad 78 \\times 9 = 702 > 630 \\checkmark" }])
Solve for x and mark the solution on a number line: -4x + 5 > 17 Explain in one sentence what happens to the inequality sign and why.
Code
makeStepperHTML(3, [ { op:"Write the inequality",eq:"-4x + 5 > 17" }, { op:"Subtract 5 from both sides",eq:"-4x > 12" }, { op:"Divide by −4 (flip sign)",eq:"x < -3",note:"Dividing by a negative number reverses the inequality — what was greater becomes less once all values are negated." }, { op:"Check: try x = −4",eq:"-4(-4) + 5 = 16 + 5 = 21 > 17 \\checkmark" }, { op:"Check: try x = −2 (not in solution)",eq:"-4(-2) + 5 = 8 + 5 = 13 \\not> 17 \\checkmark" }])
A password must be at least 8 characters. It must also be fewer than 3 times the minimum length. Write this as a compound inequality for the password length n, then state the range of valid lengths.
Code
makeStepperHTML(4, [ { op:"Write the lower bound",eq:"n \\geq 8" }, { op:"Write the upper bound",eq:"n < 3 \\times 8 = 24" }, { op:"Combine as compound inequality",eq:"8 \\leq n < 24" }, { op:"State the valid lengths",eq:"n \\in \\{8, 9, 10, \\ldots, 23\\}",note:"23 is the largest valid length because n must be strictly less than 24." }, { op:"Check boundaries",eq:"n=8: \\geq 8 \\checkmark,\\; n=23: < 24 \\checkmark,\\; n=24: \\text{ fails}" }])
Solve the compound inequality and state which whole numbers satisfy it: 1 < 3x - 2 \leq 13
Code
makeStepperHTML(5, [ { op:"Write the compound inequality",eq:"1 < 3x - 2 \\leq 13" }, { op:"Add 2 to all three parts",eq:"3 < 3x \\leq 15",note:"Adding the same amount to all parts preserves both inequalities." }, { op:"Divide all three parts by 3",eq:"1 < x \\leq 5" }, { op:"State whole-number solutions",eq:"x \\in \\{2, 3, 4, 5\\}",note:"x must be strictly greater than 1, so 1 is excluded; x = 5 is included because ≤." }, { op:"Check endpoints",eq:"x=2:\\; 3(2)-2=4,\\; 1 < 4 \\leq 13 \\checkmark;\\quad x=5:\\; 3(5)-2=13,\\; 1 < 13 \\leq 13 \\checkmark" }])
A phone plan charges $0.08 per minute after a 200-minute monthly allowance. You want your total bill to be under $25. The base plan costs $12. How many additional minutes can you use?
Code
makeStepperHTML(6, [ { op:"Write the inequality",eq:"12 + 0.08m < 25" }, { op:"Subtract 12 from both sides",eq:"0.08m < 13" }, { op:"Divide both sides by 0.08",eq:"m < 162.5" }, { op:"State the answer",eq:"m \\leq 162 \\text{ additional minutes}",note:"Since minutes are whole numbers, the most you can use is 162." }, { op:"Check",eq:"12 + 0.08 \\times 162 = 12 + 12.96 = 24.96 < 25 \\checkmark" }])
A company’s safety guideline says a storage shelf should never hold more than 75% of its rated maximum. The shelf is rated to 80 kg. Boxes weigh 6 kg each. What is the maximum number of boxes you can store on this shelf within the guideline?