Chapter 11 – Monte Carlo Simulation
11.1 Introduction
• The basic idea of simulation is to build an experimental device, or simulator, that will “act like” (simulate) the system of interest in certain important aspects in a quick, cost-effective manner.
• Simulation versus optimization
- In an optimization model the values of the decision variables are outputs. That is, the model provides a set of values for the decision variables that maximizes (or minimizes ) the value of the objective function.
- In a simulation model the values of the decision variables are inputs. The model evaluates the objective function for a particular set of values – the quality of the suggested solution as well as how much variability there might be in the various performance measures due to randomness in the inputs.
• When should simulation be used?
- analytical models yield the best answer, but they may be difficult/impossible to obtain depending on complicating factors
- analytical models typically predict only average or steady-state (long run) behavior - simulation can be performed with a great variety of software
• Simulation and random variables
- Simulation models are often used to analyze a decision under risk – the factor that is not know with certainty is though of as a random variable (behavior is described by a probability distribution) ! sometimes called Monte Carlo method
- Used e.g. for “queuing models when it is difficult or impossible to obtain analytic results, or for multi-item, multi-location inventory models which are very difficult to analyze using an analytical model
11.2 Generating random variables
• Discrete random variables = can assume only certain, specific values (e.g. integers)
- Discrete uniform distribution = each value is equally likely – can be generated from a continuous uniform distribution by INT(x+(y-x+1)*RAND()) x being the lower, y being the upper bound
• Continuous random variables = may take on any fractional value (an infinite number of possible outcomes
! probability of a specific value is zero)
- Cumulative distribution function (CDF) – e.g. f(x) = Prob{D <= x}
- As the probability that any specific value occurs is strictly zero, continuous random variables do not have probability distributions; the density function and the CDF are the 2 functions used to define a continuous random variable
- Exponentially distributed random variable with a mean of x: -x*LN(1-RAND()) - Normal distributed random variable with a mean of x and standard dev. of y:
NORMINV(RAND(),x,y)
• Random number generators (RNG) are built in into spreadsheet software
11.4 Simulating with spreadsheet add-ins
• Don’t fall into the “expected value” trap! – There are cases where the true mean of a variable can be calculated by setting all the random values to their means, but it does not always work!
• True mean of a sample normal distribution is contained in an interval of ± 1.96 standard deviations about the estimated mean divided by the square root of the number of samples
• Poisson distribution = is good description when demand is relatively small, is a one-parameter distribution, as only the mean value needs to be known (is ad discrete distribution – only nonnegative integer values)
• About simulations:
- Increasing the number of trials gives a better estimate, but even with large numbers, the can be a difference between the simulated averaged and the true expected return
- Simulations provides useful information on the distribution of results, but is sensitive to assumptions affecting the input parameters
Chapter 10 – Decision Analysis
10.1 Introduction
• Decision analysis provides a framework that establishes (1) a system of classifying decision models based on the amount of information about the model that is available and (2) a decision criterion
• decision theory treats decisions against nature – the result (return) from an individual decision depends on the action of another player (nature), over which you have no control (in game theory both players have an economic interest)
• payoff table = lists alternative decisions along the side of the table, the possible states of nature on top and gives the payoffs for all possible combinations ! the decision is always made first
10.2 Tree classes of decision models
• decision under certainty = you know which state of nature will occur (or there is just one single state) - to solve such a decision model, you just select the decision that yields the highest return
• decisions under risk = lack of certainty about future events is a characteristic of most management decision models
- definition of risk in the decision under risk: There is more than one state of nature and for which we make the assumption that the decision maker can arrive at a probability estimate for the occurrence for each of the various states of nature (generally by using historical frequencies)
"# expected value of any random variable is the weighted average of all possible values of it
! management should make the decision that maximizes the expected return
"# risk profile = shows all the possible outcomes with their associated probabilities for a given decision
"# a sensitivity analysis can be made using the data table command
• decisions under uncertainty = more than one possible state of nature, but decision maker is unwilling or unable to specify the probabilities
- Laplace Criterion = approaches the condition of uncertainty as equivalent to assuming that all states of nature are equally likely ! transforms problem into a decision under risk
- Maximin criterion = evaluates each decision by the worst thing that can happen if you make that decision ! decision that yields the maximum value of the minimum returns is then selected (but does not necessarily give the best result – often used if planner feels he cannot afford to go wrong - Maximax criterion = evaluates each decision by the best thing that can happen ! decision that
yields the maximum values of the maximum returns is then selected (same flaw as maximin) - Regret and Minimax Regret = new payoff table is made, where each current entry is subtracted
from the maximum in its column (opportunity costs) ! the typical suggestion then is to use the conservative minimax criterion, by which the smallest maximum regret is chosen
10.3 The expected value of perfect information
• Expected value of perfect information = expected return with perfect information – expected return with current sequence of events
- Can be easily calculated using Excels MAX() function 10.6 Decision Trees
• decision tree = graphical device for analyzing decisions under risk
• square node (or decision node) = represents a point at which a decision must be made – each line leading from a square represents a possible decision
• circular nodes = represent sitatuations when the outcome is not certain – each line is a possible outcome
• terminal positions = end of a branch
• terminal nodes = nodes not followed by others
• terminal value = return associated with each terminal position 10.8 Decision trees: incorporating new information
• a market research study can increase the expected return, even if it is not perfectly reliable
• conditional probability = P(A|B), probability that the event A occurs given that the event B occurs
• prior probabilities = initial estimates
• posterior probabilities = conditional probabilities ! key to obtain them is Bayes’ Theorem (see Statistics book W&W)
• when incorporating posterior probabilities in the decision tree, the tree has to be created in the chronological order in which information becomes available and decisions are required
• expected value of sample information
- EVSI (expected value of sample information) = maximum possible expected return with sample information – maximum possible expected return without sample information
- EVPI (expected value of perfect information) = maximum outcomes times the prior probabilities - when P(E|S) = 1.0 and P (D|W) = 1.0 then EVSI = EVPI, the better the sample information, the
close gets EVSI to EVPI
10.9 Sequential decisions: To test or not to test
• sequential decision model = value of an initial decision depends on a sequence of decisions and uncertain events that will follow the initial decision
• optimal strategy = a complete plan for the entire tree, it specifies what action to take no matter which of the uncertain events occurs
• to incorporate utilities into the decision tree, all you need to do is replace the payoffs with their utilities - treeplan has a built-in exponential utility function, which assumes a risk-averse utility function and
calculates the utilities for the given cash flows already on the tree 10.10 Management and decision theory
• typical management decision has the following characteristics:
- is made once and only once
- return depends on an uncertain event that will occur in the future
• we know about related event that may tell us something about the likelihood of the various outcomes ! for each decision, determine the utility of each possible outcome ! determine the probability of each possible outcome ! calculate the expected utility of each decision ! select the decision with the largest expected utility
• how do we know about the utilities and probabilities ! they are subjective and represent the best judgment and taste of the manager
Assessing subjective probabilities:
- structure is provided by equivalent lottery ! it allows one to quantify both subjective probability and utility through a process of personal judgment
- what we gain form assessing probability and utility separately – manager can concentrate attention on each of the entities one at a time
- Separating the assessments of probabilities and utilities forces a manager to give appropriate and separate consideration to each before combining the 2 to determine the final decision.
10.11 Notes on implementation
- decision analysis involves assigning probabilities and utilities to possible outcomes and maximizing expected utility in a 4 step process: (1) structuring the model, (2) assessing the probability of the possible outcomes, (3) determining the utility of the possible outcomes, and (4) evaluating alternatives and selecting a strategy
- important: decision analysis does not provide a completely objective analysis, but its important role is to make it consistent (the subjective component does not depend on “how you feel at the moment”
- continuous outcomes:
- approximate the continuous outcomes with a Pearson-Tukey approach (3 branches (representing the 0.05 fractile, the 0.5 fractile and the 0.95 fractile with optimal weights of 0.185, 0.63, 0.185) - or use the Monte Carlo simulation
Chapter 14 – Project Management: PERT and CPM
14.1 Introduction
- managing major projects involves complicated problems of scheduling, as they are often structured by the interdependence of activities
- PERT (Program Evaluation Review Technique, 1950s) and CPM (Critical Path Method, 1957) are
approaches to scheduling events of a project, that see the project as a network ! they allow for management by exception by reducing the number of activities that have to be closely monitored
14.2 A typical project: The global oil credit card operation
- first step: activity list = defines the activities in the project and establishes the immediate predecessors in the same line
- immediate predecessor = an activity that must be completed prior to the start of the activity in question - Gantt chart – simple graphical representation of earliest possible starting time for each activity and each
earliest possible completion time ! fails to show the necessary information of predecessors, as it automatically stamps each activity not completed on the earliest possible time as behind schedule and does not show the relation of the earliest possible starting times of other activities ! one cannot see whether or not the entire project is delayed
- PERT network diagram = each activity is represented by an arrow that is called a branch or an arc.
The beginning and end of each activity is indicated by a circle that is called a node. The term event is also used in connection with the nodes. An event represents the completion of the activities that lead into a node (when an activity is completed, the event occurs.).
- each activity must start at the node in which its immediate predecessors ended
"# Dummy activity (dashed line) = fictitious activity in the sense that it requires no time or resources, is just a device to enable us to draw a network representation and maintain the correct precedence relationships
"# Dummy variables can be avoided by associating activities with nodes instead of arcs (activity-on-the-node-approach)
14.3 The critical path
- second step: come up with time estimates for completion of each activity and do the critical path calculation - path = a sequence of connected activities that leads form starting to end node
- critical path = path that takes the longest time to complete, thus as all paths have to be completed successfully, it determines the overall project duration ! longest route problem
- critical activities = activities on the critical path – have to be kept on schedule - earliest start and earliest finish times:
- earliest starting time rule: The ES time for an activity leafing a particular node is the largest of the EF times for all activities entering the node
- EF = ES + t (earliest finishing time = earliest starting time + expected activity time
- continuing to each node in a forward pass through the entire network, the values [ES,EF] are computed
- latest start and latest finish times:
- in order to determine the latest date each activity can finish without delaying the entire project, we work backward form the target completion date determined with the earliest finish times
- LS = LF – t (latest starting time = latest finishing time – expected activity time)
- Latest finish time rule = the LF time for an activity entering a particular node is the smallest of the LS times for all activities leaving that node
- Slack = the amount of time an activity can be delayed without affecting the completion date for the overall project ! critical path activities are those with zero slack
- ways of reducing project duration:
- strategic analysis ! make arrangements to accomplish some activities in a different way to exclude them from the critical way ! what if question
- tactical approach: reduce the time of certain activities on the critical path
14.4 Variability in activity times
- estimating he expected activity time requires 3 inputs for each project:
- optimistic time [a] (the minimum, if everything goes perfectly); most probable time [m] (the most likely outcome); pessimistic time [b] (the maximum time, if everything goes wrong)
- activity time is thus a random variable with the beta probability distribution
- beta distribution = has a finite range of values and is capable of assuming a wide variety of shapes - estimate of expected activity time = (a + 4m + b)/6
- standard deviation of activity time = (b-a)/6 (assumption that there are 6 standard deviations between optimistic and pessimistic times)
- variance of activity time = [(b-a)/6]²
- but it is possible to use any procedure that seems appropriate to estimate the expected value and standard deviation
- probability of completing the project in time:
- T = total time that will be taken by the activities on the critical path - Var (T) = sum of the variances of the activities on the critical path
- if we assume the activity times to be independent random variables and T to have an approximately normal distribution, we can calculate the probability of completing the project in time by the formula using the standard normal distribution (Z = (T-µ)/σ))
- the result though has to be treated with care, as due to the randomness, some other path might become the critical path and thus what we observe with the critical path we observe is irrelevant
Using Crystal Ball
- by making the activity times random with Crystal Ball we can get a feel for the variability of both the project length and the critical path
- the forecasts can give us the expected project length and we can get the probability of completing in a certain time by using the cumulative chart
- for determining whether an activity might be a critical activity, we just have to look at the frequency distribution of the activity, if there is a peak at zero, it may be a critical activity (an insight that the PERT analysis might obscure)
14.5 CPM and time-cost trade-offs
- PERT is a useful approach when there is little previous time and cost experience to draw upon
- CPM is useful, if good estimates of time and resource requirements can be made on the basis of historical data, as then the trade-off between time for completion and cost of resources devoted to the activity may be very interesting
- CPM assumes costs to be a linear function of time
- Question: “What activity times should be selected to yield the desired project completion time at minimum cost?”
Required date for the CPM !!!! 4 pieces of input for each activity - normal time: maximum time for the activity – a known quantity - normal cost: cost required to achieve the normal time
- crash time: minimum time for the activity - crash cost: cost required to achieve the crash time
- with this data, the max crash hours (normal time –crash time) and the cost of one hour of crash time can be computed
- crashing = process of reducing an activity time Crashing a project
- using the normal time for each activity the earliest completion time incurring only normal costs can be calculated, then we are in a position to determine the minimum cost method of reducing this time to a specified level, by the use of a linear programming model (SOLVER!)
- objective function: minimize total cost of crashing the network for a specified completion time - constraints:
- crash time per activity <= max crash time for activity
- earliest start time for an activity => normal earliest start time – hours crashed - earliest finish time for an activity = earliest start time + normal time – crashed time - earliest finish of terminal activities <= required finishing time
- interpreting the sensitivity report the solver can provide we get insight in the cost structure of further reductions in the required finishing time
Chapter 7 – Integer optimization
7.1 Introduction to integer optimization
- integer linear programming (ILP) model = model that could be formulated and solved as linear programming model except that some or all variables are required to assume integer values
- rounded solution = in a LP model, a noninteger solution is often adapted to the integer requirement by simply rounding, this leads to acceptable answers, the larger the LP solution decision variable value is, but cannot be generalized
- integer solutions matter: for small scale variables, for variables indicating logical decisions (1=Yes) and others
- many models that can be easily solved as LP formulations become unsolvable for practical reasons as ILPs;
usually it takes 10 times longer, but frequently hundreds or thousands of times
7.2 Types of integer linear programming models
- all-integer linear program = all decision variables are required to be integers
- mixed integer linear program (MILP) = only some of the variables are restricted to integer values - binary integer linear program (0-1 integer linear program) = integer variables are restricted to 0 and 1,
representing dichotomous decisions (yes/no) ! can be found in all-integer and MILPs
- LP relexation = LP model that results if we start with an ILP and ignore the integer restrictions 7.3 Graphical interpretations of ILP models
- to sole an ILP graphically we follow 3 steps:
- find the feasible set for the LP relaxation of the ILP model - identify the integer points inside the set
- find among those points the one that optimizes the objective function
- optimal value (OV) = the highest value the objective function can reach (LP) – always occurs at the intersection of 2 constraint lines
- In a MAX model the OV of the LP relaxation always provides an upper bound on the OV of the original ILP, adding the integer constraint can only lower the OV or leave it the same
- In a MIN model the OV of the LP relaxation always provides a lower bound on the OV of the original ILP, addint the integer constraint can only raise the OV or leave it the same - rounded solutions ! with n decisions there are 2n points that can be rounded to, but:
- Non of the neighboring integer points may be feasible
- Even if one or more of the neighboring integer points is feasible, (a) such a point need not be optimal for the ILP, (b) nor does it need to be even near the optimal ILP solution
- Complete enumeration = list all feasible points and evaluate the objective function at each of them ! due to the complexity, this is usually not a feasible solution
7.4 Applications of binary variables – logical conditions - 1 = yes, 0 = no
- no more than k of n alternatives ! x1 + x2 + … + xn <= k - dependent decisions:
- not select k unless first m is selected ! xk <= xm
- if either k or m is selected, the other also has to be selected ! xk = xm
- lot size constraints: if we make the decision, then the lot size has a minimum (and a maximum) ! has to be modeled with 2 variables, a binary variable for the decision (y), a continuous variable (or integer variable) for the size (x) ! x >= min*y (and x <= max*y)
- k of m constraints
7.5 An ILP Vignette: A fixed charge model
- fixed charge models: lot size models incorporating a cost behavior in which if a facility is used a fixed amount has to be paid
- if in a warehousing model, supply variables at the points are decided upon with a binary variable and the demand at other points are integers, also the optimal solution for number of transportation units will be an integer, without the requirement of an integer output