Unit 13 Simulation Monte-Carlo Method (1)
Unit 13 Simulation Monte-Carlo Method (1)
13.1 Introduction
In the previous unit, you learnt the basic concepts and methodology of
simulation. You also learnt simulation procedure and sample size. Monte-
Carlo technique has become such an important part of simulation models
that the terms are often assumed to be synonymous. However, it is only a
special technique of simulation. The technique of Monte-Carlo involves the
selection of random observations within the simulation model.
The technique is restricted for application involving random numbers to
solve deterministic and stochastic problems. The principle of this technique
is replacement of actual statistical universe by another universe described
by some assumed probability distribution and then sampling from this
theoretical population by means of random numbers.
In fact, this process involves the generation of simulated statistics (random
variables) that can be explained in simple terms as choosing a random
number and substituting this value in it.
In this unit, you will learn the Monte-Carlo simulation method and the
application of simulation methods. You will also learn the advantages and
limitations of simulation.
Objectives:
After studying this unit, you should be able to:
describe Monte-Carlo simulation method
analyse the applications of simulation
list the advantages and limitations of simulation
If it did not rain on the previous day, the rain distribution is as depicted in
table 13.2:
Table 13.2: Rain Distribution Table
Event No rain 1 cm 2 cm 3 cm
Rain Rain Rain
Probability 0.75 0.15 0.06 0.04
Simulate the city’s weather for 10 days and determine the total days without
rain as well as the total rainfall during the periodby simulation. Use the
following random numbers:
67 63 39 55 29 78 70 06 78 76
For simulation assume that for the first day of the simulation it had not
rained the day before.
Solution: We simulate the city’s weather with and without rainfall in the
following steps:
Step 1: Previous day rain distribution is as depicted in table 13.3:
Table 13.3: Rain Distribution Table
Event Probability Cumulative RN range
probability
No rain 0.50 0.50 00-49
1 cm Rain 0.25 0.75 50-74
2 cm rain 0.15 0.90 75-89
3 cm Rain 0.05 0.95 90-94
4 cm Rain 0.03 0.98 95-97
5 cm Rain 0.02 1.00 98-99
During the simulated period it did not rain on 6 out of 10 days. The total
rainfall during the period is 5 cm.
Solved problem 2:
The number of customers at a restaurant each evening is distributed as
depicted in table 13.6:
Table 13.6: Distribution of Customers
The chef refuses to work on an evening when there are very few customers
and walks out. He will not return to work until an evening when there are lots
Manipal University Jaipur Page No. 256
Operations Research Unit 13
The following specimen run was started with ‘Monday’ and with the chef
being ‘in’. Keeping the view in mind that we are trying to reproduce the long
term behaviour of the restaurant, the initial conditions of the simulation will
not affect the results we obtain.
Table 13.8: Distribution Table
Day Day of the Random Number of Chef Number Fraction
week Digit customers ‘in’ or of days of days
‘out’ ‘in’ to ‘in’ to
date date
1 Monday 3 Average In 1 1.00
2 Tuesday 5 Average In 2 1.00
3 Wednesday 1 Lots In 3 1.00
4 Thursday 8 Very few Out 3 0.75
5 Friday 6 Very few In 4 0.80
6 Saturday 6 Very few Out 4 0.67
7 Sunday 4 Average Out 4 0.57
8 Monday 4 Average Out 4 0.50
9 Tuesday 0 Lots In 5
10 Wednesday 0.56
Solved problem 3:
A project schedule consists of five activities and the duration of these
activities is non-deterministic with the probability distribution as depicted in
table 13.9:
Table 13.9: Probability Distribution Table
Simulate the duration of the project 10 times and estimate the chances of
various paths to be critical. What is the average duration of the project?
Solution:
From the PERT network, we observe that there are two paths from the start
to end of the project, namely 1245 and 1345. Using one-digit
random number corresponding to the probability distribution of various
activities, we obtain the simulated duration of each path and hence the
simulated duration of various activities and the simulated duration of the
project. Table 13.10 depicts the results of the simulation:
A) Draw the network diagram and identify the critical path using the
expected activity times.
B) Simulate the project using random numbers to determine the activity
times. Find the critical path and the project duration.
C) Repeat the simulation four more times. Is the same path critical in all the
simulations?
Solution:
a) using the given information, the resulting network is depicted in figure
13.2. The time for each of the activities is the expected time obtained by the
summation of the products of the activity time and the corresponding
probability. For example, for activity A,
The Expected Time = 3*0.20 + 4*0.60 + 5*0.20 = 4 days.
Network design
Observe that the critical path of the project is 123467, with an
expected duration of 20.2 days.
To use the simulation for obtaining the project length, we first determine the
random number intervals for each activity. Random number coding is shown
in the table. The five simulation runs, by taking random numbers, are as
depicted in table 13.12. For each run, the critical path and the project
durations are obtained and the project time is obtained as follows:
Total time = Larger of times for activities A and C, and B + Time for activity
D + Larger of times for activities E + Time for activity G
Cumulative Random
Activity Time Probability number
Probability
Interval
A 3 0.20 0.20 00-19
4 0.60 0.80 20-79
5 0.20 1.00 80-99
B 4 0.10 0.10 00.09
5 0.30 0.40 10-39
6 0.30 0.70 40-69
7 0.20 0.90 70-89
8 0.10 1.00 90-99
C 1 0.15 0.15 00-14
3 0.75 0.90 15-89
5 0.10 1.00 90-99
D 4 0.80 0.80 00-79
5 0.20 1.00 80-99
3 0.10 0.10 00-09
E 4 0.30 0.10 10-39
5 0.30 0.70 40-69
6 0.30 1.00 70-99
F 5 0.20 0.20 00-19
7 0.80 1.00 20-99
G 2 0.50 0.50 00-49
3 0.50 1.00 50-99
Simulation worksheet
Activity
Table 13.13 depicts the simulation worksheet.
Table 13.13: Simulation Worksheet
Simulation A B C D E F G
RN D RN D RN D RN D RN D RN D RN D
1 68 4 13 5 09 1 20 4 73 6 07 5 92 3
2 99 5 93 8 18 3 20 4 22 4 07 5 29 2
3 57 4 33 5 49 3 65 4 92 6 98 7 00 2
4 57 4 12 5 31 3 96 5 86 6 92 7 91 3
5 77 4 37 5 34 3 11 4 27 4 10 5 59 3
We get the information as depicted in figure 13.3 from the above table:
It may be observed that the same path is not critical in each of the runs.
13.3.2 Simulation in job sequencing
In this section, we illustrate the use of simulation in the sequencing
problems.
Example:
A job has to be processed over two machines, machine M1 and machine
M2 in that order. The distribution of inter-arrival time of the jobs at the first
machine is as depicted in table 13.14:
Table 13.14: Distribution of Arrival Time
Time(minutes) 1 2 3 4
Probability 0.2 0.2 0.2 0.4
On the basis of 10 simulation runs, find out the average queue length before
machine M1 and the average queue length before machine M2.
Solution:
The various steps for simulation are:
1. Simulate the inter-arrival time of the ith job on machine M1 with the help
of a random number (i= 1, 2…….).
2. Arrival time of ith job.
= Arrival time of (i-1)th job (i=2,3, ….) + Inter-arrival time of ith job.
Arrival time of the first job= Inter-arrival time of the first job
3. Simulate the processing time on machine M1 by random numbers.
4. Departure time on machine M1
= Arrival time for processing on machine M2
= Max (Arrival time of ith job, process completion time of (i-1)thjob
on machine M1) + processing time of ith job on machine M1
5. If arrival time of ith job < Process completion time of (i-1)th, ith arrival
waits.
If arrival time of ith job < Process completion time of (i-2)th, both ith and (i-
1)th arrivals wait.
6. Simulate the processing time of machine M2 with the help of random
numbers.
7. Process completion by machine M2 of ith arrival
= Max [Arrival time of ith job, process completion time of (i-1)th job]
+ Process time by machine M2.
Manipal University Jaipur Page No. 265
Operations Research Unit 13
8. If arrival time of ith< process completion time of (i-1)th, the ith arrival waits.
If arrival time of ith< process completion time of (i-2)th , both ith and (i-1)th
arrivals wait, etc.
Using the procedure, the simulated processing data of 10 arrivals are
displayed in the simulation worksheet as depicted in figure 13.4:
On the basis of the simulation study, the average queue length before
machine M1 is 0.5 and the average length before machine M2 is 1.2.
13.6 Summary
Let us recapitulate the important concepts discussed in this unit:
The Monte-Carlo method is a simulation technique in which statistical
distribution functions are created by using a series of random numbers.
Simulation could be used many systems such as in a queuing,
production, dock facilities, facilities at airports to minimise congestion,
hospital appointment systems and even management games.
A number of network simulation models have also been developed, such
as simulation of probabilistic activity times in PERT network.
Simulation enables us to assess the possible risks involved in a new
policy before actually implementing it.
13.7 Glossary
Job sequencing: the arrangement of the tasks required to be carried out.
job shop: Organization of work in a manufacturing organization by job
functions.
13.9 Answers
Self Assessment Questions
1. (b) Monte-Carlo simulation involves modelling a deterministic system.
2. Random, Simulation.
3. Critical path
4. Business
5. (d) All of the above.
6. (c) They may be expensive to write and use as an experimental device.
7. (d) All of the above.
8. (c) Identify suitable values of decision variables for the specific choices
of system parameters.
Terminal Questions
1. To find the critical path and project duration. For more details refer
13.3.1
2. Advantages of simulation: to studying complicated systems, investigate
the consequences for a system and assess the possible risks involved.
For more details refer 13.4
3. Limitations of simulation: does not generate the solution techniques,
simulation models are expensive and does not produce answers by
itself. For more details refer 13.5
4. The Monte-Carlo method is a simulation technique in which statistical
distribution functions are created by using a series of random numbers.
This approach has the ability to develop many months or years of data
in a matter of few minutes on a digital computer. For more details
refer 13.2
5. Using random numbers from the first six columns for six trials:
Trial Critical paths Duration
1 BDFGH 16
2 BDFGH 19
3 BDFGH 18
4 BDFGH 17
5 ACFGH
BDFGH 16
6 ACFGH and
BDFGH 18
waits are not excessive. To avoid excessive waits for either kind of casting,
all the castings are processed as soon as possible on a first come, firstserve
basis.
Discussion Question:
Management’s objective is to minimise the expected total cost per hour. Use
simulation to evaluate and compare all the alternatives, including the status
quo and the various combinations of proposals. Then make your
recommendation to the management.
References:
Kapoor V. K. (2005). Operations Research. Sultan Chand and Sons.
Sharma J. K. (2006). Operations Research. Macmillan India Limited.
Taha H. Operations Research. Prentice Hall.
Kanti Swarup & Gupta P. K., & Hira D. S., & Manmohan (2004).
Operation Research. Sultan Chand and Sons.