Você está na página 1de 72

1

ADM2302
DGD - THURSDAY 7 - 8:30
Midterm Review

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)

Forming Linear Programming


Problems
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

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 dont 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. Dont think that you necessarily have too many variables. If you start a
problem and finish it and realize that there are variables you havent 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)

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!

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.
Dont forget about non-negativity constraintstheyre 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!?)

Plotting Lines and Graphing


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)
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)
Slope

Y-intercept

y = mx + b
Slope

Y-intercept

Plotting Lines and Graphing


In this class, we use x1 instead of x, and we use x2 instead of y.
The math doesnt change (just the names of the variables)

ax1 + bx2 = c

x2 = mx1 + b

Plotting Lines and Graphing


There are three ways of finding the intersection of two straight lines:
Graphing
Substitution
Elimination
Practice Problem: Find the intersection of the following two lines:
4x1 + 2x2 = 16

-x1 + 3x2 = 3

10
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 x 1-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
(x1,0) 4(x1) + 2(0) = 16
4x1 = 16
x1 = 4
The x1 intercept is (4,0)

-x1 + 3x2 = 3
(x1,0)
-x1 + 2(0) = 3
-x1 = 3
x1 = -3
The x1 intercept is (-3,0)

4x1 + 2x2 = 16
(0,x2) 4(0) + 2(x2) = 16
2x2 = 16
x2 = 8
The x2 intercept is (0,8)

-x1 + 3x2 = 3
(0,x2)
-(0) + 3x2 = 3
3x2 = 3
x2 = 1
The x2 intercept is (0,1)

Note: you can only graph constraints like this; NOT the objective function!

11
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.

10
(0,8)

(0,1)

-10

-5 (-3,0)

(3,2)

(4,0) 5

10

Therefore they intersect at (3,2)


Problem: what do you do if they intersect at a decimal?

12
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
You should always try to find the
intersection algebraically (sometimes
your eyes can trick you)

x2 = 8 2x1
x2 = 8 2(3)
x2 = 2

Therefore they intersect at (3,2)

13
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

x4

Lets make the x1 coefficients cancel by multiplying the second equation by four.
If we add these two equations together,
the 4x1 and -4x1 cancel each other out

4x1 + 2x2 = 16
-4x1 + 12x2 = 12 +
14x2 = 28
x2 = 2
4x1 + 2x2 = 16
4x1 + 2(2) = 16
4x1 = 12
x1 = 3

Therefore they
intersect at (3,2)

14
Practice Problem: Graph the following constraint
4x1 + 2x2 16

Graphing Inequalities
Most of the time, youll 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, theres an easy trick!

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?)

10
(0,8)

0 is not greater than 16; this doesnt 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 doesnt hold, so we are on the far
side of the line (the side without the point 0,0)

Note: if a constraint has a = sign, the FR


is on the line, not above/below it

(0,0)

Feasible Region
This side doesnt
contain (0,0)

(4,0) 5
Dont assume anything!
Some equations are
misleading

10

15

Using Graphs to Solve Problems


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
20
Graphing the objective function
Practice Problem: Find the optimal
solution of the graph to the right,
assuming the objective function is
MAX z = 2x1 + 7x2

10
(0,5)
(0,0)

Feasible
Region

(0,10)

(3.33,3.33)

(10,0)

(5,0)

10

16
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.
MAX z = 2x1 + 7x2
(0,0)
(0,5)
(3.33,3.33)
(5,0)

z = 2(0) + 7(0) = 0
z = 2(0) + 7(5) = 35
z = 2(3.33) + 7(3.33) = 30
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. Dont just assume the optimal
solution is the intersection of the two
main constraints

20

10
(0,5)
(0,0)

Feasible
Region

(0,10)

(3.33,3.33)

(10,0)

(5,0)

10

17
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 constraintsstay tuned
for more info!

20

10
(0,5)
(0,0)

Feasible
Region

(0,10)

(3.33,3.33)
(10,0)

(5,0)

10

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


An alternate way to find the optimal solution is to graph the objective function. However,
we have a problem: we dont have enough information to graph the OF since we dont
know what z is yet.
Graph z = 2x1 + 7x2
z = 2x1 + 7x2
-7x2 = 2x1 z
x2 = -(2/7)x1 + (z/7)

Slope
Y-Intercept

20

y = mx+b

We know the slope of the OF: -2/7


We dont know the y-intercept of the OF,
since we dont know what z is.

10

However, we know that we want to maximize z.


(0,5)
Therefore, if we want to maximize z, in the
process we are also maximizing z/7 (the yintercept). Therefore, if we can maximize the y- (0,0)
intercept, we can maximize the OF along the
way!

Feasible
Region

(0,10)

(3.33,3.33)

(10,0)

(5,0)

10

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 slopewe just dont 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

10
Slope is -(2/7)
(this means we go down 2, over 7)

(0,5)

(3.33,3.33)

5 (0,7)
7

10

20
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 slopewe just dont 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

We keep sliding the OF up


until we cant slide it up
anymore (because we wouldnt
be in the FR). The point(s)
which the objective function
touch are the optimal solution
(in this case its 0,5).

10
(0,5)

5 (0,7)

10

21
Practice Problem: Find the optimal solution of the graph assuming the objective function is:
MAX z = 2x1 + 7x2

Redundant Constraints
Lets say we added in the orange constraint:
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

20

10

10

22
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?

By maximizing the y-intercept,


we keep on goingand
goingand goingand going

In fact, the solution to this


problem is infinity, because we
can go infinitely high.

20

10
Therefore this problem
is unbounded. There is
no real solution (the
solution is infinity).

(0,5)

5 (0,7)

10

Note: Any open-ended feasible region runs the risk of being unbounded.
Careful thoughit depends on if its a MAX or MIN problem!
If its open to the right or top (or both) and its a MAX, its unbounded
If its open to the left or bottom (or both) and its a MIN, its unbounded

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


What would happen if we changed the objective function to MAX z = x1 + 2x2?

20
Graph z = x1 + 2x2
Slope
Y-Intercept

z = x1 + 2x2
-2x2 = x1 z
x2 = -(1/2)x1 + (z/2) y = mx+b

We know the slope of the OF: -1/2


We dont know the y-intercept of the OF,
since we dont know what z is.

10
(0,5)

(3.33,3.33)

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 yintercept). Therefore, if we can maximize the yintercept, we can maximize the OF!

5 (0,7)
2

10

24
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

20

Since there are many points on 10


that last objective function
(coloured purple) which lead to
a maximized y-intercept (and (0,5)
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, youll get a value of 10).

(3.33,3.33)

5 (0,7)

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)

25

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.
We are trying to minimize our cost
MIN z = 20x1 + 12x2
s.t.
5x1 + 3x2 60
2x1 + 2x2 30
7x1 + 9x2 126

20 (0,20)
(0,15)
(0,14)

x 1, x 2 0

10

Feasible
Region

(6.75, 8.75)

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
(18,0)
(0,0) (12,0)
means there is a good chance we have multiple
(15,0) 20
40
optimal solutions (you still need to solve
though)
Note: only the portion of the line within the FR represent the
optimal solution (i.e. its not the whole line!)

26

Thats too Confusing!


Heres 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 its open to
the bottom or left and its a MIN problem)
When a binding constraint and an objective function have the same slope (theyre 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!)

27

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

x 1, x 2 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?

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.

To graph each line, lets 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)

MAX z = 3x1 + 4x2


Subject to
(1) x1 + 2x2 13
(2) -2x1 + x2 4
(3) 2x1 - 3x2 12

x1, x2 0

-2x1 + x2 = 4
-2x1 + 2(0) = 4
-2x1 = 4
x1 = -2
The x1 intercept is (-2,0)

2x1 3x2 = 12
2x1 3(0) = 12
2x1 = 12
x1 = 6
The x1 intercept is (6,0)

-2x1 + x2 = 4
-2(0) + x2 = 4
x2 = 4

2x1 3x2 = 12
2(0) 3x2 = 12
-3x2 = 12
x2 = -4
The x2 intercept is (0,-4)

The x2 intercept is (0,4)

To determine which side of the line the FR is on, lets 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
04

2x1 3x2 12
2(0) 3(0) 12
0 12

29
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

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)

10

We know the Feasible Region is


on the side of the line with (0,0)
(this is true for all constraints in
this problem)

x1, x2 0

(2)

(0,6.5)

5
(0,4)

(3)

(1)

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)

-20

-10 (-2,0)
(0,-4)

(6,0) 10 (13,0)

20

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.

(1) and (2)

Therefore they
intersect at (1, 6)

Subject to
(1) x1 + 2x2 13
(2) -2x1 + x2 4
(3) 2x1 - 3x2 12

(1) and (3)

2x(1) 2x1 + 4x2 = 26


+ (2) -2x1 + x2 = 4
5x2 = 30
x2 = 6
-2x1 + x2 =
-2x1+ (6) =
-2x1 =
-2x1 =

MAX z = 3x1 + 4x2

4
4
-2
1

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)

x1, x2 0

31
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

We now know all the vertices of


the feasible region, allowing us
to test each corner point.

10

MAX z = 3x1 + 4x2


(0,0)
(0,4)
(1,6)
(9,2)
(6,0)

z = 3(0) + 4(0) = 0
z = 3(0) + 4(4) = 16
z = 3(1) + 4(6) = 27
z = 3(9) + 4(2) = 35
z = 3(6) + 4(00) = 18

(0,6.5)

5
(0,4)

x1, x2 0

(2)

(1,6)

(3)

(1)

(9,2)
Therefore the objective function is
maximized at 35 at the point (9,2)

-10 (-2,0)
(0,-4)

(6,0) 10 (13,0)

20

32
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.
Lets 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

33

Problems you Might Encounter


There are a number of problems you may encounter on your midterm. Its
important you have a general sense of how to solve each one:
Product-Mix problem
Blending Problems
Transportation Problems

34

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.

35

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.
Work-Hours per Unit
Department

Special
Risk

Mortgage

Work-Hours
Available

Underwriting

2400

Administration

800

Claims

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

2400

Administration

800

Claims

1200

Step 1: Define decision variables


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

Step 2: Create objective function


MAX z = 5x1 + 2x2

Step 3: State constraints


3x1 + 2x2 2400
(1)x2 800
2x1
1200

x1,x2 0

37

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).

38

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

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:

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

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

40
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

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
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.

41

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.

42

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 companys 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.
40 Tons
Produced

$2,000/ton
30 tons max

M1

S1
P

60 Tons
Produced

M2

$1,100/ton
50 tons max

S2

43
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 companys 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.

40 Tons
Produced

$2,000/ton
30 tons max

M1

S1
P

60 Tons
Produced

M2

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

$1,100/ton
50 tons max

S2

44
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 companys 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.

40 Tons
Produced

$2,000/ton
30 tons max

M1

S1
P

60 Tons
Produced

M2

$1,100/ton
50 tons max

S2

Step 2: Define objective function


We want to minimize cost
MIN z = 2000XM1S1 + 1700XM1S2 + 1600XM2S1 + 1100XM2S2 + 400XS1P + 800XS2P

45
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 companys 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.

Step 3: State constraints


Everything that goes in must come out
XM1S1 + XM1S2 =
XM2S1 + XM2S2 =
XM1S1 + XM2S1 =
XM1S2 + XM2S2 =

40
60
XS1P
XS2P

40 Tons
Produced

$2,000/ton
30 tons max

M1

S1
P

60 Tons
Produced

M2

$1,100/ton
50 tons max

S2

46
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 companys 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.

Step 3: State constraints


Each route has a capacity limit
XM1S1 30
XM1S2 30
XM2S1 50
XM2S2 50
XS1P 70
XS2P 70

Xij 0

40 Tons
Produced

$2,000/ton
30 tons max

M1

S1
P

60 Tons
Produced

M2

$1,100/ton
50 tons max

S2

47

Spreadsheets and Sensitivity Analysis


Its 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

48

Spreadsheets and Sensitivity Analysis


Its 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)

49

Spreadsheets and Sensitivity Analysis


Its 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 (dont 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?

50

Sensitivity Analysis
Allows us to examine how changes in variables/constraints will affect the final solution

51

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. theres 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, weve used all
our electronic modules and
assembly hours, but still have 560
non-electronic models left for use.

52

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

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)

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.

53
*reminder: dont 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.

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: its the


right hand side of the constraint. In
this case, we only have 4500 nonelectronic 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.

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).

54

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 cant 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.

55

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

56

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

57

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)

58

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.

59

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
its 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.

60

5. e) If the availability of nonelectronic 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 arent even using all the nonelectronic modules we have available.
Therefore, an increase in non-electronic
modules is useless to us (we already have
some were not using, we dont 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 nonelectronic module is of no use and will not
improve profit in any way (i.e. it will bring $0
of extra value).

61

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).

62

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.

63

Part of
Report
Adjustable
Cells

If Within the Allowable


Range

Constraints

If Outside the Allowable


Range

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 cant know by
how much without rerunning the model)

Shadow Price remains


valid; therefore, Optimal
Value will change by
change times shadow price
Optimal Solution will
probably change; we cant
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
cant know by how much
without re-running the
model

64

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!

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
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

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
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.

69

Practice Problem #6
There is shadow price for every decision variable in a model
a)
b)

True
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)
b)

True
False

Demand constraints frequently take the form: Beginning inventory + production - ending
inventory = demand
a)
b)

True
False

70

Practice Problem #6
There is shadow price for every decision variable in a model
a)
b)

True
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)
b)

True
False

71

Any questions?

72

Good luck!

Você também pode gostar