10pstudyhub.weebly.com10pstudyhub.weebly.com/uploads/2/4/1/1/24110831/...th… · web viewthe...
TRANSCRIPT
Linear Programming and the
Simplex Method
By: Ron Aldad
“Money makes the world go round.” Throughout history, there has always
been a race for money and profit. As humans, we strive for the best, and we believe
that the best is where the most money is. The conclusion that mathematicians came
to was that we could minimize or maximize our profits using equations, inequalities,
and constraints. This process of using these tools to organize a problem into a clear
and accurate graph is called linear programming. We are able to transform word
problems and real world situations into these graphs. In economics, this is directly
applicable to find the amount of revenue needed to make the maximum profits.
Linear programming and the simplex method are invaluable instruments that
changed the investment and economic worlds.
During World War II, Leonid Kantorovich was the mathematician that
created linear programming. He won the Nobel Prize in Economics in 1975, and he
was the only winner to ever win this award from the USSR. He used linear
programming to decrease the expenses to the army and increase the loss of the
enemy. Through inequalities, he was able to devise graphs that indicated the
optimal revenue that fit his needs. Subsequently, George Dantzig created the
simplex method that transformed linear programming into tables, rather than
graphs, and made the problems easier and faster to solve.
The fundamental idea behind linear programming and the simplex method is
to take a real world dilemma in the form of a word problem and create an equation
along with a series of constraints. In linear programming, the simpler of the two, one
2
takes the problem given to him/her and begins with the equation. Then, the
equation is put aside until the conclusion of the problem. The more important pieces
to a linear programming problem are the constraints. Usually written as
inequalities, these constraints are what help the mathematician or economist create
the graph. The graph or the inequalities depicts the points of intersection of the
inequalities, and these points tell the economist what values for (x,y) he/she would
need to plug into the original equation to find the minimal or maximum amount of
profit available. Linear programming is a graph format of answering these types of
problem and is more easily explicable through examples.
Ex. 1) “You need to buy some filing cabinets. You know that Cabinet X
costs $10 per unit, requires six square feet of floor space, and holds eight
cubic feet of files. Cabinet Y costs $20 per unit, requires eight square feet of
floor space, and holds twelve cubic feet of files. You have been given $140 for
this purchase, though you don't have to spend that much. The office has room
for no more than 72 square feet of cabinets. How many of which model
should you buy, in order to maximize storage volume” (Stapel)?
The first step is to find the two variables needed to make the equations
and inequalities.
X = the number of X cabinets bought
Y= the number of Y cabinets bought
3
Then, create the equation. In this case, it would be for the maximum
storage volume, as shown below.
V=8 x+12 y
The next step is to create constraints in the form of inequalities that follow
the problem. When doing this problem, one is able to realize that the “x” and “y”
values cannot be negative, so two constraints are:
x≥ 0
y ≥0
There are two other constraints needed for this problem: one for the cost,
and one for the space.
Cost: 10 x+20 y ≤ 140
Space: 6 x+8 y≤ 72
In order to graph these inequalities, it is easier to make them into standard
“y=” form.
Cost: y ≤−12
x+7
Space: y ≤−34
x+9
4
When graphing all four of these inequalities, one would receive a solution set
similar to one below.
(http://www.purplemath.com/modules/ineqsolv/linprog10.gif)
The final step in solving this linear programming problem is to take the three
corner points, (8, 3), (0, 7), and (12, 0), and plug them each into the original
equation that we developed.
V=8x+12 y
1) V=8 (8 )+12 (3 )
V=100
2) V=8 (0 )+12 (7 )
V=84
3) V=8 (12 )+12 (0 )
5
V=96
The final answer is that you would need to buy eight of the X cabinets
and three of the Y cabinets in order to receive the maximum storage volume
of one hundred. Example two is a simple sample problem that I created to
relate to investment business.
Ex. 2) There are two stocks that an investor wants to buy: Google and
Apple. For every Apple stock he buys, he wants to buy at least two Google
stocks. He has $400,000 to invest in Apple and $500,000 to invest in Google. If
each Apple stock at the time of purchase is $2.00 and each Google stock at the
time of purchase is $3.00, how much money should be invested in each stock
to maximize the revenue.
Just like in example one, the first step is to come up with variables and
the equation. In this case, they would be:
X= the number of Apple stocks purchased
Y= the number of Google stocks purchased
Revenue( R )=2 x+3 y
The following step is to devise the constraints. Since the investor
cannot buy a negative amount of the stock, we know that:
X ≥ 0
6
Y ≥ 0
In addition, since the investor wants at least two Google stocks for
every Apple stock, we know that:
X ≥ 2 y
Or
Y ≤ 12
x
We also know the restrictions of the amount of money he has to spend.
X ≤ 400,000
Y ≤500,000
The final step is to graph all of the inequalities we just created and plug
the corner points into the equation.
7
There are four corner intersecting points on this graph: (0,0), (0,5), (4,4), and
(4,5). When plugging each into the equation created for the optimization of
this problem, the point (4,5) would yield to the largest profit. This proves that
in order to gain the most profit, one must put in the most money, in this case,
$400,000 to Google and $500,000 to Apple. Stocks do have many other
components to them other than the money being put into them, in addition to
the fact that their prices fluctuate continuously, so this is simply a basic and
fundamental example to build on further.
Linear programming problems become more complex when there are
more than two variables. In this case, there must be a series of extra steps to
transform the inequalities to only two variables. Example three guides
through these steps.
0 1 2 3 4 5 60
1
2
3
4
5
6 Stock Investment
Y=(1/2)x
X=0
Y=0
X=4
Y=5
Amount of money for Google stock(in hundred thousands)
Am
oun
t of
mon
ey fo
r A
pp
le s
tock
(in
hu
nd
red
th
ousa
nd
s)
8
Ex. 3) “A building supply has two locations in town. The office receives
orders from two customers, each requiring 3/4-inch plywood. Customer A needs
fifty sheets and Customer B needs seventy sheets. The warehouse on the east side of
town has eighty sheets in stock; the west-side warehouse has forty-five sheets in
stock. Delivery costs per sheet are as follows: $0.50 from the eastern warehouse to
Customer A, $0.60 from the eastern warehouse to Customer B, $0.40 from the
western warehouse to Customer A, and $0.55 from the western warehouse to
Customer B. Find the shipping arrangement which minimizes costs”(Stapel).
In this case, the variables are the east warehouse for Customer A, the west
warehouse for customer A, the east warehouse for Customer B, and the west
warehouse for customer B. These can be named Ae , Aw , Be , and Bw. To put these into
applicable equations, since Customer A needs fifty sheets and Customer B needs
seventy sheets, one would then receive:
Ae+ Aw=50
Be+Bw=70
These could then be solved for only one variable in order to make them
utilizable in the following inequalities.
Aw=50−Ae
Bw=70−B e
Because of the fact that the eastern warehouse can only ship up to eighty
sheets and will not ship less then zero, one would receive the following constraint.
0≤ A e+B e ≤80
9
Similarly, one would receive the following constraint due to the facts that the
western warehouse ships more than zero sheets, but less than forty-five.
0≤ Aw+Bw≤ 45
The equation one would then create for this problem would be for the cost of
the shipment. The variable “C” represents the cost of shipment.
C=0.5 Ae+0.6 Be+0.4 Aw+0.55 Bw
Now that all of the necessary equations and inequalities created, one would
then take the inequality for the western warehouse and convert it into having the
same variables as the eastern warehouse. Using the equations on the top of this
page could do this. The first inequality does not change.
0≤ Aw+Bw≤ 45
0 ≤ (50−A e)+( 70−Be ) ≤ 45
This simplifies to:
0 ≤ 120−A e−Be ≤ 45
One could then multiply by negative one to receive:
0≥−120+ Ae+B e ≥−45
After adding one hundred and twenty to each side, the final two inequalities
are:
120≥ A e+Be ≥75
10
0≤ A e+B e ≤80
These two inequalities can finally combine into one.
75 ≤ A e+Be ≤80
One could also simplify the equation created for the cost of the shipment
through the same process.
C=0.5 Ae+0.6 Be+0.4 Aw+0.55 Bw
C=0.5 Ae+0.6 Be+0.4 (50−A e)+0.55 (70−Be )
C=0.1 Ae+0.05 B e+58.50
Due to the needs of the two customers, two other constraints that are
necessary are:
0≤ A e ≤ 50
0 ≤ Be ≤70
To make these inequalities easier to graph, and because there are only two
variables, one could rename the variables.
x=A e
y=Be
In total, the inequalities one would need to graph and to minimize the
shipment cost are:
11
x≥ 0
y ≥0
y ≥−x+75
y ≤−x+80
x≤ 50
y ≤70
The final graph should depict the solution set as shown on the following
page.
12
The corner points are (5, 70), (10, 70), (50, 30), and (50, 25). Once plugged
into the equation, the point (5,70) would yield to the minimum cost. This means that
five sheets went to Customer A from the eastern warehouse, seventy sheets went to
Customer B from the eastern warehouse, forty five sheets went to Customer A from
the western warehouse, and zero sheets went to customer B from the western
warehouse.
Linear programming is a convenient way to solve these problems when there
are few variables, but it can get complex when there are more than two, as shown in
example three. In business and economics, there are usually more than two
variables in the problems faced. For this reason, George Dantzig devised the simplex
method. Through the use of this algorithm, he was able to solve problems like
example three and ones even more complex faster and more easily.
The simplex method is the algorithm that computer programs, like excel, use
to find the optimal amount of each variable to come to the highest profit. Millions of
investors and researchers use this process in order to determine how much money
to put in each stock they are interested in and how to maximize their income. The
“solver” utensil in excel uses this algorithmic process in seconds to come up with the
answers the investors are looking for, but it is crucial to also understand how to do
this by hand in order to truly understand what is happening with the money being
invested.
The basic key to the simplex method is the tableau that organizes all of the
data and allows the algorithm to work accurately. Similar to the linear
13
programming method of solving these types of problems, the first three steps are to
find the variables, construct an equation, and create the constraints, or inequalities,
for the problem.
After these steps, the process becomes different. One would then need to
create the equations from the inequalities to be able to sync with the tableau. In
order to do this, one would need to add a “slack variable” to the “less than” side of
the inequalities. This variable represents any extra content that is left over to allow
the inequality to be transformed into an equation. Next, one would take the starting
equation that was made for this problem, not the constraints, and equal it to zero,
while keeping the income or profit variable positive. This allows the equation to be
easily applied to the tableau. The following step would be to create the tableau and
use the algorithm to come with a final answer. Examples four and five go through
the steps described above and the following.
Ex. 3) “Maximize: P = 3x + 4y subject to”(Some simplex method examples):
x+ y≤ 4
2 x+ y ≤ 5
x≥ 0
y ≥0
Since we already know the variables, equation, and inequalities, we are able
to skip to converting the inequalities to equations. For the first two inequities, we,
14
using the slack variables “s” and “v.” We do not need to add slack variable to the last
two constraints because they are not used in the tableau. This yields to:
x+ y+s=4
2 x+ y+v=5
The equation used in the tableau would be equal to zero.
−3 x−4 y+P=0
The next step is to create the tableau. We do this by placing the variables on
the left sides of the equations on the top and the numbers on the right sides of the
equations on the right side of the tableau. The slack variables and profit variable go
on the right side of the tableau. The tableau would look like this:
X Y S V PS 4V 5P 0
In order to fill in the tableau, we write in how much of each variable we have
in each equation. The filled in tableau would be:
15
X Y S V PS 1 1 1 0 0 4V 2 1 0 1 0 5P -3 -4 0 0 1 0
The most important element of the simplex method algorithm is the pivot
element. This number in the tableau is the crucial piece that we want to equal one.
Using the pivot number, we can have a series of row reductions to reach our goal: to
get every number in the final row to be positive. The way we find this pivot number
is by first finding the pivot column. It is the column with the lowest negative
number; in this case it is the negative four column. Once we find this column, we
need to take the constant, or the number in the farthest right column, and divide it
by the number in the same in the pivot column of that same row.
4 ÷1=4
5 ÷ 1=5
The row with the smaller number becomes the pivot row, and the number
that is in both the pivot column and row is the pivot number. In this case, 1 is the
pivot number. The objective in this step is to make a row reduction to make the
pivot number equal to 1. Coincidentally, the pivot number in this case is already 1;
therefore, there is no work that we need to do to change that. Now that we found the
pivot number, the next step is to get the rest of the pivot column equal to zero. This
is accomplished with a couple of row reduction steps. For the second row,
−1R1+R2→ R2
And for the third row,
4 R1+R3→ R3
16
Doing these processes will give us the following tableau with the pivot
column having two zeros and the pivot number of one. In addition, another rule to
this algorithm is that we must swap the top variable of the pivot column with the
left side variable of the row with the pivot number in it.
We would repeat these steps until all of the numbers in the bottom row are
positive. In this case, after one round, all of the numbers are already positive.
The final step to the simplex method algorithm is to interpret the results. The
variables on the left side of the tableau are equal to the corresponding numbers on
the right side of the tableau, and the other variables that are left over are set equal
to zero.
Y=4
V=1
P=16
X=0
S=0
So, the final answer to this problem is that we would get the maximum profit
of sixteen when:
17
X Y S V PY 1 1 (Pivot number) 1 0 0 4
V 1 0 -1 1 0 1P 1 0 4 0 1 16
X=0
and
Y=4
The “V” variable is the slack variable that indicates that the point does not lie
on the equations that we created from the inequalities, but it does sync with the
inequalities themselves; therefore, we are able to disregard the slack variable in this
case. The slack variable shows us that we went below one of our constraints.
Example five is an example that I created that explains how this relates to the
economic and investment worlds in addition to giving an example of a more
complex problem.
Ex. 5) An investor wants to maximize his profits when buying three stocks:
Facebook, Disney, and Yahoo (A, B, C). Stock A costs $3.00 each and has a $2.00
trading fee; stock B costs $4.00 and has a $2.00 trading fee; and stock C costs $2.00
and has a $3.00 trading fee. He has $1,000 to invest and only wants to spend $900
on trading fees. If stocks A, B, and C come up with a profit of $4, $5, and $6
respectfully, how many of each would give him the largest profit.
Again, the first steps are to identify the variables, come up with an equation,
and create the constraints. In this example, we know that:
X=¿ Number of Stock A bought
18
Y=¿ Number of Stock B bought
Z=¿ Number of Stock C bought
The equation, using the profits coming from each stock, would be:
Maximize: P=4 x+5 y+6 z
The constraints for this problem are:
X , Y ,Z ≥ 0
3 x+4 y+2 z≤ 1000
2 x+2 y+3 z≤ 900
Now, we must make the equation equal to zero and the inequities into
equations using the slack variables.
−4 x−5 y−6 z+P=0
3 x+4 y+2 z+s≤ 1000
2 x+2 y+3 z+v ≤ 900
Then, we construct the tableau.
19
X Y Z S V PS 3 4 2 1 0 0 1000V 2 2 3 0 1 0 900P -4 -4 -6 0 0 1 0
The pivot column would be the Z column because negative six is the lowest
number in the last row. Since 900 ÷ 3=300 and 1000 ÷ 2=500, the second row has the
pivot number, which is the number three. In order to get that number to equal one,
we need to divide every number in that row by three. The tableau would then look
like:
Next, we create row reductions to get the other two numbers in the pivot column
equal to zero.
−2 R2+ R1→ R1
6 R2+R3 →R3
The new tableau, with the Z variable transferred, looks like:
Since there are no negative numbers in the final row after this round, we are done.
The answer to this problem is:
X=0
20
X Y Z S V PS 3 4 2 1 0 0 1000V 2
323
1 0 13
0 300
P -4 -4 -6 0 0 1 0
X Y Z S V PS 5
383
0 1 −23
0 400
Z 23
23
1 0 13
0 300
P 0 0 6 0 2 1 1800
Y=0
Z=300
S=400
P=1800
So, the maximum profit of $1800 is reached when he buys zero of stock A, zero
of Stock B, and three hundred of stock C, but the slack variables show us that the answer
is far less than the maximum for the inequalities.
Linear programming and the simplex method are two highly important tools used
every day in the investment and economic worlds. They both take complex problems
with more than one variable, and transform them into easily solved graphs and tables. As
shown in examples two and five, both of these mathematical apparatuses are directly
applicable to business and investments.
Currently, we have even more complex mathematical algorithms and
processes to solve longer, more challenging problems. One of these, to do further
research into, is the research done at the University of Cambridge on solving semi-
infinite linear programming problems. There are still new, faster ways to solve
everyday problems we face, but without the original ideas of Leonid Kantorovich
and George Dantzig, economics and investment research would not be the same
today.
21
References
Del Grande, J. J., Bisset, W., & Barbeau, E., Jr. (1988). Finite mathematics. Houghton
Mifflin Canada.
Example (part 1): Simplex method. (n.d.). Retrieved December 26, 2013, from
PHPsimplex website:
http://www.phpsimplex.com/en/simplex_method_example.htm
Reeb, J., & Leavengood, S. (n.d.). Using the simplex method to solve linear programming
maximization problems. Retrieved December 26, 2013, from
http://ir.library.oregonstate.edu/xmlui/bitstream/handle/1957/20086/em8720-e.pdf
Solution for LPP graphical feasible region [Image]. (n.d.). Retrieved from
http://image.wistatutor.com/content/feed/u284/img1_0.jpg
Some simplex method examples. (2008, February 27). Retrieved December 26, 2013,
from
http://www.ms.uky.edu/~rwalker/Class%20Work%20Solutions/class%20work
%208%20solutions.pdf
Stapel, E. (n.d.). Linear programming: An example & how to set up word problems.
Retrieved December 26, 2013, from Purplemath website:
http://www.purplemath.com/modules/linprog2.htm
22
Stapel, E. (n.d.). Linear programming: A word problem with four variables. Retrieved
December 26, 2013, from Purplemath website:
http://www.purplemath.com/modules/linprog5.htm
Stapel, E. (n.d.). Linear programming: Introduction. Retrieved December 26, 2013, from
Purplemath website: http://www.purplemath.com/modules/linprog.htm
Stapel, E. (n.d.). Linear programming: More word problems. Retrieved December 26,
2013, from Purplemath website:
http://www.purplemath.com/modules/linprog4.htm
Stapel, E. (n.d.). Linear programming: Word problems. Retrieved December 26, 2013,
from Purplemath website: http://www.purplemath.com/modules/linprog3.htm
Steps in the simplex method [Image]. (n.d.). Retrieved from
http://i.stack.imgur.com/WTm0f.png
Summary of the simplex method [Image]. (n.d.). Retrieved from
https://people.richland.edu/james/ictcm/2006/simplex.png
23