Midterm Review PPT
-
Upload
ogonna-nwabuikwu -
Category
Documents
-
view
51 -
download
0
description
Transcript of Midterm Review PPT
ADM2302 DGD - THURSDAY 7 - 8:30 Midterm Review
1
Agenda
• Forming Linear Programming Problems
• Plotting Lines and Graphing
• Using Graphs to Solve Linear Problems
• Problems you Might Encounter
▫ Product mix, transportation, production, etc.
• Spreadsheets & Sensitivity Analysis
• Practice Midterm (if time permits)
2
A linear problem is any problem which consists of a series of variables
multiplied by a series of coefficients. If variables are multiplied by themselves
or by other variables, the problem becomes non-linear (and is not covered in
this course).
Forming linear problems always involves three steps:
1) Defining the decision variables
2) Creating the objective function
3) Stating the constraints
Forming Linear Programming
Problems
3
Defining the Decision Variables
The first thing to be done is to let the reader know what each variable in your problem
represents. Typically we use x1, x2, etc. to define our problems, but you don’t have to –
in fact, it might be more sensible for you to use letters which make sense with the
problem!
Do not be afraid to define variables if you think you need to. Some models have many,
many variables. Don’t think that you necessarily have “too many variables.” If you start a
problem and finish it and realize that there are variables you haven’t used, you can
simply remove them later!
Sometimes variables are identified by two or more subscripts:
For example:
Let xij represent the amount of ingredient i to put in cake j
(where for i, 1 = flour, 2 = salt, 3 = sugar and for j, 1 = wedding and 2 = birthday)
4
Creating the Objective Function
Typically in this class, you will only deal with two situations: maximizing profit or
minimizing cost.
If you are given information on both cost and revenue, this becomes a maximization
problem (because you are trying to maximize profit, which is revenue minus cost).
Here, it is important to make use of the variables you just defined.
For example:
How much revenue does each cake bring in? How much does each ingredient cost?
Take these coefficients (the word we use to describe numbers multiplied by variables)
and multiply them by their respective variable. The amount of each cake sold multiplied
by the amount of revenue each cake brings in is total revenue. The amount of each
ingredient used (in both cakes) multiplied by the cost of each ingredient is total cost. The
difference is profit – the thing you want to maximize!
5
Stating the Constraints
Arguably the hardest part is to think about how the details given to you in the question
can be translated numerically.
Here, it is important to think logically and translate whatever constraints the question
gives you verbally into a mathematical expression.
Don’t forget about non-negativity constraints…they’re easy marks!
For example:
If I only had 5 pounds of flour, I would have the following constraint:
The amount of flour used in birthday cakes plus the amount of flour used in wedding
cakes must be less than or equal to five pounds total.
X11 + X12 ≤ 5
(the key here is to think logically – does it make sense!?)
6
In ADM2302, you will be required to solve (by-hand) a linear system with two
variables (i.e. find the intersection of two straight lines)
Plotting Lines and Graphing
Recall that the equation of a line can be expressed in two ways:
ax + by = c
by = -ax + c
y = (-a/b)x + (c/b)
y = mx + b
Slope
Slope
Y-intercept
Y-intercept
7
In this class, we use x1 instead of x, and we use x2 instead of y.
Plotting Lines and Graphing
The math doesn’t change (just the names of the variables)
ax1 + bx2 = c x2 = mx1 + b
8
There are three ways of finding the intersection of two straight lines:
• Graphing
• Substitution
• Elimination
Plotting Lines and Graphing
Practice Problem: Find the intersection of the following two lines:
4x1 + 2x2 = 16 -x1 + 3x2 = 3
9
Practice Problem: Find the intercept of the following two lines:
4x1 + 2x2 = 16 and -x1 + 3x2 = 3
Method One: Graph
One of the easiest methods to graph a line is to find the x1-intercept (the x-intercept) and
the x2-intercept (the y-intercept), plot them, and then connect the two. In fact, you can
graph by finding any two points on the line and connecting them!
4x1 + 2x2 = 16
4(x1) + 2(0) = 16
4x1 = 16
x1 = 4
The x1 intercept is (4,0)
4x1 + 2x2 = 16
4(0) + 2(x2) = 16
2x2 = 16
x2 = 8
The x2 intercept is (0,8)
(x1,0)
(0,x2)
-x1 + 3x2 = 3
-x1 + 2(0) = 3
-x1 = 3
x1 = -3
The x1 intercept is (-3,0)
-x1 + 3x2 = 3
-(0) + 3x2 = 3
3x2 = 3
x2 = 1
The x2 intercept is (0,1)
(x1,0)
(0,x2)
Note: you can only graph constraints like this; NOT the objective function!
10
Practice Problem: Find the intercept of the following two lines:
4x1 + 2x2 = 16 and -x1 + 3x2 = 3
Method One: Graph
Our intercepts are (4,0) and (0,8) for the first line and (-3,0) and (0,1) for the second line.
If we plot these points and draw the lines by connecting them, we can see where they
intersect.
5
10
10 5 -5 -10 (4,0)
(0,8)
(-3,0)
(0,1) (3,2)
Therefore they intersect at (3,2)
Problem: what do you do if they intersect at a decimal?
11
Practice Problem: Find the intercept of the following two lines:
4x1 + 2x2 = 16 and -x1 + 3x2 = 3
Method Two: Substitution
This method is much faster and more precise than graphing; it involves solving each
equation for either x1 or x2, then setting them equal and solving.
4x1 + 2x2 = 16
2x2 = 16 - 4x1
x2 = 8 - 2x1
-x1 + 3x2 = 3
3x2 = 3 + x1
x2 = 1 + (1/3)x1
8 – 2x1 = 1 + (1/3)x1
8 – 1 = (1/3)x1 + 2x1
7 = (7/3)x1
x1 = 3
x2 = 8 – 2x1
x2 = 8 – 2(3)
x2 = 2
Therefore they intersect at (3,2)
You should always try to find the
intersection algebraically (sometimes
your eyes can trick you)
12
Practice Problem: Find the intercept of the following two lines:
4x1 + 2x2 = 16 and -x1 + 3x2 = 3
Method Three: Elimination
This method is the fastest of them all; it involves modifying the coefficients of one (or
both) variables so that they are the same in each equation (so they cancel out), adding
(or subtracting) the equations, and then solving.
4x1 + 2x2 = 16
-x1 + 3x2 = 3
Therefore they
intersect at (3,2)
Let’s make the x1 coefficients cancel by multiplying the second equation by four.
4x1 + 2x2 = 16
-4x1 + 12x2 = 12 +
14x2 = 28
x2 = 2
4x1 + 2x2 = 16
4x1 + 2(2) = 16
4x1 = 12
x1 = 3
x4
If we add these two equations together,
the 4x1 and -4x1 cancel each other out
13
Practice Problem: Graph the following constraint
4x1 + 2x2 ≥ 16
Graphing Inequalities
Most of the time, you’ll be graphing inequalities (problems with a ≤ or ≥ sign). The
common area forms the feasible region. Sometimes it can be tricky knowing which side
of the line the feasible region is on. Luckily, there’s an easy trick!
5
10
10 5 (4,0)
(0,8)
1) Sub the point (0,0) (or any point) into the
inequality.
4(0) + 2(0) ≥ 16
0 ≥ 16 X
2) Determine if the inequality holds (does it
make sense?)
0 is not greater than 16; this doesn’t make sense!
3) If the inequality holds, the side of the line
containing that point (in this case 0,0) is the
side with the FR. If not, the other side of the
line holds the FR
The inequality doesn’t hold, so we are on the far
side of the line (the side without the point 0,0) Don’t assume anything!
Some equations are
misleading
(0,0)
Feasible Region
• This side doesn’t
contain (0,0)
Note: if a constraint has a = sign, the FR
is on the line, not above/below it
14
After plotting your constraints and finding the feasible region, the next step is
to find the optimal solution. There are two ways of doing this:
• Testing each vertex (corner) of the feasible region by plugging it into the
objective function
• Graphing the objective function
Using Graphs to Solve Problems
(0,10)
(10,0)
(3.33,3.33)
Feasible
Region
(5,0) (0,0)
20
(0,5)
10
5 10
Practice Problem: Find the optimal
solution of the graph to the right,
assuming the objective function is
MAX z = 2x1 + 7x2
15
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Method One: Test each vertex
A famous scientist named George Dantzig proved that the optimal solution will always lie
on a boundary (usually a corner) of the feasible region (i.e. never “in the middle” of the
feasible region). Therefore, to find the optimal solution, all we have to do is find and test
each corner point by plugging them into the objective function! Usually, you will have to
use algebra to find the intersection of the constraints (so you can test those vertices). In
this question, they have been given to you.
(0,10)
(10,0)
(3.33,3.33)
Feasible
Region
(5,0) (0,0)
20
(0,5)
10
5 10
MAX z = 2x1 + 7x2
(0,0) z = 2(0) + 7(0) = 0
(0,5) z = 2(0) + 7(5) = 35 ✔
(3.33,3.33) z = 2(3.33) + 7(3.33) = 30
(5,0) z = 2(5) + 7(0) = 10
Therefore the optimal value of 35 occurs
at (0,5)
Note: Make sure to test ALL vertices of
the FR. Don’t just assume the optimal
solution is the intersection of the two
“main” constraints
16
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Method One: Test each vertex
Question: What does it mean if two of my vertices have the same optimal solution? (i.e. I
plug each corner point into the optimal solution and two of them get the same response)
Answer: It means the objective function is parallel to one of the constraints…stay tuned
for more info!
(0,10)
(10,0)
(3.33,3.33)
Feasible
Region
(5,0) (0,0)
20
(0,5)
10
5 10
17
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Method Two: Graph the objective function
An alternate way to find the optimal solution is to graph the objective function. However,
we have a problem: we don’t have enough information to graph the OF since we don’t
know what z is yet.
(0,10)
(10,0)
(3.33,3.33)
Feasible
Region
(5,0) (0,0)
20
(0,5)
10
5 10
Graph z = 2x1 + 7x2
z = 2x1 + 7x2
-7x2 = 2x1 – z
x2 = -(2/7)x1 + (z/7)
We know the slope of the OF: -2/7
We don’t know the y-intercept of the OF,
since we don’t know what z is.
However, we know that we want to maximize z.
Therefore, if we want to maximize z, in the
process we are also maximizing z/7 (the y-
intercept). Therefore, if we can maximize the y-
intercept, we can maximize the OF along the
way!
→ y = mx+b
Slope
Y-Intercept
18
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Method Two: Graph the objective function
We know our slope…we just don’t know our y-intercept. All we know is that we want the
biggest y-intercept we can manage while still being in the feasible region.
(3.33,3.33)
20
(0,5)
10
5 10
Slope is -(2/7)
(this means we go down 2, over 7)
(0,7)
↓2
→7
19
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Method Two: Graph the objective function
We know our slope…we just don’t know our y-intercept. All we know is that we want the
biggest y-intercept we can manage while still being in the feasible region.
20
(0,5)
10
5 10 (0,7)
We keep “sliding” the OF up
until we can’t slide it up
anymore (because we wouldn’t
be in the FR). The point(s)
which the objective function
touch are the optimal solution
(in this case it’s 0,5).
20
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Redundant Constraints
Let’s say we added in the orange constraint:
20
10
5 10
Adding this constraint has not changed the
feasible region; therefore it is redundant.
Redundant constraints are any constraints which
do not affect the feasible region (in other words, if I
were to take it away, the feasible region would
remain unchanged). Note that redundant
constraints have nothing to do with the optimal
solution.
Note: In almost all situations, redundant
constraints can be identified because they never
touch the feasible region
21
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2
Special Situation: Unbounded Problems
What would happen if the feasible region was on the other side?
20
(0,5)
10
5 10 (0,7)
By maximizing the y-intercept,
we keep on going…and
going…and going…and going…
Therefore this problem
is unbounded. There is
no real solution (the
solution is infinity).
Note: Any open-ended feasible region runs the risk of being unbounded.
Careful though…it depends on if it’s a MAX or MIN problem!
• If it’s open to the right or top (or both) and it’s a MAX, it’s unbounded
• If it’s open to the left or bottom (or both) and it’s a MIN, it’s unbounded
In fact, the solution to this
problem is infinity, because we
can go infinitely high.
22
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = x1 + 2x2
Special Situation: Infinite number of solutions
What would happen if we changed the objective function to MAX z = x1 + 2x2?
(3.33,3.33)
20
(0,5)
10
5 10 (0,7)
↓1
→2
Graph z = x1 + 2x2
z = x1 + 2x2
-2x2 = x1 – z
x2 = -(1/2)x1 + (z/2)
→ y = mx+b
Slope
Y-Intercept
We know the slope of the OF: -1/2
We don’t know the y-intercept of the OF,
since we don’t know what z is.
Again, we know that we want to maximize z.
Therefore, if we want to maximize z, in the
process we are also maximizing z/2 (the y-
intercept). Therefore, if we can maximize the y-
intercept, we can maximize the OF!
23
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = x1 + 2x2
Special Situation: Infinite number of solutions
By following the same procedure and “sliding” the objective function upwards, we
maximize the y-intercept (and therefore the objective function) at (0,5) and (3.33,3.33),
as well as all points inbetween
(3.33,3.33)
20
(0,5)
10
5 10 (0,7)
Since there are many points on
that last objective function
(coloured purple) which lead to
a maximized y-intercept (and
therefore objective function),
there are many (an infinite
number) of solutions to this
answer.
All points on this line segment
are optimal. However, there is
only one optimal value: 10 (if
you plug in any point along that
line, you’ll get a value of 10).
If you have more than one optimal solution, it means your objective function
and one of your constraints have the same slope (i.e. they are parallel)
24
Special Situation: Infinite number of solutions
If the ratio between x1 and x2 in the objective function is the same as the ratio between
x1 and x2 in one of your constraints, it is highly possible that there are infinite solutions.
(0,14) Feasible
Region
(0,0)
20
20 40
10
(12,0)
(0,15)
(0,20)
(15,0)
(18,0)
(6.75, 8.75)
We are trying to minimize our cost
MIN z = 20x1 + 12x2
s.t.
5x1 + 3x2 ≥ 60
2x1 + 2x2 ≥ 30 x1, x2 ≥ 0
7x1 + 9x2 ≥ 126
Right away we can see that 20/12 = 1.67 = 5/3
Therefore this constraint and the OF have the
same slope and are therefore parallel. This
means there is a good chance we have multiple
optimal solutions (you still need to solve
though) Note: only the portion of the line within the FR represent the
optimal solution (i.e. it’s not the whole line!)
25
Here’s a summary
• You can graph an intercept by finding its x and y intercepts and then connecting them with a
ruler
• To determine what side of the line the feasible region is on, you can use the (0,0) trick
• You should always use algebra (substitution or elimination) to find the exact point that two
lines intersect at
• To graph the objective function, find the slope with a ruler and “slide” it upwards (if MAX) or
downwards (if MIN) until you reach a point where if you were to slide it anymore it would leave
the feasible region
• A constraint which does not change the feasible region is known as redundant. Usually you
can tell a constraint is redundant if it does not touch the feasible region
• If a feasible region is “open” (not enclosed) to the right or top and the problem is a MAX
problem, the problem is unbounded and there is no optimal solution (same thing if it’s open to
the bottom or left and it’s a MIN problem)
• When a binding constraint and an objective function have the same slope (they’re parallel),
there will be infinite optimal solutions (but only one optimal value). The optimal solutions occur
on the line segment defined by the constraint (but only the part within the feasible region!)
That’s too Confusing!
26
Practice Problem #1 1. Consider the following linear programming problem:
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
a) Graph the constraint lines and mark them clearly with numbers (1), (2), and (3). Darken the feasible region.
b) Without graphing, find the optimal solution. Make sure to solve for the exact values of co-ordinates.
c) If the co-efficient of x2 in the objective function was “a”, what would be the value of “a” so that the iso-profit [objective function] line would be parallel to constraint (1) and there would be multiple optimal solutions? What would be the value of the objective function?
27
1. Consider the following linear programming problem:
a) Graph the constraint lines and mark them clearly with
numbers (1), (2), and (3). Darken the feasible region.
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
To graph each line, let’s find the intercepts:
x1 + 2x2 = 13
x1 + 2(0) = 13
x1 = 13
The x1 intercept is (13,0)
x1 + 2x2 = 13
1(0) + 2x2 = 13
2x2 = 13
x2 = 6.5
The x2 intercept is (0,6.5)
-2x1 + x2 = 4
-2x1 + 2(0) = 4
-2x1 = 4
x1 = -2
The x1 intercept is (-2,0)
-2x1 + x2 = 4
-2(0) + x2 = 4
x2 = 4
The x2 intercept is (0,4)
2x1 – 3x2 = 12
2x1 – 3(0) = 12
2x1 = 12
x1 = 6
The x1 intercept is (6,0)
2x1 – 3x2 = 12
2(0) – 3x2 = 12
-3x2 = 12
x2 = -4
The x2 intercept is (0,-4)
To determine which side of the line the FR is on, let’s test out the point (0,0) in each constraint:
x1 + 2x2 ≤ 13
(0) + 2(0) ≤ 13
0 ≤ 13 ✔
-2x1 + x2 ≤ 4
-2(0) + 2(0) ≤ 4
0 ≤ 4 ✔
2x1 – 3x2 ≤ 12
2(0) – 3(0) ≤ 12
0 ≤ 12 ✔
28
1. Consider the following linear programming problem:
a) Graph the constraint lines and mark them clearly with
numbers (1), (2), and (3). Darken the feasible region.
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
The intercepts of constraint 1 are
(13,0) and (0,6.5); the intercepts
of constraint 2 are (-2,0) and
(0,4); the intercepts of constraint
3 are (6,0) and (0,-4)
We know the Feasible Region is
on the side of the line with (0,0)
(this is true for all constraints in
this problem)
We know these vertices:
(0,0) (0,4) (6,0)
However, to solve this problem,
we also need to find the
intersection of (1) and (2), as
well as (1) and (3)
5
10
20 10 -10 -20 (6,0)
(0,6.5)
(-2,0) (13,0)
(0,4)
(0,-4)
(1)
(2)
(3)
29
1. Consider the following linear programming problem:
b) Without graphing, find the optimal solution. Make sure to
solve for the exact values of co-ordinates.
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
(1) and (2)
2x(1) 2x1 + 4x2 = 26
+ (2) -2x1 + x2 = 4
5x2 = 30
x2 = 6
-2x1 + x2 = 4
-2x1+ (6) = 4
-2x1 = -2
-2x1 = 1
Therefore they
intersect at (1, 6)
(1) and (3)
2x(1) 2x1 + 4x2 = 26
- (2) 2x1 - 3x2 = 12
7x2 = 14
x2 = 2
2x1 - 3x2 = 12
2x1 - 3(2) = 12
2x1 = 18
x1 = 9
Therefore they
intersect at (9, 2)
30
1. Consider the following linear programming problem:
b) Without graphing, find the optimal solution. Make sure to
solve for the exact values of co-ordinates.
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
We now know all the vertices of
the feasible region, allowing us
to test each corner point.
5
10
20 10 -10 (6,0)
(0,6.5)
(-2,0) (13,0)
(0,4)
(0,-4)
(1)
(2)
(3) (1,6)
(9,2)
MAX z = 3x1 + 4x2
(0,0) z = 3(0) + 4(0) = 0
(0,4) z = 3(0) + 4(4) = 16
(1,6) z = 3(1) + 4(6) = 27
(9,2) z = 3(9) + 4(2) = 35 ✔
(6,0) z = 3(6) + 4(00) = 18
Therefore the objective function is
maximized at 35 at the point (9,2)
31
1. Consider the following linear programming problem:
c) If the co-efficient of x2 in the objective function was “a”,
what would be the value of “a” so that the iso-profit
[objective function] line would be parallel to constraint (1)
and there would be multiple optimal solutions? What would
be the value of the objective function?
MAX z = 3x1 + 4x2
Subject to
(1) x1 + 2x2 ≤ 13
(2) -2x1 + x2 ≤ 4
(3) 2x1 - 3x2 ≤ 12 x1, x2 ≥ 0
We want the line z = 3x1 + ax2 to be parallel (same slope) as the line x1 + 2x2 = 13.
Let’s put both equations into y = mx + b form to easily see what m, the slope, is:
z = 3x1 + ax2
-ax2 = 3x1 – z
x2 = -(3/a)x1 + (z/a)
13 = x1 + 2x2
-2x2 = x1 – 13
x2 = -(1/2)x1 + (13/2)
We must make the slopes of each line equal for these two lines to be parallel:
-(3/a) = -(1/2)
a = 6
If a = 6 and the objective function is MAX z = 3x1 + 6x2, we would have infinite solutions.
The optimal value can be found by plugging in any point on constraint (1), such as (1,6)
or (9,2).
z = 3(1) + 6(6) = 3(9) + 6(2) = 39
32
There are a number of problems you may encounter on your midterm. It’s
important you have a general sense of how to solve each one:
• Product-Mix problem
• Blending Problems
• Transportation Problems
Problems you Might Encounter
33
Product-Mix Problems
Product-Mix problems are the most basic type of problem you can expect to encounter.
They involve choosing a combination of products to produce that maximize profit while
minimizing cost.
34
Practice Problem #2
2. The Primo Insurance Company is introducing new product lines: special risk insurance
and mortgages. The expected profit is $5 per unit on special risk insurance and $2 per
unit on mortgages. Management wishes to establish sales quotas for the new product
lines to maximize total expected profit. The work requirements are shown below.
Formulate this model algebraically.
35
Work-Hours per Unit
Department Special
Risk
Mortgage Work-Hours
Available
Underwriting 3 2 2400
Administration 0 1 800
Claims 2 0 1200
2.12 The Primo Insurance Company is introducing new
product lines: special risk insurance and mortgages. The
expected profit is $5 per unit on special risk insurance and
$2 per unit on mortgages. Management wishes to establish
sales quotas for the new product lines to maximize total
expected profit. The work requirements are shown here:
d) Formulate this same model algebraically.
Work-Hours per Unit
Department Special
Risk
Mortgage Work-Hours
Available
Underwriting 3 2 2400
Administration 0 1 800
Claims 2 0 1200
Let x1 = the amount of special risk units we should seek to sell
Let x2 = the amount of mortgages units we should seek to sell
MAX z = 5x1 + 2x2
3x1 + 2x2 ≤ 2400
(1)x2 ≤ 800
2x1 ≤ 1200
x1,x2 ≥ 0
Step 1: Define decision variables
Step 2: Create objective function
Step 3: State constraints
Blending Problem
Blending problems can be a bit confusing because they typically require the use of
percentages – and a percentage of the final result must meet a certain requirement.
For these problems, it might be a good idea to review decimal rules, and perhaps try
some practice problems which use decimals.
A key characteristic of this type of problem is that there will be a “total amount” on the
right hand side multiplied by a percentage (because a max/min percentage of the total
must meet a requirement); note that this “total amount” might be a number or a variable.
For example: if you wanted to know how much lemonade to produce, but you knew that
80% of total lemonade produced must be lemon juice, then the constraint would be
Lemon Juice = (0.8)(Lemonade Produced), where Lemonade Produced is a variable.
Alternatively, if you had a set amount of lemonade that needed to be produced, then
Lemonade Produced would be a set number (like 5 liters).
37
Practice Problem #3
3. Agri-Pro is a company that sells agricultural products to farmers in a number of states.
One service it provides to customer is custom feed mixing, whereby a farmer can order a
specific amount of livestock feed and specify the amount of corn, grain, and minerals the
feed should contain. This is an important service because the proper feed for various
farm animals changes regularly depending on the weather, pasture conditions, and so
on. Agri-Pro has just received an order from a local chicken farmer for 8,000 pounds of
feed. The farmer wants this feed to contain at least 20% corn, 15% grain, and 15%
minerals. Minimize cost using the following information:
Feed 1 Feed 2 Feed 3 Feed 4 Minimum
Requirement
Corn 30% 5% 20% 10% 20%
Grain 10% 30% 15% 10% 15%
Minerals 20% 20% 20% 30% 15%
Cost per
1000
pounds
$250 $300 $320 $150
38
3 Agri-Pro is a company that sells agricultural products to
farmers in a number of states. One service it provides to
customer is custom feed mixing, whereby a farmer can
order a specific amount of livestock feed and specify the
amount of corn, grain, and minerals the feed should
contain. This is an important service because the proper
feed for various farm animals changes regularly depending
on the weather, pasture conditions, and so on. Agri-Pro has
just received an order from a local chicken farmer for 8,000
pounds of feed. The farmer wants this feed to contain at
least 20% corn, 15% grain, and 15% minerals. Minimize
cost using the following information:
Step 1: Define decision variables
We are trying to decide how much feed to use
Let x1 = the amount of Feed 1 in thousands of pounds to use in the mix
Let x2 = the amount of Feed 2 in thousands of pounds to use in the mix
Let x3 = the amount of Feed 3 in thousands of pounds to use in the mix
Let x4 = the amount of Feed 4 in thousands of pounds to use in the mix
Step 2: Create objective function
We are trying to minimize cost
MIN z = 250x1 + 300x2 + 320x3 + 150x4
Feed 1 Feed 2 Feed 3 Feed 4 Minimum
Requirement
Corn 30% 5% 20% 10% 20%
Grain 10% 30% 15% 10% 15%
Minerals 20% 20% 20% 30% 15%
Cost per 1000 pounds
$250 $300 $320 $150
39
3 Agri-Pro is a company that sells agricultural products to
farmers in a number of states. One service it provides to
customer is custom feed mixing, whereby a farmer can
order a specific amount of livestock feed and specify the
amount of corn, grain, and minerals the feed should
contain. This is an important service because the proper
feed for various farm animals changes regularly depending
on the weather, pasture conditions, and so on. Agri-Pro has
just received an order from a local chicken farmer for 8,000
pounds of feed. The farmer wants this feed to contain at
least 20% corn, 15% grain, and 15% minerals. Minimize
cost using the following information:
Step 3: State constraints
The farmer has certain requirements for his feed mix:
x1 + x2 + x3 + x4 = 8 (farmer wants 8000 pounds)
0.3x1 + 0.05x2 + 0.2x3 + 0.1x4 ≥ 8(0.2) (20% must be corn)
0.1x1 + 0.3x2 + 0.15x3 + 0.1x4 ≥ 8(0.15) (15% must be grain)
0.2x1 + 0.2x2 + 0.2x3 + 0.3x4 ≥ 8(0.15) (15% must be minerals)
xi ≥ 0
Feed 1 Feed 2 Feed 3 Feed 4 Minimum
Requirement
Corn 30% 5% 20% 10% 20%
Grain 10% 30% 15% 10% 15%
Minerals 20% 20% 20% 30% 15%
Cost per 1000 pounds
$250 $300 $320 $150
The “total amount” (8) on the
RHS is multiplied by a
percentage. In other blending
problems, this “total” could be a
number or a variable.
40
Transportation Problem
A transportation problem involves moving resources between two or more areas;
typically the goal is to minimize cost.
The key to a transportation problem is that the amount pumped into the network must
equal the amount pumped out of the network. In other words, the total resource flow into
a node equals the total resource flow out of a node.
There may be additional constraints as well, such as a limit on what can travel certain
routes.
41
Practice Problem #4
4. The Fagersta Steelworks currently is working two mines to obtain its iron ore. This iron
ore is shipped to either of two storage facilities. When needed, it is then shipped on to
the company’s steel plant. The diagram below depicts the distribution network, where M1
and M2 are the two mines, S1 and S2 are the two storage facilities, and P is the steel
plant. The diagram also shows the monthly amounts produced at the mines and needed
at the plant, as well as the shipping cost and the maximum amount that can be shipped
per month through each shipping lane. Management now wants to determine the most
economic plan for shipping the iron ore from the mines through the distribution network
to the steel plant. Express this model in algebraic form.
M1
M2
S1
S2
P
40 Tons
Produced
60 Tons
Produced
$2,000/ton
$1,100/ton
30 tons max
50 tons max
42
3.18 The Fagersta Steelworks currently is working two
mines to obtain its iron ore. This iron ore is shipped to
either of two storage facilities. When needed, it is then
shipped on to the company’s steel plant. The diagram
below depicts the distribution network, where M1 and
M2 are the two mines, S1 and S2 are the two storage
facilities, and P is the steel plant. The diagram also
shows the monthly amounts produced at the mines and
needed at the plant, as well as the shipping cost and the
maximum amount that can be shipped per month
through each shipping lane. Management now wants to
determine the most economic plan for shipping the iron
ore from the mines through the distribution network to
the steel plant. Summarize the model in algebraic form.
43
M1
M2
S1
S2
P
40 Tons
Produced
60 Tons
Produced
$2,000/ton
$1,100/ton
30 tons max
50 tons max
Step 1: Define decision variables
We are trying to decide how much to ship on each route
Let XM1S1 = the number of tons heading from M1 to S1
Let XM1S2 = the number of tons heading from M1 to S2
Let XM2S1 = the number of tons heading from M2 to S1
Let XM2S2 = the number of tons heading from M2 to S2
Let XS1P = the number of tons heading from S1 to P
Let XS2P = the number of tons heading from S2 to P
3.18 The Fagersta Steelworks currently is working two
mines to obtain its iron ore. This iron ore is shipped to
either of two storage facilities. When needed, it is then
shipped on to the company’s steel plant. The diagram
below depicts the distribution network, where M1 and
M2 are the two mines, S1 and S2 are the two storage
facilities, and P is the steel plant. The diagram also
shows the monthly amounts produced at the mines and
needed at the plant, as well as the shipping cost and the
maximum amount that can be shipped per month
through each shipping lane. Management now wants to
determine the most economic plan for shipping the iron
ore from the mines through the distribution network to
the steel plant. Summarize the model in algebraic form.
44
M1
M2
S1
S2
P
40 Tons
Produced
60 Tons
Produced
$2,000/ton
$1,100/ton
30 tons max
50 tons max
Step 2: Define objective function
We want to minimize cost
MIN z = 2000XM1S1 + 1700XM1S2 + 1600XM2S1 + 1100XM2S2 + 400XS1P + 800XS2P
3.18 The Fagersta Steelworks currently is working two
mines to obtain its iron ore. This iron ore is shipped to
either of two storage facilities. When needed, it is then
shipped on to the company’s steel plant. The diagram
below depicts the distribution network, where M1 and
M2 are the two mines, S1 and S2 are the two storage
facilities, and P is the steel plant. The diagram also
shows the monthly amounts produced at the mines and
needed at the plant, as well as the shipping cost and the
maximum amount that can be shipped per month
through each shipping lane. Management now wants to
determine the most economic plan for shipping the iron
ore from the mines through the distribution network to
the steel plant. Summarize the model in algebraic form.
45
M1
M2
S1
S2
P
40 Tons
Produced
60 Tons
Produced
$2,000/ton
$1,100/ton
30 tons max
50 tons max
Step 3: State constraints
Everything that goes in must come out
XM1S1 + XM1S2 = 40
XM2S1 + XM2S2 = 60
XM1S1 + XM2S1 = XS1P
XM1S2 + XM2S2 = XS2P
3.18 The Fagersta Steelworks currently is working two
mines to obtain its iron ore. This iron ore is shipped to
either of two storage facilities. When needed, it is then
shipped on to the company’s steel plant. The diagram
below depicts the distribution network, where M1 and
M2 are the two mines, S1 and S2 are the two storage
facilities, and P is the steel plant. The diagram also
shows the monthly amounts produced at the mines and
needed at the plant, as well as the shipping cost and the
maximum amount that can be shipped per month
through each shipping lane. Management now wants to
determine the most economic plan for shipping the iron
ore from the mines through the distribution network to
the steel plant. Summarize the model in algebraic form.
46
M1
M2
S1
S2
P
40 Tons
Produced
60 Tons
Produced
$2,000/ton
$1,100/ton
30 tons max
50 tons max
Step 3: State constraints
Each route has a capacity limit
XM1S1 ≤ 30
XM1S2 ≤ 30
XM2S1 ≤ 50
XM2S2 ≤ 50 Xij ≥ 0
XS1P ≤ 70
XS2P ≤ 70
It’s important that you understand how spreadsheets are constructed, as well
as how certain formulas are built.
• Changing Cells – These are your “decision variables”. Solver will change
these cells. These cells will not have formulas, but will be used within other
formulas.
• Target Cell – This is your “objective function.” This is the cell you want
solver to maximize or minimize. Generally, the target cell will be a profit cell
(if maximizing profit) or a cost cell (if minimizing cost).
• Note: Only one cell can be a target cell.
• Coefficient Cells – These form the basis of your constraints and your
objective function. They are numbers which are multiplied by variables (i.e.
your changing cells) to reach the right-hand side of a constraint or the
objective function.
• These cells are also known as parameters because they never
change
Spreadsheets and Sensitivity Analysis
47
It’s important that you understand how spreadsheets are constructed, as well
as how certain formulas are built.
• Blue Cells – Coefficient cells (parameters)
• Orange Cells – Target cell (total profit/cost cell)
• Yellow Cells – Changing cells (decision variables)
Spreadsheets and Sensitivity Analysis
48
It’s also important that you know how solver works, as well as certain formulas:
• SUM(A1:B5) – Will sum all cells in the rectangle formed by A1 and B5.
• SUMPRODUCT(A1:A3,B1:B3) – Multiplies the first cell in the first range
with the first cell in the second range (A1 times B1), the second cell in the
first range with the second cell in the second range (A2 times B2), etc. and
then sums them all together (don’t get confused about the syntax!)
• IF(Condition, Result if True, Result if False) – Not as commonly used
• Solver – Self-explanatory (see picture)
If this spreadsheet had blanks, could you fill them in?
Spreadsheets and Sensitivity Analysis
49
Sensitivity Analysis
Allows us to examine how changes in variables/constraints will affect the final solution
50
Sensitivity Analysis
Final Value of Target Cell – Gives
us the optimal value (usually profit or
cost). In this case, optimal profit is
$208,200
Final Value of Adjustable Cells –
(“Adjustable” is the same as
“changing”) Gives us the optimal
solution. In this case, the optimal
solution is 0 digital boxes, 380 PVRs,
0 TVs, and 1060 recorders.
Status – Binding means that the
optimal solution touches that
constraint (i.e. there’s no extra
“slack” or “surplus”). Non-binding
means that the constraint was not
met (i.e. there was a little wiggle
room). In this case, we’ve used all
our electronic modules and
assembly hours, but still have 560 non-electronic models left for use.
51
Sensitivity Analysis
Objective Coefficient – The
coefficient that the variable in that
row is multiplied by in the objective
function. In this case, each digital box
produces $87 of profit
Allowable Increase/Decrease – The
amount the objective coefficient could be
increased or decreased without changing
the optimal solution (note: the optimal
value, i.e. profit or cost, will be changed).
In this case, increasing the profit per PVR
by up to 120 or decreasing it by 5 will not
change the optimal solution. The optimal
value (profit) will change by the coefficient
change multiplied by the final value. If
outside this range, we cannot know
exactly how the optimal solution/value will
change without rerunning the model.
Reduced Cost – The amount an
objective coefficient would have to
“improve” to make the variable
non-zero. In this case, profit per
HD TV would have to increase by
24 (alternatively, reduce by -24)
per unit before we would consider
producing TVs. *reminder: optimal solution refers to the decision variables; optimal value refers to the objective
function. Our optimal solution, plugged into the objective function, gives us our optimal value.
Reduced Cost – Alternate
interpretation: the amount that an
optimal value would increase by if we
were to force a one unit increase in
the optimal solution. In this case, if
we were to force the company to
produce 1 HD TV, profit would
increase by -24 (i.e. decrease by 24)
52
Sensitivity Analysis
Shadow Price – The amount that the
optimal value (the objective function)
would increase (decrease) if we
added (subtracted) 1 extra unit to the
RH side. In this case, an extra
electronic module would lead to $6
extra in profit. This only holds within
the allowable increase/decrease.
Constraint RHS – Simple: it’s the
right hand side of the constraint. In
this case, we only have 4500 non-
electronic modules to use.
Allowable Increase/Decrease – Tells
us the range that the shadow price is
valid in. In this case, we know that an
increase of up to 466.67 hours will
increase profit by $72/hour. We also
know a decrease of up to 1325 hours
will decrease profit by $72/hour.
Outside this range, though, we cannot
make any solid conclusions.
53
Note: Shadow Price is easy to
calculate! If given two scenarios with
different RHS constraints, you can
easily calculate the Shadow Price by
dividing the difference in the optimal
values with the difference in the RHS
constraints (think of two points on a
straight line; the SP is the slope).
*reminder: don’t confuse “Allowable Increase/Decrease” in this section with the one in the Adjustable Cells section. Here, it refers
to the range the shadow price is valid in (this has nothing to do with the optimal solution!). In the previous section, it referred to the
range which the objective coefficient could be changed without impacting the optimal solution.
100% Rule
If two or more elements are changing at the same time, you can use the 100% rule to
determine how things will change.
• If two or more objective coefficients are changing, calculate each change as a
percentage of the allowable increase (if increasing) or decrease (if decreasing). If
the TOTAL sum of the percentage changes is greater than 100%, then we deem this
to be outside the feasible range (and therefore we cannot determine exactly how the
optimal solution and value will change). If it is less than 100%, then this is inside the
feasible range and the optimal solution will remain the same.
• Similarly, if two or more RHS constraints are changing, calculate each change in
the same way (as a percentage of the allowable increase/decrease). If the TOTAL
sum of the percentage changes is greater than 100%, then the shadow prices are
no longer valid and we can’t determine how the optimal value will change. If it is less
than 100%, then the shadow prices are still valid and we can therefore determine
how the optimal value will change.
• See Practice Question 5, part B for an example.
54
Practice Problem #5 5. HiTech Electronics produces four consumer electronic products. They are Digital Boxes, PVRs, HD TVs, and HD Recorders. Each product uses a certain number of electronic modules, non-electronic modules, and assembly hours. Available are 4700 electronic modules, 4500 non-electronic modules, and 2500 assembly hours.
The linear programming problem is the following:
x1 to 4 = units produced (in the same order as above)
MAX z = 87x1 + 96x2 + 216 x3 + 162x4
s.t.
3x1 + 4x2 + 4 x3 + 3x4 ≤ 4700 (electronic)
2x1 + 2x2 + 4 x3 + 3x4 ≤ 4500 (non-electronic)
x1 + 1x2 + 3 x3 + 2x4 ≤ 2500 (assembly hours)
xi ≥ 0
55
5. a) Determine the optimal
production schedule of HTE for the
four products. What is the optimal
profit of such optimal strategy?
Answer: According to this report, the
optimal solution is to produce no digital
boxes or HD TVs, 380 PVRs, and 1060 HD
Recorders. This will lead to an optimal
value (profit) of $208,200
56
5. b) What would be the impact on the
production schedule and the optimal
profit if the local supplier decreased
the purchasing cost of electronic
modules by $0.75? Justify,
Answer: If we look at the original problem two slides
ago, we see that digital boxes use 3 electronic
modules, PVRs use 4 electronic modules, HD TVs use
4 electronic modules, and recorders use 3 electronic
modules (see previous slides).
This corresponds to an INCREASE in the profit
coefficients (decreased cost = higher profit) of 3(0.75) =
$2.25 per unit for digital boxes and HD recorders and
4(0.75) = $3 per unit for PVRs and HD TVs. Because
we are changing multiple coefficients, we must use the
100% rule. Since 2.25/3 + 3/120 + 3/24 + 2.25/30 =
0.975 (less than 100%), the optimal solution will not
change (we will still produce the same amount).
The optimal value WILL change. We now make $2.25
more profit per unit for digital boxes and HD recorders,
and $3 more profit per unit for PVRs and HD TVs.
Z = $208,200 + 2.25(0) + 3(380) + 3(0) + 2.25(1060)
Z = $211,725
Therefore profit will increase by $3,525 to $211,725
Recall: The allowable increase of
the objective coefficient tells us
how much the objective coefficient
(i.e. profit per unit) can increase
without causing a change in the
optimal solution (i.e. we would still
produce the same amount)
57
5. c) In order to start producing HD
TVs, what would need to happen to
the unit profit of HD TVs?
Answer: Recall that the reduced cost
tells us how much a coefficient needs
to “improve” before the variable would
become non-zero
In this case, the objective coefficient
(profit per unit) of HD TVs would need
to improve by $24 before we would
consider producing HD TVs.
Therefore, unit profit would need to
increase $24.
58
5. d) What is the shadow price for
assembly time? If the assembly time
available were to be 2600 hours
instead of the current value, what
would be the new profit and what
would happen to the product mix?
Answer: Recall that the shadow price tells us how
much the optimal solution would
increase/decrease if we were to add one unit to the
right-hand side (RHS) or a constraint (so long as
it’s within the allowable increase/decrease)
In this case, an increase of 100 assembly hours
would yield additional profit of $72 x 100 = $7,200.
Note that the increase of 100 is within the
allowable increase of 466.67, so the shadow price
is valid.
The product mix will almost certainly change;
however, the sensitivity report does not give us
information as to how a change in constraints will
change the optimal solution.
59
5. e) If the availability of non-
electronic modules increases by 500
units, what effect will it have on the
product mix? Why is its shadow price
zero?
Answer: Recall that non-electronic modules
is a non-binding constraint, which means
we already aren’t even using all the non-
electronic modules we have available.
Therefore, an increase in non-electronic
modules is useless to us (we already have
some we’re not using, we don’t need
more!). The optimal value and solution (i.e.
the product mix) will be unchanged.
The shadow price tells us how much an
increase/decrease in a constraint will
increase/decrease the objective function
(profit). Clearly, since extra non-electronic
modules are useless to us, an extra non-
electronic module is of no use and will not
improve profit in any way (i.e. it will bring $0
of extra value).
60
5. f) If the available electronic
modules were only 4000, how would it
impact total profit? What can you say
about the product mix?
Answer: Electronic modules is a binding
constraint, meaning we are using all that
we have available.
Recall that the shadow price tells us how
much the optimal value (profit) will
increase/decrease given an
increase/decrease in the right hand side of
a constraint. A 700 unit decrease in
electronic modules would lead to a $6 x
700 = $4200 decrease in profit (note that
700 is within the allowable decrease of 960,
so the shadow price is valid).
Again, the product mix will likely change,
but we cannot determine how (since the
sensitivity report gives us no information
about how the change in a constraint will
change the optimal solution).
61
Tells us about the optimal value and optimal
solution
Gives us information on how changes to
the objective coefficient will change the
optimal solution (i.e. product mix), so long
as the changes are with the allowable
increase or decrease (we can use that
information to determine the effect on the
optimal value, i.e. profit/cost).
Gives us information on how changes to a
constraint will affect the optimal value (i.e.
profit). Gives no information on how
changes to constraints will affect the
optimal solution (i.e. product mix). We
cannot make any conclusions beyond the
allowable range.
62
63
Part of
Report
If Within the Allowable
Range
If Outside the Allowable
Range
Adjustable
Cells
• Optimal Solution will not
change
• Optimal Value will change
by the coefficient change
multiplied by the final value
• Optimal Solution and
Value will most likely
change (we can’t know by
how much without re-
running the model)
Constraints • Shadow Price remains
valid; therefore, Optimal
Value will change by
change times shadow price
• Optimal Solution will
probably change; we can’t
know by how much without
re-running the model
• Shadow Price is no longer
valid; therefore, Optimal
Value and Solution will
most likely change, but we
can’t know by how much
without re-running the
model
Question: If you were given a
sensitivity report, would you be able
to use things like shadow price,
reduced cost, etc. to work backwards
and calculate what the original values
were?
Question: Given certain information,
could you calculate things like
shadow price, reduced cost, etc.
yourself?
Question: Do you know the difference
between “Allowable
Increase/Decrease” in the Adjustable
Cells part of the report versus the
Constraints part of the report?
Answer: You should!
64
Practice Problem #6 6. Which of the following is not true:
• A feasible solution satisfies all constraints
• An optimal solution satisfies all constraints
• An infeasible solution violates all constraints
• A feasible solution points does not have to lie on the boundary of the feasible region
The amount that the objective function coefficient of a decision variable would have to
improve before that variable would have a positive value in the solution is the
• Shadow price
• Allowable increase
• Reduced cost
• Slack variable
65
Practice Problem #6 6. Which of the following is not true:
• A feasible solution satisfies all constraints
• An optimal solution satisfies all constraints
• An infeasible solution violates all constraints
• A feasible solution points does not have to lie on the boundary of the feasible region
The amount that the objective function coefficient of a decision variable would have to
improve before that variable would have a positive value in the solution is the
• Shadow price
• Allowable increase
• Reduced cost
• Slack variable
66
Practice Problem #6 When formulating transportation problem on a spreadsheet (e.g. Excel), which of the
following are necessary?
a) parameter table.
b) network representation.
c) solution table.
d) a and b only.
e) a and c only.
f) all of the above.
Let Xij = the production of product i in period j. To specify that production of product 1 in
period 3 and in period 4 differs by no more that 100 units.
• X13 – X14 <100; X14 – X13 <100.
• X13 – X14 < 100; X13 – X14 > 100.
• X13 – X14 < 100; X14 – X13 > 100.
• X13 – X14 > 100; X14 – X13 > 100.
67
Practice Problem #6 When formulating transportation problem on a spreadsheet (e.g. Excel), which of the
following are necessary?
a) parameter table.
b) network representation.
c) solution table.
d) a and b only.
e) a and c only.
f) all of the above.
Let Xij = the production of product i in period j. To specify that production of product 1 in
period 3 and in period 4 differs by no more that 100 units.
• X13 – X14 <100; X14 – X13 <100.
• X13 – X14 < 100; X13 – X14 > 100.
• X13 – X14 < 100; X14 – X13 > 100.
• X13 – X14 > 100; X14 – X13 > 100.
68
Practice Problem #6 There is shadow price for every decision variable in a model
a) True
b) False
Because the shadow price represents the improvement in the value of the optimal
solution per unit increase in right-hand side, a shadow price cannot be negative
a) True
b) False
Demand constraints frequently take the form: Beginning inventory + production - ending
inventory = demand
a) True
b) False
69
Practice Problem #6 There is shadow price for every decision variable in a model
a) True
b) False
Because the shadow price represents the improvement in the value of the optimal
solution per unit increase in right-hand side, a shadow price cannot be negative
a) True
b) False
Demand constraints frequently take the form: Beginning inventory + production - ending
inventory = demand
a) True
b) False
70
Any questions?
71
Good luck!
72