Sei sulla pagina 1di 55

MONTE CARLO

SIMULATION
CHE 517N Quantitative Methods in Management

Flores, Dharyl C.

Francisco, Fraulein Angela G.

Senagote, Roger Francis


Outline

01 Introduction: Simulation

02 Brief History: Monte Carlo Simulation

03 Five Steps of Monte Carlo Simulation

04 Sample Problem # 1: Solved by hand


Sample Problem # 2: Using QM for Windows & Excel
05 Spreadsheets

06 Advantages and Disadvantages of MC Simulation

Applications
07
SIMULATION
SIMULATION
SIMULATION
simulate means to try to duplicate the
features, appearance, and characteristics
of a real system

to imitate a real-world
situation mathematically, then
to study its properties and
operating characteristics, and,
finally, to draw conclusions
and make action decisions
based on the results of the
simulation
PROCESS OF SIMULATION

Define Problem

Introduce Important
Variables

Construct Simulation
Model
Specify Values of
Variables to Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
PROCESS OF SIMULATION
Define Problem

Introduce Important
Variables
In general, the goal of simulation study
is to determine how a system will
Construct Simulation behave under certain conditions.
Model

Specify Values of Variables to


Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
PROCESS OF SIMULATION
Define Problem

Introduce Important
Variables
This involved deciding on the structure of the
model and using a computer to carry out the
Construct Simulation
Model
simulations.

Specify Values of Variables to


Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
PROCESS OF SIMULATION
Define Problem

Introduce Important
Variables

Construct Simulation
Model

Specify Values of
Variables to Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
PROCESS OF SIMULATION
Define Problem

Introduce Important
Variables

Construct Simulation
Model

Specify Values of Variables


to Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
PROCESS OF SIMULATION
Define Problem

Introduce Important
Variables The close the approximation of the model to
reality, the less the risk inherent in applying the
Construct Simulation results.
Model

Specify Values of Variables


to Be Tested

Conduct a Simulation

Examine the Results

Select Best Course of


Action
The problems tackled by simulation can range from very
simple to extremely complex, from bank teller lines to an
analysis of the U.S. economy. Although very small
simulations can be conducted by hand, effective use of this
technique requires some automated means of calculation,
namely, a computer. Even large-scale models, simulating
perhaps years of business decisions, can be handled in a
reasonable amount of time by computer.
Brief History Monte Carlo Simulation

It was developed as a quantitative technique by


the great mathematician John von Neumann
during World War II.

efforts to
develop nuclear
weapons

John von Neumann


Brief History Monte Carlo Simulation

Working with neutrons at the Los Alamos


Scientific Laboratory, von Neumann used
simulation to solve physics problems
that were too complex or expensive to
analyze by hand or by physical model.
The random nature of the neutrons
suggested the use of a roulette wheel in
dealing with probabilities. Because of the
gaming nature, von Neumann called it the
John von Neumann Monte Carlo model of studying laws of
chance.
Monte Carlo Simulation: General Concept
Basic idea:
to generate values for the variables making up the model being studied

A few examples of variables in real-world


systems that are probabilistic in nature and can
be simulated are:
1. Times between machine breakdowns
2. Number of employees absent from work
each day
3. Times to complete project activities
4. Inventory demand on a daily or weekly basis
5. Times between arrivals at a service facility
Monte Carlo Simulation: General
Concept
Basic idea:
to generate values for the variables making up the model being
studied
Basis:

experimentation on the chance (or probabilistic) elements


through random sampling
Five Steps of Monte Carlo Simulation

1 2 3 4 5
Establishing an Generating
Establishing Building a Simulating a
interval of random
probability cumulative series of trials
random numbers
distributions for probability
numbers for
important input distribution for each variable
variables each variable in
step 1
Five Steps of Monte Carlo Simulation

1 2 3 4 5
Establishing an Generating
Establishing Building a Simulating a
interval of random
probability cumulative series of trials
random numbers
distributions for probability
numbers for
important input distribution for each variable
variables each variable in
step 1
Five Steps of Monte Carlo Simulation

1 2 3 4 5
Establishing an Generating
Establishing Building a Simulating a
interval of random
probability cumulative series of trials
random numbers
distributions for probability
numbers for
important input distribution for each variable
variables each variable in
step 1
Five Steps of Monte Carlo Simulation

1 2 3 4 5
Establishing an Generating
Establishing Building a Simulating a
interval of random
probability cumulative series of trials
random numbers
distributions for probability
numbers for
important input distribution for each variable
variables each variable in
step 1
Five Steps of Monte Carlo Simulation

1 2 3 4 5
Establishing an Generating
Establishing Building a Simulating a
interval of random
probability cumulative series of trials
random numbers
distributions for probability
numbers for
important input distribution for each variable
variables each variable in
step 1
Sample Problem 1:
The manager of a machine shop is concerned about machine
breakdowns. A decision has been made to simulate breakdowns
for a 10-day period. Historical data on breakdowns over the last
100 days are given in the following table:

Number of Frequency
breakdowns (DAYS)
0 10
1 30
2 25
3 20
4 10 Simulate breakdowns for a 10-day period.
5 5 Read two digit random number starting
100 at the top of column 1 and reading
down.
Step 1: Establishing Probability Distributions.

Probability of
The probability, or relative Number of Frequency Occurrence/
frequency, for each possible breakdowns (DAYS) Relative
outcome of a variable is found Frequency
by dividing the frequency of 0 10 10/100 = 0.10
observation by the total 1 30 30/100 = 0.30
number of observations.
2 25 25/100 = 0.25

Note: Probability distributions, need not 3 20 20/100 = 0.20


be based solely on historical 4 10 10/100 = 0.10
observations. Often, managerial
estimates based on judgment and 5 5 5/100 = 0.05
experience are used to create a 100 100/100 = 1.00
distribution. Sometimes, a sample of
sales, machine breakdowns, or service
rates is used to create probabilities for
those variables (Render, 2012).
Step 2: Building a cumulative probability distribution for each variable in step 1

Number of Cumulative
A cumulative probability is the Probability
breakdowns Probability
probability that a variable (breakdown)
0 10/100 = 0.10 0.10
will be less than or equal to a particular
value. A cumulative distribution lists all 1 30/100 = 0.30 0.40
of the possible values and the
probabilities. 2 25/100 = 0.25 0.65

3 20/100 = 0.20 0.85


The cumulative probability for each level
of breaddown is the sum of the number 4 10/100 = 0.10 0.95
in the probability column (middle
column) added to the previous 5 5/100 = 0.05 1.00
cumulative probability (rightmost 100/100 = 1.00
column).
Step 3: Establishing an interval of random numbers for each
variable
Interval of
Number of Cumulative
Probability Random
Assign random–number intervals breakdowns Probability
Numbers
to correspond with the cumulative 10/100 =
frequencies for breakdowns 0 0.10 00 to 09
0.10
30/100 =
A random number is a series of 1 0.40 10 to 39
0.30
digits (say, two digits from 01, 02,
25/100 =
..., 98, 99, 00) that have been 2 0.65 40 to 64
0.25
selected by a totally random
20/100 =
process. 3 0.85 65 to 84
0.20
10/100 =
4 0.95 85 to 94
0.10
5 5/100 = 0.05 1.00 95 to 99
100/100 =
1.00
Step 3: Establishing an interval of random numbers for each
variable

Note: Two-digit numbers are used Interval of


Number of Cumulative
because the frequencies are given Probability Random
breakdowns Probability
to two decimal places. Numbers
10/100 =
0 0.10 00 to 09
0.10
Note: The ending digit of each
30/100 =
random-number interval is 1 less 1 0.40 10 to 39
0.30
than the cumulative frequency,
25/100 =
and the interval begins at the 2 0.65 40 to 64
0.25
cumulative frequency for the last
20/100 =
event, except for the first one, 3 0.85 65 to 84
which begins at 00. 0.20
10/100 =
4 0.95 85 to 94
0.10
5 5/100 = 0.05 1.00 95 to 99
100/100 =
1.00
Step 4: Generating random numbers
18 20 84 29 91 73 64 33 15 67 54 07
25 19 05 64 26 41 20 09 88 40 73 34
Random numbers may be 73 57 80 35 04 52 81 48 57 61 29 35
generated for simulation problems 12 48 37 09 17 63 94 08 28 78 51 23
in several ways. If the problem is
54 92 27 61 58 39 25 16 10 46 87 17
very large and the process being
studied involves thousands of 96 40 65 75 16 49 03 82 38 33 51 20
simulation trials, computer 23 55 93 83 02 19 67 89 80 44 99 72
programs are available to 31 96 81 65 60 93 75 64 26 90 18 59
generate the random numbers
45 49 70 10 13 79 32 17 98 63 30 05
needed.
01 78 32 17 24 54 52 44 28 50 27 68
41 62 57 31 90 18 24 15 43 85 31 97
22 07 38 72 69 66 14 85 36 71 41 58
Step 4: Generating random numbers
18 20 84 29 91 73 64 33 15 67 54 07
25 19 05 64 26 41 20 09 88 40 73 34
The random numbers used in 73 57 80 35 04 52 81 48 57 61 29 35
Monte Carlo simulation can come 12 48 37 09 17 63 94 08 28 78 51 23
from any source that exhibits the
54 92 27 61 58 39 25 16 10 46 87 17
necessary randomness. Typically,
they come from one of the two 96 40 65 75 16 49 03 82 38 33 51 20
sources: 23 55 93 83 02 19 67 89 80 44 99 72
(1) Large studies depend on 31 96 81 65 60 93 75 64 26 90 18 59
computer-generated numbers
45 49 70 10 13 79 32 17 98 63 30 05
(2) Small studies commonly
make use of numbers from a 01 78 32 17 24 54 52 44 28 50 27 68
table of random digits 41 62 57 31 90 18 24 15 43 85 31 97
22 07 38 72 69 66 14 85 36 71 41 58
Step 5: Simulating a series of trials

18 20 84 29 91 73 64 33 15 67 54 07
Read two digit 25 19 05 64 26 41 20 09 88 40 73 34
random number 73 57 80 35 04 52 81 48 57 61 29 35
starting at the top 12 48 37 09 17 63 94 08 28 78 51 23
of column 1 and
54 92 27 61 58 39 25 16 10 46 87 17
reading down.
96 40 65 75 16 49 03 82 38 33 51 20
23 55 93 83 02 19 67 89 80 44 99 72
31 96 81 65 60 93 75 64 26 90 18 59
45 49 70 10 13 79 32 17 98 63 30 05
01 78 32 17 24 54 52 44 28 50 27 68
41 62 57 31 90 18 24 15 43 85 31 97
22 07 38 72 69 66 14 85 36 71 41 58
Step 5: Simulating a series of trials

Next, convert the random numbers into number of breakdowns.

Simulated number
Interval of Day Random number
Number of of breakdowns
Random
breakdowns 1 18 1
Numbers
2 25 1
0 00 to 09
3 73 3
1 10 to 39
4 12 1
2 40 to 64 5 54 2
3 65 to 84 6 96 5
4 85 to 94 7 23 1
8 31 1
5 95 to 99
9 45 2
10 01 0
17
Simulated number of
Day
breakdowns
1 1 The mean number of breakdowns for this 10-day
2 1 period simulation is 17/10 = 1.7

3 3
Comparing this to expected
4 1 number of breakdowns based on
5 2 the historical data:
6 5
7 1 𝐸𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑑𝑎𝑖𝑙𝑦 𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛
5
8 1 =
𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 𝑜𝑓 𝑖 𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛𝑠
× (𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛 𝑜𝑓 𝑚𝑎𝑐ℎ𝑖𝑛𝑒𝑠)
9 2 𝑖=0

10 0
17
Probability of
Number of Frequency Occurrence/ The mean number of breakdowns for this
breakdowns (DAYS) Relative 10-day period simulation is 17/10 = 1.7
Frequency
Comparing this to expected number of
0 10 10/100 = 0.10 breakdowns based on the historical data:
1 30 30/100 = 0.30
𝐸𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑑𝑎𝑖𝑙𝑦 𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛
2 25 25/100 = 0.25 5
𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 𝑜𝑓 𝑖 𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛𝑠
3 20 20/100 = 0.20
=
× (𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛 𝑜𝑓 𝑚𝑎𝑐ℎ𝑖𝑛𝑒𝑠)
𝑖=0
4 10 10/100 = 0.10
𝐸𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑑𝑎𝑖𝑙𝑦 𝑏𝑟𝑒𝑎𝑘𝑑𝑜𝑤𝑛
5 5 5/100 = 0.05 = 0.10 0 + 0.30 1 + 0.25 2
100/100 = + 0.20 3 + 0.10 4 + 0.05 5
100
1.00 = 2.05 𝑝𝑒𝑟 𝑑𝑎𝑦
Several points are worth taking:
1. The simple example is intended to illustrate the
basic concept of Monte Carlo simulation.

2. The simulation should be viewed as a sample, it


is quiet likely that additional runs of 10 numbers
would produce different means.

3. Because of the variability inherent in the results


of small samples, it would be unwise to attempt
to draw any firm conclusions from them; in an
actual study, much larger sample sizes would be
used.
Five Steps of Monte Carlo Simulation

1 2 3 4 5

Establishing Building a Generating Simulating a


Establishing an
probability cumulative random numbers series of trials
interval of random
distributions for probability
numbers for each
important input distribution for
variable
variables each variable in
step 1
Harry’s Auto Tire Example

Harry’s Auto Tire sells all types of tires, but a popular


radial tire accounts for a large portion of Harry’s
overall sales. Recognizing that inventory costs can be
quite significant with this product, Harry wishes to
determine a policy for managing this inventory. To see
what the demand would look like over a period of
time, he wishes to simulate the daily demand for a
number of days.
Step 1: Establishing Probability Distributions

Probability of
Demand for Tires Frequency (Days)
Occurence
10
0 10 200
= 0.05

20
1 20 200
= 0.10

40
2 40 200
= 0.20

60
3 60 200
= 0.30

40
4 40 200
= 0.20

30
5 30 200
= 0.15

200 1.0
Step 2: Building a Cumulative Probability Distribution

Cumulative
Daily Demand Probability
Probability
0 0.05 0.05
1 0.10 0.15
2 0.20 0.35
3 0.30 0.65
4 0.20 0.85
5 0.15 1.0
Graphical Representation of the
Cumulative Probability Distribution for Radial Tires
Step 3: Setting Random Number Intervals

Random number intervals is a set of numbers to represent each possible value or outcome

Cumulative Interval of Random


Daily Demand Probability
Probability Numbers
0 0.05 0.05 01 to 05
1 0.10 0.15 06 to 15
2 0.20 0.35 16 to 35
3 0.30 0.65 36 to 65
4 0.20 0.85 66 to 85
5 0.15 1.0 86 to 00
Step 4: Generating Random Numbers
We can select numbers from anywhere in the table to use in the simulation
Step 5: Simulating the Experiment

 We can simulate outcomes of an experiment by simply


selecting random numbers from the table
 If the random number chosen is 81 and the interval is 66 to
85 represents a daily demand for four tires, we select a
demand of four tires
 By simulating 10 days of demand for radial tires at Harry’s
Auto Tire
Ten-Day Simulation of Demand for Radial Tires

Day Random Number Simulated Daily


Demand
1 52 3
A total of 39 tires for
2 37 3
a 10-day demand.
3 82 4
4 69 4 Hence, the average
5 98 5 daily demand for
6 96 5 tires is 3.9
7 33 2
8 50 3
9 88 5
10 90 5
Comparing the 10-day Simulation to the Expected Daily
Demand
5

Expected Daily Demand = Probability of i Tires × (Demand of i Tires)


i =0

= 0.05 × 0 + 0.10 1 × 0.20 2 × (0.30)(3)


× (0.20)(4) × (0.15)(5)

= 2.95 tires

*If this simulation were repeated hundreds or thousands of time, it is much more likely that the average simulated
demand would be nearly the same as the expected demand
Advantages
.
Limitations
Uses of the MCM

Sampling
The objective is to gather information about a
random object by observing many realizations of it.
An example is simulation modeling, where a
random process mimics the behavior of some real-
life system, such as a production line or
telecommunications network. Another example is
found in Bayesian statistics, where Markov chain
Monte Carlo (MCMC) is often used to sample from
a posterior distribution.
Uses of the MCM

Estimation
In this case the emphasis is on estimating
certain numerical quantities related to a
simulation model. An example in the artificial
context is the evaluation of multi-dimensional
integrals via Monte Carlo techniques by writing
the integral as the expectation of a random
variable.
Uses of the MCM

Optimization
In many applications these
functions are deterministic and
randomness is introduced artificially in
order to more efficiently search the
domain of the objective function. Monte
Carlo techniques are also used to
optimize noisy functions, where the
function itself is random — for example,
the result of a Monte Carlo simulation.
Applications
Modelling Biochemical Processes
The biochemical models describing complex and dynamic
metabolic systems are typically multi-parametric and non-linear, thus
the identification of their parameters requires non-linear regression
analysis of the experimental data.
Applications

Industrial Engineering and Operations


Research
This is one of the main application areas of simulation
modeling. Typical applications involve the simulation of
inventory processes, job scheduling, vehicle routing,
queueing networks, and reliability systems. The MCM is also
used increasingly in the design and control of autonomous
machines and robots.
Applications

Physical Processes and Structures


The direct simulation of the process of neutron
transport was the first application of the MCM in the
modern era, and Monte Carlo techniques continue to be
important for the simulation of physical processes.
In addition to classical transport problems, Monte
Carlo techniques have enabled the simulation of photon
transport through biological tissue — a complicated
inhomogeneous multi-layered structure with scattering
and absorption.
Applications

Random Graphs and Combinatorial


Structures
Monte Carlo techniques have proven to be
very effective in studying the properties of random
structures and graphs that arise in statistical
physics, probability theory, and computer science.
The classical models of ferromagnetism, the
Ising model and the Potts model, are examples of
these random structures, where a common
problem is the estimation of the partition function.
Applications

Economics and Finance


Monte Carlo techniques have become
increasingly important tools for analyzing
them. These techniques are particularly
effective in solving problems involving a
number of different sources of uncertainty (for
example, pricing basket options, which are
based on a portfolio of stocks).
Applications

Computational Statistics
The ever increasing complexity of data (“big
data”) requires radically different statistical models
and analysis techniques from those that were used
20–100 years ago. By using Monte Carlo
techniques, the statistician is no longer restricted
to use basic (and often inappropriate) models to
describe data. Now any probabilistic model that
can be simulated on a computer can serve as the
basis for a statistical analysis.

Potrebbero piacerti anche