Introduction

When Wh you think of simulation, hi k f i l i what comes to mind?

CHAPTER 9: Simulation

Introduction

Introduction
Computer simulation:

A simulator is an experimental device that “acts like” or simulates the system of interest. Computer models can be a type of simulator when they are developed to evaluate a business problem.

A quick & inexpensive way to acquire knowledge concerning a problem that is usually gained through experience Creates an environment to obtain C t i t t bt i information in a quick, cost-effective costand low risk manner about alternative actions

1

Simulation should be used when:
1. Analytical models are difficult or impossible to develop because of complicating factors. 2. We want to predict something other than average or “steady state” (long run) steady-state” (long-run) behavior.

Excel Features & Functions
FEATURES
• Data Analysis: Descriptive Statistics • Data Analysis: Histogram

FUNCTIONS
• • • • • • RAND: generates a random real number INT: rounds a number down to the nearest integer NPV: calculates net present value of an investment SQRT: returns a positive square root AVERAGE: returns the arithmetic mean VLOOKUP: searches for a value in the first column of a table array and returns a value in the same row from another column in the table array • COUNTIF: counts the number of cells within a range that meet defined criteria

Terminology • • • • Simulation Models Probability Distributions Cumulative Probability Distributions Random Variables/Random Numbers(RN)
−discrete vs. continuous di i

Monte Carlo Simulation
1. Construct a Cumulative Probability Distribution Di t ib ti 2. Create Random # Distribution from Cumulative Probability Distribution 3. 3 Generate Random Numbers (RAND)

• Expected Value

4. Project a Random Observation of the Variable (VLOOKUP)

2

Probability Distributions
Discrete: integer values (whole numbers) Continuous: fractional or decimal values (infinite number of values) Cumulative Distributions
Demand 8 9 10 11 12 13 % .10 .20 .30 .20 .10 .10 Cumu % 0 .10 .30 .60 .80 .90

Continuous Distributions
• Normal distribution
− Most widely used − Conditions:
Some value is most likely (mean) Symmetrical around mean More likely to be near mean

• Uniform distribution
− All values between min & max occur with equal likelihood − Conditions:
Min value is fixed Max value is fixed All values occur with equal likelihood

To generating random variables:
Draw random sample from given probability distribution. distribution

• Random variable: a variable whose
y outcome is not known with certainty

Generate random numbers

3

To generating random variables:
Draw random sample from given probability distribution. distribution

Monte Carlo Simulation
13 (10.0%) 14 (10.0%) 15 (10.0%) 12 (20.0%)

• Probability distribution: describes the
behavior of a random variable by defining its:
Central Tendency: Mean (expected value) Variability: Standard Deviation Limit: Upper & lower (min/max) Nature: Discrete vs Continuous

10 (30.0%) 11 (20.0%)

Monte Carlo Simulation
13 (10.0%) 14 (10.0%) 15 (10.0%) 12 (20.0%)

Probability Distributions

The Toss of a Fair Coin

10 (30.0%) 11 (20.0%)

TAILS 50%

HEADS 50%

4

Probability Distributions
The Roll of a Fair Die

SIX 17% FIVE 17% 1 %

ONE 16% TWO 16%

FOUR THREE 18% 17%

Generating random numbers

Generating Random Numbers

Continuous random variable requirements:
1. Ability to generate decimal numbers 2. Understand cumulative distribution of the random variable to be generated

We’ll use Excel’s Rand function to generate random numbers

5

Generating Random Numbers
Continuous Distribution function
Demand 8 9 10 11 12 13 % Cumu % .10 .10 .20 .30 .30 .60 .20 .10 .10 .80 .90 1.00 Random # 0.0 – 0.09999 0.1 – 0.29999 0.3 – 0.59999 0.6 – 0.79999 0.8 – 0.89999 0.9 – 0.99999

MGS3100 Student Age Distribution Fall 2009

Limit: Minimum Age = 19; Maximum Age = 40 Prob (D<=x) Central Tendency: Mean = 24 M di = 22 M Median Nature: Discrete vs Continuous?

Mode M d = 21

MGS3100 Student Age Distribution Fall 2009
Age 19 20 21 22 23 24 25 26 27 >28 # 1 7 10 7 1 2 1 2 1 8 % 2.5% 17.5% 25.0% 17.5% 2.5% 5.0% 2.5% 5.0% 2.5% 20.0% Cumulative % 2.5% 20.0% 45.0% 62.5% 65.0% 70.0% 72.5% 77.5% 80.0% 100.0%

Classroom Exercise
Question 9-4: Sally’s Solar Car 9Sales/ Week 0 1 2 3 4 5
What probability distribution & cumulative probability distribution would you assign to demand so that the probability of a particular demand in the simulation is equal to the relative frequency of that demand over the last 50 weeks?

# Weeks 2 5 12 16 8 7

6

Generating Random Numbers

Simulate Demand with Random Numbers
3. Assign random numbers, using an interval from 0 to 1, to formulate a continuous distribution 1
Demand 8 9 10 11 12 13 % .10 .20 .30 .20 .10 .10 Cumu % .10 .30 .60 .80 .90 1.00 Random# 0.0 – 0.09999 0.1 – 0.29999 0.3 – 0.59999 0.6 – 0.79999 0.8 – 0.89999 0.9 – 0.99999

Continuous random variable requirements:
1. Ability to generate decimal numbers 2. Understand cumulative distribution of the random variable to be generated

The probability of drawing a number between .9 and .99999 is 1 out of 10 or 0.1 (10%).

Simulate Demand with Random Numbers
4. Generate random numbers and project demand d d
Demand 8 9 10 11 12 13 % .10 .20 .30 30 .20 .10 .10 Cumu % .10 .30 .60 60 .80 .90 1.00
Random Number Demand Random# 0.7612 11 0.7184 11 0.0 – 0.09999 0.1437 9 0.1 – 0.29999 0.9471 13 9 0.3 0.59999 0.1574 0 3 – 0 59999 0 1574 0.3308 10 0.6 – 0.79999 0.2962 9 0.5629 10 0.8 – 0.89999 0.1832 9 0.9 – 0.99999 0.7194 11 0.2679 9 0.7444 11

Expected Values
Multiply profit (in this example) by respective probabilities to get expected profit

Table 2, p187

7

All-Ways-Open Market Q13, p216

All-Ways-Open Market
1. Construct a Cumulative Probability Distribution Di t ib ti
Sales 40 41 42 43 44 45 Total Week 4 10 12 9 8 7 50 Prob. 0.08 0.20 0.24 0.18 0.16 0.14 Cumu 0.08 0.28 0.52 0.70 0.86 1.00 Random #s 0.00-0.7999 0.80-0.2799 0.28-0.5199 0.52-0.6999 0.70-0.8599 0.86-0.9999

Monte Carlo Simulation Recap
1. Construct a Cumulative Probability Distribution Di t ib ti 2. Create Random # Distribution from Cumulative Probability Distribution 3. 3 Generate Random Numbers 4. Project a Random Observation of the Variable (VLOOKUP)

Review: Generating Random Numbers

Continuous random variable requirements:
1. Ability to generate decimal numbers 2. Understand cumulative distribution of the random variable to be generated

8

Monte Carlo Simulation Recap
1. Construct a Cumulative Probability Distribution Di t ib ti 2. Create Random # Distribution from Cumulative Probability Distribution 3. 3 Generate Random Numbers 4. Project a Random Observation of the Variable

Generating Random Numbers

Discrete random variable requirements:
1. Ability to generate whole numbers 2. Understand distribution of the discrete random variable to be generated

Generating Random Numbers
Discrete Distribution Function
Excel 2007: The RANDBETWEEN function can be used to generate discrete distribution
=RANDBETWEEN(8,12) returns a discrete uniform distribution of integers between 8 & 12

Generating Random Numbers
Discrete Distribution Function
Excel 2003: The INT function used in conjunction with the RAND function generates discrete distribution
Values for RAND() =INT(8+5*RAND()) 8 9 10 11 12

=INT(8 + 5 * RAND()) returns a discrete uniform distribution of integers between 8 & 12

0 <=RAND() <0 2 <0.2 0.2 <RAND() <0.4 0.4 <RAND() <0.6 0.6 <RAND() <0.8 0.8 <RAND() <1.0

9

Startup Costs Sales Price Fixed Costs (per year) Variable Costs (per year)

$150,000 $ 35,000 $ 15,000 75% of revenues

Airbus: Capital Budgeting for New Product Line

Tax depreciation: $10,000/yr over 4 yr product life Salvage value: Estimated to be $0.00 Cost of capital: 10% Tax rate: 34% Demand: ??, but to get started we’ll assume 10 planes/year for 4 yr product life

P. 167

AIRBUS: NPV Model

AIRBUS: NPV Model w/Random Demand
Assumptions: • Yearly demand will be either 8, 9, 10, 11, or 12 • Each demand value is equally likely to occur We will include RANDBETWEEN function to sample from a discrete uniform distribution on the integers 8, 9, 10, 11, 12 We will generate multiple simulation trials

The model uses Excel’s NPV function to calculate Net Present Value

10

AIRBUS: NPV Model w/Random Demand
We modify the NPV model to generate random demands for each year

AIRBUS: Evaluate the Proposal
We need to answer two questions about the NPV distribution: 1. What is the mean or expected value of the NPV? 2. What is the probability that the NPV assumes a negative value? We’ll create a simulation model to answer these questions. Use Data Table to run the simulation automatically and capture the resulting NPV in a separate table.

AIRBUS: Evaluate the Proposal
1. What is the mean or expected value of the NPV?

AIRBUS: Evaluate the Proposal
2. What is the probability that NPV assumes a g negative value?

• What is the best possible outcome? We review the Distribution of Outcomes: The Frequency Table

• What is the worse possible outcome?

11

AIRBUS: Evaluate the Proposal
3. How confident are we in these results? Confidence intervals use the following statistics: 1.00 =68% 1.96 = 95.0% 3.00 = 99.7% To compute a 95% confidence interval:

AIRBUS: Evaluate the Proposal
4. Would we be more confident if we ran more trials?

• I Increasing the # of trials will give better NPV i th ft i l ill i b tt
estimate, but there will always be differences between the average & true expected return

mean ±

1.96 ∗ std n

• Simulations can provide useful information
on the distribution results

• Simulation results are sensitive to
assumptions affecting input parameters.

12