Introduction to Simulation



Similar documents
Chapter 3 RANDOM VARIATE GENERATION

Data Analysis Tools. Tools for Summarizing Data

How to Use a Data Spreadsheet: Excel

How To Use Excel With A Calculator

Monte Carlo Simulation. SMG ITS Advanced Excel Workshop

Chapter 9 Monté Carlo Simulation

Building and Using Spreadsheet Decision Models

ModelRisk for Insurance and Finance. Quick Start Guide

Using Excel (Microsoft Office 2007 Version) for Graphical Analysis of Data

In-Depth Guide Advanced Spreadsheet Techniques

sensitivity analysis. Using Excel 2.1 MANUAL WHAT-IF ANALYSIS 2.2 THRESHOLD VALUES

seven Statistical Analysis with Excel chapter OVERVIEW CHAPTER

MBA 611 STATISTICS AND QUANTITATIVE METHODS

TEACHING SIMULATION WITH SPREADSHEETS

Drawing a histogram using Excel

FTS Real Time Client: Equity Portfolio Rebalancer

Chapter 4 Lecture Notes

TEST 2 STUDY GUIDE. 1. Consider the data shown below.

Understanding Confidence Intervals and Hypothesis Testing Using Excel Data Table Simulation

Notes on Excel Forecasting Tools. Data Table, Scenario Manager, Goal Seek, & Solver

Introduction to Statistical Computing in Microsoft Excel By Hector D. Flores; and Dr. J.A. Dobelman

Appendix 2.1 Tabular and Graphical Methods Using Excel

Commonly Used Excel Formulas

Activity 3.7 Statistical Analysis with Excel

Important Probability Distributions OPRE 6301

Intro to Simulation (using Excel)

Getting Started with Excel Table of Contents

Chapter 12 Simulation 537

0 Introduction to Data Analysis Using an Excel Spreadsheet

SOME EXCEL FORMULAS AND FUNCTIONS

University of Southern California Marshall Information Services

Probability Distributions

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

Data exploration with Microsoft Excel: univariate analysis

MATH 140 Lab 4: Probability and the Standard Normal Distribution

6.4 Normal Distribution

Simulation and Lean Six Sigma

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Using simulation to calculate the NPV of a project

5 IN THIS CHAPTER. Working Capital and Cash Flow Analysis

Below is a very brief tutorial on the basic capabilities of Excel. Refer to the Excel help files for more information.

Break-Even and Leverage Analysis

Table of Contents TASK 1: DATA ANALYSIS TOOLPAK... 2 TASK 2: HISTOGRAMS... 5 TASK 3: ENTER MIDPOINT FORMULAS... 11

Tools for Excel Modeling. Introduction to Excel2007 Data Tables and Data Table Exercises

Gamma Distribution Fitting

Finite Mathematics Using Microsoft Excel

AMS 5 CHANCE VARIABILITY

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

The Fourier Analysis Tool in Microsoft Excel

Interpreting Data in Normal Distributions

Justifying Simulation. Why use simulation? Accurate Depiction of Reality. Insightful system evaluations

How To Check For Differences In The One Way Anova

6 Scalar, Stochastic, Discrete Dynamic Systems

Understanding Margins

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

CHAPTER 2 Estimating Probabilities

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

FINANCIAL ECONOMICS OPTION PRICING

Understanding Margins. Frequently asked questions on margins as applicable for transactions on Cash and Derivatives segments of NSE and BSE

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS Instructor: Michael Gelbart

Risk Analysis and Quantification

Using Analysis Tools: Goal Seek, Solver, and Data Tables

6 3 The Standard Normal Distribution

Risk Analysis Overview

SECTION 2-1: OVERVIEW SECTION 2-2: FREQUENCY DISTRIBUTIONS

CHAPTER 7 INTRODUCTION TO SAMPLING DISTRIBUTIONS

Numbers 101: Cost and Value Over Time

ESTIMATING THE DISTRIBUTION OF DEMAND USING BOUNDED SALES DATA

MICROSOFT EXCEL FORECASTING AND DATA ANALYSIS

MBA Jump Start Program

11.3 BREAK-EVEN ANALYSIS. Fixed and Variable Costs

Introduction to Data Tables. Data Table Exercises

Calc Guide Chapter 9 Data Analysis

How To Use Excel On A Computer Or A Computer With A Cell Phone Or Cell Phone

STT315 Chapter 4 Random Variables & Probability Distributions KM. Chapter 4.5, 6, 8 Probability Distributions for Continuous Random Variables

MICROSOFT EXCEL STEP BY STEP GUIDE

Betting with the Kelly Criterion

APPENDIX B. The Risk Pool Game B.1 INTRODUCTION

MONT 107N Understanding Randomness Solutions For Final Examination May 11, 2010

Stat 20: Intro to Probability and Statistics

To create a histogram, you must organize the data in two columns on the worksheet. These columns must contain the following data:

Data Analysis. Using Excel. Jeffrey L. Rummel. BBA Seminar. Data in Excel. Excel Calculations of Descriptive Statistics. Single Variable Graphs

Statistical Data analysis With Excel For HSMG.632 students

Statistics in Astronomy

The Math. P (x) = 5! = = 120.

Simulation Exercises to Reinforce the Foundations of Statistical Thinking in Online Classes

ACS Microcomputer Workshop Excel: Functions and Data Analysis Tools

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

Notes on Factoring. MA 206 Kurt Bryan

Polynomial Degree and Finite Differences

Using Excel. 4. The Scenario Manager function is used to create and evaluate a collection of what-if scenarios containing multiple input values.

Simple Random Sampling

Excel Modeling Practice. The Svelte Glove Problem Step-by-Step With Instructions

Microsoft Axapta Inventory Closing White Paper

t Tests in Excel The Excel Statistical Master By Mark Harmon Copyright 2011 Mark Harmon

The Intuition Behind Option Valuation: A Teaching Note

Aachen Summer Simulation Seminar 2014

Normality Testing in Excel

Transcription:

ancmat03.qxd 11/16/06 3:28 PM Page C1 SUPPLEMENT Introduction to Simulation C LEARNING OBJECTIVES After completing this supplement you should be able to 1 2 3 4 5 Explain why simulation is a valuable tool for decision making. Define the steps involved in the simulation modeling process. Generate random numbers from various distributions in Excel. Develop and run a simulation model in Excel. Analyze the results from a simulation in Excel. SUPPLEMENT OUTLINE Uncertainty and Risk in Decision Making C2 Simulation Overview and Software C2 Simulation Modeling Process C3 Random Number Generation in Excel C4 WHAT S IN ACC Continuous Probability Distributions C8 Application of Simulation to Decision Making C12 Other Applications of Simulation C21 Simulation within OM: Putting It All Together C21 OM FOR ME? FIN MKT OM HRM MIS C1

ancmat03.qxd 11/16/06 3:28 PM Page C2 C2 SUPPLEMENT C INTRODUCTION TO SIMULATION How do you deal with uncertainty in your everyday life? For example, you need to complete several assignments for different classes. You might estimate the time that each assignment will take in order to budget your time. You have probably encountered a situation in which an assignment actually took longer than you or your instructor estimated. This may have had an effect on your performance on other assignments. When there is uncertainty present, such as uncertainty in the amount of time necessary to complete an assignment, decisions become more complex. No longer can we rely on fixed values. We must be willing to consider variation in estimates. For example, you might estimate that an assignment will take between two and four hours. If you do this for several assignments, the key question is how long it will take to complete all assignments. Simulation is a tool that can directly take into account the uncertainty in a situation, incorporating the uncertainties from multiple sources. It has become one of the most useful analytical techniques in operations management for analyzing facility layouts, testing scheduling methods, and other important questions. UNCERTAINTY AND RISK IN DECISION MAKING Computer simulation A methodology that evaluates the performance of a system when one or more input values are uncertain. Managers face decisions every day involving uncertainty. If a company is considering expanding a facility, there is uncertainty about whether future demand will be high enough to make the expansion financially attractive. The decision to expand, however, must be made before it is known what future demand will be. The uncertainty in demand implies the risk that the company will be hurt financially. Quantitative models can provide tremendous insight and assistance in decision making. Unfortunately, many quantitative models ignore the uncertainty present in the real situations. Sometimes this uncertainty is taken into account after a model is built when some different what-if scenarios are considered, or a sensitivity analysis is conducted, using methods similar to those discussed in Supplement A. However, oftentimes there is uncertainty about a number of factors, and it is difficult to do a complete scenario analysis. Computer simulation is a methodology that allows one to model the uncertainty directly and obtain a clear picture of the effect of that uncertainty on the output quantities of a model. That is, simulation allows a decision maker to accurately determine the effects of the uncertainty present in a situation. SIMULATION OVERVIEW AND SOFTWARE A computer simulation is a model that mimics what might happen in reality. In the broadest sense, every mathematical model is really a simulation. However, in this supplement we restrict ourselves to situations in which there is some uncertainty or randomness about some aspect of the system under consideration and we want to model that uncertainty directly. For example, future demand is uncertain in most business planning situations. Customers arrive to a restaurant drive-through window according to some random process rather than being equally spaced in time. Simula-

ancmat03.qxd 11/16/06 3:28 PM Page C3 SIMULATION MODELING PROCESS C3 tion allows us to model this random behavior and compute system performance measures, providing valuable information for decision makers. Simulation is one of the most commonly used analytical tools for complex systems. This supplement focuses on spreadsheet-based simulation models. Spreadsheet simulation is well suited to analyze many operational problems. We will apply Monte- Carlo Simulation, which repeatedly takes samples from known probability distributions for the random parameters in a problem and computes the resulting output measures. Examples of decision situations amenable to Monte-Carlo Simulation include location and expansion decisions, inventory analyses, project planning, and relatively simple waiting line (queuing) systems. All of these situations typically involve uncertainty. In this supplement we will develop, run, and analyze these simulation models using only built-in Excel functionality. However, you should be aware that there are Excel add-ins available for simulation that provide more functions for probability distributions and analysis of the simulation results and eliminate some of the routine tasks involved in running the simulation model. Two leading Excel add-ins are Crystal Ball (http://www.decisioneering.com) and @Risk (http://www.palisade.com). Although relatively complex systems can be analyzed in spreadsheets, there are many software products available that are better able to handle large, complex systems. Many of these products employ what is known as discrete-event simulation, which is a methodology for modeling how the state of the system under investigation changes as different events (such as customer arrivals or departures) occur. For example, if you were planning the layout and operation of an entire new production or service facility, modeling the supply chain of a company, or reengineering complex business processes, a stand-alone simulation product using discrete-event simulation would be a better choice than a spreadsheet model. Products more suitable for complex systems modeling include ProModel (http://www.promodel.com), Extend (http://www.imaginethatinc.com), and ProcessModel (http://www.processmodel.com). OR/MS Today (http://www.lionhrtpub.com/orms.shtml), a publication of the Institute for Operations Research and Management Science (INFORMS), periodically publishes simulation software surveys. Monte-Carlo Simulation A simulation that repeatedly samples from probability distributions and computes the resulting performance measures of the system. Discrete-event simulation A methodology that models the state of a system as it changes as a result of certain events that occur randomly in time. The process of developing and using a spreadsheet-based simulation model is similar to that for a regular spreadsheet model (see Supplement A). The key difference is that a simulation model directly incorporates the randomness or uncertainty present in the situation. Therefore, the output of a simulation model is not a single number, but rather a probability distribution. Figure C-1 shows a schematic of a simulation model. Typically, there are certain inputs that are fixed, that is, not subject to uncertainty. For example, we may know for certain the price we must pay for a product. In addition, there are also one or more inputs that are random. For example, we may not know the exact level of demand, but we can use our knowledge of the situation to describe the possible values of demand using a probability distribution (just as we do not know the outcome of a single roll of a die beforehand, but we can describe the probability distribution of possible outcomes). Since at least one of the inputs is random, this implies that the output of the model is also random. The output of a simulation analysis is really the probability distribution of possible output values, rather than a single number. This gives the decision maker a much clearer picture of the risk involved in a situation than is possible with a regular model. SIMULATION MODELING PROCESS

ancmat03.qxd 11/16/06 3:28 PM Page C4 C4 SUPPLEMENT C INTRODUCTION TO SIMULATION FIGURE C-1 Fixed (Known) Inputs Simulation model schematic Random (Uncertain) Inputs Simulation Model Outputs/Performance Measures Decision Variables Briefly, the simulation modeling process in a spreadsheet involves the following steps. Just as in any modeling and analysis activity, sometimes it is necessary to loop back to a previous step. Deterministic spreadsheet model A logically correct and complete model, but without any randomness built into it. Develop a deterministic spreadsheet model. Determine the appropriate probability distributions to use for the random inputs to the model. Modify the deterministic model by incorporating the random inputs using the probability distributions. Recalculate the model many times to generate many possible values of the model output(s). Each single recalculation is called a trial or replication. Analyze the possible output values by considering the summary statistics and the probability distribution of the output(s). RANDOM NUMBER GENERATION IN EXCEL The foundation of any simulation model is random number generation. In order to create simulations of real systems, we must have a way to mimic how they behave in the real world. For example, consider the act of tossing a coin. There are two possible outcomes, heads and tails, with equal probability. How can we simulate this activity, generating outcomes that mimic what might happen if we tossed a real coin? While this is a very simple situation, the basic concept applied here is exactly the same as is used for more complex situations. The key to modeling any random event hinges on generating random values uniformly distributed between 0 and 1. We ll let X be a specific random value from this distribution between 0 and 1, denoted U(0, 1). If we can generate values of X, then logic and mathematics can be applied to convert these values into the real outcomes. For example, if X is between 0.0 and 0.5, we would consider that to be a heads, and if X is between 0.5 and 1.0, we would consider it to be tails (the reverse definition of heads and tails also works because of the equal probability of the event). Fortunately, Excel has a built-in function to generate values from the U(0, 1) distribution. This function is written RAND(), where the parentheses are required and nothing is put between them. The parentheses are there to indicate to Excel that we are entering a function. Each time the RAND function is calculated, a different number between 0 and 1 is the result.

ancmat03.qxd 11/16/06 3:28 PM Page C5 RANDOM NUMBER GENERATION IN EXCEL C5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A B C D E 50 Random Numbers Between 0 and 1 Using =RAND() Function 0.0315 0.6994 0.9362 0.7039 0.8702 0.7175 0.2131 0.4071 0.2706 0.6158 0.4030 0.1604 0.6318 0.4906 0.9260 0.7933 0.7953 0.9929 0.7353 0.8710 0.0286 0.9634 0.3228 0.7877 0.9788 0.1769 0.8939 0.6887 0.4608 0.1845 0.0933 0.0601 0.9990 0.9388 0.7421 0.0493 0.0077 0.6724 0.8535 0.8682 0.2417 0.4332 0.2643 0.7290 0.1131 0.8998 0.6985 0.2092 0.5859 0.8812 A4: =RAND() Copied to A4:E13 FIGURE C-2 Fifty U(0,1) random numbers Figure C-2 shows fifty numbers generated using the RAND function. The function was entered into one cell and copied to all the others. So, although exactly the same function is entered into each of these cells, each resulting value is different. To recalculate the set of numbers again, press the F9 key. Excel independently calculates each one of the functions. Therefore, we can use each of these values to determine a heads or a tails. Problem-Solving Tip: If you are working through this supplement at the computer, your numerical results for all the examples will differ from what is shown in the text. This is the nature of random numbers and simulation. A histogram of values from the RAND function should show the values to be approximately uniformly distributed between 0 and 1. Figure C-3 shows a histogram based on fifty values of the RAND function. There are ten bins in this histogram, and the labels on the horizontal axis are the upper end point of each bin. Therefore, the column for 0.2 indicates there were four values 0.10 but 0.20. If the values Frequency 8 7 6 5 4 3 2 1 0 Histogram (50 Random Values from = RAND() function) FIGURE C-3 Histogram of fifty values from RAND() function 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Upper End of Category

ancmat03.qxd 11/16/06 3:28 PM Page C6 C6 SUPPLEMENT C INTRODUCTION TO SIMULATION were perfectly uniformly distributed, there would be five observations in each of these ranges. However, as you know, if you flip a coin fifty times, you will generally not get exactly twenty-five heads and twenty-five tails. As more values from RAND are generated, the resulting histogram should become more and more uniform. Figure C-4 is a histogram generated from 5000 values of the RAND function. Notice that these columns are much more even in height than for the 50-value histogram. Just as a pollster obtains a better representation of the views of the entire population by interviewing more people, we obtain a truer picture of the real system if we compute many replications of a simulation model. Bernoulli Distribution: Simulating the Flip of a Coin Returning to the coin flip, how do we simulate this? Taking one value from U(0, 1), if that value is 0.5, we can consider that a heads ; otherwise, we ll consider it a tails. This can be done in Excel using the IF function, as shown in Figure C-5. This figure also shows the results from 100 coin flips, by copying the respective formulas down and counting the numbers of heads and tails. Note that in this figure some of the rows have been hidden (Format/Row/Hide). We use the COUNTIF function to count the numbers of heads and tails. The first argument in this function is the count range and FIGURE C-4 Histogram of 5000 values from RAND function 600 500 Histogram (5000 Random Values from = RAND() function) Frequency 400 300 200 100 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Upper End of Category FIGURE C-5 Spreadsheet for coin flip example: Bernoulli distribution 1 2 3 4 5 6 7 8 9 10 11 102 103 A B C D E F G H Coin Toss Simulation A4: =RAND() U(0,1) H/T 0.010 Heads 0.031 Heads B4: =IF(A4<0.5,"Heads","Tails") 0.908 Tails 0.936 Tails 0.196 Heads Number Heads 43 0.667 Tails Number Tails 57 0.713 Tails Total 100 0.355 Heads 0.151 Heads 0.757 Tails E8: =COUNTIF(B$4:B$103,"Heads") E9: =COUNTIF(B$4:B$103,"Tails")

ancmat03.qxd 11/16/06 3:28 PM Page C7 RANDOM NUMBER GENERATION IN EXCEL C7 the second is the criteria. In this particular set of 100 coin flips, we had 43 heads and 57 tails. If we recalculate the spreadsheet (by hitting the F9 key), we will generate 100 new coin flips, and our total heads and tails will probably be different. There is nothing special about the 0.5 probability used in the coin flip situation. We might be simulating a customer service operation, where the probability of a customer making a complaint is 0.01. In a model, a complaint would likely trigger a conflict-resolution process, which would involve additional employee resources, time, and costs. Any situation involving two outcomes can be modeled in this way. Another example is if we have a process that produces defective items with some probability. A random variable that can have two outcomes is called a Bernoulli random variable. Discrete Uniform Distribution: Simulating the Roll of a Die What if there are more than two outcomes? For example, how would we model the outcome from a normal six-sided die? The outcomes from a single die come from a discrete uniform distribution, since there is a finite number of outcomes, each having the same probability. Conceptually, the random number generation process is the same as for the coin flip. We generate a U(0,1) random number (say, X) and then translate that number into one of the numbers 1, 2,...,6 with equal likelihood. Therefore, if 0 X 0.167 (i.e., 1/6), then the die outcome is 1. If 0.167 X 0.333, then the die outcome is 2, and so on, up through if 0.833 X 1, the die outcome is 6. This could be accomplished in Excel by modifying the IF statement used for the coin flip example. However, we would need to nest multiple IF functions to accomplish this. Fortunately, there is a better way using Excel s VLOOKUP function. The VLOOKUP (vertical lookup) function looks up a value in a table and returns a corresponding value from the same row. For example, we could use it to look up a customer number and return the number of items that customer has purchased. The VLOOKUP function has the form Bernoulli random variable A random variable that can assume only two values. Discrete uniform distribution A probability distribution in which there are a finite number of equally spaced outcomes, each with equal probability. VLOOKUP(lookup_value, table_array, col_index_num) The lookup_value is the value to be found in the first column of the table_array. The table_array is the table of information in which data is looked up. The col_index_num is the column number in the table_array from which the matching value is returned. A col_index_num of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. For more information, see the Excel help system. Figure C-6 shows how the simulation of a die roll can be conducted. As before, we have copied the logic down to represent 100 rolls of the die (some rows have been hidden) and counted the number of each outcome. We know in a limited sample we will not have exactly 16.67 percent of the rolls corresponding to each possible outcome. The VLOOKUP function in cell B4, VLOOKUP(A4,E$7:G$12,3), converts the U(0,1) random number in cell A4 (the lookup_value) to a simulated outcome of the die. It looks in the first column of the table_array E$7:G$12. Specifically, it looks in cells E$7:E$12 for the greatest value that is less than or equal to the value in A4. Since A4 contains the value 0.607, the VLOOKUP function stops at the 0.500 in cell E10, this being the greatest value that is also less than or equal to 0.607. Then, since 3 is the col_index_num, the VLOOKUP function returns the value in column 3 of the table, in the same row as the value 0.500 (i.e., the value 4 in cell G10). Similarly,

ancmat03.qxd 11/16/06 3:28 PM Page C8 C8 SUPPLEMENT C INTRODUCTION TO SIMULATION FIGURE C-6 Spreadsheet for die roll example: discrete uniform distribution 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 102 103 A B C D E F G Die Roll Simulation U(0,1) Roll 0.607 4 B4: =VLOOKUP(A4,E$7:G$12,3) 0.127 1 Cumulative Probability Distrib 0.005 1 Probability Begin End Outcome 0.911 6 0.167 0.000 0.167 1 0.533 4 0.167 0.167 0.333 2 0.505 4 0.167 0.333 0.500 3 0.496 3 0.167 0.500 0.667 4 0.167 2 0.167 0.667 0.833 5 0.198 2 0.167 0.833 1.000 6 0.294 2 0.631 4 0.924 6 Results of Simulation 0.421 3 Roll Frequency Fraction 0.245 2 1 18 0.18 0.453 3 2 15 0.15 0.556 4 3 24 0.24 0.663 4 4 20 0.20 0.077 1 5 10 0.10 0.711 5 6 13 0.13 0.776 5 100 0.385 3 0.468 3 0.352 3 0.668 5 0.440 3 0.008 1 0.503 4 0.614 4 A4: =RAND() (copied down) E23: =SUM(E17:E22) E17: =COUNTIF(B$4:B$103,D17) (copied down) F17: =E17/E$23 (copied down) E8: =F7 F7: =E7+D7 (copied down) cell B5 has the value of 1, since the value in A5 is 0.127. The VLOOKUP functions stops at E$7 and returns the value in the third column, G$7. General discrete distribution A probability distribution with (usually) a finite number of possible outcomes, not necessarily with equal probabilities. General Discrete Distribution Just as there was nothing special about the 0.5 probability for the coin flip example, there is nothing special about the equal probability of each outcome in the roll of the die. The outcomes could be the demand for a product with different probabilities for each. Figure C-7 shows an example. The only difference is that there are now seven possible outcomes, and the probabilities for the outcomes are not all the same. Such a distribution is called a general discrete distribution. Demand can be one of the values 100, 150,...,400, with individual probabilities shown in cells D7:D13. Obviously, an important thing to do is to make sure the probabilities sum to 1. CONTINUOUS PROBABILITY DISTRIBUTIONS The three examples so far have been of discrete distributions, which are distributions that have a countable number of possible outcomes. Loosely speaking, most people think of discrete distributions as having a finite number of possible outcomes, but a

ancmat03.qxd 11/16/06 3:28 PM Page C9 CONTINUOUS PROBABILITY DISTRIBUTIONS C9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 102 103 A B C D E F G General Discrete Distribution A4: =RAND() U(0,1) Demand 0.034 100 0.549 250 Cumulative Distribution 0.039 B4: =VLOOKUP(A4,E$7:G$13,3) 100 Probability Begin End Demand 0.356 200 0.05 0.00 0.05 100 0.569 250 0.10 0.05 0.15 150 0.207 200 0.25 0.15 0.40 200 0.139 150 0.30 0.40 0.70 250 0.049 100 0.15 0.70 0.85 300 0.534 250 0.10 0.85 0.95 350 0.477 250 0.05 0.95 1.00 400 0.036 100 1.00 0.470 250 0.772 300 0.066 150 Results of Simulation 0.682 250 Demand Frequency Fraction 0.389 200 100 10 0.10 0.450 250 150 8 0.08 0.962 400 200 18 0.18 0.502 250 250 36 0.36 0.651 250 300 18 0.18 0.738 300 350 5 0.05 0.644 250 400 5 0.05 0.419 250 100 0.545 250 0.800 300 FIGURE C-7 Spreadsheet for general discrete distribution distribution with outcomes 0, 1, 2,...is also considered to be discrete. Discrete distributions are valuable for simulating events such as whether we get awarded a contract or not, the number of days required for some task, or the number of customers arriving in a store in some given period of time. The other major type of probability distribution is a continuous distribution, which can take on any value, perhaps within some range. Actually, the RAND function generates a continuous uniform distribution between 0 and 1. There are many continuous distributions, but some common ones used in simulation include the uniform distribution, the normal distribution, and the exponential distribution. Figure C-8 illustrates these types of distributions. Discrete distribution A distribution that has a countable number of possible outcomes. Continuous distribution A probability distribution that can take on any fractional or whole value. Simulating Continuous Probability Distributions The RAND function is a continuous uniform probability distribution between 0 and 1, or U(0,1). In general, a continuous uniform distribution can be between any two values, for instance, a and b. We would refer to this as U(a, b). To generate a U(a, b) random number in Excel, we can use the formula a (b a)*rand() The quantity (b a) is the total range of the distribution. Multiplying by RAND() is essentially taking a fraction of this range. Adding a to this value then results in a Continuous uniform distribution A probability distribution that ranges between a minimum and maximum value, with any value in between equally likely to occur.

ancmat03.qxd 11/16/06 3:29 PM Page C10 C10 SUPPLEMENT C FIGURE C-8 INTRODUCTION TO SIMULATION Normal Distribution, mean = 80, stdev = 10 Examples of continuous probability distributions 40 60 80 100 120 Uniform Distribution, minimum = 10, maximum = 50 10 10 30 50 70 Exponential Distribution, mean = 10 0 10 20 30 40 50 60 number between a and b. For example, if the time to complete a task was uniformly distributed between 10 and 50 minutes, we would generate a U(10, 50) random number to represent this time. Then the corresponding formula would be 10 (50 10)*RAND() If RAND() equals 0, this formula results in a time of 10 minutes; if RAND() equals 1, the formula computes to 50 minutes. Similarly, if RAND() equals 0.5, the formula computes to 30, which is halfway between 10 and 50. Essentially, RAND() is acting like a fraction, and adding a fraction of the value (b a) to the minimum value a. Figure C-9 shows a histogram of 250 simulated values from a U(10, 50) distribution. Note the general shape of this distribution is rectangular, indicating a relatively even distribution of values across this range. The previous section showed how to generate values from a general discrete distribution using the VLOOKUP function. If a discrete distribution is between two integers, with each value equally likely, a simpler approach is possible. This approach takes advantage of the logic for the continuous uniform distribution but rounds the

ancmat03.qxd 11/16/06 3:29 PM Page C11 CONTINUOUS PROBABILITY DISTRIBUTIONS C11 14.0% 12.0% 10.0% 8.0% 6.0% 4.0% 2.0% 0.0% 12.08 Frequency (%, n = 250) 16.04 19.99 23.95 27.90 31.86 35.82 39.77 43.73 47.68 Midpoint of Range FIGURE C-9 Histogram of 250 simulated values from a U(10, 50) distribution result down to the nearest integer. If we want to generate a discrete uniform distribution between 10 and 50, with only integer values possible, we can use the following formula: INT (10 (50 10 1)*RAND()) The INT function rounds any value down to the nearest integer. Besides the use of this function, the only change is in the (50 10 1) portion. The 1 is needed because of this rounding down, so that all values between 10 and 50 (including 10 and 50 themselves) are possible. Simulating other distributions is conceptually the same as we have seen. First a U(0, 1) random number is generated, and this number is transformed into a random number from the desired distribution. For other distributions, the mathematics of the process becomes more difficult, but for two additional distributions Excel functions can be readily used. The normal distribution is often used to model many real-world phenomena, such as the delivery time from a supplier, the demand for a product or service, or the cost of raw material. To generate normally distributed random numbers in Excel, you need to know the mean,, and standard deviation, s. Then the following formula generates a normal random number, denoted N(, ): NORMINV(RAND(),, ) The NORMINV function is the inverse normal function. RAND() acts like a probability in this function (note that it is between 0 and 1), and the NORMINV function returns the value of the distribution corresponding to the point at which the area under the curve is equal to the value from RAND. Figure C-10 shows a histogram from 250 simulated values from a N(80, 10) distribution. Note the familiar bell shape of this histogram. The exponential distribution is a very common distribution in the modeling of customer arrivals to service systems, such as a call center or a drive-through window. Specifically, it is used to represent the time between successive customer arrivals, called the interarrival time. The mean interarrival time is denoted, and we would refer to such a distribution as EXP( ). To generate exponentially-distributed random numbers, the following formula should be used: Normal distribution A distribution characterized by a mean and standard deviation, indicated by the familiar bell shape with a large density around the mean and with diminished density as one moves further from the mean. Exponential distribution A distribution characterized by a mean, with possible outcomes all positive. *LN(RAND())

ancmat03.qxd 11/16/06 3:29 PM Page C12 C12 SUPPLEMENT C INTRODUCTION TO SIMULATION FIGURE C-10 Histogram of 250 simulated values from a N(80, 10) distribution 30.0% 25.0% 20.0% 15.0% 10.0% 5.0% 0.0% 55.45 Frequency (%, n = 250) 61.44 67.42 73.41 79.40 85.38 91.37 97.36 103.34 109.33 Midpoint of Range In this formula, LN is the Excel function for the natural logarithm. The minus sign is needed because the natural logarithm of a number between 0 and 1 is negative. Figure C-11 shows a histogram of 250 simulated values from an EXP(10) distribution. All values are greater than zero. The distribution starts off with a high frequency of observations near zero, but quickly tails off. This tends to match the arrival behavior of many service systems, where frequently the time between successive customer arrivals is quite small. For reference, Table C-1 summarizes the formulas needed to generate the probability distributions discussed here. Commercial add-ins such as Crystal Ball and @Risk can generate many other distributions, but the ones provided here are some of the most common. APPLICATION OF SIMULATION TO DECISION MAKING In this section we show how spreadsheet-based simulation can be used to analyze a situation involving uncertainty and risk. We will set up and solve a relatively simple newsvendor problem. The newsvendor problem is one in which a retailer, for instance, needs to purchase some quantity of an item prior to demand being known. If too few are ordered, it will forgo potential profit. However, if too many are ordered, the excess over the amount demanded must be heavily discounted. This fundamental problem commonly occurs in retailing, such as when a store needs to order seasonal or perishable merchandise. However, it also exists for manufacturers of products that decline in value FIGURE C-11 Histogram of 250 simulated values from an EXP(10) distribution 50.0% 40.0% 30.0% 20.0% 10.0% Frequency (%, n = 250) 0.0% 2.45 7.30 12.15 17.00 21.86 26.71 31.56 36.41 41.26 46.12 Midpoint of Range

ancmat03.qxd 11/16/06 3:29 PM Page C13 APPLICATION OF SIMULATION TO DECISION MAKING C13 Distribution Excel Function Description Bernoulli IF(RAND() p,1,0) Returns the result, either 0 or 1, of a single Bernoulli trial, where p is the probability of success. Used to model random events with only two outcomes. General Discrete VLOOKUP(RAND(), Returns one of the values Lookup_Array,3) in the third column of the Lookup_Array. The first two columns must contain the ranges corresponding to the cumulative probability distribution, as shown in the examples. Continuous Uniform a (b a)*rand() Returns a value in the range from a to b. Each value in this range is equally likely to occur. Exponential *LN(RAND()) Returns a value from an exponential distribution with mean. Often used to model the time between events or the lifetime of a device with a constant probability of failure. Normal NORMINV(RAND(),, ) Returns a value from a normal distribution with mean and standard deviation. Discrete Uniform INT (a (b a 1) Returns one of the integers *RAND()) between a and b, inclusive. Each value is equally likely to occur. TABLE C-1 Excel Formulas to Generate Common Probability Distributions after they are produced. For example, in the fast-changing electronics industry, if a company commits to manufacturing too many handheld computers, it will be left with product that is worth only a fraction of what it was worth when produced. Even transportation services such as airlines face a form of this problem, since airlines must decide ahead of time how frequently to fly a given route and which type of aircraft to use. DG Outerwear must decide how many of a particular style and size of winter coat to order for the coming season. Lead times in the industry are such that the order must be placed in June, well before the actual realization of demand. Coats cost $75 for DG to purchase, and the planned sales price is $100. If not enough coats are ordered, assume that the potential customer leaves without purchasing a substitute coat. If too many coats are ordered, DG must discount the coats in order to sell them at the salvage value. The demand for this size and style of coat is estimated to be between 20 and 40, with each possibility equally likely. If coats must be salvaged, the salvage price may be $15, $20, $25, or $30 with probabilities 0.05, 0.30, 0.50, and 0.15, respectively. Assume that all remaining coats will sell at this salvage price. The approach DG has used in the past is to estimate the expected demand and to order somewhat more than that number of coats. For this year, DG is considering ordering 35 coats, but wonders if that is really the best decision. EXAMPLE C.1 DG Outerwear

ancmat03.qxd 11/16/06 3:29 PM Page C14 C14 SUPPLEMENT C INTRODUCTION TO SIMULATION Before You Begin: In this problem, determine how many of a particular winter coat to order for the coming season. You can place only one order because of the long lead time for this coat. Your objective is to order the number of this type of coat that will provide the highest expected payoff. There is considerable uncertainty to model. Demand is represented by a uniform distribution, with a low of 20 coats up to a maximum of 40. Salvage value for the coats is also uncertain, with values ranging from $15 up to $30. Use a simulation model to provide insight into what might happen if 35 coats are ordered. Deterministic Model We know several things in this problem: The purchase price is $75, and the regular sales price is $100. The salvage price can be one of four quantities. Before the season begins we do not know which value will be necessary to liquidate any remaining coats. Demand is also uncertain, but we estimate that it will be between 20 and 40. We need a model to be able to evaluate different purchase quantities. That is, purchase quantity is the decision variable. The first step in setting up a simulation model is to build the model logic. We initially ignore the uncertainty and focus on the spreadsheet logic. In particular, the logic needs to compare the quantity purchased with the demand. The quantity sold at the regular price, $100, will necessarily be the smaller of these two quantities, since we cannot sell more than we purchase and we also cannot sell more than what customers are willing to buy at the regular price. Once the quantity sold at the regular price is determined, we can compute the number (if any) of remaining coats. These coats will be sold at the salvage price. The model can then compute the total revenue, the total costs, and the profit. Figure C-12 shows a deterministic model of this situation. For the demand and salvage price cells (cells D17 and G17), we have just entered sample values. The focus here is developing the correct logic for the situation. The formulas are listed here: E17 MIN(B$8,D17) F17 B$8 E17 H17 B$5*E17 FIGURE C-12 Deterministic model for DG Outerwear problem 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 A B C D E F G H I J DG Winter Coats Fixed Inputs Demand Distribution (Discrete Uniform) Purchase Price of Coat $75 Minimum 20 Regular Sales Price $100 Maximum 40 Decision Variable Salvage Price Distribution (Discrete) Purchase Quantity 35 Cumulative Distribution Probability Begin End Price 0.05 0.00 0.05 $15 0.30 0.05 0.35 $20 0.50 0.35 0.85 $25 0.15 0.85 1.00 $30 1.00 Simulation Logic Demand Reg Sales Qty Salv Sales Qty Salv Price Reg Rev Salv Rev Profit 30 30 5 $25 $3,000 $125 $500

ancmat03.qxd 11/16/06 3:29 PM Page C15 I17 G17*F17 J17 H17 I17 (B$8*B$4) APPLICATION OF SIMULATION TO DECISION MAKING C15 The formula in cell E17 results in 30, since there were only 30 customers willing to purchase the coat at the regular price. Cell F17 computes the amount remaining as the purchase quantity less the number sold at the regular price. Then the regular and salvage revenues can be computed, followed finally by the profit. This model can certainly be used to do what-if analysis, but it does not take into account the uncertainty of demand and salvage price. Simulation Model The model becomes a simulation model when we directly incorporate the uncertainty of demand and salvage price. Figure C-13 shows this additional logic. Notice that we have added columns for Replication and RN1, and RN2. for two random numbers from the U(0, 1) distribution. Other changes to the model are in the demand and salvage price cells. The demand cell now generates a random integer uniformly distributed between 20 and 40, and the salvage price cell generates a random price from the salvage price distribution. The new formulas are listed here: Replicating the Model B17: RAND() C17: RAND() D17: INT(E$4 (E$5 E$4 1)*B17) G17: VLOOKUP(C17,E$10:G$13,3) Figure C-13 shows one replication of the simulation logic. A replication consists of a single sampling of the random values from the applicable distributions, calculating the output of the model, and recording that result. That is, a single replication represents one possible value of the profit. Just as a political pollster would never Replication Replication of a simulation model consists of sampling inputs from respective probability distributions, computing the logic of the model, and recording the resulting output value. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 A B C D E F G H I J DG Winter Coats Fixed Inputs Demand Distribution (Discrete Uniform) Purchase Price of Coat $75 Minimum 20 Regular Sales Price $100 Maximum 40 Decision Variable Salvage Price Distribution (Discrete) Purchase Quantity 35 Cumulative Distribution Probability Begin End Price 0.05 0.00 0.05 $15 0.30 0.05 0.35 $20 0.50 0.35 0.85 $25 0.15 0.85 1.00 $30 1.00 Simulation Logic Replication RN1 RN2 Demand Reg Sales Qty Salv Sales Qty Salv Price Reg Rev Salv Rev Profit 1 0.003 0.992 20 20 15 $30 $2,000 $450 ($175) FIGURE C-13 Simulation logic for DG Outerwear problem (one replication)

ancmat03.qxd 11/16/06 3:29 PM Page C16 C16 SUPPLEMENT C INTRODUCTION TO SIMULATION consider speaking to a single person to develop predictions on how the public at large will vote, a simulation model never consists of just one replication. Rather, we must perform many replications of the model in order to get a clearer picture as to the likelihood of different profit levels. In Figure C-14, we have copied the logic for a single replication down to generate 250 replications. Notice that the random numbers change for each replication, resulting in different demand, salvage price, and profit values. We are really simulating the upcoming winter sales season 250 times in order to obtain more insight into the likelihood of profit levels, assuming we purchase 35 coats. Problem-Solving Tip: How many replications should you run for a simulation? We have used 250 as a sample size. However, there is no simple answer to this question, although more is always better in terms of the precision of the estimates. This is a statistical question, no different from the question pollsters face in determining how many people to interview in order to achieve some level of precision in a survey. Obviously, it is easy to run additional replications of a simple model, but for complex simulation models, the computation time of additional replications can become significant. (Some simulations can run for hours or even days.) FIGURE C-14 Completed simulation model for DG Outerwear problem 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 265 266 267 268 269 270 271 272 273 274 275 A B C D E F G H I J DG Winter Coats Fixed Inputs Demand Distribution (Discrete Uniform) Purchase Price of Coat $75 Minimum 20 Regular Sales Price $100 Maximum 40 Decision Variable Salvage Price Distribution (Discrete) Purchase Quantity 35 Cumulative Distribution Probability Begin End Price 0.05 0.00 0.05 $15 0.30 0.05 0.35 $20 0.50 0.35 0.85 $25 0.15 0.85 1.00 $30 1.00 Simulation Logic Replication RN1 RN2 Demand Reg Sales Qty Salv Sales Qty Salv Price Reg Rev Salv Rev Profit 1 0.911 0.701 39 35 0 $25 $3,500 $0 $875 2 0.279 0.724 25 25 10 $25 $2,500 $250 $125 3 0.064 0.585 21 21 14 $25 $2,100 $350 ($175) 4 0.595 0.355 32 32 3 $25 $3,200 $75 $650 5 0.404 0.405 28 28 7 $25 $2,800 $175 $350 6 0.932 0.302 39 35 0 $20 $3,500 $0 $875 249 0.544 0.795 31 31 4 $25 $3,100 $100 $575 250 0.084 0.823 21 21 14 $25 $2,100 $350 ($175) Average $435 Standard Deviation $392 Minimum ($325) Maximum $875 95% Confidence Interval on Average Lower CL $386 Upper CL $483

ancmat03.qxd 11/16/06 3:29 PM Page C17 APPLICATION OF SIMULATION TO DECISION MAKING C17 Recall from statistics that as the sample size is increased, precision improves, but at a decreasing rate. This is because in the formula for the confidence interval for the mean of a population, the square root of the sample size appears in the denominator. Therefore, as this sample size increases, the benefit of increased precision takes more and more samples to obtain. For the problems covered here, a sample size of 250 is usually sufficient, but 500 or even 1000 is even better. You should experiment and see how much the width of the confidence interval changes with a larger sample size. Commercial add-in products allow you to specify a precision level, with the simulation automatically stopping when this level is reached. Analyzing the Results After we have replicated the model, we need to compute summary statistics. These are shown in Figure C-14. Generally speaking, it is a good idea to compute the average, standard deviation, minimum, and maximum values of the simulation output(s). We have also calculated a confidence interval for the true average profit. Formulas for these summary statistics are provided here: J268: AVERAGE(J$17:J$266) J269: STDEV(J$17:J$266) J270: MIN(J$17:J$266) J271: MAX(J$17:J$266) J274: J$26821.96*J$269/SQRT(250) J275: J$26811.96*J$269/SQRT(250) If we purchase 35 coats, we see that our average, or expected, profit is $435. However, there is a relatively large standard deviation of $392. This implies that in any given year, there is a significant amount of uncertainty in the profit we will earn. Over the course of 250 replications, the worst case is a loss of $325 and the best case a profit of $875. We are 95 percent confident that the true average profit lies somewhere in the interval from $386 to $483. Our estimate of the average profit is based on these 250 trials; if we were to perform additional replications, our estimate would become more precise. Problem-Solving Tip: After running a simulation model for the number of replications you desire, oftentimes it is a good idea to freeze the random numbers upon which the simulation is based. If you don t do this, the entire simulation will recalculate any time you change a value in a cell or even open or close the file. To freeze the random numbers, first highlight the cells to be frozen, choose Edit/Copy and then Edit/Paste Special. In the Paste Special dialog box, select Values, and click OK. Any functions, such as RAND(), in the cells you selected, will be replaced by the values that were in there when you did the copy/paste operation. In this way you can run a simulation, freeze the results, and then perform more detailed analysis on the results. That being said, sometimes you will want to leave the results of a simulation live so that every time you make a change to a cell, the results will update. This is the case if you want to try out different values for a decision quantity, for example.

ancmat03.qxd 11/16/06 3:29 PM Page C18 C18 SUPPLEMENT C INTRODUCTION TO SIMULATION We now have valuable information for DG, if it decides to purchase 35 coats. In making this decision, DG must be willing to accept the uncertainty in profit as outlined. Is this the best order quantity? Since we have a flexible simulation model, it is quite easy to try different quantities. The simulation results will automatically calculate, along with the summary statistics. For the sake of simplicity, suppose DG can order in increments of 5 coats. Therefore, DG will consider order quantities of 20, 25, 30, 35, and 40 coats. Summary statistics for these values are provided in Table C-2. From the table, we see that if 20 coats are ordered, a guaranteed $500 profit can be achieved. This is not surprising, since we assume that demand is between 20 and 40 coats. For a 25-coat purchase quantity, average profit increases to $568, but standard deviation of profit also increases, to $117. Simultaneously, minimum profit gets worse, and maximum profit gets better. This should be intuitive after considering that we are investing additional money in inventory, so there is a greater potential gain, but at the same time the possibility of doing worse. If we purchase 30 coats, average profit declines from the 25-coat option, but the standard deviation continues to rise. As we move to the 35- and 40-coat purchases, average profit continues to decline, with the standard deviation increasing. Problem-Solving Tip: To recalculate a spreadsheet, press the F9 key. In a simulation model, this will force all cells involving the RAND() function to recalculate, as well as any cells that depend on them. In light of these values, it would appear that purchasing 20 or 25 coats is the best alternative. Purchasing 20 coats involves no uncertainty, and purchasing 25 allows maximizing expected profit. Surprisingly, even though 30 coats is the average of the demand distribution, it is better in this case (because of the revenues and costs) to purchase somewhat less than this quantity. Suppose we decide to purchase 25 coats. What does the actual distribution of possible profit values look like? To determine this, we can generate a histogram of the profit values, using the Tools/Data Analysis/Histogram tool. If Data Analysis does not appear in the Tools menu of Excel, go to Tools/Add Ins, and put a check beside the Analysis Tool Pack item. This histogram is shown in Figure C-15. The histogram is really the probability distribution of profit, after considering the uncertainty in demand and salvage price. At first, this histogram appears very odd. The vast majority (193 out of 250) of the observations have profit values greater than $598, with the remainder being spread out rather evenly over the range from $225 to TABLE C-2 Purchase Standard Quantity Average Deviation Minimum Maximum Summary Statistics of Profit for DG Outerwear Coat Problem 20 $500 $0 $500 $500 25 $568 $117 $225 $625 30 $551 $264 $50 $750 35 $435 $392 $325 $875 40 $230 $460 $600 $1000

ancmat03.qxd 11/16/06 3:29 PM Page C19 APPLICATION OF SIMULATION TO DECISION MAKING C19 Bin Frequency $225 3 $252 13 $278 1 $305 3 $332 5 $358 1 $385 5 $412 6 $438 2 $465 4 $492 4 $518 0 $545 6 $572 4 $598 0 More 193 Frequency 250 200 150 100 50 0 Histogram of Profit Values for Purchase Quantity = 25 (250 total replications) $225 $252 $278 $305 $332 $358 $385 $412 $438 $465 $492 $518 $545 $572 $598 More FIGURE C-15 Histogram of profit values for a purchase quantity of 25 Upper End of Category $598. Why is this? Recalling that the distribution of demand is uniform, it would seem that the profit distribution should be uniform as well. However, this is clearly not the case. The key point is that since we are purchasing 25 coats, there is sufficient demand to sell all of those coats most of the time. In fact, demand will be 25 coats or more approximately 75 percent of the time (since demand ranges from 20 to 40 coats). As we see, 193 times out of 250 (77 percent of the time) we appear to be earning the maximum possible profit of $625. The other 23 percent of the time (when demand is between 20 and 24 coats), profit is spread across the other possible values. Using a Data Table to Run a Simulation In this example, we developed the logic for a single replication and then copied that entire logic down in order to run 250 replications. This worked because the logic for this model was relatively simple and could be put into a single row. Most models are more complex. Another way to run many replications is to use Excel s Data Table feature, covered in Supplement A, where it is used for sensitivity analysis. Here we use it to have Excel recalculate the logic many times, each time with different random numbers, and store the results in a table. Figure C-16 shows the model with a Data Table used to do the replications. To do this, we have started with the single-replication model, which was shown in Figure C- 13. The steps involved in using a Data Table for the simulation are as follows, assuming the logic for a single replication is already complete: 1. Label two columns, one for replications and one for profit. In the replications column, from A22 to A271, enter the numbers 1...250. This is done easily with the Edit/Fill/Series command, with Series in Columns, Step value of 1, and Stop value of 250. Note that we do not put anything in cell A21. 2. In cell B21, enter the formula J17. This simply references the profit value from the simulation logic. 3. Select the range A21:B271. Be sure to include the top row in the selection. It is really the formula in cell B21 that tells the Data Table what value you re interested in.

ancmat03.qxd 11/16/06 3:29 PM Page C20 C20 SUPPLEMENT C FIGURE C-16 DG Outerwear simulation using Data Table INTRODUCTION TO SIMULATION 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 270 271 A B C D E F G H I J Decision Variable Salvage Price Distribution (Discrete) Purchase Quantity 35 Cumulative Distribution Probability Begin End Price 0.05 0.00 0.05 $15 0.30 0.05 0.35 $20 0.50 0.35 0.85 $25 0.15 0.85 1.00 $30 1.00 Simulation Logic RN1 RN2 Demand Reg Sales Qty Salv Sales Qty Salv Price Reg Rev Salv Rev Profit 0.425 0.255 28 28 7 $20 $2,800 $140 $315 Data Table for Simulation Replications B21: =J17 Replications Profit $ 315 Summary Statistics 1 $ 875 Average $ 413 2 $ 35 StdDev $ 403 3 $ 795 Minimum $ (400) 4 $ (325) Maximum $ 875 5 $ 75 6 $ (100) 95% Confidence Interval 7 $ 200 Lower CL $ 363 8 $ 200 Upper CL $ 463 9 $ (35) 10 $ (250) 11 $ (400) 249 $ 200 250 $ 715 4. Keeping the range from #3 selected, go to Data/Table in the Excel menu. In the resulting dialog box, leave the Row Input Cell field blank, and click on cell A21 (or any blank cell on the worksheet) for the Column Input Cell. Click OK. The results from 250 replications should now be showing in cells B22:B271. Note: Recall in Supplement A the Column Input Cell was set to vary an input parameter of the model, but here we are using it simply to force Excel to recalculate the model. 5. If all the values in B22:B271 are the same, press the F9 key to force recalculation of the worksheet. This can occur if Excel s recalculation settings have been changed. You can change these settings at Tools/Options/Calculation. Supplement A and the Excel help system contain additional information about the Data Table command. 6. Compute summary statistics from the results in cells B22:B271. 7. If desired, freeze the results from the simulation in cells B22:B271 using Edit/Copy, Edit/Paste Special/Values. Using the Data Table command to run simulations is normally easier, once you get the hang of it, than copying all of the simulation logic. It also allows you to run more complex models. Recap In this example we have begun to see the power of spreadsheet simulation. Simulation models allow us to incorporate our uncertainty directly into the model, run the model many times, and compute summary statistics. Rather than relying on a single point es-