1 BA 555 Practical Business Analysis Linear Programming (LP) Sensitivity Analysis Simulation Using @Risk Agenda
1
BA 555 Practical Business Analysis
Linear Programming (LP) Sensitivity Analysis
Simulation Using @Risk
Agenda
2
Sensitivity Analysis (p.70)
How will a change in a coefficient of the objective function affect the optimal solutions?
How will a change in the right-hand-side value for a constraint affect the optimal solution?
MAX 3 A + 4 B SUBJECT TO 2) 2 A + 2 B <= 80 3) 2 A + 4 B <= 120 END
3
Range of Optimality (p.70)
The range of values over which an objective function coefficient may vary without causing any change in the values of the decision variables in the optimal solution.
OBJ COEFFICIENT RANGES VARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE A 3.000000 1.000000 1.000000 B 4.000000 2.000000 1.000000
MAX 3 A + 4 B SUBJECT TO 2) 2 A + 2 B <= 80 3) 2 A + 4 B <= 120 END
4
Range of Feasibility (p.70)
The range of values over which a right-hand side may vary without changing the value and interpretation of the dual price (shadow price).
MAX 3 A + 4 B SUBJECT TO 2) 2 A + 2 B <= 80 3) 2 A + 4 B <= 120 END
RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 80.000000 40.000000 20.000000 3 120.000000 40.000000 40.000000
OBJECTIVE FUNCTION VALUE 1) 140.0000 VARIABLE VALUE REDUCED COST A 20.000000 .000000 B 20.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.000000 3) .000000 .500000
OBJECTIVE FUNCTION VALUE 1) 140.0000 VARIABLE VALUE REDUCED COST A 20.000000 .000000 B 20.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.000000 3) .000000 .500000
5
Reduced Cost (p.70)
The amount by which an objective function coefficient would have to improve (increase for a maximization problem, decrease for a minimization problem), before it would be possible for the corresponding variable to assume a positive value in the optimal solution.
OBJECTIVE FUNCTION VALUE 1) 140.0000 VARIABLE VALUE REDUCED COST A 20.000000 .000000 B 20.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.000000 3) .000000 .500000
6
LINDO: The Model and Report LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) 240 VARIABLE VALUE REDUCED COST C 4.000000 .000000 D 3 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 2.500000 3) .000000 3.750000 4) 5.000000 .000000 NO. ITERATIONS= 2 RANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGES VARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE C 30.000000 30.000000 10.000000 D 40.000000 20.000000 20.000000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 36.000000 24.000000 16.000000 3 40.000000 26.666670 16.000000 4 8.000000 INFINITY 5.000000
Objective: MAX 30 C + 40 D
s.t. (carpentry) 6 C + 4 D <= 36 (varnishing) 4 C + 8 D <= 40 (demand for desks) D <= 8 (non-negativity) C >= 0 D >= 0
LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) 240 VARIABLE VALUE REDUCED COST C 4.000000 .000000 D 3 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 2.500000 3) .000000 3.750000 4) 5.000000 .000000 NO. ITERATIONS= 2 RANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGES VARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE C 30.000000 30.000000 10.000000 D 40.000000 20.000000 20.000000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 36.000000 24.000000 16.000000 3 40.000000 26.666670 16.000000 4 8.000000 INFINITY 5.000000
7
EXCEL: The Model
8
EXCEL: The Answer ReportMicrosoft Excel 11.0 Answer ReportWorksheet: [LP Example 10.xls]Example10Report Created: 11/7/2006 11:03:04 AM
Target Cell (Max)Cell Name Original Value Final Value
$D$11 Maximize profit 240 240
Adjustable CellsCell Name Original Value Final Value
$B$6 Production C 4 4$C$6 Production D 3 3
ConstraintsCell Name Cell Value Formula Status Slack
$D$19 Carpentry Total hours 36 $D$19<=$F$19 Binding 0$D$20 Varnishing Total hours 40 $D$20<=$F$20 Binding 0$C$6 Production D 3 $C$6<=$C$8 Not Binding 5
9
EXCEL: The Sensitivity ReportMicrosoft Excel 11.0 Sensitivity ReportWorksheet: [LP Example 10.xls]Example10Report Created: 11/7/2006 11:03:04 AM
Adjustable CellsFinal Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease$B$6 Production C 4 0 30 30 10$C$6 Production D 3 0 40 20 20
ConstraintsFinal Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease$D$19 Carpentry Total hours 36 2.5 36 24 16$D$20 Varnishing Total hours 40 3.75 40 26.66666667 16
Dual Prices in LINDO
10
EXCEL: The Limit ReportMicrosoft Excel 11.0 Limits ReportWorksheet: [LP Example 10.xls]Limits Report 1Report Created: 11/7/2006 10:26:28 AM
TargetCell Name Value
$D$11 Maximize profit 240
Adjustable Lower Target Upper TargetCell Name Value Limit Result Limit Result
$B$6 Production C 4 0 120 4 240$C$6 Production D 3 0 120 3 240
The values in the Lower Limit column indicate thesmallest value each decision variable can assumewhile the values of all other decision variables remainConstant and all the constraints are satisfied.
The values in the Upper Limit column indicate thelargest value each decision variable can assumewhile the values of all other decision variables remainconstant and all the constraints are satisfied.
11
Simulation (pp. 81 – 104)
Uncertainty
12
Simulation: Preparation (p.81) An experiment is the process by which an observation (or
measurement) is obtained. Flipping a fair coin 5 times to observe the total number of Heads (H) or
Tails (T). An event is the outcome of an experiment.
3 H’s and 2 T’s in 5 trials. A variable X is a random variable if the value it assumes,
corresponding to the outcome of an experiment, is a chance or random event. It may be defined as a specification or description of a numerical result from a random experiment. X = total number of T in 5 trials.
Probability shows you the likelihood or chances for each of the various potential future events, based on a set of assumptions about how the world works. Probability tells you what the data will be like when you know how the world is. (Cf. Statistics helps you figure out what the world is like after you have seen some data that it generated.) Pr( X = 5 ) = 0.03125.
13
Probability Distributions (p.81) The pattern of probabilities for a random variable is called its
probability distribution. It can be represented by a formula, table, or graph.
A Probability Table Variable X Probability
0 0.03125 1 0.15625 2 0.31250 3 0.31250 4 0.15625 5 0.03125
A Probability Distribution Plot
Probability Distribution of X
X = Total Number of T in 5 trials
Pro
babi
lity
0 1 2 3 4 50
0.1
0.2
0.3
0.4
A Probability Density Function
kk
kkXP
5
2
11
2
15)(
In short, a probability distribution tells us (1) what possible outcomes of a random experiment are, and (2) how likely each outcome occurs.
14
Game 1 Expected Payoff (p.82)
Game 1. Flip a fair coin once. You get $1 if T occurs. Expected Payoff = $1P(T) + $0P(H) = $1(0.5) + $0(0.5) = $0.50
Game 1 Probability Distribution
Pro
bab
ility
0
0.2
0.4
0.6
H T
15
Game 2 Expected Payoff (p.82)Game 2. Flip a fair coin 5 times. You get $1 for every T. Expected Payoff
=
5
0
)(k
kxPx
= kk
k kx
5
5
0
)5.01()5.0(5
=
5
0
5)5.01()5.0()!5(!
!5
k
kk
kkx
= … = … = $2.5
Game 2 Probability Distribution
Number of Tails
Pro
babi
lity
0
0.1
0.2
0.3
0.4
01
23
45
16
Simulation
Simulation is a method for learning about a real system by experimenting with a model that represents the system. In other words, a simulation model is a model that imitates a real-life situation.
How does a computer “flip coins?”
17
Excel Function: =Rand()
Returns an evenly distributed random number greater than or equal to 0 and less than 1. A new random number is returned every time the worksheet is calculated.
To generate a random real number between a and b, use: RAND()*(b - a) + a
0 1
Uniform Distribution (0.0, 1.0)
18
Simulation Using Excel Functions (p.82)
Formula in cells B2, B6:B10: =if(rand() < 0.5, “H”, “T”) Formula in cell B11: =countif(B6:B10, “T”) Formula in Cell C2: =1 * B2 Formula in cell C6: =1 * B11 Problem ? hard to keep track of results.
19
A Simulation Model (p.77)
Controllable Inputs(values are selected by decision makers)
Probabilistic Inputs(values are randomly generated)
Model(mathematical expressions andlogical relationships)
Output
Controllable Inputs(values are selected by decision makers)
Probabilistic Inputs(values are randomly generated)
Model(mathematical expressions andlogical relationships)
Output
A simulation model contains the mathematical expressions and logical relationships that describe how to compute the value of the output given the values of the inputs (both controllable and probabilistic inputs).
20
Game 1 Simulation Using @Risk (p.83)
-0.2 0.15 0.5 0.85 1.2
5% 90% 5% 0 1
Mean=0.5
Distribution for Payoff/C2
0.000
0.100
0.200
0.300
0.400
0.500
0.600
Mean=0.5
-0.2 0.15 0.5 0.85 1.2
@RISK Student VersionFor Academic Use Only
21
Game 2 Simulation Using @Risk (p.84)
-1 0 1 2 3 4 5 6
5% 90% 5% 1 4
Mean=2.5
Distribution for Payoff / Outcome/B8
0.000
0.050
0.100
0.150
0.200
0.250
0.300
0.350
0.400
Mean=2.5
-1 0 1 2 3 4 5 6
@RISK Student VersionFor Academic Use Only
22
Key Idea: Use Probability Distributions to Describe Uncertainty/Summarize Experience
Probability Distributions
23
Estimated Unit Sales
Summarize your experience/knowledge on unit sales using:
=RiskUniform(0.08, 0.12) =RiskNormal(0.10, 0.02) =RiskNormal(0.10, 0.001) =RiskPert(0.08, 0.10, 0.12)
=RiskTriang(0.08, 0.10, 0.12) =RiskDiscrete({0.08,0.10, 0.12},{0.1, 0.7,
0.2})
24
NPV: Simulation Results
100100
-150 -100 -50 0 50 100 150 200 250
24.24% 67.82% 7.95% 0 100
Mean=33.08259
Distribution for NPV / Year 0/C19
0.000
0.020
0.040
0.060
0.080
0.100
0.120
0.140
0.160
0.180
0.200
Mean=33.08259
-150 -100 -50 0 50 100 150 200 250
@RISK Student VersionFor Academic Use Only
25
Other @Risk Functions