Writing constraints as inequalities
Decision variables
- A decision variable is a quantity you get to choose in the problem.
- Define each one in words with a letter, e.g. let = number of tables made, = number of chairs made.
- Everything else in the problem — profit, hours used, material used — is built out of and .
- Choosing clear variables first makes every later step (constraints, objective, graph) fall into place.
Turning a limit into an inequality
- A constraint is a limit the choice must respect — a fixed amount of time, material, money or space.
- Each constraint becomes one linear inequality:
- Work out how much of the resource one unit of each variable uses.
- Multiply by the variable and add the terms.
- Compare with the total available using or .
- Example: if a table needs hours and a chair needs hour of assembly, and there are hours available:
The non-negativity constraints
- You cannot make a negative number of a real object.
- So every linear programming problem carries the non-negativity constraints:
- Never forget these — they keep the feasible region in the first quadrant.
Common constraint types
- Resource limit — a shared resource is capped: (an upper limit, ).
- Minimum requirement — you must make at least a certain amount: (a lower limit, ).
- Ratio / relationship — one variable compared to another: "at least twice as many chairs as tables" is .
Reading "at least", "at most", "no more than"
- "at most" / "no more than" / "up to" / "maximum" → .
- "at least" / "no fewer than" / "minimum" → .
- "exactly" → an equals sign (a line, not a region).
- Underline the key phrase in the question and write the symbol above it before forming the inequality.
A Te Puke kiwifruit grower packs two box sizes: large trays and small trays. Each large tray uses kg of fruit; each small tray uses kg. There are 60 kg of fruit available. Each large tray takes minutes to pack and each small tray minute, with 40 minutes of packing time. The grower must pack at least 10 small trays to fill a standing order. Write all the constraints.
Step 1 — Define the variables
They are already named: = large trays, = small trays.
Step 2 — Fruit constraint
Large trays use kg each, small trays kg each, and only kg is available:
Step 3 — Time constraint
Packing uses minutes per large tray and minute per small tray, out of minutes:
Step 4 — The standing-order minimum
"At least 10 small trays" is a lower limit on :
Step 5 — Non-negativity
You cannot pack a negative number of trays:
Test yourself
Practice by grade
One question each at Achieved, Merit and Excellence. Have a go, then compare with the model answer.
A workshop makes stools and benches. Each stool uses hour of labour and each bench uses hours, with labour hours available. Write the labour constraint and the non-negativity constraints.
A grower plants hectares of apples and hectares of pears on a hectare block. Apples cost $800/ha to establish and pears $1200/ha, with a budget of $48000. The grower wants at least twice as much apple as pear. Write all four constraints (besides non-negativity).
A dairy company blends tonnes of standard powder and tonnes of premium powder. A student writes the protein constraint as but is told the blend must supply at least units of protein. Explain the student's error, give the corrected inequality, and explain what forgetting would do to the feasible region.