Skip to main content
Examonaut

Topic 5 · Lesson 1 of 5

Formulating linear programming problems

The three parts

  1. Decision variables: what you are choosing, with units, for example "xx = the number of tables made each week". Define them clearly.
  2. Objective function: what to maximise or minimise, written in terms of the variables, for example "maximise P=40x+25yP = 40x + 25y".
  3. Constraints: the limits, as linear inequalities, including non-negativity (x,y≥0x, y \geq 0). Simplify each one by dividing through by any common factor.

Turning words into inequalities

  • "At most 60 hours" or "no more than": ≤\leq. "At least" or "no fewer than": ≥\geq.
  • Use the same units throughout: if one machine time is in minutes and the limit is in hours, convert.
  • Ratios are the commonest trap. "At least twice as many chairs as tables" means x≥2yx \geq 2y (test it: 10 chairs and 5 tables should be allowed). "Tables must be at most a third of the total" means y≤13(x+y)y \leq \frac{1}{3}(x + y), which simplifies to 2y≤x2y \leq x.
  • "At least 30% of the total must be type A": x≥0.3(x+y)x \geq 0.3(x + y), so 7x≥3y7x \geq 3y.

Worked example

Formulating

A firm makes xx trays of type X and yy trays of type Y. Type X uses 1 kg of resin and type Y uses 1 kg; 7 kg is available. Type X takes 1 hour of moulding and Y takes 3 hours; there are 15 hours. Type X takes 2 hours of finishing and Y takes 1 hour; there are 12 hours. Profit is £3 per X and £2 per Y.

Show solution

Maximise P=3x+2yP = 3x + 2y subject to x+y≤7x + y \leq 7, x+3y≤15x + 3y \leq 15, 2x+y≤122x + y \leq 12, x,y≥0x, y \geq 0.

Practise this topic

Both are part of Premium.