Building the model
Linear programming finds the best value of a quantity subject to limits. First choose decision variables, usually x and y for the two unknown quantities. Then write each restriction as a linear inequality — these are the constraints. Finally write the quantity to optimise as the objective function, a linear expression such as P = ax + by.
Turning words into inequalities
Common phrases translate directly: "at least 20" → x ≥ 20; "not more than 50" → x ≤ 50; "x is at most twice y" → x ≤ 2y; "y is at least three times x" → y ≥ 3x. Quantities that cannot be negative give x ≥ 0 and y ≥ 0.
A good habit is to write a short key stating exactly what x and y represent, list every constraint on its own line, and keep the non-negativity conditions x ≥ 0 and y ≥ 0 even when they seem obvious. Read each sentence of the problem in turn and ask whether it limits the variables or defines the quantity to optimise. A clear, well-labelled model makes the graphing stage that follows far quicker and much less error-prone.
Key formula /
General model: Optimise P = ax + by subject to a set of linear constraints and x ≥ 0, y ≥ 0. A constraint must be linear — no x², xy or x/y terms.
Worked example
A workshop makes x tables and y chairs. Each week at most 10 items can be made, and the number of chairs is at least twice the number of tables. Profit is RM30 per table and RM20 per chair. Model: maximise P = 30x + 20y subject to x + y ≤ 10, y ≥ 2x, x ≥ 0, y ≥ 0.
Remember
- Define what x and y stand for.
- "At least" → ≥, "at most/not more than" → ≤.
- Every constraint and the objective must be linear.