Linear programming & operations research · Lesson 1 of 2

Linear programming

Shading the region that satisfies several inequalities, finding its corners, and the corner-point method for the greatest or least value of ax + by.

16 minYou should already know: Inequalities
  1. 1
  2. 2

A linear programming problem asks for the greatest (or least) value of an expression like P=ax+byP = ax + by when xx and yy must satisfy several linear inequalities.

The feasible region

Draw each boundary line, then keep the side that satisfies the inequality (see inequalities). Test a point that is not on the line, such as the origin. The region that satisfies all of them at once is the feasible region.

The corner-point method

The greatest and least values of ax+byax + by over the region always occur at a corner. So:

  1. find the corners, by solving the equations of the lines that meet there;
  2. work out ax+byax + by at each corner;
  3. pick the largest (or smallest).
ax + by = kfeasible
The best point is a cornerSlide the line ax + by = k out: it leaves the region at a corner
The corner-point methodSet the coefficients of P = ax + by
−1135792468xy
20greatest P(4, 4)at
P = 2x + 3y at the corners: (0, 0) → 0; (6, 0) → 12; (5, 3) → 19; (4, 4) → 20; (0, 6) → 18. The greatest is 20, at (4, 4).

Worked example · NECO 2023

NECO 2023 · Paper 1 · Q49

The corner points of the feasible region of a problem are A(0,3)A(0, 3), B(2,3)B(2, 3), C(4,3)C(4, 3), D(3,4)D(3, 4) and E(0,0)E(0, 0). If P=35x+40yP = 35x + 40y, what is the maximum value of PP?

  1. P at each corner

    • A(0,3){A(0, 3)}: 120{120}. B(2,3){B(2, 3)}: 70+120=190{70 + 120 = 190}.
    • C(4,3){C(4, 3)}: 140+120=260{140 + 120 = 260}. D(3,4){D(3, 4)}: 105+160=265{105 + 160 = 265}. E(0,0){E(0, 0)}: 0{0}.

    Think first. Put each corner into 35x + 40y.

  2. The greatest

    • The maximum is 265{265}, at DD: option E.

Worked example · WAEC 2020

WAEC 2020 · Paper 2 · Q4

Shade the region, PP, in the xx–yy plane which satisfies simultaneously the inequalities:

x+y≥5,2y−x≥0,x+5y≤21x + y \ge 5, \qquad 2y - x \ge 0, \qquad x + 5y \le 21

Use the diagram in 4(a) to find, on the region PP, the minimum value of xx;

the maximum value of (3x+2y)(3x + 2y).

  1. The region

    • 3+3=6≥5{3 + 3 = 6 \ge 5}, 6−3=3≥0{6 - 3 = 3 \ge 0} and 3+15=18≤21{3 + 15 = 18 \le 21}: (3,3)(3, 3) is in PP, a triangle.

    Think first. Test (3, 3) in all three inequalities.

  2. The corners

    • x+y=5{x + y = 5} and x+5y=21{x + 5y = 21}: 4y=16{4y = 16}, so (1,4){(1, 4)}.
    • y=x2{y = \frac{x}{2}} and x+y=5{x + y = 5}: 3x2=5{\frac{3x}{2} = 5}, so (103,53){\left(\frac{10}{3}, \frac53\right)}.
    • y=x2{y = \frac{x}{2}} and x+5y=21{x + 5y = 21}: 7x2=21{\frac{7x}{2} = 21}, so (6,3){(6, 3)}.

    Think first. Solve each pair of boundary lines.

  3. Least x, greatest 3x + 2y

    • The least xx on the region is at (1,4){(1, 4)}: x=1{x = 1}.
    • 3x+2y{3x + 2y}: 11{11}, 1313{13\frac13} and 24{24}. The greatest is 24{24}, at (6,3){(6, 3)}.

More: regions

Your turn

WAEC 2012 · Paper 2 · Q4

  1. (a)

    Indicate by shading graphically the set of all points P(x,y)P(x, y) in the OxyOxy plane that satisfy simultaneously the inequalities 2x−y≥−42x - y \ge -4, x+y≤10x + y \le 10, y−x>0y - x > 0, y≥2y \ge 2 and x≥0x \ge 0.

    Model answer
    246810246810xy(5, 5)y = 2x + 4x + y = 10y = xy = 2R

    Draw each boundary line, then shade the side that satisfies every inequality. The region RR has corners (5,5)(5, 5), (2,8)(2, 8), (0,4)(0, 4), (0,2)(0, 2), (2,2)(2, 2). The line y=xy = x is dashed because y−x>0y - x > 0 is strict (points on it are not included). WAEC accepts either shading the wanted region or shading the unwanted side, as long as you label the region clearly.

    For (b): check 10x+5y10x + 5y at each corner; the largest value, 75, is at (5,5)(5, 5).

  2. (b)

    Using the graph, find the values of xx and yy for which 10x+5y10x + 5y is maximum.

    Separate values with commas, e.g. 3, −2

Try it on a graph

The feasible region; test the corners in 10x + 5y.

Worked solution (try it first)

(a)

  1. Draw 2x−y=−42x - y = -4, x+y=10x + y = 10, y=xy = x (dashed, since y−x>0y - x > 0), y=2y = 2 and x=0x = 0, and shade the region that satisfies all five.
  2. Its corners: (0,2)(0, 2).
  3. y=2y = 2 and y=xy = x give (2,2)(2, 2).
  4. y=xy = x and x+y=10x + y = 10 give (5,5)(5, 5).
  5. x+y=10x + y = 10 and 2x−y=−42x - y = -4 give 3x=63x = 6, so (2,8)(2, 8).
  6. 2x−y=−42x - y = -4 and x=0x = 0 give (0,4)(0, 4).

(b)

  1. 10x+5y10x + 5y at the corners: 1010, 3030, 7575, 6060 and 2020.
  2. The maximum is 7575, at x=5x = 5, y=5y = 5.

Report a problem with this question