Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

M.Sc.

Course
in
Applied Mathematics with Oceanology
and
Computer Programming
Semester - III
Paper- MTM 306B Special Paper-OR
SLM 20.6
Operational Research Modelling-I
(Simulation)

Unit structure

1. Introduction
2. Objectives
3. Keywords
4. Introduction
5. What is simulation?
6. Types of simulation
7. Advantages of the simulation technique
8. Limitations of simulation
9. Applications of simulation
10. Steps of simulation process
11. Stochastic simulation and random numbers
11.1. Monte Carlo simulation
11.2. Generation of random number

1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

12. Applications
12.1. Evaluation of π by Monte Carlo method
12.2. Simulation of coin tossing
13. Simulation of inventory problems
14. Simulation of queuing problems
15. Simulation languages
16. Summary
17. Glossary
18. Self assessment questions
19. Suggested Further Readings

6.1 Introduction
Simulation is a method of solving decision making problems by desiring, constructing or manipulating a
model of a real system. It is defined to be the action of performing experiment on a model of a given
system. It duplicates the essence of a system or activity without actually obtaining the reality.
Simulation involves the construction of symbolic model that describes the systems operation in terms
of individual events and components dividing the system into smaller components and combining them in
their logical order, analyses the effect of their interactions on one another studying the various alternatives
with respect to the performance of the model and choosing the best one.
Simulation must be treated as a statistical experiment unlike the mathematical models where the output
of the model represents a long run steady state behavior. A simulation experiment differs from regular
laboratory experiment in the sense that it can be conducted totally on the computer by expressing the
interaction among the components of the system as mathematical relationship.

6.2 Objectives
Go through this module, you will learn

ˆ The definition of simulation.

ˆ Types of simulation

ˆ Merits and demerits of simulation

ˆ Application of simulation

ˆ Generation of random numbers


2 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ˆ Monte Carlo method of simulation

ˆ Problems on simulation

6.3 Keywords

Simulation, Stochastic simulation, Random numbers, Monte Carlo method.

6.4 Introduction

Techniques like linear programming, dynamic programming, queuing theory, network models, etc. are not
sufficient to tackle all the important managerial problems requiring data analysis. East technique has its
own limitations.
Linear programming models assume that the data do not alter over the planning horizon. It is one tune
decision process and assumes average values for the decision variables. If the planning horizon is long,
the multiperiod linear programming model may deal with the yearly average data, but will not take into
account the variation over the months and weeks with the results that month to month and week to week
operations are left implicit.
Dynamic programming models can be used to tackle very simple situations involving only a few variables.
If the number of state variables is a bit larger, the computation task becomes quite complex and involved.
In general, the simulation technique is a dependable tool in situations where mathematical analysis is
either too complex or too costly.

6.5 What is simulation?

Simulation is an immitation of reality. In the laboratories a number of experiments are performed on


simulated models to determine the behavior of the real system in true environments. A simple illustration
is the testing of an aircraft mode in a wind tunnel from which we determine the performance of the actual
aircraft under real operating conditions. Planetarium represents a beautiful simulation of the planet system.

6.6 Types of simulation

Simulation is mainly of two types:

(a) Analogue (or environmental) simulation. The simple examples cited in section 118.5 are of simulating
the reality in physical form, which we may refer as analogue (or environmental) simulation.
Directorate of Distance Education 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

(b) Computer (or system) simulation. For the complex and intricate problems of managerial decision
making, the analogue simulation may not be applicable. A mathematical model is formulated for
which a computer programme is developed, and then the problems is solved by using high speed
computer. Such system of simulation is called a computer simulation or system simulation.

6.7 Advantages of the simulation technique


(i) This approach is suitable to analyse large and complex real life problems which cannot be solved by
usual quantitative methods.

(ii) Simulation eliminates the need of costly trial and error methods of trying out the new concept on
real methods and equipment.

(iii) Simulation has the advantage of being relatively free from mathematics and can be easily understood
by the operating personnel.

(iv) Simulation models are comparatively flexible and can be modified to accommodate the changing
environments of the real situation.

(v) Computer simulation can compress the performance of a system over several years and involving
large calculations into a few minutes.

(vi) The simulation technique is easier to use than mathematical model and is quite superior to the
mathematical analysis.

6.8 Limitations of simulation


(i) It is the trial and error approach that produce different solutions in repeated runs. That is, it does
not generate optimal solutions to problem.

(ii) The simulation model does not produce solution by itself The user has to provide all the constraints
for the solutions which he wants to examine.

(iii) Sometimes simulation models are expensive and take a long time to develop it.

(iv) Each application of simulation is adhoc to a great extent.

6.9 Applications of simulation


(i) In the field of basic sciences, it has been used to evaluate the area under a curve, to estimate the
value of π, in matrix inversion and study of particle diffusion.
4 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(ii) In industrial problems including the design of queuing systems, inventory control, communication
networks, chemical processes, nuclear reactors and scheduling of production processes.

(iii) In business and economic problems, including customer behavior, price determination, economic
forecasting and capital budgeting.

(iv) In social problems, including population growth, effect of environment on health and group behavior.

(v) In biomedical systems, including fluid balance, distribution of electrolyte in human body and brain
activities.

(vi) In the design of weapon systems, war strategies tactics.

6.10 Steps of simulation process


Steps 1 : Identify the problem
Steps 2 : (a) Identify the decision variables.
(b) Decide the performance criterion and decision rules.
Steps 3 : Construct a numerical model so that it can be analysed on the computer.
Steps 4 : Validate the model to ensure whether it is truely representing the system being analysed and
the results will be reliable.
Steps 5 : Design the experiments to the conducted with the simulation model.
Steps 6 : Run the simulation model on the computer to get the results.
Steps 7 : Examine the results in terms of problem solution as well as their reliability and correctness.

6.11 Stochastic simulation and random numbers


When a system contains certain decision variables that can be represented by a probability distribution,
the simulation model used to study this type of system is called the stochastic simulation.
Stochastic simulation models use random numbers to generate in certain events.

6.11.1 Monte Carlo simulation

The Monte Carlo method of simulation was developed by the two mathematicians John Von Neumann and
Stainslaw Ulam, during World War IT to study how far neutrons would travel through different materials.
The technique provided an approximate but quite workable solution to the problem.
The steps involved in carrying out Monte Carlo simulation are :

(i) Select the objective function of the problem. It is either to be maximized or minimized.
Directorate of Distance Education 5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

(ii) Identify the variables that effect the measure of effectiveness significantly.

(iii) Determine the cumulative probability distribution of each variable selected in step 2. Plot these
distributions with values of the variables along X-axis and cumulative probability values along the
Y - axis.

(iv) Get a set of random numbers.

(v) Consider each random number as a decimal value of the cumulative probability distribution. Each
cumulative distribution plot along the Y -axis. Project this point horizontally till it meets the distri-
bution curve. Then project the point of intersection drawn on the X-axis.

(vi) Record the value generated in step 5. Substitute in the formula chosen for measure of effectiveness
and find its simulated value.

(vii) Repeat steps 5 and 6 until sample is large enough to the satisfaction of the decision maker.

6.11.2 Generation of random number

Random numbers are numbers that occur in a sequence such that two conditions are satisfied:
(i) the values are uniformly distributed over a defined interval or set, and
(ii) it is impossible to predict future values based on past or present ones.
Several methods are available to generate random numbers. Practically, these methods do not generate
ideal random numbers, because these methods follow some algorithms. So the available methods generate
pseudo random numbers.
The commonly used simplest method to generate random numbers is the power residue method. A
sequence of non negative integers x1 , x2 , . . . is generated from the following relation

xn+1 = (axn )(mod m)

where x0 is a starting value called the seed, a and m are two positive integers (a < m). The expres-
sion (axn )( mod m) gives the remainder when axn is divided by m. The possible values of xn+1 are
0, 1, 2, . . . , m − 1, i.e. the number of different random numbers is m. The period of random number
depends on the values of a, x0 and m. Appropriate choice of a, x0 and m gives a long period random
numbers.
Suppose the computer which will generate the random numbers have a word length of b bits. Let
m = 2b−1 − 1, a = an odd integer of the from 8k ± 3 and closed to 2b/2 , x0 = an odd integer between 0 and
m. Now ax0 is a 2b bits integer. The least b significant bits form the random numbers x1 . The process is
repeated for a desired number of times.
For a 32-bit computer,
m = 231 − 1 = 2147483647, a = 216 + 3 = 65539, x0 = 1267835015, (0 < x0 < m).
6 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

To obtain the random numbers between [0, 1], all numbers are divided by m − 1. These numbers are
uniformly distributed over [0, 1].

Example 6.1 Use the formula xn+1 = (axn )(mod m) for m = 32767, a = 259, x0 = 10527 find first seven
random numbers.

Solution. In this case, m = 32767, a = 259, x0 = 10527. The values of xn , axn , xn+1 are tabulated below.

n xn axn xn+1
0 10527 2726493 6832
1 6832 1769488 70
2 70 18130 18130
3 18130 4695670 9989
4 9989 2587151 31325
5 31325 8113175 19726
6 19726 5109034 30149
7 30149 7808591 10045

Thus, the eight random numbers between 0 and 32767 are 06832, 00070, 18130, 09989, 31325, 19726,
30149, 10045.

Note 6.1 Fortunately, in C programming language a ready made function rand() available in <stdlib.h>
is available which generates a random number between 0 and RAND MAX (a C constant, which is the largest
integer available in the computer). If we need a random number between 0 and 1, then the expression
rand()/RAND MAX. To get different set of random numbers in different run, we have to use the function
randomize() which is available in <time.h>. The function randomize() generates a seed from the time
which is associated in the computer.

6.12 Applications
6.12.1 Evaluation of π by Monte Carlo method

Let x2 + y 2 = 1 be the equation of a circle whose centre at (0,0) and radius 1. An approximate area of the
circle can be found by counting the random points in a square of side 1 unit into which a circle of radius
1 is inscribed. Consider the first quadrant of the circle.
Now generate a pair of random numbers x and y between 0 and 1. If these random numbers satisfying
the inequation X 2 + y 2 ≤ 1 lie within the first quadrant of the circle. The area of the square is 1 and that
of the circle in first quadrant is π/4. Now generate a large number of random pairs and count the number
Directorate of Distance Education 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

of points within the first quadrant of the circle. If n1 be the number of points within the first quadrant of
π n1
the circle and n be the total number of points generated then the required value of 4 is n .
The following program computes the value of π using Monte Carlo method for a given value of n.

#include<iostream.h>
#include<stdlib.h>
#include<time.h>
#include<conio.h>
void main()
{
float x, y, pi;
int i, n, n1=0;
randomize();
cout<<"Enter number of number numbers do you generate ? ";
cin>>n;
for(i=1; i<=n;i++)
{
x=rand()/(float)RAND_MAX;
y=rand()/(float)RAND_MAX;
if(x*x+y*y<=1) n1++;
}
pi=4.0*n1/(float)n;
cout<<"The value of pi is "<<pi<<endl;
}

The output for 10 different runs.

Sl. No. n π
1 100 3.200000
2 145 3.144825
3 450 3.262222
4 650 3.280000
5 900 3.173333
6 1100 3.116364
7 15000 3.146667
8 20000 3.152200
9 25000 3.141920
10 32000 3.141625
8 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The actual value of π is 3.14159265 correct up to 8 decimal places. We see that the closed to π are
3.141920 and 3.141625 and these are obtained by generating 25000 and 32000 random numbers. Another
close value of π obtained by generating 145 random numbers, which is 3.144825.

6.12.2 Simulation of coin tossing

By generating the random numbers between 0 and 1, the probability of getting ‘head’ or ‘tail’ in a single
toss can be determined. Suppose 0 and 1 represent respectively the head and tail.
Generate a large number of random numbers, say n, and count the occurrence of 0, let it be n1 , then
n1 n−n1
the probability of occurrence of head in a single trial is n and similarly the probability of tail is n .
The following program finds the probability of occurrence of head in a single trial.

#include<iostream.h>
#include<stdlib.h>
#include<time.h>
void main()
{
float x, prob;
int i, n, n1=0;
randomize();
cout<<"How many random numbers do you want to generate ? ";
cin>>n;
for(i=1; i<=n;i++)
{
x=random(2);
if(x==1) n1++;
}
prob=(float)n1/n;
cout<<"The probability of head is "<<prob<<endl;
getch();
}

The output for 10 executions of the program is tabulated below.


Directorate of Distance Education 9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

Sl. No. n Prob. of head


1 100 0.490000
2 260 0.496154
3 500 0.510000
4 840 0.504762
5 1300 0.506923
6 5200 0.514038
7 10000 0.493400
8 25000 0.502640
9 30000 0.497133
10 32000 0.499406
We know that the probability of getting head in a single toss of a coin is 0.5. From the above results we
see that all the results are very close to the desired value.

6.13 Simulation of inventory problems


Example 6.2 Using random numbers to stimulate a sample, find the probability that a packet of 6
products does not contain any defective product, when the production line produces 10% defective products.
Compare the answer with the expected probability.

Solution. Given that 10% of the total production is defective and 90% is non-defective. If we have 100
random numbers (0 to 99), then 90 of them (or 90%) represent non-defective products and remaining 10 of
them (or 10%) represent defective products. Thus, the random numbers 00 to 89 ate assigned to variables
representing non-defective products and 90 to 100 are assigned to variables representing defective products.
If we choose a set of 2-digit random numbers in the range 00 to 99 to represent a packet of 6 products as
shown below, then we would expect that 90% of the time they would fall in the range 00 to 89.
Sample number Random number
A 86 02 22 57 51 68
B 39 77 32 77 09 79
C 28 06 24 25 93 22
D 97 66 63 99 61 80
E 69 30 16 09 05 53
F 33 63 99 19 87 26
G 87 14 77 43 96 43
H 99 53 93 61 21 52
I 93 86 52 77 65 15
J 18 46 23 34 25 85
10 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Here it may be noted that out of ten simulated samples 6 contains one or more defective and 4 contain
no defective. Thus the expected percentage of non-defective products is 40%. However, theoretically the
probability that a packet of 6 products containing no defective product is (0.9)6 = 0.53144 = 53.14%.

Example 6.3 A bakery keeps stock of a popular brand of cake. Previous experience shows the daily
demand pattern for the item with associated probabilities, as given below:
Daily demand(number) : 0 10 20 30 40 50
Probability : 0.01 0.20 0.15 0.50 0.12 0.02
Use the following sequence of random numbers to simulate the demand for next 10 days.
Random numbers : 40, 19, 87, 83, 73, 84, 29, 09, 02, 20.
Also, estimate the daily average demand for the cakes.

Solution. Using the daily demand distribution, we obtain the cumulative probability distribution and
interval for random numbers as shown in the following table.

Daily Demand Probability Cumulative probability Random number interval


0 0.01 0.01 00 - 00
10 0.20 0.01 + 0.20 = 0.21 01 - 20
20 0.15 0.21 + 0.15 = 0.36 21 - 35
30 0.50 0.36 + 0.50 = 0.86 36 - 85
40 0.12 0.86 + 0.12 = 0.98 86 - 97
50 0.02 0.98 + 0.02 = 1.00 98 - 99

Conduct the simulation experiment for demand by taking a sample of 10 random numbers, which
represent the sequence of 10 samples. Each random sample number here is a sample of demand.
The simulation calculations for a period of 10 days are given in the following table.

Days Random number Demand


1 40 30
2 19 10
3 87 40
4 83 30
5 73 30
6 84 30
7 29 20
8 09 10
9 02 10
10 20 10
Totlal=220
Directorate of Distance Education 11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

The demand for the first day is calculated as follows: the random number 40 lies in the interval 36 - 85
and the demand of this interval is 30, so the demand of the first day is 30. And the demand for other days
are obtained in similar way.
Expected demand = 220/10 = 22 units per day.

Example 6.4 Recall the above example and solve the same problem by considering the following two sets
of random numbers.
Random numbers:
Set 1: 40, 19, 87, 83, 73, 84, 29, 09, 02, 20
Set 2: 12, 56, 34, 74, 89, 99, 01, 16, 25, 39.

Simulate the demand for next 10 days by averaging these two values. Also, estimate the daily average
demand for the cakes.

Solution. As in previous case, based on the daily demand distribution, we obtain a random number
interval as shown in the following table:

Daily Demand Probability Cumulative probability Random number interval


0 0.01 0.01 00-00
10 0.02 0.01 + 0.20 = 0.21 01 − 20
20 0.15 0.21 + 0.15 = 0.36 21 − 35
30 0.50 0.36 + 0.50 = 0.86 36 − 85
40 0.12 0.86 + 0.12 = 0.98 86 − 97
50 0.02 0.98 + 0.02 = 1.00 98 − 99

Days Random number Demand Random number Demand Average Demand


1 40 30 12 10 20
2 19 10 56 30 20
3 87 40 34 20 30
4 83 30 74 40 35
5 73 30 89 40 35
6 84 30 99 50 40
7 29 20 01 10 15
8 09 10 16 10 10
9 02 10 25 20 15
10 20 10 39 30 20
220 260 240
12 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

First set of random numbers gives 220 as the total demand for 10 days, the second set gives 260. The
average demands for 10 days are 20, 20, 30, 35, 35, 40, 15, 10, 15, 20. This set of demands is calculated
based on the two sets of demands and it is more realistic compared to the demands obtained for single set
of random numbers. And the average demand per day is 240/10 = 24.

Note 6.2 If we consider more set of random numbers and taking average of all such demands we finally
obtained a very good results.

6.14 Simulation of queuing problems


Example 6.5 A firm has a single channel service station with the following arrival and service time
probability distributions:

Inter arrival time(minutes) Probability Service time(Minutes) Probability


10 0.10 5 0.08
15 0.25 10 0.14
20 0.30 15 0.18
25 0.25 20 0.24
30 0.10 25 0.22
30 0.14

The customer’s arrival at the service station is a random phenomenon and the time between the arrival
varies from 10 minutes to 30 minutes. The service time varies from 5 minutes to 30 minutes. The queuing
process begins at 10 A.M. and proceeds for 15 arrivals. An arrival goes to the service facility immediately, if
it is free. Otherwise it will wait in a queue. The queue discipline is first come-first-served. If the attendant’s
wages are Rs. 10 per hour and the customer’s waiting time costs Rs. 15 per hour, then would it be an
economical proposition to engage a second attendant? Answer using Monte Carlo simulation technique.

Solution. The cumulative probability distributions and random number interval both for inter-arrival
time and service time are shown in the following table 1 and table 2.
Table 1
Inter arrival time(minutes) Probability Cumulative probability Random number interval
10 0.10 0.10 00-09
15 0.25 0.35 10-34
20 0.30 0.65 35-64
25 0.25 0.90 65-89
30 0.10 1.00 90-99

Table 2
Directorate of Distance Education 13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

Service time(minutes) Probability Cumulative probability Random number interval


5 0.08 0.08 00-07
10 0.14 0.22 08-21
15 0.18 0.40 22-39
20 0.24 0.64 40-63
25 0.22 0.86 64-85
30 0.14 1.00 86-99

The simulation work sheet developed to the given problem is shown in table 3.
Table 3

Arrival Random Arrival Entry Service Waiting Random Service Exist Time in
number number time into time time number time time system
required system begin required
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)=(6)+(8)
1 20 15 15 15 0 26 15 30 15
2 73 25 40 40 0 43 20 60 20
3 30 15 55 60 5 98 30 90 35
4 99 30 85 90 5 87 30 120 35
5 66 25 110 120 10 58 20 140 30
6 83 25 135 140 5 90 30 170 35
7 32 15 150 170 20 84 25 195 45
8 75 25 175 195 20 60 20 215 40
9 04 10 185 215 30 8 10 225 40
10 15 15 200 225 25 50 20 245 45
11 29 15 215 245 30 37 15 260 45
12 62 20 235 260 25 42 20 280 45
13 37 20 255 280 25 28 15 295 40
14 68 25 280 295 15 84 25 320 40
15 95 30 310 320 10 65 25 345 35

From the 15 samples of waiting time, 225 minutes and the time spent 545 minutes by the customer in
the system, we compute all average waiting time in the system and average service time as follows:
225
Average waiting time = 15 = 15 minutes
545
Average service time = 14 = 36.33 minutes.
Thus the average cost of waiting and service per hour is given by
15
Cost of waiting = 15 × 60 = Rs. 3.75
14 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36.33
Cost of service = 10 × 60 = Rs. 6.05
Since average cost of service per hour is more than the average cost of waiting per hour, therefore it
would not be an economical proposition to engage a second attendant.

6.15 Simulation languages

Simula, short for ”simulation language,” was the first object-oriented programming language. In the late
1960s, the Norwegian developers of Simula, O. J. Dahl and Kristen Nygaard, were looking for a way for
programs to simulate or model the world as computer users. They conceived the idea that programmers
should model programs around objects rather than procedures. They also invented the idea of classes so
that objects could be developed that shared similar characteristics. So that objects could communicate
and make requests of each other, they conceived the simple notion of the message .
Smalltalk is a programming language that was designed expressly to support the concepts of object-
oriented programming. In the early 1970’s, Alan Kay led a team of researchers at Xerox to invent a
language that let programmers envision the data objects they intended to manipulate. Unlike C++ ,
Smalltalk was not built on the syntax of a procedural language; it is a ”pure” object-oriented language
with more rigorously enforced rules than C++, which permits some of the procedural constructs of the C
language.

6.16 Summary

In this SLM, we discussed the concept of simulation, when to use simulation and types of simulation.
Advantages and disadvantages of simulation techniques are also discussed. We also discussed the Monte
Carlo simulation technique and generation of random numbers. Some very simple as well as some complex
problems have been solved. That is, we finds the values of π, probability to get head in a single coin tossed,
using simulation. Also, solved the problems on inventory and queuing theory using simulation.

6.17 Glossary

Simulation. Simulation is a method of solving decision making problems by desiring, constructing


or manipulating a model of a real system. It is defined to be the action of performing experiment on
a model of a given system.

Stochastic simulation. When a system contains certain decision variables that can be represented
by a probability distribution, the simulation model used to study this type of system is called the
stochastic simulation.
Directorate of Distance Education 15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

Monte Carlo simulation. The Monte Carlo method of simulation was developed by the two
mathematicians John Von Neumann and Stainslaw Ulam, during World War IT to study how far
neutrons would travel through different materials. The technique provided an approximate but quite
workable solution to the problem.

Analogue (or environmental) simulation. Analogue (or environmental) simulation. The simple
examples cited in section 118.5 are of simulating the reality in physical form, which we may refer as
analogue (or environmental) simulation.

Computer simulation or system simulation. For the complex and intricate problems of man-
agerial decision making, the analogue simulation may not be applicable. A mathematical model
is formulated for which a computer programme is developed, and then the problems is solved by
using high speed computer. Such system of simulation is called a computer simulation or system
simulation.

Random numbers. Random numbers are numbers that occur in a sequence such that two conditions
are satisfied:
(i) the values are uniformly distributed over a defined interval or set, and
(ii) it is impossible to predict future values based on past or present ones.

6.18 Self assessment questions


1. What is simulation? Describe its advantages in solving the problems. Give its main limitations with
suitable examples.

2. What is simulation? Describe simulation process. What are the reasons for using simulation.

3. What is the need of simulation? Is simulation method gives optimal solution? Explain.

4. Explain how do you apply Monte Carlo method for queuing problem.

5. Explain in brief the advantages and disadvantages of Monte Carlo simulation method.

6. Explain the different mathematical steps in a Monte Carlo simulation method.

7. Describe a method for generation of random numbers. Generate 7 random numbers by using the
method you discussed.

8. The management of a bank is thinking of opening a drive in facility for its branch office in a commercial
area. The inter-arrival times of the customers at the branch are as follows:
16 Directorate of Distance Education
Advanced Optimization and Operations Research-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Inter arrival time Probability


(minutes)
3 0.17
4 0.25
5 0.25
6 0.20
7 0.13

It is planned to have one cashier who can serve the customers at the following rate:

Inter arrival time Probability


(minutes)
3 0.10
4 0.30
5 0.40
6 0.15
7 0.05

Determine the number of spaces to be planned for the waiting cars. Simulate the operation of the
facility for arriving sample of25 cars. If the location has space for not more than two waiting cars
how many customers would be turned away due to lack of space? What is the average waiting time
of a customer?

9. The demand for a particular item has the probability distribution shown below:
Daily demand(units) : 4 5 6 7 8 9 10 11 12
Probability : 0.06 0.14 0.18 0.17 0.16 0.12 0.08 0.06 0.03
If the lead time is 5 days, using simulation study the implications of inventory policy of ordering 50
units whenever the inventory at the end of the day is 40 units. Assume the initial stock level of 75
units and run the simulation for 25 days.

10. Six truck loads of material are delivered everyday at a factory at regular intervals of 45 minutes. The
trucks carry 2, 4, 2, 4,3, 3 tons of material respectively. Unloading has to be carried out by teams
of two men, each team capable of handling 800kg/hr, upto a maximum of 6 items simultaneously.
Assuming that penalty for detaining a lorry for more than 45 minutes (including unloading time) is
Rs. 10 per hour and the cost of each labourer is Rs. 8 per day, determine the least costly number of
teams.

11. The following table gives the arrival, pattern at a Coffee Counter for’ one minute’ intervals. The
service is taken as 2 person in one minute in one counter.
Directorate of Distance Education 17
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unit 6.6 Simulation

Number of persons arriving : 0 1 2 3 4 5 6 7


Probability percentage : 5 10 15 30 20 10 5 5
and queue formed when the following 20 random numbers are given :
5, 25, 16, 80, 35, 48, 67, 79, 90, 92, 9, 14, 1, 55, 20, 71, 30, 42, 60 and 85. Find the queue length if
two counters are used, i.e. 4 persons in one minute.

6.19 Suggested Further Readings


1. S. D. Sharma, Operations Research, Kedar Nath Ram Nath & Co.

2. Prem Kumar Gupta and D. S. Hira, Operations Research, S. Chand.

3. J. K. Sharma, Operations Research, Macmillan.

18 Directorate of Distance Education

You might also like