Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Advertisements

Statistical Inventory control models I
1 Overview of Simulation When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions set for analytic.
11 Simulation. 22 Overview of Simulation – When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions.
Presentation on Probability Distribution * Binomial * Chi-square
Chapter 13 – Boot Strap Method. Boot Strapping It is a computer simulation to generate random numbers from a sample. In Excel, it can simulate 5000 different.
Probability Distributions CSLU 2850.Lo1 Spring 2008 Cameron McInally Fordham University May contain work from the Creative Commons.
Stochastic Inventory Modeling
Simulation Operations -- Prof. Juran.
AP STATISTICS Simulation “Statistics means never having to say you're certain.”
Session 7a. Decision Models -- Prof. Juran2 Overview Monte Carlo Simulation –Basic concepts and history Excel Tricks –RAND(), IF, Boolean Crystal Ball.
(Monté Carlo) Simulation
Chapter 5 Discrete Random Variables and Probability Distributions
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 5-1 Chapter 5 Some Important Discrete Probability Distributions Statistics.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Pearson Prentice-Hall, Inc.Chap 5-1 Statistics for Managers Using Microsoft® Excel 5th Edition.
Chapter 5 Understanding Randomness
The Binomial Probability Distribution and Related Topics
© 2004 by Prentice Hall, Inc., Upper Saddle River, N.J F-1 Operations Management Simulation Module F.
Binomial & Geometric Random Variables
Monté Carlo Simulation MGS 3100 – Chapter 9. Simulation Defined A computer-based model used to run experiments on a real system.  Typically done on a.
Chapter 11: understanding randomness (Simulations)
Simulation.
CHAPTER 6 Random Variables
Problem A newly married couple plans to have four children and would like to have three girls and a boy. What are the chances (probability) their desire.
Copyright © 2010 Pearson Education, Inc. Unit 3: Gathering Data Chapter 11 Understanding Randomness.
Chap 5-1 Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall Chapter 5 Discrete Probability Distributions Business Statistics: A First.
Simulation Examples ~ By Hand ~ Using Excel
5-1 Business Statistics: A Decision-Making Approach 8 th Edition Chapter 5 Discrete Probability Distributions.
Chapter 14 Simulation. What Is Simulation? Simulation is to mimic a process by using computers.
The AIE Monte Carlo Tool The AIE Monte Carlo tool is an Excel spreadsheet and a set of supporting macros. It is the main tool used in AIE analysis of a.
Economic Order Quantity The economic order quantity (EOQ) is the fixed order quantity (Q) that minimizes the total annual costs of placing orders and holding.
Discrete Distributions The values generated for a random variable must be from a finite distinct set of individual values. For example, based on past observations,
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics Michael Baron. Probability and Statistics for Computer Scientists,
Section Using Simulation to Estimate Probabilities Objectives: 1.Learn to design and interpret simulations of probabilistic situations.
BINOMIALDISTRIBUTION AND ITS APPLICATION. Binomial Distribution  The binomial probability density function –f(x) = n C x p x q n-x for x=0,1,2,3…,n for.
Understanding Randomness
Advance Waiting Line Theory and Simulation Modeling.
Simulation is the process of studying the behavior of a real system by using a model that replicates the behavior of the system under different scenarios.
Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc Chapter 16 Chi-Squared Tests.
AP STATISTICS Objective: Understanding Randomness Do Now: Take out any completed contracts, personal profiles, as well as your written design study. HW:
Simulation Using computers to simulate real- world observations.
Copyright (C) 2002 Houghton Mifflin Company. All rights reserved. 1 Understandable Statistics Seventh Edition By Brase and Brase Prepared by: Mistah Flynn.
Simulation is the process of studying the behavior of a real system by using a model that replicates the system under different scenarios. A simulation.
Computer Simulation. The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions.
Discrete Random Variables. Introduction In previous lectures we established a foundation of the probability theory; we applied the probability theory.
Simulation. Simulation is a way to model random events, such that simulated outcomes closely match real-world outcomes. By observing simulated outcomes,
Simulation Discrete Variables. What is it? A mathematical model Probabilistic Uses the entire range of possible values of a variable in the model.
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Stats3 Day 1 Chapter 11- using random # table. Do Now Read Handout
1 Copyright © 2014, 2012, 2009 Pearson Education, Inc. Chapter 9 Understanding Randomness.
Copyright (C) 2002 Houghton Mifflin Company. All rights reserved. 1 Understandable Statistics Seventh Edition By Brase and Brase Prepared by: Lynn Smith.
Warm-up What is the best way to answer each of the questions below: an experiment, a sample survey, or an observational study that is not a sample survey?
Introduction to Simulation Chapter 12. Introduction to Simulation  In many spreadsheets, the value for one or more cells representing independent variables.
Test of Goodness of Fit Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007.
Chapter Five The Binomial Probability Distribution and Related Topics
Computer Simulation Henry C. Co Technology and Operations Management,
CHAPTER 6 Random Variables
Prepared by Lloyd R. Jaisingh
Binomial and Geometric Random Variables
Experimental Probability vs. Theoretical Probability
Modeling and Simulation CS 313
Chapter 5 Sampling Distributions
Chapter 11 Goodness-of-Fit and Contingency Tables
Chapter 5 Some Important Discrete Probability Distributions
The Binomial and Geometric Distributions
Chapter 6: Random Variables
Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007
Slides by John Loucks St. Edward’s University.
Simulation Supplement B.
Presentation transcript:

Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1

COMPUTER SIMULATION What is it? Creating a computer model of a system Subjecting the model to various scenarios Statistically analyzing the results in order to predict how the real system will behave

EXAMPLE #1--coin tossing A gambling game where a coin is tossed repeatedly until the number of heads and number of tails differ by 3. You pay $100 for each toss. You collect $800 at the end of each game. Do you want to play?

EXAMPLE #1 By hand simulation of the game: Heads Tails Payoff

EXAMPLE #1 Suppose we simulate 10 games and find the number of tosses to be: 5,13,7,5,9,5,3,11,5, and 7. Avg. # of tosses / game = 7 Do you want to play?

EXAMPLE #1 To simulate this game on Excel, we need to get Excel to generate “heads” and “tails” randomly. The RAND() function =RAND() causes Excel to generate a (uniformly distributed) random value between 0 and 1 in that cell.

EXAMPLE #1 How could we randomly generate “Heads” or “Tails”? The IF() function =IF(logical condition,value if true,value if false) Using these tools, create a model which will simulate the gambling game.

Homework Status At this point you should be able to complete the following homework problems in Chapter 16: #1

Generating random values What about generating the weather on a given day if the probability of “rainy” is .5, the probability of “cloudy” is .3, and the probability of “clear” is .2? How could we use Excel to generate outcome from the throw of a single die? How could we use Excel to generate the outcome from the throw of a single die, if the die had “A”, “B”, “C”, “D”, “E”, “F” on its faces?

Generating random values To generate a new random value, just press F9. F9 actually “recalculates” all values on the workbook. This is done automatically whenever you change any cell in the workbook.

Building a Monte Carlo Simulation Model Identify the random values of interest, i.e. the things you model will need to randomly generate. (Outcome of flipping a coin, time a customer requires to complete a transaction, number of machine failures on a given day, etc.)

Building a Monte Carlo Simulation Model Define a mapping for the desired random values, in such a way that the probabilities are observed. May map from “the numbers on [0,1)”, if using Excel’s rand() function, or May map from “the X-digit integers” if using a random number table or multisided die

Building a Monte Carlo Simulation Model Define the logic associated with the system (and model).

Example #2-- Machine failures You are asked to recommend whether your company should purchase a maintenance agreement for the copy machine. Maintenance agreement costs $1000 per year and covers service call charges for all unscheduled maintenance. Without agreement, unscheduled maintenance calls cost $50 each.

Example #2-- Machine failures You find that the copy machine has breakdowns in this manner: In any given day, the probability of one machine failure is .03, the probability of two failures is .01, and the probability of 3 or more failures is 0.

Example #2-- Machine failures 1. What are the RANDOM VALUES in this situation? # of failures on any given day

Example #2-- Machine failures 2. MAPPING: Since the probabilities have at most 2 significant digits, we might generate 2-digit random numbers. We might map them to the “number of failures in a day” like this: 00-96 map to 0 failures 97-97 map to 1 failure 99 map to 2 failures

Example #2-- Machine failures 3. LOGIC (TO SIMULATE ONE YEAR OF OPERATION): Start Let DAY =1 (DAY will tell what day of the year it is) Generate and record # of failures for the day (using mapping). Is DAY = 365? If no, then add one to DAY and go to step 3. If yes, then stop and compute the total number of failures.

Example #2-- Machine failures Once the model is built, we run it a number of times, and perform statistical analysis of the results in order to predict how the real system will behave.

Example #2-- Machine failures To run the system, we generate random numbers (using a computer or a table or whatever). For our first run, we might choose to generate 2-digit random numbers from, a pair of 10-sided dice. Alternatively we could use, the numbers from some section of a Random Number table like Table 16.2 (p. 720 of your text)

Example #2-- Machine failures We can keep track of our observations in a table or chart. Day # random # # of failures 1 2 3 4 5 and so on...

Example #2-- Machine failures After 365 (simulated) days, we could count the number of failures, and compute the cost of service calls with and without maintenance agreement. We could run the model a number of times and then average the observations to reach a conclusion. (In actuality, we’d probably build a confidence interval for the mean # of failures per year.)

Example #2-- Machine failures For example suppose the number of failures per (simulated) year were: 24, 20, 19, 18, 19, 16, 14, 17, 14,17 Estimated average number of failures per year (from this simulation) = 17.8

Example #2-- Machine failures Cost of paying $50 per maintenance call times average of 17.8 failures per year = $890 per year. Cost of maintenance contract = $1000. per year. Conclusion: Don’t buy the maintenance contract.

Example #2-- Machine failures Why didn’t each (simulated) year get the same number of failures? What conclusion would we have reached if we’d stopped after 2 (simulated years)? How many years should we simulate?

How many times to run a simulation model? Make several (N0) preliminary runs of the model, recording the value of the quantity you wish to predict, and then computing the sample standard deviation (s). The total estimated number of runs required to get a (1- α) confidence interval of width ≤ W is given by: N ≥ (t2 * s2) / (W/2)2 Where t is the t-statistic for N0-1 degrees of freedom and α/2 , where α=level of significance

Homework At this point you should be able to complete the following homework problems in Chapter 16: #3 #6 #8 #13

Random Number Options in Excel VLOOKUP to generate samples from a discrete distribution To generate samples from a discrete distribution, we store the description of the distribution in 2 columns: The first holds the cumulative probability distribution. (offset by one row and starting with zero) The second holds the values that the random variable can take

Random Number Options in Excel In the cells which are to hold the randomly generated values, we specify =VLOOKUP(RAND(), area where table describing distribution is stored, 2) The first argument is a randomly generated value between 0 and 1 The third argument is the column number (in the table) where the values are stored

EXAMPLE #3--Inventory Consider an inventory system which uses a reorder quantity model. Suppose the assumptions of EOQ, EPLS, Shortages, or Quantity Discounts models are not satisfied. Specifically suppose demand is not “known and constant”. How to determine a good lot size, Q?

EXAMPLE #3--Inventory Items cost $10 each and annual holding rate is 45%. Fixed cost to place an order is $15. Weekly demand is distributed in this way: Weekly Demand Probability 9 .1 10 .2 11 .4 12 .2 13 .1 The company is considering using lot sizes of 50, 75, and 100. Use simulation to determine which lot size tends to give the lowest annual costs.

Homework At this point you should be able to complete the following homework problems in Chapter 16: #15

Random Number Options in Excel How to generate samples from a Normal distribution with mean μ and standard deviation σ? =NORMINV(R, μ, σ) How to generate samples from a Uniform distribution on [a,b) =a+(b-a)*R where R is a random number on [0,1)

EXAMPLE #4--Inventory Items cost $10 each and annual holding rate is 45%. Fixed cost to place an order is $15. Weekly demand is normally distributed with mean of 22 units and a standard deviation of 5 units. The company is considering using lot sizes of 50, 75, and 100. Use simulation to determine which lot size tends to give the lowest annual costs.

EXAMPLE #4--Inventory Items cost $10 each and annual holding rate is 45%. Fixed cost to place an order is $15. Weekly demand is uniformly distributed between 15 and 20 units. The company is considering using lot sizes of 50, 75, and 100. Use simulation to determine which lot size tends to give the lowest annual costs.

Homework At this point you should be able to complete the following homework problems in Chapter 16: #17 #21 Dates assignment (on Blackboard)

Waiting Line Models Up until now, the examples we have considered could be considered “static” models, in that they have involved independent trials In the Machine Failure problem, the number of failures on one day did not affect the number of failures on any other day. In the Inventory examples, the demand in one week did not affect the demand in another week. How can we create a model of a system in which that’s not the case? That is, what if the state of the system changes as a result of one event, so that the state of the system is different when the next event occurs?

Waiting Line Models Interarrival time Probability .5 minutes 10% Consider a customer service system with one server Customers arrive with interarrival times distributed like this: Service times are distributed normally with mean=1.5 minutes, and standard deviation = .5 minutes Create a simulation model which simulates 1000 customer arrivals and computes Average wait time # of customers who must wait % of customers who must wait Interarrival time Probability .5 minutes 10% 1 minute 20% 1.5 minutes 40% 2 minutes 2.5 minutes

Waiting Line Models Challenge: Modify your model for 2 servers