Spreadsheets as a Tool for Teaching Simulation

Simulation can be a difficult subject to teach, as most commercial software requires learning new approaches and time is limited, particularly in business overview courses. Spreadsheets have a distinct advantage in that most students developed a high level of expertise prior to taking management science courses. As such, they provide an ideal platform on which to learn the basics of simulation methodology. In this paper, we describe the use of spreadsheets as a tool for teaching simulation for both pure Monte-Carlo approaches (focusing on the advantages of using Excel add-ins), and for simple systems simulation models such as queueing. ________________________________________ Simulation models are logical descriptions of the interrelationships among elements of a decision problem, or the sequence of events that occur in a system over time. They capture probabilistic behavior and allow one to estimate key statistics such as means or tail probabilities of distributions that cannot be derived analytically. Simulation models can be categorized into two broad categories. Systems simulation models capture the dynamics and behavior of interacting elements of a system, such as a manufacturing facility or call center. These models are driven by changes that occur in the system over time. Monte-Carlo simulation models, on the other hand, are timeindependent. They involve repeated sampling from probability distributions of model inputs to characterize the distributions of model outputs. Monte-Carlo simulation models generate distributions of potential outcomes of key model variables along with their likelihood of occurrence. Simulation has been an important tool in management science throughout its history. Most applications of simulation have revolved around dynamic systems -for instance, inventory control, project planning, queueing and scheduling, production, material handling and logistics, and service and communication systems [Pritsker, et al., 1994]. Although Monte-Carlo simulation has been around for decades, it is only recently that practitioners have demonstrated a renewed interest in the subject, particularly for risk assessment applications [Nichols, 1994; Whitford, 1997]. Risk simulation has become a significant tool in finance and marketing analysis, as well as other areas of application. The principal focus on simulation in most engineering schools has been on dynamic systems, while many business schools emphasize Monte-Carlo simulation. However, much cross-over exists, as Monte-Carlo simulation finds useful applications in engineering systems, and business process reengineering relies on dynamic system models. Implementing system simulation models typically requires a commercial simulation package such as SLAM, Arena, Extend, SIMSCRIPT, or GPSS. While these powerful packages offer many significant advantages to commercial users, they can often be difficult to introduce in survey courses in management science, primarily because of the time involved in learning the terminology and procedures required to run the software Although “point-and-click” object-oriented approaches have alleviated this significantly, commercial packages still require a high amount of startup, particularly in a short academic term for an introductory overview course. Spreadsheets, on the other hand, offer many pedagogical advantages for learning simulation. These include •= Rapid start-up -Because the basics of spreadsheets are taught in introductory courses such as accounting or statistics, students can easily understand model implementation issues in simulation. •= Integrated graphics -Spreadsheets allow users to quickly and easily develop visualizations of data, and gain useful insights that typical simulation output does not provide. EVANS Spreadsheets as a Tool for Teaching Simulation _____________________________________________________________________________________________ _____________________________________________________________________________________________ INFORMS Transactions on Education 1:1 (27-37) INFORMS 28 •= Dynamic updating -New results can be immediately obtained as data are changed. Of particular interest from a teaching perspective is the dynamic updating of graphs and charts as new results are obtained. •= Statistics integration -A full complement of statistical tools and functions allow users to perform on-the-spot analyses of results without having to transfer data to other software packages. Monte-Carlo simulation is particularly well-suited to spreadsheet models. In fact, we conjecture that the recent popularity of Monte-Carlo risk analysis methods is due to technology advances: powerful desktop computers and user-friendly software designed around spreadsheets, such as Crystal Ball and @Risk. The purpose of this paper is to discuss some key issues associated with teaching simulation methods using Excel spreadsheets and to provide some illustrative examples. We will discuss both Monte-Carlo simulation as well as dynamic systems simulation, focusing on implementation, advantages, and limitations. Building Spreadsheet Simulation Models In general, building a simulation model involves the following steps: 1. Formulating the problem to determine the objectives of the simulation study, the system performance measures to be computed, and the scenarios to be evaluated. A scenario is any specification of the controllable inputs, that is, a particular variation of the system that we wish to study. By comparing the performance of different scenarios, we expect to be able to draw conclusions as to which scenario is the best, if indeed there is a significant difference. 2. Developing a logical model of the system under study that describes key events and actions that take place. Visual models provide the basis for implementing the simulation model on a spreadsheet. For systems simulations, the model is usually described with a flowchart; for MonteCarlo simulations, one often uses an influence diagram. 3. Specifying probabilistic assumptions needed to drive the simulation, that is, the probability distributions of input variables. If historical data are available, we can use the empirical distribution to drive the simulation, or fit the data to a theoretical distribution using data fitting techniques. If not, then a distribution must be selected judgmentally. 4. Implementing the model on a computer to perform the necessary calculations required to evaluate the distribution of model outputs. One of the advantages of using spreadsheets is that an experienced spreadsheet user can develop a model rapidly by exploiting the built-in functions and structure of the spreadsheet. We first illustrate an example of a Monte-Carlo simulation model using the capabilities of Excel as the simulation driver. Figure 1 shows a simple newsboy simulation with a demand distribution that is normal with a mean of 60 and standard deviation of 10. The basic data are given in the range A1:B9. Random normally-distributed demands in cell B8 can be generated using the Excel formula =NORMINV(RAND(),60,10) (although we assumed a continuous distribution, the random variate can easily be made discrete). Of course, any mechanism for generating random variates for the proper distribution can be used. This is, however, one of the limitations of Excel. Although Excel provides a random number generation routine through the Analysis Toolpak; the scope of available distributions is very limited. In many cases, the user must explicitly write a formula for generating random variates using the RAND() function, similar to the way one needs to implement simulations using general purpose languages such as FORTRAN or BASIC. Such generating formulas can be found in many simulation texts; for example, Law and Kelton (1991). EVANS Spreadsheets as a Tool for Teaching Simulation _____________________________________________________________________________________________ _____________________________________________________________________________________________ INFORMS Transactions on Education 1:1 (27-37) INFORMS 29 Figure 1: Spreadsheet model and data table simulation of a newsboy problem The actual simulation is implemented using the Excel Data Table feature in cells D1:J12. Each row corresponds to a single trial, and each column evaluates an alternative order quantity. In this sense, Excel provides a significant advantage over general-purpose programming or simulation languages that would require the evaluation of each alternative independently within a programming loop. Several authors, such as Plane (1994), Ragsdale (1998) and Winston and Albright (1997) have described how data tables can be used to replicate samples in a Monte-Carlo fashion by selecting a blank cell for the column input cell in the Excel dialog box. (The row input cell would be the order quantity, B7.) However, another Excel limitation is that it does not allow one to set a random number seed to control the stream of random numbers. Thus, each column represents an independent sample, and statistical techniques for variance reduction cannot be used. Summary statistical information in the range D14:J16 is derived from standard Excel functions. These statistics can be graphed easily using the Excel charting procedure as shown in Figure 1. The integrated graphical features of spreadsheets 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 30 31 32 33 34 A B C D E F G H I J Newsboy Simulation Trial 270.00 $ 40 50 60 70 80 90 Selling price 12.00 $ 1 180 $ 225 $ 270 $ 259 $ 255 $ 226 $ Cost 7.50 $ 2 180 $ 225 $ 270 $ 313 $ 291 $ 181 $ Discount price 6.00 $ 3 180 $ 225 $ 210 $ 223 $ 131 $ 231 $ 4 180 $ 215 $ 236 $ 315 $ 273 $ 241 $ Order Quantity 60 5 180 $ 225 $ 221 $ 259 $ 209 $ 110 $ Demand 60.80222 6 180 $ 225 $ 196 $ 187 $ 126 $ 123 $ Profit 270.00 $ 7 180 $ 225 $ 270 $ 269 $ 281 $ 243 $ 8 180 $ 152 $ 230 $ 257 $ 233 $ 237 $ 9 180 $ 136 $ 256 $ 238 $ 278 $ 237 $ 10 1