Linear Programming PP
Linear Programming PP
Solution
3x – 1 < 2x + 5
3x – 2x < 5 + 1
x<6
The line x = 6 is the boundary
between the wanted region (the
solution set) and the unwanted
region.
Since the points on the line x = 6
are not included in the solution set
the line x = 6, is broken.
6 y
5
4
3
x<6
2
1
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
x=6
Example 2
5 - 3y ≥ 10 – 4y
- 3y +4y ≥ 10 – 5
y≥ 5
In the figure below, y = 5 is the
boundary line between the
required region and the unwanted
region.
The line is continuous because it is
part of the required line.
The solution set is the unshaded
region.
y
y≥5
(6,6)
6
5
4
3
2
1
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
Example 3
Determine the solution set for
the inequality 2x + 3 y 6.
Solution
Replacing the inequality
with an equality =, we obtain
the equation 2x + 3y = 6, whose
graph is:
y
8
7
6
5
4
3
2
1
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6 2x + 3y = 6
-7
-8
Picking the origin as a
test point, we find
2(0) + 3(0) 6, or 0 6,
which is false.
Thus, the solution set
is:
y
8
7
6
5
4
3 2x + 3 y 6
2
1 (0, 0)
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6 2x + 3y = 6
-7
-8
Example 4
Graph x – 3y > 0.
Solution
Replacing the inequality >
with an equality =, we obtain
the equation x – 3y = 0, whose
graph is:
y
8
7
6
5
4 x – 3y = 0
3
2
1
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8
Graph x – 3y > 0.
Solution
We use a dashed line to
indicate the line itself will not
be part of the solution, since
we are dealing with a strict
inequality >.
y
8
7
6
5
4 x – 3y = 0
3
2
1
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8
Since the origin lies on
the line, we cannot use
the origin as a testing
point: (0, 0)
y
8
7
6
5
4 x – 3y = 0
3
2
1 (0, 0)
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8
Graph x – 3y > 0.
Solution
Picking instead (3, 0) as a test
point, we find (3) – 2(0) > 0, or 3 >
0, which is true.
4 x 3 y 12
x y 0
Solution
2
1
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
y
(6,6)
6
5
4
x–y0
3
x–y=0
2
1
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
y
(6,6)
6
5
4x + 3y 12
4x + 3y = 12 4
x–y0
3 x–y=0
2 P( 127 , 127 )
1
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
Bounded and Unbounded Sets
-6 -5 -4 -3 -2 -1 1 2 3 4 5 6
x
-1
-2
-3
-4
-5
-6
Example 6
Illustrate the solution set of the
following systems of inequations
on a Cartesian diagram.
Where x, y ∈ R; y ≥ 5x + 1,
y ≥ 5 – 2x , y ≤ 7.
Solution
Consider the first inequation, y ≥ 5x + 1.
y = 5x + 1 is a boundary line.
That is;
when x = 0, y=1
when x = 1, y=6
Points on and above the continuous line
through (1,6) and (0,1) satisfy the inequation
y ≥ 5x + 1
Similarly, points on and above the
continuous line through (0,5) and (2,1)
satisfy the inequation y ≥ 5 – 2x .
Points on and below the continuous line
y = 7 satisfy the inequation y ≤ 7.
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8 y = 5 – 2x
Example 7
Determine the solution set for the
following system of inequations.
Solution
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
y=0 -3
-4
-5
-6
-7 2x y 8 0
-8
x y60 2x y 8 0 x0 y0
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
y=0 -3
-4
-5
-6
-7 2x y 8 0
-8
Exercise 2
1. Illustrate the solution set of each of the systems
of inequations on Cartesian diagrams and state
whether it is a bounded or unbounded set .
a) x – y < 3, x + y < 3
b) x + y ≥ 0, x – y ≥ 0
c) 3y + 4x ≥ 12, 2y + 5x ≥ 10
d) 7y + 12x ≤ 84, 12y +5x ≤ 60, x ≥ 0, y ≥ 0
e) x ≥ 0, y ≥ 0, x ≤ ½, 3y + 2x ≤ 6
f) x ≥ 0, y ≤ 4, x ≤ 3, x ≤ y
Mathematical models
Example 8
1. Wamunyima has K5 000 to spend. He needs to
buy two types of biscuits, A and B. Type A costs
K500 per packet and type B costs K800 per
packet. He intends to buy not more than three
packets of type A and at least one of type B. Let
the number of packets of type A be x and the
number of packets of type B be y.
Write down the inequations arising from the
given information.
Solution
x packets at K500 each = K500x
y packets at K800 each = K800y
Chair y 475 1 1
To make x desks and y chairs will require x +y hours
in workshop Ι and 2x + y hours in workshop ΙΙ.
Considering the time each worshop is available we
see that ,
✦ x + y ≤ 4 ………. (1)
✦ 2x + y ≤ 6 ……….(2)
The number of desks or chairs made can obviously
not be negative, and so
✦x ≥ 0 ……………(3 )
✦ y≥0 ……………(4)
The profit realized from selling x desks and y chairs
is (profit per desk) x (number of desks) + (profit per
chair ) x ( number of chairs), i.e.
✦ 550x + 475y ….. (5)
Maximize P x 1.2 y
Subject to 2 x y 180
x 3 y 300
x 0
y 0
Linear Programming Problem
P x 1.2 y
which is the objective function to be
maximized.
Type-A Type-B Time Available
Profit/Unit $1.00 $1.20
Machine I 2 min 1 min 180 min
Machine II 1 min 3 min 300 min
2 x y 180
Type-A Type-B Time Available
Profit/Unit $1.00 $1.20
Machine I 2 min 1 min 180 min
Machine II 1 min 3 min 300 min
x 3y
and must not exceed 300 minutes.
Thus, we have the inequality
x 3 y 300
Type-A Type-B Time Available
Profit/Unit $1.00 $1.20
Machine I 2 min 1 min 180 min
Machine II 1 min 3 min 300 min
x 0
y 0
Example 1: A Production Problem
Solution
In short, we want to maximize the objective
function
P x 1.2 y
C 6x 8 y
and is the objective function to be minimized.
Brand-A Brand-B Minimum Requirement
Cost/Pill 6¢ 8¢
Iron 40 mg 10 mg 2400 mg
Vitamin B1 10 mg 15 mg 2100 mg
Vitamin B2 5mg 15 mg 1500 mg
40 x 10 y 2400
Brand-A Brand-B Minimum Requirement
Cost/Pill 6¢ 8¢
Iron 40 mg 10 mg 2400 mg
Vitamin B1 10 mg 15 mg 2100 mg
Vitamin B2 5mg 15 mg 1500 mg
10 x 15 y 2100
Brand-A Brand-B Minimum Requirement
Cost/Pill 6¢ 8¢
Iron 40 mg 10 mg 2400 mg
Vitamin B1 10 mg 15 mg 2100 mg
Vitamin B2 5mg 15 mg 1500 mg
5 x 15 y 1500
Solution
In short, we want to minimize the objective
function
C 6x 8 y
subject to the system of inequalities
40 x 10 y 2400
10 x 15 y 2100
5x 15 y 1500
x 0
y 0
Graphical Solutions of
Linear Programming
Problems
Feasible Solution Set and Optimal Solution
Linear Programming
If a linear programming problem has a solution,
then it must occur at a vertex, or corner point, of
the feasible set S associated with the problem.
200
(0, 180)
100
(90, 0)
100 200 300 x
2 x y 180
2 x y 180
✦Graph the solution for the
inequality
x 3 y 300
considering only positive values
for x and y:
y
300
200
(0, 100)
100
(300, 0)
100 200 300 x
x 3 y 300 x 3 y 300
✦Graph the intersection of the
solutions to the inequalities,
yielding the feasible set S.
300
200
100
S
100 200 300 x
x 3 y 300
2 x y 180
Next, find the vertices of the
feasible set S.
✦The vertices are A(0, 0),
B(90, 0), C(48, 84), and
D(0, 100).
y
300
200
2 x y 180
Now, find the values of P at the vertices
and tabulate them:
Vertex P = x + 1.2 y
A(0, 0) 0
B(90, 0) 90
C(48, 84) 148.8
D(0, 100) 120
A Production Problem
300 40 x 10 y 2400
(0, 240)
200
100
(60, 0)
100 200 300 x
We first graph the feasible set S for
the problem.
✦Graph the solution for the
inequality
10 x 15 y 2100
considering only positive values
for x and y:
y
300
10 x 15 y 2100 200
10 x 15 y 2100
(0, 140)
100
(210, 0)
300
200 5 x 15 y 1500
5 x 15 y 1500 100
(0, 100)
(300, 0)
10 x 15 y 2100
300
S
200
5 x 15 y 1500 100
10 x 15 y 2100
300
A(0, 240)
S
200
5 x 15 y 1500 100
B(30, 120)
C(120, 60)
D(300, 0)
100 200 300 x
Now, find the values of C at the vertices
and tabulate them:
Vertex C = 6x + 8 y
A(0, 240) 1920
B(30, 120) 1140
C(120, 60) 1200
D(300, 0) 1800
Finally, identify the vertex with the lowest
value for C:
✦ We can see that C is minimized at the
vertex B(30, 120) and has a value of 1140.
Vertex C = 6x + 8y
A(0, 240) 1920
B(30, 120) 1140
C(120, 60) 1200
D(300, 0) 1800
Example 2: A Nutrition Problem
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8
2x +y =8
To find the maximum value of x + 3y, we must
consider the set of parallel lines corresponding
to the equation x + 3y = k where k ∈ R.
From the graph, x + 3y has a maximum value
of 15 at the vertex point (0,5).
The minimum value is 0 at the vertex point
(0,0).
The search line helps us to find the maximum
and minimum points systematically.
y
8
x+y=5 7
6
A(0, 5) 5
x +3y= k 4
3
2 B (3, 2)
1 D (0, 0)
C (4, 0)
-9 -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 9 x
-1
-2
-3
-4
-5
-6
-7
-8
2x +y =8
Exercise
1. Find the maximum and minimum values in
each of the following where x, y ∈ Z: