03. Inequalities and Linear Programming S1 211
03. Inequalities and Linear Programming S1 211
Programming
• Graph and solve systems of
linear inequalities in two
variables
2
Linear Inequality in Two Variables
Linear inequality can be written in one of the following
forms
𝑎𝑥 + 𝑏𝑦 + 𝑐 < 0 𝑎𝑥 + 𝑏𝑦 + 𝑐 ≤ 0
𝑎𝑥 + 𝑏𝑦 + 𝑐 > 0 𝑎𝑥 + 𝑏𝑦 + 𝑐 ≥ 0
where
𝑎, 𝑏, and 𝑐 are constants
not both 𝑎 and 𝑏 are zero
When graphing,
• a solid line – included in the solution (≤, ≥)
• a dashed line – not included in the solution (<, >)
3
One Linear Inequality in Two Variables
The graph of 𝑦 < 𝑥 consists of all points in which the 𝑦-
coordinate is less than the 𝑥-coordinate
6
Try This 01
A food vendor at a rock concert sells hot dogs for $4
and hamburgers for $5. How many of these
sandwiches must be sold to produce sales of at least
$1,000? Express your answer as a linear inequality
and draw its graph.
7
Systems of Linear Inequalities
If we have two or more inequalities in two variables,
we can find the solutions that satisfy all the
inequalities. We call the inequalities a system of
inequalities, and the solution of the system can be
found by finding the intersection of the solution sets
of all the inequalities.
8
Example: Graphical Solution of a
System of Inequalities
3𝑥 − 2𝑦 ≥ 4
Graph the solution of the system ቊ
𝑥+𝑦−3>0
9
Example: Graphical Solution of a
System of Inequalities cont’d
3
We plot 𝑦 ≤ 𝑥 −2
2
as a solid line,
and 𝑦 > 𝑥 + 3 as a
dashed line 10
Example: Graphical Solution of a
System of Inequalities cont’d
12
Example: Systems of Linear
Inequalities
CDF Appliances expects orders for at least 64,000 of the
coffee makers and at least 40,000 of the cappuccino
machines.
15
Example: Systems of Linear
Inequalities cont’d
Finding eq. (1) minus eq. (2) gives one equation in one
variable and allows us to complete the solution
4𝑦 = 200
𝑦 = 50
𝑥 = 150
19
Solving Linear Programming
Graphically
20
Solving Linear Programming
Graphically
① When the feasible region for a linear programming problem
is closed and bounded, the objective function has a
maximum and a minimum value
a) If the co-op’s profits per acre are $240 per corn and $160
for soybeans, how many acres of each crop should the co-
op plant to maximise profit? What is the maximum profit?
b) If the market conditions change so that the co-op’s profits
per acre change to $300 for corn and $100 for soybeans,
how should the co-op adjust its planting to maximise
profit? What is the maximum profit? 22
Example: Maximising Profits cont’d
𝒙 𝒚
𝑦 ≤ −3𝑥 + 13,500
0 6000 𝒙 𝒚
6000 0 0 13500
4500 0
3
𝑥 + 𝑦 ≤ 5250
4 𝒙 𝒚
3
𝑦 ≤ − 𝑥 + 5250 0 5250
4
7000 0
24
Example: Maximising Profits cont’d
The solution of
the system of
constraint
inequalities forms
the feasible region
25
Example: Maximising Profits cont’d
Point 𝐴 = 0, 0
26
Example: Maximising Profits cont’d
C 𝑥 + 𝑦 = 6000 (1)
D ൝3
𝑥 + 𝑦 = 5250 (2)
4
3
E −𝑥 + 6000 = − 𝑥 + 5250
4
A 1
𝑥 = 750
4
𝑥 = 3000; 𝑦 = 3000
28
Example: Maximising Profits cont’d
29
Example: Maximising Profit
A farm co-op has 6000 acres available on which to plant corn
and soybeans. The following table summarises each crop’s
requirements for fertiliser/herbicide, harvesting labour hours,
and the available amounts of these resources.
a) If the co-op’s profits per acre are $240 per corn and $160
for soybeans, how many acres of each crop should the co-
op plant to maximise profit? What is the maximum profit?
b) If the market conditions change so that the co-op’s profits
per acre change to $300 for corn and $100 for soybeans,
how should the co-op adjust its planting to maximise
profit? What is the maximum profit? 30
Example: Maximising Profits cont’d
31
Example: Maximising Profits cont’d
33
Try This 03
If the company can sell all the can openers, how many
of each type should it make in order to maximise the
monthly profit?
34
The Simplex Method
• Useful if there are more than 2 variables
35
The Simplex Method
Standard maximisation problems, satisfy the
following conditions:
1. The objective function is to be maximised
2. All variables are nonnegative
3. The constraints are of the form
𝑎1 𝑥1 + 𝑎2 𝑥2 + ⋯ + 𝑎𝑛 𝑥𝑛 ≤ 𝑏
where 𝑏 > 0
38
The Simplex Method
39
The Simplex Method
40
Example: Simplex Method
A farm co-op has 6000 acres available on which to plant corn
and soybeans. The following table summarises each crop’s
requirements for fertiliser/herbicide, harvesting labour hours,
and the available amounts of these resources.
If the co-op’s profits per acre are $240 per corn and $160 for
soybeans, how many acres of each crop should the co-op
plant to maximise profit? What is the maximum profit?
41
Example: Simplex Method cont’d
43
Example: Simplex Method cont’d
44
Example: Simplex Method cont’d
45
Example: Simplex Method cont’d
46
Example: Simplex Method cont’d
47
Example: Simplex Method cont’d
48
Example: Simplex Method cont’d
The simplex matrix 𝐴 is shown below with the 𝑥-column (with the most
negative value) indicated as the pivot column.
1
9
¾
−240
Note that when the positive coefficients in the pivot column (𝑥-column)
are divided by the constants in the augment, the smallest quotient is
4,500 (R2). This smallest quotient identifies the pivot row.
The pivot entry (or pivot) is the entry in both the pivot column and pivot
row, in this case the value 9 (circled) in R2, C1 of matrix 𝐴.
49
Example: Simplex Method cont’d
1
𝑅 →𝑅2
Note that this 9 2
transformation was
based on holding 𝑦 = 0
and increasing 𝑥 as
much as possible so
that the resulting point
would be possible
50
Example: Simplex Method cont’d
Variables with columns of this type (but not the objective function)
are called basic variables. The columns for variables 𝑦 and 𝑠2 do
not have this special form and these columns correspond to
nonbasic variables.
51
Example: Simplex Method cont’d
The pivot entry (or pivot) is the entry in both the pivot
2
column and pivot row, in this case the value (circled) in R1,
3
C2 of matrix 𝐵.
53
Example: Simplex Method cont’d
④ Pivoting
3
𝑅 →𝑅1
2 1
This means that the co-op should plant 3750 acres of corn (𝑥) and
2250 acres of soybeans (𝑦) for a maximum profit of $1,260,000. And
this planting scheme results in 0 unused acres of land (𝑠1 ), 0 gallons
of fertiliser/herbicide (𝑠2 ), and 187.5 unused hours of labor (𝑠3 ) 55
Try This 04
Maximise 𝑍 = 5𝑥1 + 4𝑥2 subject to
𝑥1 + 𝑥2 ≤ 20
2𝑥1 + 𝑥2 ≤ 35
−3𝑥1 + 𝑥2 ≤ 12
𝑥1 , 𝑥2 ≥ 0
56
The Simplex Method: Tasks and
Procedure
The simplex method involves a series of decisions
and operations using matrices. It involves three
major tasks
58
Example: Simplex Method Tasks cont’d
Task 𝐵: Determine necessary operations and implementing
those operations to reach a solution
The most –ve entry in the last row is −4, so the pivot
column is in C1. The smallest quotient is 5, so R2 is the
pivot row. Thus, the pivot entry is R2, C1 (circled in 𝐴)
3
−𝑅2 +𝑅1 →𝑅1
4𝑅2 +𝑅3 →𝑅3 2
The pivot column is in C2, and the smallest quotient is in R1. The
new pivot entry is circled, and it is in R1, C1. Then, using row
operations, to make the pivot entry ‘1’, and the all other entries in
the pivot column, C2, to ‘0’.
2
𝑅 →𝑅1 2 1 2 1
3 1 1 3
−
3 2 1 1 3
−
3 2
− 𝑅1 +𝑅2 →𝑅2
2 1 2
𝑅1 +𝑅3 →𝑅3 0 −
3 3
4
2 5
0 3 3
22
61
Example: Simplex Method Tasks cont’d
2 1
1 3
−
3 2
1 2
0 −
3 3
4
2 5
0 3 3
22
62
Simplex Method: Multiple Solutions
A linear programming problem can have multiple solutions
when the optimal value for the objective function occurs at
two adjacent corners of the feasible region. Consider the
following:
Maximise 𝑓 = 2𝑥 + 𝑦
1
subject to 𝑥 + 𝑦 ≤ 16
2
𝑥 + 𝑦 ≤ 24
𝑥, 𝑦 ≥ 0
63
Simplex Method: Multiple Solutions
cont’d
64
Simplex Method: Multiple Solutions
cont’d
When this occurs, we can use the column with the zero
indicator as our pivot column and often obtain a new
solution that has the same value for the objective function.
66
Simplex Method: No Solution
It is also possible for a linear programming problem
to have an unbounded solution (and thus, no
maximum value for 𝑓)
Example:
Maximise 𝑓 = 2𝑥1 + 𝑥2 + 3𝑥3
subject to 𝑥1 − 3𝑥2 + 𝑥3 ≤ 3
𝑥1 − 6𝑥2 + 2𝑥3 ≤ 6
67
Simplex Method: No Solution cont’d
1
2
−3
3 ÷ −3 = −1
−2𝑅1 +𝑅2 →𝑅2
3𝑅1 +𝑅3 →𝑅3 0÷0=0
The most –ve value in the last row is 𝑥2 , −10, so that is the
pivot column. But there are no +ve coefficients – so what does
this means??
69
Simplex Method: No Solution cont’d
3 ÷ −3 = −1
−2𝑅1 +𝑅2 →𝑅2
3𝑅1 +𝑅3 →𝑅3 0÷0=0
If, after the pivot column has been found, there are no
positive coefficients in that column, no maximum
solution exists.
71
Inequalities and Linear Programming
• Graph and solve
systems of linear
inequalities in two
variables