Computational Maths
Computational Maths
B (3,4)
A(7,0)
C=43
5x + 7y = 43
C= 28 5x + 7y = 35
C=21 5x+ 7y = 28
C=14 5x + 7y = 21
5x + 7y = 14
C=0
5x + 7y =7
5x + 7y = 0
FIGURE 9.6
position in the family of lines 5x + 7y =C: It is the line farthest from the origin that
of C: 43.
still passes through the set of feasible solutions. It yields the largest value
(Remember, we are not interested in what happens outside the region OABC.) Thus the
largest value of the function f(x, y) = 5x + 7y subject to the condition that the point
at the
(x, y) must belong to the region 0ABC is 43; clearly this maximum value occurs
point B (3,4).
Consider the polygonal region 0ABC in Figure 9.6. This shaded region has the
property that the line segment PO joining any two points P and in the region lies
FIGURE 9.7
9,2 LINEAR PROGRAMMING MODELS 275
entirely within the region. Such aset of points in a plane is called a convex set, For
xample,tthe shaded regions in Figure 9,7 are convex, while those in Figure 9,8 are not.
nce the convex set in Figure 9.6 is bounded by the polygon OABC, it is calleda
olygonal convex set.
FIGURE 9.8
Let us return to Example 9.5. Observe that the corner points of the region OABC
are O(0,0),A (7,0), B(3,4), and C(0,2). We evaluate the function f(o,y) = 5x + 7y
at these corner points:
f(O) =f(0,0) = S 0+7-0 =0
f(A) =f(7,0) = 5 7+7-0= 35
fB) =f3,4) =53+ 7-4= 43
f(C) =f(0,2) =5 0+72 = 14
Since 43 is the largest of these four values, the given function takes on the maximum
value 43 for x=3 andy = 4,subject to the given constraints.Consequently (3,4) is
the optimal solution of the problem.
EXAMPLE 9.6 Minimize the function g(x, y) = 13x- 15y subject to the constraints
in Example 9.5.
SOLUTION Since the set of feasible solutions remains the same as that in the above
example, let us now evaluate g(x,y) at the corner points O, 4, B, and C:
g(0) =g(0,0) =13 -0-15 -0 =0
gA) =g(7, 0) = 13 7-15 0 =91
gB) =g(3,4) =133-15 4=-21
g(C) =g(0,2) =13 -0-15 2 =-30
Thus the function g has minimum value -30 at x = 0,y =2.
Models
276
CHAPTER9 Linear Programming
(0, 240) C
X+y= 30 B (180, 120)
23x +
31y= 720
ol0.0) (300,0) A
FIGURE 9.9
Incidentally, you should consider Example 9.7 if the company wants to make a
profit of $150on every black and white set and $225 on every color set.
EXAMPLE 9.8 Afarmer grows tomatoes and beans on his 125-acre farm. It costs
S20to grow an acre of tomatoes and S1O to grow an acre of beans; however, he has
only $1500 to meet the expenses. It takes 18 man-hours to grow an acre of tomatoes
and 6 man-hours to grow an acre of beans. He has at most 1080 man-hours for the
whole job. If the profits from an acre of tomatoes and an acre of beans are $40 and
$25, respectively, how many acresof each should he grow to maximize his total profit?
What is the maximum possible profit?
SOLUTION Assume that the farmer should grow x acres of tomatoes andy acres of
beans to maximize his profits. Clearly,
X+y< 125 constraint on available land
3x +y= 180
(0, 125) D
C (25, 100)
B(30, 90)
(0,0)
(60,0) A
x+y =125
2* +y = 150
FIGURE 9.10
points O, A, B, C,
These conditions define the shaded region in Figure 9.10 with corner
and D. Let us now evaluate the function p(x, y) at these points:
p(0) =p(0,0) = 40 0+ 250= $0
pA) =p(60,0) = 40 60 + 25 -0 = $2400
pB) =p(30,90) =40- 30 + 25 90 = $3450
p(C) =P(25, 100) = 40 - 25 + 25 100 = $3500
pD) =p(0, 125) =40-0 + 25 125 = $3125
The farmer should thus grow 25 acres of tomatoes and 100 acres of beans to yield a
maximum profit of $3500.
EXERCISES 9.2
1. Find the corner points of the regions defined by the
a) x>0, y>0 following inequalities
b) x>0, y>0
2x+y6
c) x>0, y>0 d) x>0,y>0
x+y<S x<6
X-y<3 y<6
2x-yK4 2x + 3y<24
2. Maximize the functionf= 1lx + 7y subject to the constraints in Exercise 1
3. Minimize the function g=13x- 5y subject to the constraints in
Exer cise 1.
4. Minimize each function f subject to the given contraints.
a) f=5x1 +4x, b) f= 5xË + 7x2
X1>0, X)>0 x0, X,>0
X tx >13
x} t 2x;> 20 X} +4x2>20
2x1 tx>20 2x1 + 3*,>30
8x1 + 5x,>80
5. A dietitian in a hospital wishes to design a meal that includes food I
and food II.
The meal should contain at least 48 units of protein and 20 units of iron.
One
unit of food Icontains 8 units of protein and 4 units of iron, while 1 unit of
food II contains 6 units of protein and 2 units of iron. One unit of
food I
40¢ and lunit of food II costs 25 ¢. Let x denote the units of food I and ycosts
denote the units of food II.
a) Find the linear constraints.
b) Find the objective function.
c) Graph the solution set of the inequalities in part a.
d) Find the corner points of the region obtained in part c.
e) Evaluate the objective function at the corner points.
f) How many units of food Iand food II should the meal include to meet the
required nutritional demnands at a minimum cost?
g) What is the minimum cost?
6. A certain company makes two types of sweaters: type A and type B. It
costs $9
to make a type A Sweater and $3 to make a type B sweater. The
make at most 300 sweaters and spend at most $1800 a day. The number companyofcan
Sweaters of type B cannot exceed the number of sweaters of type A by more than
100. The company makes a profit of $5 for every sweater of type
A and $3 for
every sweater of type B.
a) Find the linear constraints.
b) Find the corner points of the region defined by the
c) What is the objective function? constraints in part a.
d) How many sweaters of each type should the
a maximum profit? company make a day to yield
e) What is the maximum
profit?
7. Paul wants to invest part of his $4000 in
a business
savings bank that pays 6% interest annually. Since and deposit the rest at a
riskier, he does not want to invest more than three investing in the business is
times what he would deposit
in the bank, He wants to make a profit of
15% from his business investment. How
should he divide his money to make a
return? maximum total income? What is the total
9.2 LINEAR PROGRAMMING MODELS 20
)TION Letx denote the number of units of lunch andy the number of units
of dinner. The problenm now is to minimize the cost function f(*, y) 25x +40y
subject to the constraints
x>0,)>0
12r + 8y> 64 carbohydrate constraint
6r t6p 42 protein constraint
6r + 10 >54 vitamin C constraint
constraints can be rewritten as
The last three
xty>7
}r+ Sp >27
Vou shouldverify that Figure 9|l is the graph of these inequalities. We evaluate the
obtain
cOst function at the corner points and
fA) =f(9,0)= 259+ 40 0= $2.25
fB) =f(4,3) = 25 -4 +40 3 =$2.20
f(C) =f(2,5)= 25 2 + 40 5 = $2.50
fD) =f(0,8)= 25 0+40-8 = $3.20
D (0, 8)
C(2, 5)
B(4,3)
3x +
5y =27
X+y =7 A (9,0)
3x + 2y = 16
FIGURE 9.11
minimum nutritional
Clearly, 4 units of lunch and 3 units of dinner will meet the
requirements for each child; the minimum cost will be $2.20.
zH0 CAPTER OLinear Programming MMooets
EXERCISES 9.2
1 Find the corner paints of the tegiots efined by the following inequalities
a) 2D, y>0 b) x>0,y>0
S3
Zr+ 3y <24
2. Maximize the function f 1lx + 7y subject to the constraints in Exercise 1
1 Minimire the function g=|3r Sy subject to the constraints in Exercse
4. Minimize cach function f subject to the given conttaints.
alSx4r b) f5x, +7x
20, x0 X20, kg20
K4230
2x+>20
Sr5Y,280
S. Adietitian in a hospital wishes to desugn a meal that incudes food Land food I
The meal ahould contain at least 48 units of protein and 20 units of iton. One
food ll contains 6units of proten nd 2 unitsof ton. One unit of foot Lcosts
404 and unit of food Il costs 25¢ Letx denote the units of food [anda
denote the units of food li.
d) How mnywcaters of each type should the company make a day to yield
profit
Paul want
savis hunk that vM iiterrtanialu h
tskiet, he does ot wänt to itvest more than three times what he would depasit
11 Solve Example 9.8 if the farmer has a profit of $50 from an acre of tomatoes
and $20 from an acre of beans,
1) Aretired carpenter makes hi-fi cabinets and bookcases to supplement his social
security income. He can work, at most, 36 hours a week. A hi-fi cabinet requires
4hours of hand work, including 2 hours on saws and 1 hour on drill and sander:
a bookcase requires 3 hours of hand work, including 1 hour on saws and1hour
on drill and sander. Since the carpenter's son is also using the tools, the carpenter
cannot use his saws for more than 16 hours a week, and his drill and sander forfor
more than 11 hours a week. If he sells a hi-fi cabinet for $70 and a bookcase
What is
$40, how many of each kind should he make to maximize his revenue?
his maximum possible income from sales?
objective function and the linear constraints in the problems we discussed in the
The
two unknowns. Butmany real-world problems
preceding section contained only Unfortunately, the graphical method is not very
involve more than two variables.
variables, it is very time-consuming to find
nelptul in those cases: if there are threesolutions and then to evaluate the objective
feasible
he corner points of the set of the optimal solution. If the problem
Tunctions at these points in order to identify it is impossible to find the feasible solutions
three unknowns. then
contains more than
282 CHAPTER 9 Linear Programming Models
By taking the coefficients and the constant terms, we can form the matrix
slack variables
S S
1 1 1 0 0 7
3 1 1 15
-3 0 1 0
indica tors
This matrix is the augmented matrix of the system. It is called the initial simplex
tableau. The entries of its last row, except the last entry 0, are called indicators. In our
remaining discussion we shall, for convenience, omit the parentheses of all tableaux.
9,3 THE SIMPLEX ALGORITHM 283
E9.11
EXAMPLE Set up tthe initial
simplex
functionJ , ) = 170x + 225y subject to thetableau for Example 9,7:
constraints maximize the
x>0, y>0
xty<300
2x +3y <720
sOLUTION By introducing two slack
inequalities can be written
as variables S,>0 and s,>0,the last two
xty +s, = 300
2x + 3y t s = 720
Ve now have the system of equations
xt yt si =300
2x+ 3y + S2 = 720
-170x - 225y +f=0
-5-3 0 0 0
The snallest negative indicator of this tableau is -5; the column that contains the
smallest negative indicator is called the pivotal column. Divide each positive number
of the pivotal column into the corresponding entry of the last coluimn. In this case,
we have 7÷1=7and 15 3 =5. The row that yields the smallest of these quotients,
namely 5, is called the pivotal row. The number that belongs to the pivotal column
and pivotal row has a central position in the simplex method; accordingly, it is called
the pivot. In our above tableau, the pivot is 3. It is circled in Table 9.1.
TABLE 9,1
yS1 S
1 1 1 0 7
1 0 0 1 15 pivotal row
-5 -30 0 1 0
-pivotal column
284 CHAPTER 9 Linear Programming Models
TABLE 9.2
1 1 1 0 300
2 (3) 0 1 0 720 pivotal row
-170 -225 0 0 1 0
-pivotal column
Thus far, we have illustrated the first two of the following steps in the simplex
method:
STEP 1 Set up the initial simplex tableau.
STEP 2 Locate the pivot p of the tableau.
STEP 3 If the pivot p is 1, then go to Step 4; otherwise, divide the pivotal row
by p to give 1 in the pivotal position.
STEP 4 Convert the remaining entries of the pivotal column into zeros by using
the elementary row operations discussed in Section 8.2.
STEP 5 Repeat Steps 2-4 until a tableau with nonnegative indicators is obtained.
This is the final tableau we need in this algorithm; it is called the terminal simplex
tableau.
STEP 6 The optimal solution and the maximum value of the objective function
can be read from this terminal tableau.
Let us now illustrate Steps 3-6 for the problem in Example 9.10. The initial tableau,
shown in Table 9.1, is
Sj
1 1 1 7
1 1 0 15 pivotal row
-5 -3 0 0 1
-pivotal column
To change the pivot 3 to 1, we divide the pivotal row by 3. This yields the tableau
S
1 1 0 7
00
-5 -3 0 0 1 |0
9.3 THE SIMPLEX ALGORITHM 285
the other two entries of the pivotal
To make column zero, we add -1
and 5 times the
rowtothe first row second row to the third row. The times the second
now becomes above tableau
S1 S2
Sincethe second indicator is still negative, we look for the pivot of this tableau, which
is clearly $. Therefore we divide the first row by to get 1in the pivot; use this new
pivot I to transform the other entries of the pivotal column into zeros. You should
check that the resulting tableau is
S1 S) f
1 0 3
1 0 4
0 0 2 1 29 maximum value
This is clearly the terminal tableau.
How do we now read the optimal solution and the maximum alue of the function
irom this tableau? This tableau is the augmented matrix of the system
=3
1
X =4
2s t S tf= 29
This can be rewritten as
1 1
x=4t ,s; ,52
3 1
y=3-,5; z'2
f= 29-2s, - S2
the maximum value 29 when s, =0 and
It is clear from the last equation that fattains
s, =0=s, we have x=4 and y=3.
S =0. (Remember, S, >0 and s, >0.)When
value 29 when x = 4 and y =3. You should
Thus the function f takes on the maximum
verify this by graphing.