Linear Programming

Problems and Solutions

with your fx-991ES or fx-

115ES Calculator

Dr Allen Brown

Cambridge

Paperbacks

Cambridge Paperbacks

www.CambridgePaperbacks.com

First published by Cambridge Paperbacks 2019

© Allen Brown 2019

All rights reserved. No part of this publication may be reproduced or

transmitted in any form or by any means, electronic or mechanical, including

photocopy, recording, or any information storage and retrieval system without

permission in writing from the author.

Disclaimer

Although the author and publisher have made every effort to ensure that the

information in this book was correct during preparation and printing, the

author and publisher hereby disclaim any liability to any party for any errors

or omissions.

Read this First

Linear programming is part of a larger subject known

as Operations Research which deals with methods of

allocating resources in the most efficient way

possible. In itself linear programming is a big subject

and this ebook only covers a small part and serves as

a brief introduction only.

Linear programming problems relate to maximising or

minimising resources, such as maximising the profit

on a set of products or services.

When first learning about linear programming you

need to plot the constraints of your problem which

derive from inequalities. From the plots you should

then be able to maximise the objective function.

In this ebook you are shown how you can use your fx-

991ES or fx-115ES calculator to perform linear

programming calculations without having to resort to

actually plotting functions yourself.

In all the examples it will be assumed the variables x

and y are always ≥ 0 so every plot will be in the upper

right quadrant of your graph paper.

A concept of plot type and the classification of plot is

introduced in the first chapter to enable you to know

what the plot of the function actually look like before

you embark on solving them.

When using your fx calculator, it will be in its matrix

mode and it’s assumed you have some knowledge of

basic matrix algebra. Owing to the limitations of the fx

calculator, only small scale linear programming

problems are tackled. Nonetheless these serves as a

really good introduction into the nature of

calculations needed to apply linear programming to

real problems.

As you work through this ebook your understanding

of linear programming will increase, it’s therefore

important you perform all the keystrokes yourself to

maximise the learning experience.

Dr Allen Brown

Cambridgeshire

Contents

1 Classification of Linear Programming Graphs ................... 2

2 Basic Linear Programming ................................................. 6

Example 2.1 ....................................................................... 8

Example 2.2 ..................................................................... 12

Example 2.3 ..................................................................... 15

Example 2.4 ..................................................................... 18

Example 2.5 ..................................................................... 21

3 Linear Programming with Three Constraints. ................. 25

Example 3.1 ..................................................................... 26

Example 3.2 ..................................................................... 32

Example 3.3 ..................................................................... 39

4 Applying Linear Programming ......................................... 45

Example 4.1 ..................................................................... 45

Example 4.2 ..................................................................... 49

1

1 Classification of Linear Programming Graphs

It’s possible to classify basic linear programming

problems according to the number of negative values

in the inequalities. In Chapter 2 you will see

inequalities in a pair,

+ ≤

12

1

11

+ ≤

2

22

21

And in Chapter 3 you will see inequalities in a trio,

111 + 112 ≤

1

221 + 222 ≤

2

311 + 312 ≤

3

The appearance of a plot of these inequalities will

depend on the sign of the y value and the diagrams on

the next three pages will help you to appreciate the

different graphs formed by these inequalities. The

shaded region in each graph is the feasibility region.

The classification method is determined by the

number of inequalities and the number of positive

values in the inequalities. The value n before the

nTypem refers to the number of inequalities and m the

number of positive y coefficients.

2

2Type2

There are 2 inequalities.

Both y coefficients are

positive and there are 4

vertices on the feasibility

region.

2Type1

There are 2 inequalities.

Only one y coefficient is

positive and there are 4

vertices on the feasibility

region.

2Type0

There are 2 inequalities.

Both y coefficients are

negative and there are 4

vertices on the feasibility

region.

3

3Type3

There are 3 inequalities.

All 3 y coefficients are

positive and there are 5

vertices on the feasibility

region.

3Type2

There are 3 inequalities.

Two of the y coefficients

are positive and one

negative There are 5

vertices on the feasibility

region.

3Type1

There are 3 inequalities.

One of the y coefficients

is positive and two are

negative There are 5

vertices on the feasibility

region.

4

3Type0

There are 3 inequalities.

All three of the y

coefficients are negative.

There are 4 vertices on

the feasibility region.

You will also need to look at the right hand side of the

inequality, as a brief guide observe the shaded regions

in the following graphs,

− ≤ 0 − ≥ 0

You will note we have not followed the convention of

a broken line for a ≥ or ≤ and a solid line for > or <.

When you see or derive the inequalities in a linear

programming problem, by referring to these diagrams

you will be able to recognise the graph associated

with the inequalities. In the examples in the following

chapters, reference will be made to the graph Type.

5

2 Basic Linear Programming

In linear programming you have an objective function

and a number of inequality constraints. In this chapter

we shall be looking at how your fx-991ES calculator

can be used to find the objective function from two

constraints only. In effect we shall be using the corner

point method. The objective function is for the form,

= +

2

1

The constraints are of the form,

+ ≤

11

1

12

+ ≤

21

22

2

, ≥ 0

We shall express the constraints in matrix notation,

11 12

1

( ) ( ) = ( )

21 22 1

=

or

−

=

The objective function can be written as,

6

= ( 1 ) ( )

1

or

=

which becomes,

−1

= ( ) 1

When the two constraint equations are plotted, they

often appear as seen in the graph below.

The shaded region, knowns as the feasibility region, is

where the constraint inequalities are valid. The matrix

X gives the coordinate of the intersection and the

values of this coordinate are then used to determine

7

the objective function. Very often the objective

function passes through the intersection corner, but

not exclusively so. This means the intersection

coordinate is not always the optimum solution which

maximises or minimises P. Eq:1 on the previous page

finds the intersection coordinate and the value of the

objective function at that value – this may not be the

optimum solution.

In the following examples set your fx-991ES calculator

to be used in its matrix mode. MatA will be 2 × 2

matrix, MatB will be a 2 × 1 matrix and MatC will be

1 × 2 matrix. Here are some examples to determine

the objective junction.

Example 2.1

Find the maximum value of the objective function,

= 40 + 30

With the constraints,

+ ≤ 240

2 + ≤ 320

This will form a 2Type2 graph (page 3). Set calculator

in matrix mode ((MODE)6);

8

Select 1,

Select 5 as we want MatA to be a 2 × 2 matrix,

Not populate A with the values from the constraint

equations,

1=1=2=1=

Now to populate MatB,

Cq(MATRIX)22

9

Now select option 6,

Enter the following keystrokes,

240=320=

Now populate MatC with the objective function, enter

the following keystrokes,

Cq(MATRIX)32R

And select option 2,

10

Enter the following keystrokes,

40=30=

All three matrices have been populated; to determine

the coordinate to maximise the value of the objective

function enter the following keystrokes,

Cq(MATRIX)3uq(MATRIX)4

Maximum value of the objective function occurs at

80

( ). Now perform Eq:1 on page 7; enter the

100

following keystrokes,

Cq(MATRIX)5(q(MATRIX)3u

q(MATRIX)4)

11

The maximum P value is 8000. The graph below shows

the objective function in green and the constraints in

red and pink. As expected they all pass through the

80

( ) coordinate on the graph which is 2Type2 graph.

160

Example 2.2

Find the maximum value of the objective function,

= 10 + 15

12

With the constraints,

3 + 6 ≤ 60

+ ≤ 16

Again this will form a 2Type2 graph. Assuming you are

continuing from Example 1.1, all three matrices have

to be reset. Here are the keystrokes for MatA,

Cq(MATRIX)213=6=1=1=

Here are the keystrokes for MatB,

Cq(MATRIX)22 60=16=

Here are the keystrokes for MatC (the objective

function),

Cq(MATRIX)23 10=15=

13

All three matrices are ready, enter the following

keystrokes to find the coordinate of the intersection,

Cq(MATRIX)3uq(MATRIX)4=

The value of the objective function at this coordinate

are,

Cq(MATRIX)5Oq(MATRIX)6=

The value of P at the intersection is therefore 180. A

graph of the constraints and the objective function (in

green) is shown below.

14

From the graph, you are able to determine the

coordinate where the two constraint inequalities

intersect. To calculate the optimum solution, enter

the other values from the corners into the objective

function. These are,

0 0 16

( ) , ( ) , ( )

10 0 0

The value of the objective function is,

10 × 0 + 15 × 10 = 150

10 × 16 + 15 × 0 = 160

The intersection corner is therefore the optimum

solution giving a value of 180.

Example 2.3

Find the maximum value of the objective function,

= 40 + 35

With the constraints,

2 + 3 ≤ 60

4 + 3 ≤ 96

15

Again a 2Type2 graph. Reload the three matrices in

your fx-991ES calculator with the keystrokes,

For MatA, (MATRIX)

Cq(MATRIX)21 2=3=4=3=

For MatB

Cq(MATRIX)22 60=96=

For MatC

Cq(MATRIX)23 40=35=

Now all three matrices are ready. To find the

intersection of the two inequalities, enter the

following keystrokes,

16

Cq(MATRIX)3uq(MATRIX)4=

The value of the objective function at this coordinate

is,

Cq(MATRIX)5Oq(MATRIX)6=

The objective function has a value of 1,000 as it passes

through the intersection corner of the feasibility

region. A graph of the inequalities and the objective

function is shown below.

17

To calculate the optimum solution, enter the other

values from the corners into the objective function.

These are,

0 0 24

( ) , ( ) , ( )

20 0 0

The value of the objective function is,

= 40 + 35

40 × 0 + 35 × 20 = 700

40 × 24 + 35 × 0 = 960

The intersection corner is therefore the optimum

solution giving a value of = 1,000.

Example 2.4

Find the maximum value of the objective function,

= 5 + 7

With the constraints,

+ 3 ≤ 6

5 + 2 ≤ 10

Another 2Type2 graph. Reload the three matrices in

your fx-991ES calculator with the keystrokes,

For MatA,

18

Cq(MATRIX)21 1=3=5=2=

For MatB

Cq(MATRIX)22 6=10=

For MatC

Cq(MATRIX)23 5=7=

Now all three matrices are ready. To find the

intersection of the two inequalities, enter the

following keystrokes,

Cq(MATRIX)3uq(MATRIX)4=n

19

The value of the objective function at this coordinate

are,

Cq(MATRIX)5Oq(MATRIX)6=n

The objective function has a value of 17.692 as it

passes through the intersection corner of the

feasibility region. A graph of the inequalities and the

objective function is shown below.

To calculate the optimum solution, enter the other

values from the corners into the objective function.

These are,

20

0 0 2

( ) , ( ) , ( )

2 0 0

The value of the objective function is,

= 5 + 7

5 × 0 + 7 × 2 = 14

5 × 2 + 7 × 0 = 10

The intersection corner is therefore the optimum

solution giving a value of = 17.69.

Example 2.5

Find the maximum value of the objective function,

= 10 + 50

With the constraints,

3 + 10 ≤ 20

6 − 5 ≥ 6

This is a 2Type1 graph (see page 3). Reload the three

matrices in your fx-991ES calculator with the

keystrokes,

For MatA,

Cq(MATRIX)21

3=10=6=z5=

21

For MatB

Cq(MATRIX)22 20=6=

For MatC

Cq(MATRIX)23 10=50=

Now all three matrices are ready. To find the

intersection of the two inequalities, enter the

following keystrokes,

Cq(MATRIX)3uq(MATRIX)4=n

The value of the objective function at this coordinate

are,

22

Cq(MATRIX)5Oq(MATRIX)6=n

The objective function has a value of 89.33 as it passes

through the intersection corner of the feasibility

region. A graph of the inequalities and the objective

function is shown below.

23

Compare with the plot on page 3, as expected it’s a

2Type1 plot. The value of the objective function as the

other two corners on the feasibility region (from the

graph) are,

= 10 + 50

(1, 0) = 10 × 1 = 10

(6.6, 0) = 10 × 6.6 = 66

Clearly (2.13, 1.36) is the optimum solution.

24

3 Linear Programming with Three

Constraints.

When there are three constraint inequalities, the

feasibility region is likely to have five corners as shown

in the graph below which is a 3Type3 graph (page 4).

The task in hand is therefore to determine the

intersections of the inequalities. They will appear as,

111 + 112 ≤

1

221 + 222 ≤

2

311 + 312 ≤

3

25

There are three possible sets of simultaneous

equations,

Set 1 Set 2

111 + 112 ≤ 111 + 112 ≤

1

1

221 + 222 ≤ 311 + 312 ≤

2

3

Set 3

221 + 222 ≤

2

311 + 312 ≤

3

However only two sets are required as you can see

from the graph on the previous page, one of the

intersections lies outside the feasibility region. The

coordinate with an x value between the other two is

the one to discard – the one outside the feasibility

region. It’s necessary to load the matrices in your fx-

991ES calculator three times to obtain the

coordinates of the intersections.

Example 3.1

Find the maximum value of the objective function,

= 9 + 5

26

With the constraints,

+ 2 ≤ 5.2

2 + ≤ 5

6 + 5 ≤ 16.5

These will form a 3Type3 graph. Consider these as

three sets,

Set 1 Set 2

+ 2 ≤ 5.2 + 2 ≤ 5.2

2 + ≤ 5 6 + 5 ≤ 16.5

Set 3

2 + ≤ 5

6 + 5 ≤ 16.5

Enter the following keystrokes. Set 1:

MatA

Cq(MATRIX)21 1=2=2=1=

MatB

Cq(MATRIX)22 5.2=5=

27

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=

Set 2:

+ 2 ≤ 5.2

6 + 5 ≤ 16.5

Enter the keystrokes,

MatA

Cq(MATRIX)21 1=2=6=5=

MatB

Cq(MATRIX)22 5.2=16.5=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=

28

Set 3:

2 + ≤ 5

6 + 5 ≤ 16.5

Enter the keystrokes,

MatA

Cq(MATRIX)21 2=1=6=5=

MatB

Cq(MATRIX)22 5=16.5=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=

29

We now look at the coordinates of the three

intersections and determine which one will not lie

within the feasibility region.

Set 1 Set 2 Set 3

From comparing the x values for the three

coordinates you can see that

Set 2(x) < Set 1(x) < Set 3(x).

Set 1 will be discarded as the intersection outside the

feasibility region. We have the coordinate for the

intersections in Set 2 and Set 3, substitute these into

the objective function. The objective function is,

= 9 + 5

Enter the following keystrokes,

(MODE)1 9Q(X)+5Q(Y)

Set 2: r

X? 1=

Y? 2.1=n

30

Set 3: r

X? 2.125=

Y? 0.75=n

Regarding the intercepts, the maximum value of P

2.125

occurs at ( ) and has a value of 22.975. A graph of

0.75

the three inequalities is shown here.

31

As you can see is a 3Type3 graph; there are five corners

in the feasibility region. Below you can see the

objective function in green.

Example 3.2

Find the maximum value of the objective function,

= 8 + 100

With the constraints,

9 − 50 ≥ 0

4 + 35 ≤ 280

+ 15 ≤ 90

These will form a 3Type2 graph (see page 4). Consider

these as three sets,

32

Set 1 Set 2

9 − 50 ≥ 0 9 − 50 ≥ 0

4 + 35 ≤ 280 + 15 ≤ 90

Set 3

4 + 35 ≤ 280

+ 15 ≤ 90

With the presence of the negative value in the first

inequality, this indicates that two of the intersection

values will be colinear (on the line joining the origin).

The one furthest away from the origin is the one to

discarded as it will be outside the feasibility region.

You will observe the first inequality passes through

the origin, therefore the intersection values for Set 1

and Set 2 will be colinear because they contain the

first inequality. To determine the intersection values,

enter the following keystrokes on your calculator

(assuming it already in its matrix mode).

Set 1:

9 − 50 ≥ 0

4 + 35 ≤ 280

33

MatA

Cq(MATRIX)21

9=z50=4=35=

MatB

Cq(MATRIX)22 0=280=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=n

Set 2:

9 − 50 ≥ 0

+ 15 ≤ 90

MatA

Cq(MATRIX)21

34

9=z50=1=15=

MatB

Cq(MATRIX)22 0=90=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=n

Set 3:

4 + 35 ≤ 280

+ 15 ≤ 90

MatA

Cq(MATRIX)21

4=35=1=15

35

MatB

Cq(MATRIX)22 280=90=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=

The three intersection coordinates are,

Set 1 Set 2 Set 3

We know Set 1 and Set 2 are colinear and you can

determine the distance from the origin for each

coordinate use Pythagoras’s rule. The keystrokes for

your calculator are, (MODE)1

36

Set 1:

s27.18d+4.89d=

Set 2:

Cs24.32d+4.37d=

Discard Set 1 as the intersection coordinate is outside

the feasibility region. Given the objective function on

page 30,

= 8 + 100

Enter the following keystrokes,

C8Q(X)+100Q(Y)

For the intersection coordinate from Set 2,

r

X? 24.324=

37

Y? 4.3782=

The objective function for Set 2 is 632.412. For the

intersection coordinate from Set 3,

r

X? 42=

Y? 3.2=

The objective function has a maximum of 656.0 and

passes through the optimum intersection coordinate

from Set 3. A graph of the inequalities and the

objective function (in green) is shown on the next

page.

38

As you can see this is a 3Type2 graph as defined on

page 4.

Example 3.3

Find the maximum value of the objective function,

= 55 + 100

With the constraints,

15 − 10 ≤ 9

8 − 10 ≤ 2

3 − 10 ≥ −9

39

Looking at these inequality constraints and comparing

with the plots on page 5 you will recognise this a

3Type0 as all the y coefficients are negative. Also the

intersection coordinate furthest away from the origin

will be discarded. Consider these are three sets.

Set 1 Set 2

15 − 10 ≤ 9 15 − 10 ≤ 9

8 − 10 ≤ 2 3 − 10 ≥ −9

Set 3

8 − 10 ≤ 2

3 − 10 ≥ −9

Enter the following keystrokes for,

Set 1

MatA

Cq(MATRIX)21

15=z10=8=z10=

MatB

Cq(MATRIX)22 9=2=

40

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=n

Set 2:

15 − 10 ≤ 9

3 − 10 ≥ −9

MatA

Cq(MATRIX)21

15=z10=3=z10=

MatB

Cq(MATRIX)22 9=z9=

41

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=n

Set 3:

8 − 10 ≤ 2

3 − 10 ≥ −9

MatA

Cq(MATRIX)21

8=z10=3=z10=

MatB

Cq(MATRIX)22 2=z9=

Perform the calculation to determine the intersection,

Cq(MATRIX)3uq(MATRIX)4=n

42

The intersection coordinates for the three sets are,

Set 1 Set 2 Set 3

Looking at the 3Type0 plot on page 5, we need to

determine the intersection coordinate furthest from

the origin. Normally you would apply Pythagoras’s

rule, however in this case you can see that Set 3 has

the coordinate furthest away from the origin, this one

will be discarded. We now need to determine which

intersection gives the optimum solution. Need to

maximise,

= 55 + 100

The keystrokes for this equation are,

(MODE)1 55Q(X)+100Q(Y)

For the intersection for Set 1:

r

X? 1=

43

Y? 0.6=

For the intersection for Set 2:

r

X? 1.5=

Y? 1.35=n

The optimum solution is from Set 2 and giving an

objective function of,

55 + 100 = 217.5

A plot of the inequalities and the objective function (in

green) is shown in the graph below.

44