Chapter 9 Monté Carlo Simulation



Similar documents
Chapter 3 RANDOM VARIATE GENERATION

Stats on the TI 83 and TI 84 Calculator

Math 431 An Introduction to Probability. Final Exam Solutions

5. Continuous Random Variables

MBA 611 STATISTICS AND QUANTITATIVE METHODS

UNIT I: RANDOM VARIABLES PART- A -TWO MARKS

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

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

Random variables, probability distributions, binomial random variable

QUANTITATIVE METHODS IN BUSINESS PROBLEM #2: INTRODUCTION TO SIMULATION

Overview of Monte Carlo Simulation, Probability Review and Introduction to Matlab

Chapter 5 Discrete Probability Distribution. Learning objectives

CHAPTER 6: Continuous Uniform Distribution: 6.1. Definition: The density function of the continuous random variable X on the interval [A, B] is.

Important Probability Distributions OPRE 6301

STAT 315: HOW TO CHOOSE A DISTRIBUTION FOR A RANDOM VARIABLE

Chapter 4. Probability and Probability Distributions

Binomial Random Variables

Normal Probability Distribution

The Normal Distribution. Alan T. Arnholt Department of Mathematical Sciences Appalachian State University

Chapter 4. Probability Distributions

BINOMIAL DISTRIBUTION

You flip a fair coin four times, what is the probability that you obtain three heads.

MATH 140 Lab 4: Probability and the Standard Normal Distribution

Notes on Continuous Random Variables

2 Binomial, Poisson, Normal Distribution

z-scores AND THE NORMAL CURVE MODEL

Choosing Probability Distributions in Simulation

Lecture 8. Confidence intervals and the central limit theorem

ST 371 (IV): Discrete Random Variables

Approximation of Aggregate Losses Using Simulation

Introduction to Simulation

An Introduction to Basic Statistics and Probability

The normal approximation to the binomial

Binomial Distribution Problems. Binomial Distribution SOLUTIONS. Poisson Distribution Problems

Practice Problems #4

Pr(X = x) = f(x) = λe λx

The Normal distribution

Chapter 4 - Lecture 1 Probability Density Functions and Cumul. Distribution Functions

3 Continuous Numerical outcomes

Review #2. Statistics

Section 5 Part 2. Probability Distributions for Discrete Random Variables

Lesson 20. Probability and Cumulative Distribution Functions

Exploratory Data Analysis

Normal Distribution. Definition A continuous random variable has a normal distribution if its probability density. f ( y ) = 1.

Normal distribution. ) 2 /2σ. 2π σ

4. Continuous Random Variables, the Pareto and Normal Distributions

Chapter 5 - Practice Problems 1

Random variables P(X = 3) = P(X = 3) = 1 8, P(X = 1) = P(X = 1) = 3 8.

SPREADSHEET SIMULATION IN ACCOUNTING WITHOUT ADD-INS

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

Binomial Distribution n = 20, p = 0.3

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

12.5: CHI-SQUARE GOODNESS OF FIT TESTS

TEACHING SIMULATION WITH SPREADSHEETS

Probability Distributions

6 3 The Standard Normal Distribution

The Normal Distribution

Lecture 3: Continuous distributions, expected value & mean, variance, the normal distribution

Questions and Answers

Key Concept. Density Curve

The mathematical branch of probability has its

Multiple Choice: 2 points each

Chapter 3: DISCRETE RANDOM VARIABLES AND PROBABILITY DISTRIBUTIONS. Part 3: Discrete Uniform Distribution Binomial Distribution

3.4. The Binomial Probability Distribution. Copyright Cengage Learning. All rights reserved.

The normal approximation to the binomial

Density Curve. A density curve is the graph of a continuous probability distribution. It must satisfy the following properties:

2. Discrete random variables

Lecture 8: More Continuous Random Variables

LECTURE 16. Readings: Section 5.1. Lecture outline. Random processes Definition of the Bernoulli process Basic properties of the Bernoulli process

Statistical Functions in Excel

Continuous Random Variables

Chapter 4 Lecture Notes

STAT x 0 < x < 1

Summary of Formulas and Concepts. Descriptive Statistics (Ch. 1-4)

Normal Approximation. Contents. 1 Normal Approximation. 1.1 Introduction. Anthony Tanbakuchi Department of Mathematics Pima Community College

The Binomial Probability Distribution

6.041/6.431 Spring 2008 Quiz 2 Wednesday, April 16, 7:30-9:30 PM. SOLUTIONS

Stat 515 Midterm Examination II April 6, 2010 (9:30 a.m. - 10:45 a.m.)

Section 6.1 Discrete Random variables Probability Distribution

Probability Distributions

Probability Distributions

People have thought about, and defined, probability in different ways. important to note the consequences of the definition:

Lecture 7: Continuous Random Variables

Sample Questions for Mastery #5

36106 Managerial Decision Modeling Monte Carlo Simulation in Excel: Part I

8. THE NORMAL DISTRIBUTION

Finite Mathematics Using Microsoft Excel

Chapter 5. Random variables

Chapter 4. iclicker Question 4.4 Pre-lecture. Part 2. Binomial Distribution. J.C. Wang. iclicker Question 4.4 Pre-lecture

Understanding Confidence Intervals and Hypothesis Testing Using Excel Data Table Simulation

Probability Calculator

Dongfeng Li. Autumn 2010

SAMPLING DISTRIBUTIONS

WEEK #22: PDFs and CDFs, Measures of Center and Spread

MAS108 Probability I

Probability. Distribution. Outline

Maximum Likelihood Estimation

TEACHER NOTES MATH NSPIRED

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

), 35% use extra unleaded gas ( A

Transcription:

MGS 3100 Business Analysis Chapter 9 Monté Carlo What Is? A model/process used to duplicate or mimic the real system Types of Models Physical simulation Computer simulation When to Use (Computer) Models? Problems/systems are too comple to be analyzed mathematically There are random components in the system Benefits of Model It is relatively straightforward and generally easier to understand It can model a wide range of problems and answer what-if types of questions without actually changing or building a real system It is generally cheaper, quicker, and safer to eperiment with than a real system Limitations It can be epensive and time consuming to develop There is no guarantee that it will give optimal or eact solution to the problem 3 Monte Carlo Key element is randomness Assume that some inputs are random variables Modeling randomness by generating random variables from their probability distributions Since some inputs to the model are random, outputs from the model are random too. Modeling Process Develop the basic model that behaves like the real problem, with a special consideration of the random or probabilistic input variables Conduct a series of computer runs (called trials) to learn the behavior of the simulation model Compute the summary (output) statistics and make inferences about the real problem 4

Monte Carlo Eample process is similar to statistical inference process Statistics: start with a population, sampling from the population, and then based on sample information to infer population : start with a basic model to represent real problem, replicating the basic model, and then based on the replication results to help solve real problem The larger the number of trials (sample size), the more reliable will be the simulation result! Basic Model: Profit = f(demand) Input: Relationship: Output: t Demand function f Profit How simulation works: Step 1: basic model development: generate one possible random Demand and find the corresponding Profit Step : basic model replication: generate many possible values of Demand and dfind corresponding Profits Step 3: result summarization: calculate summarized statistics on the Profit such as average, min, ma etc. 5 6 How Works Random Numbers What Do We Need Know for? What variable is to be simulated Is the variable discrete or continuous? The distribution of the variable values it can take on and the probabilities biliti of those values occurring. How to Generate Variables? Step 1: Generate random numbers. Step : Create a rule to map the random numbers to values of the variable desired in the right proportion, and apply the rule. Uniformly distributed between 0 and 1 Each number in [0,1] is equally likely The building blocks of all simulation models Other random variables can be generated from random numbers In Ecel, =RAND() generates random numbers When the formula is copied to other cells, different random numbers are generated Press F9 (recalculate) key or do any change in the spreadsheet, all random numbers will change You can freeze the random numbers by using Copy and dpaste Special Value commands 7 8

Types of Variables in Discrete Take only limited specific values or specific points. Eample: number of defects, answer to T/F questions. Continuous Can take any value (between specific points) Eample: time between machine breakdown, filling volume in a coke s bottling assembly line 9 Generating Random Variables General Two-Step Approach first, generate random numbers (u) second, transform random numbers via CDF to random variables () with desired probability distribution u F() =F -1 (u) Inverse transformation method 10 Eample: p generate discrete r.v. Suppose monthly demand follows the following distribution ib ti Demand () p() 5 0.10 0 0.40 30 0.30 50 0.0 We want to generate 1 random demands (may be for net 1 months). How? Eample: generate discrete r.v. First find CDF: Demand () p() F() 5 0.1 0.1 0 04 0.4 05 0.5 30 0.3 0.8 50 0. 1 The CDF (F()) essentially establishes a rule that maps a demand to a random number range Demand 5 0 30 50 Rand # 0 01 0.1 0.5 08 0.8 1 What is the probability that a random number will be in range [0, 0.1], [0.1, 0.5], [0.5, 0.8], or [0.8, 1]? 11 1

Eample: p generate discrete r.v. That is, we have the following rule: If the random number Then the corresponding falls in demand is 0 0.1 5 0.1 0.5 0 05 0.5 08 0.8 30 0.8 1.0 50 So if we get a random number, say 0.1537, then we know we find a demand of 0 13 Eample: generate discrete r.v. Now if we need to simulate 1 times, what we need to do is to generate 1 random numbers and then follow the rule to get 1 demand levels Replication Random number Demand 1 0.7669 30 0.93813 50 3 0.57897 30 4 0.500 0 5 0.14009 0 6 0.98889 50 7 0.07436 5 8 0.47831 0 9 0.6698 30 10 0.1965 0 11 0.55519 30 1 0.45593 0 14 Manual : 1. Coin Toss. Machine Failures Tossing two coins at one time. If both are heads up, then you win $4, if only one head up, then you win $1, if both are tails, then you lose $6. Simulate this game 5 times. Random Random #of Cumulative Game # 1 # Heads Win Win 1 0.5473 0.6513 3 0.944 0.07360736 0.163 0.1758 4 5 0.385 0.5584 0.8958 0.171 Simulate machine failures for the net 5 months based on the historical data given in the table on the left. Number Frequency of Failures (# of months per month this occurred) Random # 0 36 0.3451 1 0 0.0085 3 0.9853 3 1 0.8788 Total 60 0.5694 Number of Failures 15 16

3. Coke Weight Cans from a Coke production line follow the following distribution regarding g their weights. Simulate the process on the net page and find what percentage of cans are at or above 1 oz. Weight Percentage Cumulative Percentage 11.8 oz. or less 11.9 oz. 10% 0% 10% 30% 1.0 oz. 1.1 oz. 1. oz. or more 40% 0% 10% 70% 90% 100% 17 3. Coke Weight Random Can # # Weight 1 oz.? 1 0.7457 0.099 3 0.7477 4 0.0497 5 0.958 6 0.3816 7 0.5874 8 0.8700 9 0.9336 10 0.668 18 Generating Random Variables In Ecel Generating Discrete r.v. with Ecel Use VLOOKUP function Generating Continuous r.v. with Ecel Uniform between a and b: = a+(b-a)*rand() Normal with mean μ and standard deviation σ = NORMINV(RAND(), μ, σ) Eponential with mean μ: = - μ*ln(rand()) Using Ecel s Features in Tools Data Analysis Random Number Generation Generating Discrete rv r.v. in Ecel First, find cumulative distribution of the r.v. Second, generate random numbers by =RAND() Finally, use VLOOKUP function (Note: the nd and 3 rd steps can be combined as one step) 19 0

An Eample A B C D E F G 1 Generating discrete random variables with VLOOKUP function 3 Random number range Demand 4 0 0.1 5 5 0.1 0.5 0 6 0.5 0.8 30 7 0.8 1 50 8 9 Random number Outcome 10 0.47444547 0 The range A4:C7 has been range- 11 0.71318343 30 named TABLE 1 0.844783096 50 13 0.86109451 50 14 0.434684 0 15 0.3073877 0 16 0.017091017091 5 17 18 with Spreadsheet Coin Toss Newsboy Problem - Walton s Bookstore Capital Budgeting (tetbook pp. 167-174) A B C D E F G 9 Random number Outcome 10 =RAND() =VLOOKUP(A10,TABLE,3) 11 =RAND() =VLOOKUP(A11,TABLE,3) 1 =RAND() =VLOOKUP(A1,TABLE,3) 13 =RAND() =VLOOKUP(A13,TABLE,3) 14 =RAND() =VLOOKUP(A14,TABLE,3) 15 =RAND() =VLOOKUP(A15,TABLE,3) 16 =RAND() =VLOOKUP(A16,TABLE,3) 17 18 *** TABLE in VLOOKUP is the range name for cell range A4:C7 The second column in the TABLE range (A4:C7) is not necessary. Without it (only two columns in the TABLE range), the VLOOKUP function will be VLOOKUP(A10,TABLE,) 1 Queuing (Waiting Line) Model Appendi Random Variable & Probability bilit Distribution A Quick Review Random Variable (r.v.) A variable that has many possible values, but eactly which one it will take is unknown Discrete r.v. vs. Continuous r.v. Probability Distribution Mathematical mechanism used to characterize the probabilistic bili pattern/behavior of a random variable Two types of probability distribution: probability density function (pdf) and cumulative distribution function (CDF) 3 Probability Distributions probability density function for discrete r.v. A list of all possible values of a discrete r.v.,x,and their associated probabilities, p() P(X = ), where is a particular value the r.v. X may take. Eample: X = # of cars sold per day in a car shop p() p() 03 0.3 0 0.10 1 0.0 0.30 0. 3 0.0 0.1 4 0.10 5 010 0.10 1.00 0 1 3 4 5 4

Probability Distributions Probability Distributions probability density function for continuous r.v. For continuous r.v., a pdf itself is not a probability. Rather, any area under the curve pdf curve is the probability Eample: X = The eact fluid content of a 1-ounce coke randomly selected from the production line f() P(a X b) f() a b 5 Cumulative Distribution Function (CDF) CDF (or F()) is the cumulative form of the pdf For any r.v. X, F() = P(X ) Eample: X = # of cars sold per day p() F()=P(X ) 0 010 0.10 010 0.10 1 0.0 0.30 0.30 0.60 3 00 0.0 080 0.80 4 0.10 0.90 5 0.10 1.00 1.00 pdf CDF 6 Useful Discrete Distributions Useful Discrete Distributions The Binomial Distribution Used to model the number of successes in a series of independent eperiments, each of which has only two possible outcomes: success and failure Eamples: the number of workers absent in a department of 10 employees on any day; the number of American-made cars in a parking lot of 30 spaces; the number of defective items in a sample of 10 n n pmf: P ( X = ) = p (1 p ), = 0,1,,,...,, n where n = number of trials, p = prob. of success X = number of successes in n trials The Poisson Distribution Used to model the number of events that occur in certain amount of time or space Eamples: the number of people arriving at a bank during lunch hour; the number of misspelled words on a page of your tetbook λ pmf: e λ P ( X = ) =, = 0,1,,...! where λ = average number of occurrences, e =.7188 X = number of occurrences 7 8

Useful Continuous Distributions Uniform Distribution between 0 and 1 Any value in the range [0, 1] is equally likely pdf: f() = 1, if 0 1 = 0, if < 0 or > 1 CDF: F() =, if 0 1 = 0, if < 0 or > 1 Useful Continuous Distributions Normal Distribution The most important probability distribution in Statistics ti ti and other applications Symmetric around the mean and bell shaped pdf: f ( ) = 1 ) / e σ, < < πσ If X N(μ, σ ), then Z=(X - μ)/σ N(0, 1) f() Uniform pdf F() Uniform CDF f() pdf 1 1 CDF 0 1 0 1 9 μ 30 Useful Continuous Distributions Triangular Distribution The pdf has a triangular shape Used when we only know the minimum, maimum and most likely values of a r.v., but no other information Useful Continuous Distributions Eponential Distribution Useful for modeling the time between two successive random events Eamples in queuing systems: inter-arrival times of customers, service times f() a - minimum b - most likely c -maimum f() f ) = 1 e μ μ (, μ: mean a b c 31 3