๐ŸŽ›๏ธ Linear Programming

OCR FSMQ Additional Maths ยท Coordinate Geometry (CG6โ€“CG8)

Level 3 · Ages 15–16

← Back to topic overview
1 What Linear Programming Is
Linear programming finds the best possible value of a quantity when your choices are limited by constraints. It is the most obviously practical topic in the whole qualification โ€” it is used every day in manufacturing, logistics, farming and finance.
StatementWhat it asks
CG6Express real situations in terms of linear inequalities
CG7Use graphs of linear inequalities to solve 2-dimensional maximisation and minimisation problems
CG8Know the definition of objective function and be able to find it in 2-dimensional cases
The two ingredients
Constraints: the inequalities limiting what you can do
Objective function: the quantity you want to maximise or minimise
The fact that makes it work
The optimum of a linear objective function always occurs at a vertex (corner) of the feasible region
Why the optimum is at a vertex. Lines of constant objective value, such as $3x + 5y = k$, are all parallel. Sliding that line across the region, the last point it touches before leaving is a corner. Only if the line happens to be parallel to an edge does a whole edge tie for the optimum โ€” and the corners of that edge are still among the best.
2 Setting Up the Problem (CG6, CG8)
Worked Example 1 โ€” Translating a situation

A workshop makes bookcases and desks. A bookcase needs $3$ hours of assembly and $2$ hours of finishing, and sells for a profit of ยฃ$40$. A desk needs $5$ hours of assembly and $2$ hours of finishing, for a profit of ยฃ$60$. There are $60$ assembly hours and $32$ finishing hours available. Set the problem up.

โ‘ Let $x$ = number of bookcases and $y$ = number of desks.
โ‘กObjective function: maximise $P = 40x + 60y$ (profit in ยฃ).
โ‘ขAssembly: $3x + 5y \leqslant 60$
โ‘ฃFinishing: $2x + 2y \leqslant 32$, which simplifies to $x + y \leqslant 16$.
โ‘คNon-negativity: $x \geqslant 0$, $y \geqslant 0$.
Watch which way round the numbers go. The $3$ and $5$ in the assembly constraint are hours per item; the $60$ is the total available. Swapping rows and columns of the data is the commonest set-up error.
Lay the data out in a table before writing any inequality โ€” rows for products, columns for resources. The constraints then read straight off the columns.
3 The Feasible Region (CG7)
The feasible region is the set of points satisfying every constraint at once โ€” the overlap of all the half-planes. See Inequalities in Two Variables for the shading technique.
x y O B C D feasible region constraint 1 constraint 2 Test every vertex O, B, C, D in the objective function — the best one wins
Never read a vertex off the graph. Solve the two boundary equations simultaneously. A vertex of $\left(\tfrac{20}{3}, \tfrac{16}{3}\right)$ is impossible to read accurately from a hand-drawn axis.
4 Finding the Optimum
The vertex method โ€” reliable and quick
1. Find every vertex of the feasible region
2. Evaluate the objective function at each one
3. Pick the largest (or smallest) value
Worked Example 2 โ€” Completing the workshop problem

Maximise $P = 40x + 60y$ subject to $3x + 5y \leqslant 60$, $x + y \leqslant 16$, $x \geqslant 0$, $y \geqslant 0$.

โ‘ Boundary $3x + 5y = 60$ passes through $(20, 0)$ and $(0, 12)$.
โ‘กBoundary $x + y = 16$ passes through $(16, 0)$ and $(0, 16)$.
โ‘ขVertices on the axes: $(0,0)$;  $(0, 12)$ โ€” the lower of $12$ and $16$;  $(16, 0)$ โ€” the lower of $20$ and $16$.
โ‘ฃWhere the two slanted lines meet: from $x + y = 16$ we get $x = 16 - y$, so $3(16-y) + 5y = 60$.
โ‘ค$48 + 2y = 60$, so $y = 6$ and $x = 10$. The vertex is $(10, 6)$.
Vertex$P = 40x + 60y$
$(0, 0)$$0$
$(16, 0)$$640$
$(10, 6)$$400 + 360 = 760$
$(0, 12)$$720$
โ‘ฅThe maximum profit is ยฃ$760$, making $10$ bookcases and $6$ desks.
โ‘ฆCheck the constraints: assembly $3(10)+5(6) = 60$ โœ“ (exactly used); finishing $10+6 = 16$ โœ“ (exactly used).
Both resources being fully used is typical of the optimum. If a resource were left over, you could usually make something more.
Worked Example 3 โ€” A minimisation

A farmer must supply at least $24$ units of nitrogen and at least $16$ units of phosphate. Feed A gives $2$ nitrogen and $2$ phosphate per sack at ยฃ$3$; feed B gives $6$ nitrogen and $2$ phosphate per sack at ยฃ$5$. Minimise the cost.

โ‘ Let $x$ = sacks of A, $y$ = sacks of B. Minimise $C = 3x + 5y$.
โ‘กNitrogen: $2x + 6y \geqslant 24$, i.e. $x + 3y \geqslant 12$.
โ‘ขPhosphate: $2x + 2y \geqslant 16$, i.e. $x + y \geqslant 8$.
โ‘ฃBoth are "at least", so the region is away from the origin and unbounded above.
โ‘คVertices: $(12, 0)$ on the $x$-axis (satisfies $x+y \geqslant 8$ โœ“); $(0, 8)$ on the $y$-axis (satisfies $x + 3y = 24 \geqslant 12$ โœ“).
โ‘ฅThe lines meet where $x + 3y = 12$ and $x + y = 8$: subtracting gives $2y = 4$, so $y = 2$ and $x = 6$.
Vertex$C = 3x + 5y$
$(12, 0)$$36$
$(6, 2)$$18 + 10 = 28$
$(0, 8)$$40$
โ‘ฆCheapest is ยฃ$28$: $6$ sacks of A and $2$ of B.
For a minimisation the region is unbounded, so there is no maximum โ€” but the minimum is still at a vertex. Do not look for a fourth corner that does not exist.
5 When Answers Must Be Whole Numbers
You cannot make $6.67$ bookcases. When the variables count physical objects, the optimum must be a point with whole-number coordinates inside the feasible region.
Worked Example 4 โ€” Rounding down carefully

Maximise $P = 5x + 4y$ subject to $2x + 3y \leqslant 13$, $x + y \leqslant 5$, $x, y \geqslant 0$, with $x$ and $y$ whole numbers.

โ‘ The slanted lines meet where $2x + 3y = 13$ and $x + y = 5$.
โ‘ก$x = 5 - y$, so $10 - 2y + 3y = 13$, giving $y = 3$ and $x = 2$.
โ‘ขHappily $(2, 3)$ is already a whole-number point. $P = 10 + 12 = 22$.
โ‘ฃOther vertices: $(5, 0)$ gives $P = 25$;  $(0, 4)$ โ€” from $3y \leqslant 13$, so $y \leqslant 4.33$ โ€” gives $P = 16$.
โ‘คThe maximum is $P = 25$ at $(5, 0)$.
โ‘ฅVerify: $2(5) + 3(0) = 10 \leqslant 13$ โœ“ and $5 + 0 = 5 \leqslant 5$ โœ“
Note that the vertex $(0, 4.33)$ had to be rounded down to $(0,4)$ to stay feasible. Rounding up would break the constraint.
6 Quick Reference

Objective function

The quantity being optimised.

Constraints

One inequality per limited resource.

Don't forget

$x \geqslant 0$, $y \geqslant 0$.

Simplify

Divide out common factors before plotting.

Feasible region

The overlap of all the constraints.

The key fact

The optimum is at a vertex.

Vertices

Solve boundary lines in pairs โ€” never read them off.

Method

Tabulate the objective at every vertex.

Minimisation

"At least" constraints give an unbounded region.

Whole numbers

Test nearby integer points; recheck all constraints.

7 Practice Questions
Question 1

Define "objective function".

โ–ถ Show solution

The objective function is the expression, in the problem's variables, for the quantity being maximised or minimised โ€” for example the profit $P = 40x + 60y$ or the cost $C = 3x + 5y$.

Question 2

A chair needs $2$ m of timber and a table needs $5$ m. There is $40$ m available. Write the constraint.

โ–ถ Show solution

With $x$ chairs and $y$ tables: $2x + 5y \leqslant 40$.

Question 3

Evaluate $P = 3x + 7y$ at the vertices $(0,0)$, $(4,0)$, $(2,3)$ and $(0,4)$, and state the maximum.

โ–ถ Show solution

$(0,0)$: $0$

$(4,0)$: $12$

$(2,3)$: $6 + 21 = 27$

$(0,4)$: $28$

Maximum $P = 28$ at $(0, 4)$.

Question 4

Find the vertex where $2x + y = 10$ meets $x + 2y = 11$.

โ–ถ Show solution

Double the first: $4x + 2y = 20$.

Subtract the second: $3x = 9$, so $x = 3$.

Then $y = 10 - 6 = 4$. The vertex is $(3, 4)$.

Question 5

Simplify the constraint $15x + 25y \leqslant 300$.

โ–ถ Show solution

Divide by $5$: $3x + 5y \leqslant 60$.

Question 6

Maximise $P = x + y$ subject to $x + 2y \leqslant 8$, $3x + y \leqslant 9$, $x, y \geqslant 0$.

โ–ถ Show solution

Axis vertices: $(3, 0)$ from $3x \leqslant 9$; $(0, 4)$ from $2y \leqslant 8$.

Slanted lines meet: $x + 2y = 8$ and $3x + y = 9$. From the second, $y = 9 - 3x$:

$x + 18 - 6x = 8$, so $-5x = -10$ and $x = 2$, $y = 3$.

$(0,0)$: $0$;  $(3,0)$: $3$;  $(2,3)$: $5$;  $(0,4)$: $4$

Maximum $P = 5$ at $(2, 3)$.

Question 7

Minimise $C = 2x + 3y$ subject to $x + y \geqslant 6$, $2x + y \geqslant 8$, $x, y \geqslant 0$.

โ–ถ Show solution

Axis vertices: $(0, 8)$ from $y \geqslant 8$ โ€” check $x+y = 8 \geqslant 6$ โœ“; and $(6, 0)$ from $x \geqslant 6$ โ€” check $2x = 12 \geqslant 8$ โœ“

Lines meet: subtracting $x+y=6$ from $2x+y=8$ gives $x = 2$, so $y = 4$.

$(0,8)$: $24$;  $(2,4)$: $4 + 12 = 16$;  $(6,0)$: $12$

Minimum $C = 12$ at $(6, 0)$.

Question 8

Explain why the optimum of a linear objective function cannot occur strictly inside the feasible region.

โ–ถ Show solution

From any interior point you can move a small distance in the direction that increases the objective function, and still remain inside the region.

So an interior point can always be improved upon, and therefore cannot be optimal.

Moving in that direction repeatedly, you must eventually reach a boundary, and then slide along it to a corner. Hence the optimum lies at a vertex (or along a whole edge, if the objective line happens to be parallel to that edge).

Question 9

A vertex is found at $\left(\tfrac{7}{2}, \tfrac{9}{2}\right)$, but $x$ and $y$ must be whole numbers. Describe carefully how you would proceed.

โ–ถ Show solution

Test the whole-number points near the vertex: $(3,4)$, $(3,5)$, $(4,4)$ and $(4,5)$.

For each, first check it satisfies every constraint โ€” some will lie outside the region, because the vertex is a corner and at least one constraint is tight there.

Then evaluate the objective function at the surviving points and take the best.

You should not simply round the vertex to the nearest integers, because the rounded point may be infeasible.

Question 10

A bakery makes loaves and rolls. Each loaf needs $500$ g of flour and $10$ minutes of oven time; each roll needs $100$ g of flour and $4$ minutes of oven time. There is $30$ kg of flour and $8$ hours of oven time each day. Loaves sell at a profit of ยฃ$1.20$, rolls at ยฃ$0.30$.

(a) Write down the objective function and the constraints.   (b) Find all the vertices of the feasible region.   (c) Find the production plan that maximises profit.   (d) The bakery is offered extra flour. Explain whether this would increase the maximum profit.

โ–ถ Show solution

Let $x$ = loaves and $y$ = rolls.

(a) Maximise $P = 1.2x + 0.3y$.

Flour (in grams): $500x + 100y \leqslant 30\,000$, which simplifies to $5x + y \leqslant 300$.

Oven (in minutes): $10x + 4y \leqslant 480$, which simplifies to $5x + 2y \leqslant 240$.

And $x \geqslant 0$, $y \geqslant 0$.

(b) On the $x$-axis: flour gives $x \leqslant 60$, oven gives $x \leqslant 48$. The binding one is $48$, so $(48, 0)$.

On the $y$-axis: flour gives $y \leqslant 300$, oven gives $y \leqslant 120$. The binding one is $120$, so $(0, 120)$.

Where the slanted lines meet: subtracting $5x + y = 300$ from $5x + 2y = 240$ gives $y = -60$.

A negative $y$ means the lines cross outside the first quadrant, so this is not a vertex of the feasible region.

Vertices: $(0,0)$, $(48, 0)$, $(0, 120)$.

(c) $(0,0)$: $P = 0$

$(48, 0)$: $P = 1.2 \times 48 = ยฃ57.60$

$(0, 120)$: $P = 0.3 \times 120 = ยฃ36.00$

The maximum profit is ยฃ$57.60$, from $48$ loaves and no rolls.

Check: flour used $= 48 \times 500 = 24$ kg $\leqslant 30$ kg โœ“; oven $= 480$ min $= 8$ h โœ“

(d) No. At the optimum only $24$ kg of the $30$ kg of flour is used โ€” there is already $6$ kg spare.

The binding constraint is oven time, which is fully used. Extra flour cannot be baked, so it would not raise the profit at all. To increase profit the bakery needs more oven capacity, not more flour.

Linear Programming (CG6โ€“CG8) ยท OCR FSMQ Additional Maths · Created with MathJax