Linear Mathematical Models UG 5th Sem Open Course
Linear Mathematical Models UG 5th Sem Open Course
MODELS
(Open Course)
(other than B Sc students)
Fifth semester
School of Distance Education
Calicut University
UNIVERSITY OF CALICUT
V SEMESTER
OPEN COURSE
Prepared by : Sreehari T
Asst professor in mathematics
SDE, Calicut university
DISCLAIMER
“The author(s) shall be solely responsible for
DISCLAIMER
the content and views expressed in this book”
"The author(s) shall be solely responsible
Contents
1 Linear Functions 1
Linear Functions
1
Figure 1.1: xy- plane
The x-axis and y-axis divide the plane into four parts, or
quadrants. For example, quadrant I includes all those points whose
x - and y-coordinates are both positive. The quadrants are
numbered as shown in Figure 1.1 . The points on the axes
themselves belong to no quadrant. The set of points
corresponding to the ordered pairs of an equation is the graph of the
equation. The x - and y-values of the points where the graph of an
equation crosses the axes are called the x-intercept and y-intercept,
respectively. See Figure 1.2
2
Figure 1.2: x-intercepts and y-intercepts
Change in y ∆y y2 − y1
m= = =
Change in x ∆x x2 − x1
where x1 ̸= x2 .
Example 1.1.1. Find the slope of the line passing through the points
(x1 , y1 ) = (−3, 5) and (x2 , y2 ) = (2, −4). Given in Figure 1.2.
3
Figure 1.3: A line passing through (−3, 5) and (2, −4)
x2 − x1 = 2 − (−3) = 5
∆y = y2 − y1
= −4 − 5
= −9
∆y −9
Hence m = ∆x
= 5
.
Example 1.1.2. Find the slope of the line through each pair of
4
points.
∆y 5−6 −1 1
m= = = =
∆x −4 − 7 −11 11
−3 − (−3) 0
m= = =0
−2 − 5 −7
3 − (−4) 7
m= =
2−2 0
5
Definition 1.1.2. (Slope-Intercept Form) If a line has slope m and
y-intercept b, then the equation of the line in slope-intercept form
is
y=mx+b.
3
y = x−3
4
2
y =− x+2
7
6
given by
y − y1 = m (x − x1 )
y − y1 = m (x − x1 )
5 5
y − (−7) = (x − 3) (y1 = −7, m = , x1 = 3)
4 4
5
y + 7 = (x − 3)
4
4y + 28 = 5(x − 3) ( Multiply both sides by 4)
4y + 28 = 5x − 15 ( Distribute. )
4y = 5x − 43 ( Combine constants. )
5 43
y = x− ( Divide both sides by 4.)
4 4
Remark:
Definition 1.1.4. (Parallel Lines) Two lines are parallel if and only
if they have the same slope, or if they are both vertical.
Example 1.1.5. Find the equation of the line that passes through
the point (3, 5) and is parallel to the line 2x + 5y = 4
7
The slope of 2x + 5y = 4 can be found by writing the equation in
slope-intercept form.
2x + 5y = 4
2 4
y =− x+
5 5
This result shows that the slope is −2/5. Since the lines are par-
allel, −2/5 is also the slope of the line whose equation we want.
This line passes through (3, 5). Substituting m = −2/5, x1 = 3,
and y1 = 5 into the point-slope form gives
y − y1 = m (x − x1 )
2 2 6
y − 5 = − (x − 3) = − x +
5 5 5
2 6
y =− x+ +5
5 5
2 31
y =− x+ .
5 5
y = 5x − 4
The slope is 5. Since the lines are perpendicular, if line L has slope
8
m, then
5m = −1
1
m=−
5
Now substitute m = −1/5, x1 = 3, and y1 = 7 into the point-slope
form.
1
y − 7 = − (x − 3)
5
1 3
y−7=− x+
5 5
1 3 5
y =− x+ +7·
5 5 5
1 38
y =− x+
5 5
9
Figure 1.4: Points of graph y = x + 1
10
Exercise
(a) parallel to 2x + 3y = 6,
(b) perpendicular to 5x − 2y = −1.
(a) y = x + 1
(b) 7x + 5y = 1
x y
(c) 3
+ 4
=1
(d) x − 2y = −1
(e) −9x + 11y = 5
11
1.2 Linear Functions and Applications
y = f (x) = mx + b
Example 1.2.1. Let g(x) = −4x + 5. Find g(3), g(0), g(−2), and
g(b).
Solution: To find g(3), substitute 3 for x.
Similarly,
g(0) = −4(0) + 5 = 0 + 5 = 5
g(−2) = −4(−2) + 5 = 8 + 5 = 13
and
g(b) = −4b + 5.
12
has studied the supply and demand for watermelons. He has
noticed that the demand increases as the price decreases. He has
determined that the quantity (in thousands) demanded weekly, q,
and the price (in dollars) per watermelon, p, are related by the
linear function
13
by the linear function
14
(b) to graph the supply function, p = 0.75q, shown in blue in
Figure 1.6.
212 − 32 9
m= =
100 − 0 5
15
The F -intercept of the graph is 32 , so by the slope-intercept
form, the equation of the line is
9
F = C + 32
5
(a) f (2)
(b) f (4)
(c) f (−3)
(d) f (−1)
(e) g(1.5)
(f) g(2.5)
(g) g(−1/2)
(h) g(−3/4)
(i) f (t)
(j) g (k 2 )
2. Let the supply and demand functions for butter pecan ice
cream be given by
2 2
p = S(q) = q and p = D(q) = 100 − q
5 5
16
where p is the price in dollars and q is the number of
10-gallon tubs.
Definition 1.2.2. The line which the sum of the squares of the
vertical distances from the data points to the line is as small as
possible. Such a line is called the least squares line.
For the least squares line, the sum of the distances we are to
minimize, d21 + d22 + · · · + d2n , is written as
X
d21 + d22 + · · · + d2n = d2 .
17
To calculate the distances, we let (x1 , y1 ) , (x2 , y2 ) , · · · , (xn , yn ) be
the actual data points and we let the least squares line be Y =
mx + b. We use Y in the equation instead of y to distinguish the
predicted values (Y ) from the y-value of the given data points. The
predicted value of Y at x1 is Y1 = mx1 + b, and the distance, d1 ,
between the actual y-value y1 and the predicted value Y1 is
d1 = |Y1 − y1 | = |mx1 + b − y1 |
Likewise,
d2 = |Y2 − y2 | = |mx2 + b − y2 | ,
and
dn = |Yn − yn | = |mxn + b − yn | .
Σd2
= (mx1 + b − y1 )2
+ (mx2 + b − y2 )2
+ · · · + (mxn + b − yn )2
X
= (mx + b − y)2
18
Definition 1.2.3. The least squares line Y = mx + b that gives the
best fit to the data points (x1 , y1 ) , (x2 , y2 ) , . . . , (xn , yn ) has slope
m and y-intercept b given by
Example 1.2.4. Calculate the least squares line for the accidental
death rate data.
Solution: To find the least squares line for the given data, we
first find the required sums. To reduce the size of the numbers, we
19
rescale the year data. Let x represent the years since 1900 , so that,
for example, x = 10 corresponds to the year 1910 . Let y represent
the death rate. We then calculate the values in the xy, x2 , and y 2
columns and find their totals. (The column headed y 2 will be used
later.) Note that the number of data points is n = 10.
Putting the column totals into the formula for the slope m, we
get
n(Σxy) − (Σx)(Σy)
m=
n (Σx2 ) − (Σx)2
10(28, 135) − (550)(595.5)
=
10(38, 500) − (550)2
281, 350 − 327, 525
=
385, 000 − 302, 500
−46, 175
=
82, 500
= −0.5596970 ≈ −0.560.
The significance of m is that the death rate per 100, 000 people
20
is tending to drop (because of the negative) at a rate of 0.560 per
year.
Now substitute the value of m and the column totals in the
formula for b:
Σy − m(Σx)
b=
n
595.5 − (−0.559697)(550)
=
10
595.5 − (−307.83335)
=
10
903.33335
= = 90.333335 ≈ 90.3
10
Substitute m and b into the least squares line, Y = mx + b; the
least squares line that best fits the 10 data points has equation
Y = −0.560x + 90.3.
PP P
xy) − ( x) ( y)
n(
r=q P P 2 q P 2
n ( x ) − ( x) · n ( y ) − ( y)2
2
P
21
pioneer Karl Pearson (1857-1936). The correlation coefficient r
is between 1 and −1 or is equal to 1 or −1. Values of exactly 1
or −1 indicate that the data points lie exactly on the least squares
line. If r = 1, the least squares line has a positive slope; r =
−1 gives a negative slope. If r = 0, there is no linear correlation
between the data points (but some nonlinear function might provide
an excellent fit for the data). A correlation coefficient of zero may
also indicate that the data fit a horizontal line. To investigate what
is happening, it is always helpful to sketch a scatterplot of the data.
Some scatterplots that correspond to these values of r are shown in
Figure 1.10 .
22
n(Σxy) − (Σx)(Σy)
r=p p
n (Σx ) − (Σx)2 · n (Σy 2 ) − (Σy)2
2
Exercise
2. The formulas for the least squares line were found by solving
23
the system of equations
X X
nb + x m= y
X X X
x b+ x2 m = xy.
a1 x1 + a2 x2 + · · · + an xn = k,
3x + 10y = 115
a1 x 1 + a2 x 2 + · · · + an x n = k
24
is a sequence of numbers s1 , s2 , . . . , sn such that
a1 s1 + a2 s2 + · · · + an sn = k.
2. The graphs are distinct parallel lines. When this is the case,
the system is inconsistent; that is, there is no solution
common to both equations. See Figure 1.11(b).
3. The graphs are the same line. In this case, the equations are
said to be dependent, since any solution of one
equation is also a solution of the other. There are infinitely
many
solutions. See Figure 1.11(c).
25
Figure 1.11: Types of Solutions for Two Equations in Two
Unknowns
26
The Echelon Method:A systematic approach for solving
systems of equations using the three transformations is called the
echelon method. The goal of the echelon method is to use the
transformations to rewrite the equations of the system until the
system has a triangular form.
For a system of two equations in two variables, for example, the
system should be transformed into the form
x + ay = b
y = c,
where a, b, and c are constants. Then the value for y from the
second equation can be substituted into the first equation to find
x. This is called back substitution. In a similar manner, a system
of three equations in three variables should be transformed into the
form
x + ay + bz = c
y + dz = e,
z = f.
Example 1.2.6. Solve the system of equations from the animal feed
example that began this section:
11x + 4y = 95 (1.5)
27
results to −3 times equation (1.5).
3x + 10y = 115
(11R1 + (−3)R2 → R2 ) 98y = 980 (1.6)
10 115
x+ (10) = Substitute y = 10
3 3
100 115
x+ =
3 3
115 100
x= −
3 3
15
= =5
3
Exercise
28
Use the echelon method to solve each system of two equations in
two unknowns. Check your answers.
1.
x+y =5
2x − 2y = 2
2.
3x − 2y = −3
5x − y = 2
3.
3x + 2y = −6
5x − 2y = 10
4.
6x − 2y = −4
3x + 4y = 8
When we use the echelon method, since the variables are in the
same order in each equation, we really need to keep track of just the
29
coefficients and the constants. For example, consider the following
system of three equations in three unknowns.
2x + y − z = 2
x + 3y + 2z = 1
x+y+z =2
30
Row Operations
For any augmented matrix of a system of equations, the following
operations produce the augmented matrix of an equivalent system:
1. interchanging any two rows; 2. multiplying the elements of a
row by any nonzero real number; 3. adding a nonzero multiple of
the elements of one row to the corresponding elements of a nonzero
multiple of some other row.
For example,By the first row operation, interchanging two rows,
the matrix
0 1 2 3
−2 −6 −10 −12
2 1 −2 −5
−2 −6 −10 −12
becomes 0 1 2 3
2 1 −2 −5
Here we interchanging the rows R1 and R2 .
The Gauss-Jordan method is an extension of the echelon method
of solving systems. Before the Gauss-Jordan method can be used,
the system must be in proper form: the terms with variables should
be on the left and the constants on the right in each equation, with
the variables in the same order in each equation.
The system is then written as an augmented matrix. Using row
operations, the goal is to transform the matrix so that it has zeros
above and below a diagonal of 1’s on the left of the vertical bar.
Once this is accomplished, the final solution can be read directly
from the last matrix. The following example illustrates the use of
the Gauss-Jordan method to solve a system of equations.
31
Example 1.2.7. Solve the system
3x − 4y = 1
5x + 2y = 19
32
The final transformation is to change the −4/3 in row 1 to 0 .
" #
4 1 0 3
R2 + R1 → R1
3 0 1 2
x=3
y = 2,
so we can read the solution directly from the last column of the
final matrix. Check that (3, 2) is the solution by substitution in the
equations of the original matrix.
33
previous row (except possibly for any rows of all zero at the bottom
of the matrix), and the first nonzero entry in each row is the only
nonzero entry in its column.
7. Multiply each row by the reciprocal of the nonzero element in
that row.
Exercise
0 0 1 1
1 0 0 4
(d). 0 1 0 2
0 0 1 3
34
1.2.5 Addition and Subtraction of Matrices
5 −1
0.5 8 0.9
(b) 0 5.1 −3 is a 3 × 3 matrix.
−4 0 5
h i
(c) 1 6 5 −2 5 is a 1 × 5 matrix.
3
−5
(d)
is a 4 × 1 matrix.
0
2
35
Definition 1.2.6. Matrix Equality
Two matrices are equal if they are the same size and if each pair of
corresponding elements is equal.
By this definition,
" # " #
2 1 1 2
and
3 −5 −5 3
are not equal (even though they contain the same elements and are
the same size) since the corresponding elements differ.
36
matrix X − Y in which each element is found by subtracting the
corresponding elements of X and Y .
Exercise
−1 1 0
37
2 4 −1 " #
2 4 −1
(f). 3 7 5 =
3 7 5
0 0 0
" #
3 4
Example 1.2.11. Calculate −5A, where A = .
0 −1
Solution :
" # " #
3 4 −15 −20
(−5) =
0 −1 0 5
.
38
Example 1.2.12. Find the product AB of matrices
" # 1
2 3 −1
A= and B= 8
4 2 2
6
Solution
Since A is 2 × 3 and B is 3 × 1, we can find the product matrix AB.
Step 1 Multiply the elements of the first row of A and the
corresponding elements of the column of B.
" # 1
2 3 −1
8 2 · 1 + 3 · 8 + (−1) · 6 = 20
4 2 2
6
39
Note that the product of a 2 × 3 matrix and a 3 × 1 matrix is a 2 × 1
matrix.
40
conditions is " #
1 0
I=
0 1
To check that I, as defined above, is really the 2 × 2 identity, let
" #
a b
A=
c d
A × A−1 = A−1 × A = I.
41
" #
1 3
Example 1.2.13. Verify that the matrices A = and B =
2 5
" #
−5 3
are inverses of each other.
2 −1
Solution :
Multiply A times B as in the previous section:
" #" # " #
1 3 −5 3 1 0
AB = =
2 5 2 −1 0 1
Similarly,
" #" # " #
−5 3 1 3 1 0
BA = =
2 −1 2 5 0 1
3 0 0
Solution :
42
Write the augmented matrix [A | I].
1 0 1 1 0 0
[A | I] = 2 −2 −1 0 1 0
3 0 0 0 0 1
Begin by selecting the row operation that produces a zero for the
first element in row 2.
1 0 1 1 0 0
− 2R1 + R2 → R2
0 −2 −3 −2 1 0
− 3R1 + R3 → R3
0 0 −3 −3 0 1
Get 0 ’s in the third column. Now get 1’s down the main diagonal.
1
R1 → R1 1
3 1 0 0 0 0 3
1
R2 → R2 0 0 1 − 2 − 12
1 1
2
2
1 1 0 − 13
− R3 → R3
3
Get 1’s down the diagonal. From the last transformation, the
43
desired inverse is
1
0 0 3
A−1 = − 12 − 21 1
.
2
1 0 − 13
AX = B
A−1 (AX) = A−1 B Multiply both sides by A−1 .
A−1 A X = A−1 B
Associative property
IX = A−1 B Multiplicative inverse property
X = A−1 B. Identity property
44
matrix of coefficients and A−1 exists, X is the matrix of variables,
and B is the matrix of constants, first find A−1 . Then X = A−1 B.
To solve the system, first find A−1 . Do this by using row operations
on matrix [A | I] to get
" #
5 3
1 0 13 13
1 2
.
0 1 − 13 13
45
Next, find the product A−1 B.
" #" # " #
5 3
4 2
A−1 B = 13
1
13
2
= .
− 13 13
2 0
Since X = A−1 B,
" # " #
x 2
X= =
y 0
Exercise
0 1 0 −1 −2 2
2. Find"the inverse,
# if it exists, for each matrix.
1 −1
(a).
2 0
46
" #
1 1
(b).
2 3
" #
3 −1
(c).
−5 2
" #
−3 −8
(d).
1 3
" #
1 −3
(e).
−2 6
" #
5 10
(f).
−3 −6
1 0 0
(g). 0 −1 0
1 0 1
1 3 0
(h). 0 2 −1
1 0 2
47
matrix of the economy.
48
In Example 1.2.16, suppose the production matrix is
60
X = 52
48
49
Module 2
ax + by ≤ c
ax + by < c,
ax + by ≥ c,
or ax + by > c,
50
Graph the linear inequality 2x − 3y ≤ 12.
Solution : Because of the “ = ” portion of ≤, the points of the line
2x − 3y = 12 satisfy the linear inequality 2x − 3y ≤ 12 and are
part of its graph. As in Chapter 1, find the intercepts by first letting
x = 0 and then letting y = 0; use these points to get the graph of
2x − 3y = 12 shown in Figure 2.1 .
2x − 3y ≤ 12
−3y ≤ −2x + 12 Subtract 2x
y ≥ 32 x − 4 Multiply by − 31
51
number reverses the direction of the inequality symbol.)
2
y < x−4
3
52
Figure 2.3: Graph of 2x − 3y = 12
1. Draw the graph of the boundary line. Make the line solid if
the inequality involves ≤ or ≥; make the line dashed if the
inequality involves ⟨ or ⟩.
(a) Solve the inequality for y; shade the region above the
line if the inequality is of the form y > or y ≥; shade
the region below the line if the inequality is of the form
y < or y ≤.
(b) Choose any point not on the line as a test point. Shade
the half-plane that includes the test point if the test point
53
satisfies the original inequality; otherwise, shade the
half-plane on the other side of the boundary line.
54
the boundary lines are not in the solution, the boundary lines are
dashed.
2x − 5y ≤ 10
x + 2y ≤ 8
x≥0
y≥0
Solution :
55
On the same axes, graph each inequality by graphing the boundary
and choosing the appropriate half-plane. Then find the feasible
region by locating the overlap of all the half-planes. This feasible
region is shaded in Figure 2.5 . The inequalities x ≥ 0 and y ≥ 0
restrict the feasible region to the first quadrant.
Exercise
56
(h). 2x − y > 2
(i). x + 3y ≥ −2
(k). 2x + 3y ≤ 6
(b). 4x − y < 6
3x + y < 9
(c). x + 3y ≤ 6
2x + 4y ≥ 7
(d). −x − y < 5
2x − y < 4
(e). x + y ≤ 7
x − y ≤ −4
x + y ≤ −5
(f). 3x − 2y ≥ 6
4x + y ≥ 0
y ≤ −6
57
2.2 Solving Linear Programming Problems
Graphically
2x + y ≤ 4
−x + 2y ≤ 4
x≥0
y≥0
2x + y = 4
−x + 2y = 4
58
Every point in the feasible region satisfies all the constraints;
however, we want to find those points that produce the maximum
possible value of the objective function. To see how to find this
maximum value, change the graph of Figure 11 by adding lines
that represent the objective function z = 3x + 4y for various sam-
ple values of z. By choosing the values 0,5 , 10 , and 15 for z, the
objective function becomes (in turn)
59
z will be obtained from a line parallel to the others and between the
lines representing the objective function when z = 10 and z = 15.
The value of z will be as large as possible and all constraints will
be satisfied if this line just touches the feasible region. This occurs
at point A. We find that A has coordinates (4/5, 12/5). (See the
review in the margin.) The value of z at this point is
4 12 60
z = 3x + 4y = 3 +4 = = 12.
5 5 5
60
corner points of the feasible region.
Example 2.2.2. Sketch the feasible region for the following set of
constraints, and then find the maximum and minimum values of the
objective function z = x + 10y.
x + 4y ≥ 12
x − 2y ≤ 0
2y − x ≤ 6
x≤6
Solution :
The graph in below figure shows that the feasible region is bounded.
Use the corner points from the graph to find the maximum and
minimum values of the objective function.
61
The minimum value of z = x + 10y is 24 at the corner point
(4, 2). The maximum value is 66 at (6, 6).
Exercise
62
(a). Maximize z =5x + 2y
subject to: 4x − y ≤ 16
2x + y ≥ 11
x≥3
y ≤8.
(b). Maximize subject to:
z = 10x + 8y
2x + 3y ≤ 100
5x + 4y ≤ 200
x ≥ 10
0 ≤ y ≤ 20
z = 10x + 10y
5x + 8y ≥ 200
25x − 10y ≥ 250
x + y ≤ 150
x≥0
y ≥ 0.
63
(d). Maximize subject to:
z = 4x + 5y
10x − 5y ≤ 100
20x + 10y ≥ 150
x + 12
y≥1
x≥0
y≥0
64
Rental Information
Canoes Kayaks Total
Number of Boats x y ≤ 65
Cost of Each $600 $750 ≤ $45, 000
Revenue $25 $30
The constraints, imposed by the number of boats and the cost,
correspond to the rows in the table as follows.
x + y ≤ 65
600x + 750y ≤ 45, 000
4x + 5y ≤ 300.
65
programming problem is as follows:
66
The objective function, which represents revenue, is maximized
when x = 25 and y = 40. He should buy 25 canoes and 40 kayaks
for a maximum revenue of $1825 a day.
67
Let x represent the required amount of food A and y the amount of
food B. Use the given information to prepare the following table
68
Figure 2.9: Graph of feasible region
69
economical solution, even though it exceeds the requirement for
using at least 2 units of food B. Notice from Figure 22 that the
four lines representing the four constraints do not meet at a single
point, so any solution in the feasible region will have to exceed at
least one constraint. The rescue shelter manager might use this
information to negotiate a better deal with the distributor of food B
by making a guarantee to use at least 4 units of food B per serving
in the future.
70
Module 3
71
problems such as the following:
a1 x1 + a2 x2 + a3 x3 + · · · + an xn ≤ b,
a1 x 1 + a2 x 2 + · · · + an x n ≤ b with b ≥ 0.
72
10 is converted into an equation by adding the slack variable s1 to
get
x1 + x2 + s1 = 10, where s1 ≥ 0.
with
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0
73
Maximize z = 3x1 + 2x2 + x3
subject to: 2x1 + x2 + x3 + s1 = 150
2x1 + 2x2 + 8x3 + s2 = 200
2x1 + 3x2 + x3 +s3 = 320
with
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, s1 ≥ 0, s2 ≥ 0, s3 ≥ 0
−3x1 − 2x2 − x3 + z = 0.
74
This matrix is called the initial simplex tableau. The numbers
in the bottom row, which are from the objective function, are called
indicators(except for the 1 and 0 at the far right).
75
slack variable, giving the equation
x1 + x2 + x3 + s1 = 100.
Here s1 represents the amount of the farmer’s 100 acres that will
not be used ( s1 may be 0 or any value up to 100 ). The constraint
pertaining to the production cost can be expressed as
76
The linear programming problem can now be stated as follows:
Exercise
(a) x1 + 2x2 ≤ 7
(b) 6x1 + 2x2 ≤ 50
(c) 1.5x1 + 2.1x2 + 1.3x3 ≤ 12
(d) 0.5x1 + 1.1x2 + 1.4x3 ≤ 21
77
(ii) name them, and
(iii) use slack variables to convert each constraint into a linear
equation.
(a)
Maximize z = 5x1 + 7x2
subject to: 2x1 + 3x2 + ≤ 15
4x1 + 5x2 + ≤ 35
1x1 + 6x2 + ≤ 20
with
x1 ≥ 0, x2 ≥ 0
.
(b)
Maximize z = 1.2x1 + 3.5x2
subject to: 2.4x1 + 1.5x2 + ≤ 15
4x1 + 5x2 + ≤ 35
1x1 + 6x2 + ≤ 20
with
x1 ≥ 0, x2 ≥ 0
78
the coefficients of the variables from the linear equation to write an
augmented matrix. Finally, we used the pivot to go from one corner
point to another corner point in the region of feasible
solutions. Now we are ready to put all this together and produce
an optimum value for the objective function. To see how this is
done, let us complete Example 3.1.2 from Section 3.1. In this
example, we were trying to determine, under certain constraints,
the number of acres of potatoes (x1 ), corn (x2 ), and cabbage (x3 )
the farmer should plant in order to optimize his profit (z). In the
previous section, we set up the following simplex tableau.
x1 x2
x3 s 1 s 2 z
1 11 1 0 0 100
10 47 0 1 0 500
−120 −40 −60 0 0 1 0
79
The coefficient of x1 is the largest, which indicates that he will
make the most profit per acre planting potatoes. It makes sense,
then, to first try increasing x1 to improve the profit. To determine
how much we can increase x1 , we look at the constraint equations:
x1 + x2 + x3 + s1 = 100
10x1 + 4x2 + 7x3 + s2 = 500.
Because there are two equations, only two of the five variables can
be basic (and nonzero). If x1 is nonzero in the solution, then x1
will be a basic variable. Therefore, x2 and x3 will stay at 0 , and
the equations simplify to
x1 + s1 = 100
10x1 + s2 = 500
Since s1 and s2 are both nonnegative, the first equation implies that
x1 cannot exceed 100 , and the second implies that 10x1 cannot
exceed 500 , so x1 cannot exceed 500/10, or 50 . To satisfy both of
these conditions, x1 cannot exceed 50 , the smaller of 50 and 100 .
If we let x1 take the value of 50 , then x1 = 50, x2 = 0, x3 = 0, and
s2 = 0. Since x1 + s1 = 100, then s1 = 100 − x1 = 100 − 50 = 50.
Therefore, s1 is still a basic variable, while s2 is no longer a basic
variable, having been replaced in the set of basic variables by x1 .
This solution gives a profit of
80
or $6000, when 50 acres of potatoes are planted. The same result
could have been found from the initial simplex tableau given below.
Recall that the indicators are the numbers in the bottom row in the
columns labeled with real or slack variables. To use the tableau,
we select the variable with the most negative indicator. (If no
indicator is negative, then the value of the objective function cannot
be improved.) In this example, the variable with the most negative
indicator is x1 . Basic variables
x1 x2
x3 s 1 s 2 z
1 1
1 1 0 0 100
10 4
7 0 1 0 500
−120 −40 −60 0 0 1 0
Notice that we do not form a quotient for the bottom row. Of the
two quotients found, the smallest is 50 (from the second row). This
81
indicates that x1 cannot exceed 500/10 = 50, so 10 is the pivot.
Using 10 as the pivot, perform the appropriate row operations to
get zeros in the rest of the column. We will use the method from
Section 3.1 (calculating by hand) to perform the pivoting.
x1 = 50, x2 = 0, x3 = 0, s1 = 50, s2 = 0,
with z = 6000, the same as the result found above. None of the
indicators in the final simplex tableau are negative, which means
that the value of z cannot be improved beyond $6000. To see
why, recall that the last row gives the coefficients of the objective
function so that or
82
operations, repeating the process until no negative indicators
remain.
Once there are no longer any negative numbers in the final row,
create a 1 in the columns corresponding to the basic variables and
z. In the previous example, this is accomplished by dividing rows
1 and 2 by 10 .
x1 = 50, x2 = 0, x3 = 0, s1 = 50, s2 = 0,
83
standard maximum linear programming problem by the simplex
method.
Simplex Method For Standard Maximization Problems
84
9. Read the solution from the final tableau.
Figure 3.1:
85
of x and y as variables.) The constraints were as follows:
x1 + x2 ≤ 65 Number
4x1 + 5x2 ≤ 300 Cost
x1 ≥ 0, x2 ≥ 0
x1 + x2 + s1 = 65
4x1 + 5x2 + s2 = 300
x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0.
86
The solution from this tableau is x1 = 0 and x2 = 60, with z =
1800. (From now on, we will list only the original variables when
giving the solution.) This corresponds to the corner point (0, 60)
in Figure 3.1 . Verify that if we instead pivoted on the column with
the indicator of −25, we would arrive at the corner point (65, 0),
where the objective function has the value 1625, which is smaller
than its value at (0, 60).
Because of the indicator −1, the value of z might be improved.
We compare quotients and choose the 1 in row 1, column 1, as pivot
to get the final tableau.
87
Here the solution is x1 = 25 and x2 = 40, with z = 1825. This
solution, which corresponds to the corner point (25, 40) in Figure
3.1 , is the same as the solution found earlier.
Each simplex tableau above gave a solution corresponding to
one of the corner points of the feasible region. As shown in Figure
3.2 , the first solution corresponded to the origin, with z = 0. By
choosing the appropriate pivot, we moved systematically to a new
corner point, (0, 60), which improved the value of z to 1800 . The
next tableau took us to (25, 40), producing the optimum value of
z = 1825. There was no reason to test the last corner point, (65, 0),
since the optimum value z was found before that point was reached.
Figure 3.2:
Exercise
88
programming problem is given. Use the simplex method to
solve each problem.
(a)
x1 x2
x3 s 1 s 2 z
1 4
4 1 0 0 16
2 1
5 0 1 0 20
−3 −1 −2 0 0 1 0
(b)
x1 x2
x3 s 1 s 2 z
3 3
2 1 0 0 18
2 3 0 1 0 16
2
−4 −6 −2 0 0 1 0
(c)
x1 x2 x3 s 1 s 2 s 3 z
2 1 2 1 0 0 0 25
4 3 2 0 1 0 0 40
3 1 6 0 0 1 0 60
−4 −2 −3 0 0 0 1 0
(a)
Maximize z = 3x1 + 5x2
subject to: 4x1 + x2 ≤ 25
2x1 + 3x2 ≤ 15
with x1 ≥ 0, x2 ≥ 0
89
(b)
Maximize z = 5x1 + 2x2
subject to: 2x1 + 4x2 ≤ 15
3x1 + x2 ≤ 10
with x1 ≥ 0, x2 ≥ 0
(c)
Maximize z = 10x1 + 12x2
subject to: 4x1 + 2x2 ≤ 20
5x1 + x2 ≤ 50
2x1 + 2x2 ≤ 24
with x1 ≥ 0, x2 ≥ 0
a1 y1 + a2 y2 + · · · + an yn ≥ b, with b ≥ 0
90
rather than maximized, and all constraints must have ≥ instead of
≤.
We use y1 , y2 , etc., for the variables and w for the objective
function as a reminder that these are minimizing problems. Thus,
w = c1 y1 + c2 y2 + · · · + cn yn .
Duality: An interesting connection exists between standard
maximization and standard minimization problems: any solution
of a standard maximization problem produces the solution of an
associated standard minimization problem, and vice versa. Each
of these associated problems is called the dual of the other. One
advantage of duals is that standard minimization problems can be
solved by the simplex method discussed in the first two sections of
this chapter. Let us explain the idea of a dual with an example.
91
Now look at the following matrix, which we obtain from the one
above by interchanging rows and columns.
The rows of the first matrix (for the minimization problem) are
the columns of the second matrix.
The entries in this second matrix could be used to write the
following maximization problem in standard form (again ignoring
the fact that the numbers in the last row are not negative):
92
Figure 3.3:
Figure 3.4:
93
of feasible solutions for the maximization problem produced by
exchanging rows and columns. The solutions of the two problems
are given below.
The two feasible regions in Figure 3.3 and Figure 3.4 are
different and the corner points are different, but the values of the
objective functions are equal—both are 48. An even closer
connection between the two problems is shown by using the
simplex method to solve this maximization problem.
94
Notice that the solution to the minimization problem is found
in the bottom row and slack variable columns of the final simplex
tableau for the maximization problem. This result suggests that
standard minimization problems can be solved by forming the dual
standard maximization problem, solving it by the simplex method,
and then reading the solution for the minimization problem from
the bottom row of the final simplex tableau.
95
problem, let us find the duals of some typical linear programming
problems. The process of exchanging the rows and columns of
a matrix, which is used to find the dual, is called transposing the
matrix, and each of the two matrices is the transpose of the other.
The transpose of an m × n matrix A, written AT , is an n × m
matrix.
−3 7 −1
Solution : Both matrix A and its transpose are 3 × 3 matrices.
Write the rows of matrix A as the columns of the transpose.
2 6 −3
AT = −1 8 7
5 0 −1
96
problem.
1 1 10
2 1 8
2 5 0
Form the transpose of the matrix as follows:
1 2 2
1 1 5
10 8 0
97
problem takes on a minimum value if and only if the objective
function z of the corresponding dual maximization problem takes
on a maximum value. The maximum value of z equals the minimum
value of w.
Example 3.3.4.
3 2 0
6 3 0
98
Solve this standard maximization problem using the simplex method.
Start by introducing slack variables to give the system
x1 + 2x2 + s1 = 3
3x1 + x2 +s2 = 2
−6x1 − 3x2 + z = 0
x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0
The first tableau for this system is given below, with the pivot as
indicated.
x1 x2 s 1 s 2 z
3
− 15 0 7
0 1 5 5
1 0 − 15 2
5
0 1
5
3 9 27
0 0 5 5
1 5
Since a 1 has been created in the z column, the last row of this
final tableau gives the solution to the minimization problem. The
minimum value of w = 3y1 + 2y2 , subject to the given constraints,
is 27/5 and occurs when y1 = 3/5 and y2 = 9/5. The minimum
value of w, 27/5, is the same as the maximum value of z.
99
Let us summarize the steps in solving a standard minimization
linear programming problem by the method of duals.
Solving a Standard Minimum Problem with Duals
Exercise
(a)
1 2 3
3 2 1
1 10 0
(b) " #
3 4 −2 0 1
2 0 11 5 7
100
(c)
4 5 −3 15
7 14 20 −8
5 0 −2 23
(d)
1 11 15
0 10 −6
4 12 −2
1 −1 13
2 25 −1
(a)
Maximize z = 4x1 + 3x2 + 2x3
subject to: x1 + x2 + x3 ≤ 5
x1 + x2 ≤ 4
2x1 + x2 + 3x3 ≤ 15
with x1 ≥ 0, x2 ≥ 0, x3 ≥ 0.
(b)
Maximize z = 2x1 + 7x2 + 4x3
subject to: 4x1 + 2x2 + x3 ≤ 26
x1 + 7x2 + 8x3 ≤ 33
with x1 ≥ 0, x2 ≥ 0, x3 ≥ 0.
101
(c)
x1 + x2 + x3 ≥ 60
x1 + x2 + x3 − s3 = 60
102
for some nonnegative variable s3 . (Remember that s1 and s2 are
the slack variables in the problem.)
The new variable, s3 , is called a surplus variable. The value of
this variable represents the excess number of acres (over 60 ) that
may be planted. Since the total number of acres planted is to be no
more than 100 but at least 60, the value of s3 can vary from 0 to 40
. We must now solve the system of equations
x1 + x2 + x3 +s1 =100
10x1 + 4x2 + 7x3 + s2 =500
x1 + x2 + x3 − s3 =60
−120x1 − 40x2 − 60x3 +z =0
103
but the sum is supposed to be at least 60. All the variables in any
feasible solution must be nonnegative if the solution is to
correspond to a point in the feasible region.
When a negative value of a variable appears in the solution, row
operations are used to transform the matrix until a solution is found
in which all variables are nonnegative. Here the problem is the −1
in a column corresponding to a basic variable. If the number in that
row of the right-hand column were 0 , we could simply multiply
this row by −1 to remove the negative from the column. But we
cannot do this with a positive number in the righthand column.
Instead, we find the positive entry that is farthest to the left in the
third row (the row containing the −1 ); namely, the 1 in row 3 ,
column 1 . We will pivot using this column. (Actually, any column
with a positive entry in row 3 will do; we chose the column farthest
to the left arbitrarily.) Use quotients as before to find the pivot,
which is the 10 in row 2, column 1. Then use row operations to get
the following tableau.
104
The value of s3 is now 0 and the solution is feasible. We now
continue with the simplex method until an optimal solution is found.
We check for negative indicators, but since
We use this rule for simplicity. There are, however, more
complicated methods for choosing the pivot element that require,
on average, fewer pivots to find the solution. there are none, we
have merely to create a 1 in each column corresponding to a basic
variable or z.
The solution is
130 1 50 2
x1 = = 43 , x2 = = 16 , x3 = 0
3 3 3 3
17, 600
z= = 5866.67
3
For maximum profit with this new constraint, the farmer should
plant 43 31 acres of potatoes, 16 23 acres of corn, and no cabbage.
The profit will be $5866.67, less than the $6000 profit if the farmer
105
were to plant only 50 acres of potatoes. Because of the additional
constraint that at least 60 acres must be planted, the profit is
reduced. Notice that s1 = 40. This is the slack variable for the
constraint that no more than 100 acres are available. It indicates
that 40 of the 100 available acres are still unused. In summary, the
following steps are involved in solving the nonstandard problems
in
Solving a Nonstandard Problem
106
9. Once a feasible solution has been found, continue to use
the simplex method until the optimal solution is found this
section.
z = −w = −3y1 − 2y2 .
107
objective function.
y1 + 3y2 + s1 = 6
2y1 + y2 − s2 = 3
3y1 + 2y2 +z = 0
108
, row 2 by 2 , and row 3 by 2 to find the final solution: y1 = 3/2 and
y2 = 0. Since z = −w = −9/2, the minimum value is w = 9/2.
y1 + y2 ≤ 28
y3 + y4 ≤ 8
109
Since dealership A needs 20 cars and dealership B needs 16 cars,
y1 + y3 ≥ 20 and y2 + y4 ≥ 16
110
necessary quotients, we find that the 1 is also the pivot, leading to
the following tableau.
111
We now have the feasible solution
y1 = 12, y2 = 16, y3 = 8, y4 = 0,
s1 = 0, s2 = 0, s3 = 0, s4 = 0.
with w = 10, 640. But there are still negative indicators in the
bottom row, so we can keep going. After two more tableaus, we
find that
y1 = 20, y2 = 8, y3 = 0, y4 = 8,
Exercise
(a)
2x1 + 3x2 ≤ 8
x1 + 4x2 ≥ 7
(b)
3x1 + 7x2 ≤ 9
4x1 + 5x2 ≥ 11
112
(c)
2x1 + x2 + 2x3 ≤ 50
x1 + 3x2 + x3 ≥ 35
x1 + 2x2 ≥ 15
(d)
2x1 + x3 ≤ 40
x1 + x2 ≥ 18
x1 + x3 ≥ 20
(a)
Minimize w = 3y1 + 4y2 + 5y3
subject to: y1 + 2y2 + 3y3 ≥ 9
y2 + 2y3 ≥ 8
2y1 + y2 + 2y3 ≥ 6
with y1 ≥ 0, y2 ≥ 0, y3 ≥ 0.
(b)
Minimize w = 8y1 + 3y2 + y3
subject to: 7y1 + 6y2 + 8y3 ≥ 18
4y1 + 5y2 + 10y3 ≥ 20
with y1 ≥ 0, y2 ≥ 0, y3 ≥ 0.
(c)
113