You are on page 1of 37

UNIT V

Markov Analysis: Introduction, Stochastic process, Transition probability, Transition


probability matrix, n-step transition probabilities, Markov Chain, Markov Analysis,
Examples.
Simulation: Introduction, Types of Simulation, Limitations of Simulation technique,
Phases of simulation model, Generation of Random Numbers, Monte-Carlo Estimation,
Applications to: Inventory Control, Queuing Problems, Capital Budgeting, Financial
Planning. Advantages and Disadvantages of simulation.
Simulation
Definition
• Simulation is a numerical technique for conducting experiments on a digital

computer, which involves certain types of mathematical and logical relationships

necessary to describe the behavior and structure of a complex, real world system

over extended period of time.

• According to Donald G. Malcolm, a simulated model may be defined as one which

depicts the working of a large scale system of men, machines, materials and

information operating over a period of time in a simulated environment of actual real

world conditions.
Types of Simulation
• It is mainly two types:

- Analogue simulation or Environmental simulation

- Computer simulation or System simulation

• Analogue simulation is the solving the reality in physical form.

• Computer simulation is for the complex and intricate problems of managerial


decision making the analogue simulation may not be applicable, and the actual
experimentation with the system may be uneconomical also. Under these situations, the
complex system is formulated into a mathematical model for which a computer
program is developed, and then the problem is solved by using high speed electronic
computer.
• The simulation models can be classified into four categories:

(a) Deterministic models: In these models, input and output variables are not

permitted to be random variables and models are described by exact

functional relationship.

(b) Stochastic models: In these models, at least one of the variables or

functional relationship is given by probability functions.

(c) Static models: These models do not take variable time into consideration.

(d) Dynamic models: These models deal with time varying interaction.
When simulation should be used?
• Actual observation of a system may be too expensive.

• The problem is too big or intricate to handle with linear, dynamic, and standard
probabilistic models.

• The standard sensitivity analysis is too clumsy and computationally burdensome for
observing the actual environment.

• It is not possible to develop a mathematical model. Even though a mathematical model


can be formulated, a straight forward analytical solution may not be available.

• It is not possible to perform validating experiments on mathematical models


describing the system.

• There may not be sufficient time to allow the system to operate extensively.
Drawbacks of Scientific method
• It may be either impossible or extremely costly to observe certain

processes in the real life situations.

• The observed system may be so complex that it may be impossible to

describe it in terms of a set of mathematical equations.

• It may be either impossible or very costly to perform validating

experiments on mathematical models describing the system.


Drawbacks of Analytical method
• Analytical techniques used in dynamic programming, queuing theory, network
models, etc are not sufficient to tackle all the important managerial problems
requiring data analysis due to following limitations.

• Dynamic programming models, however, can be used to determine optimal strategies


taking into the account the uncertainties and can analyse multi period planning
problems. But it still has its own shortcomings. It can be used to tackle very simple
situations involving a very few variables, if the number of state variables becomes
larger, the computation work becomes quite complex and difficult.
Drawbacks of Iterative method
• In LP models, we assume that data does not change over the entire
planning horizon. This is one time decision process and assumes average
values for the decision variables. If the planning horizon is long, say 15
years, the multi period linear programming model may deal with the yearly
averaged data, but will not take into account the variations over the months
and weeks. Consequently, month to month and week to week operations
are left implicit.
• In many real situations, the uncertainties about the data are such that they
cannot be ignored. In case the uncertainty relates to only a few variables,
the sensitivity analysis can be used to determine its effect on the decision.
Why simulation is used for solving real life
problems?
• Simulation techniques allow experimentation with a model of the real life
system rather than the actual operating system.
• Sometimes there is no sufficient time to allow the actual system to operate
extensively.
• The non technical manager can comprehend simulation more easily than a
complex mathematical model.
• The use of simulation enables a manager to provide insights into certain
managerial problems.
Limitations of Simulation technique
• Optimum results cannot be produced by simulation. Since the model
mostly deals with uncertainties, the results of simulation are only reliable
approx. involving statistical errors.
• The other difficulty lies in the quantification of the variables. In many
situations, it is not possible to quantify all the variables which effect the
behaviour of the system.
• For the problems requiring use of computer, the simulation is by no means
a less costly method of analysis. Thus, simulation is comparatively costlier
and time consuming method in many situations.
Phases of simulation model

• It consists of two basic phases

Phase 1: Data Generation: Data generation involves the sample

observation of variables and can be carried out with the help of any of the

following methods.

(i) Using the random number tables.

(ii) Resorting to mechanical devices.


Phase 2: Book Keeping: The book keeping phase of a simulation model

deals with updating the system when new events occur, monitoring and

recording the system states as and when they change; and keeping track

of quantities of our interest (such as idle time, waiting time) to compute

the measures of effectiveness.


Advantages
In comparison to the mathematical programming and standard statistical
analysis, the simulation has many advantages over these techniques,
• Simulation models are comparatively flexible and can be modified to
adjust the variation in the environments of real situations.
• The simulation is an easier technique to use than mathematical models and
thus, considered quite superior to the mathematical analysis.
• Simulation technique has the advantage of being relatively free from
complicated mathematics and thus, can be easily understood by the
operating staff and also by non technical managers.
• Simulation offers the solution by allowing experimentation with a model of
the system without interfering with the real system. Thus, the simulation is
often a bypass for complex mathematical analysis.
• Computer simulation can compress the performance of a system over
several years and involving large calculations into a few minutes of
running time.
• By simulation technique, the management can foresee the difficulties and
bottlenecks that may arise due to addition of new machines, equipment or
process. Thus, this technique eliminates the need of costly trial and error
methods of trying out the new concept on real methods and concepts.
Disadvantages
• Simulation is not precise. It is not an optimization process and does not yield an
answer but merely provides a set of the systems responses to operating conditions.
In many cases, this lack of precision is difficult to measure.
• Not all situations can be evaluated using simulation. Only the situations involving
uncertainties can be tackled by simulation. Because, without a random component,
all simulated experiments would provide the same answer.
• A good simulation model is may be too expensive. Often it takes many years to
develop an usable corporate planning model.
• Simulation generates a way of evaluating solutions but does not generate the
solution techniques. Users must still generates the solution approaches they want to
test.
Simulation languages
• GASP and SIMSCRIPT are two widely used general simulation languages.

• The most commonly used language is GPSS (General purpose Simulation

system).

• These languages are very economical and comparable with the FORTRAN,

COBOL, ALGOL.

• DYNAMO, SIMPAC, SIMULATE, SIMULA, CSMP, GSP, ESP, and CSL

are the some of the simulation languages.


Monte Carlo Method
• It 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.

• The method is generally used to solve problem which cannot be adequately

represented by mathematical models, or where the solution of the model is

not possible by analytical method.


• Steps in Monte Carlo simulation:

1: Establishing Probability Distribution


2: Cumulative probability distribution

3: Setting Random number intervals


4: Generating random numbers
Applications:
1. Estimate the demand for future period.

2. Inventory control problem.


3. Investment and budgeting problem.

4. Quality control problem.

5. Job sequencing problem.


6. Maintenance problem.

7. Simulation of network.
Problem: Customers arrive at a service facility to get the required service.
The interarrival and service times are constant and are 1.8 and 4 minutes
respectively. Simulate the system for 14 minutes. Determine the average
waiting time of a customer and idle time of the service facility.
Solution:
The arrival times of customers within 14 minutes period will be

Customer 1 2 3 4 5 6 7 8
Arrival time 0 1.8 3.6 5.4 7.2 9.0 10.8 12.6
(min)
The time at which the service begins and ends within time period of 14
minutes is shown below. Waiting time for customer and idle time of service
facility also calculated.
Customer Service Waiting time Idle time of
Begins Ends of customer service facility

1 0 4 0 0
2 4 8 4 – 1.8 = 2.2 0
3 8 12 8 – 3.6 = 4.4 0
4 12 16 (14) 12 – 5.4 = 0
Waiting time for first four customers is calculated
6.6 above.
Service facility will close at 14 minutes. But the customers enter into the
service facility and leave after 14 minutes whether the service is provided
or not. So even though the service is provided or not waiting time should be
calculated for all the customers.

Customer 5 6 7 8
Waiting Time (min) 14 – 7.2 = 14 – 9 = 5 14 – 10.8 = 14 – 12.6 =
6.8 3.2 1.4

0+2.2+4.4+6.6+6.8+5+3.2+1.4
𝐴𝑣𝑒𝑟𝑎𝑔𝑒𝑤𝑎𝑖𝑡𝑖𝑛𝑔𝑡𝑖𝑚𝑒𝑜𝑓 𝑡h𝑒𝑐𝑢𝑠𝑡𝑜𝑚𝑒𝑟𝑠= =3.7 𝑀𝑖𝑛𝑢𝑡𝑒𝑠
8

Idle time for facility = 0


Problem: A dentist schedules all her patients for 30 minutes appointments.
Some of the patients take more or less than 30 minutes depending on the type
of dental work to be done. The following summery shows the various
categories of work, their probabilities and the time needed to complete the
work.

Category Time Required Probability of


(Minutes) category
Filling 45 0.40
Crown 60 0.15
Cleaning 15 0.15
Extractio 45 0.10
n
Checkup 15 0.20

Simulate the dentist’s clinic for four hours and determine the average waiting
time for the patients as well as the idleness of the doctor. Assume that all the
patients show up at the clinic at exactly their scheduled arrival times, starting
at 8 AM. Use the following random numbers for handling the above problem:
40, 82, 11, 34, 25, 66, 17 and 79.
Solution:
The time taken by the dentist to treat eight patients arriving in four hours at
the clinic is calculated in the following table.

Category Time Probabili Cumulative Random no. Random no. fitted


(min) ty Probability interval
Filling 45 0.40 0.40 00 – 39 11(3), 34(4), 25(5),
17(7)
Crown 60 0.15 0.55 40 – 54 40(1)
Cleaning 15 0.15 0.70 55 – 69 66(6)
Extractio 45 0.10 0.80 70 – 79 79(8)
n
Checkup 15 0.20 1.00 80 -1.00 82(2)
Thus the times taken by the dentist to treat the eight patients are 60, 15, 45,
45, 45, 15, 45 and 45 respectively. Let us simulate the dentist’s clinic starting
at 8 AM.
Patient Arrival Dentist’s Waiting time Idle time
no. time treatment of patient for dentist
Starts Ends

1 8.00 8.00 9.00 - -


2 8.30 9.00 9.15 30 -
3 9.00 9.15 10.00 15 -
4 9.30 10.00 10.45 30 -
5 10.00 10.45 11.30 45 -
6 10.30 11.30 11.45 60 -
7 11.00 11.45 12.30 45 -
8 11.30 12.30 13.15 60 -
1
𝐴𝑣𝑒𝑟𝑎𝑔𝑒𝑤𝑎𝑖𝑡𝑖𝑛𝑔𝑡𝑖𝑚𝑒= ( 0+30+15+30+45+60+45+60 )=35.625𝑚𝑖𝑛𝑢𝑡𝑒𝑠
8
Average idleness of the dentist = Nil
Problem: A bakery keeps stock of a popular brand of cake. Daily demand based on past
experience is given below.

Daily Demand 0 15 25 35 45 50
Probability 0.01 0.15 0.2 0.5 0.12 0.02
Consider the following sequence of random numbers: 48, 70, 09, 51, 56, 77, 15, 14, 68 and 09.
Using the sequence simulate the demand for the next 10 days. Find the stock situation if the
owner of the bakery decides to make 35 cakes every day. Also estimate the daily average demand
for the cakes on the basis of the simulated data.
Solution:
The demand for the cakes for the next 10 days can be obtained from the following table

Allocation of random numbers to demand of cakes


Demand Probability Cumulative Random no. Random nos. fitted
Probability interval
0 0.01 0.01 00  
15 0.15 0.16 01 – 15 09(3), 15(7), 14(8), 09(10)
25 0.20 0.36 16 – 35  
35 0.50 0.86 36 – 85 48(1), 78(2), 51(4), 56(5), 77(6), 68(9)
45 0.12 0.98 86 – 97  
50 0.02 1.00 97 – 99  
In order to simulate the demand the number 00 is assigned to zero demand, numbers
01 – 15 are assigned to demand of 15 cakes, 16 – 35 are assigned to demand of 25 cakes
and so on. The 10 random numbers are fitted corresponding to the range against the
demand values. The random numbers give the demand for next 10 days as per the
numbers given in parenthesis. The demand for the next 10 days is 35, 35, 15, 35, 35,
35, 15, 15, 35, 15 respectively.
The stock situation for various days if the decision is made to make 35 cakes
every day is given in the following table.
Day Demand Number of Stock
cakes
1 35 35 -
2 35 35 -
3 15 35 20
4 35 35 20
5 35 35 20
6 35 35 20
7 15 35 40
8 15 35 60
9 35 35 60
10
1 15 35 80
𝐴𝑣𝑒𝑟𝑎𝑔𝑒𝑑𝑎𝑖𝑙𝑦 𝑑𝑒𝑚𝑎𝑛𝑑= ( 35+35+15+35+35+35+15+15+35+15 )=27𝑐𝑎𝑘𝑒𝑠
10
Problem: A book store wishes to carry ‘Ramayana’ in stock. Demand is
probabilistic and replenishment of stock takes 2 days (i.e., if an order is placed on
March 1, it will be delivered at the end of the day on March 3). The probabilities
of demand are given below:

Demand 0 1 2 3 4
Probability 0.05 0.10 0.30 0.45 0.10

Each time an order is placed, the store incurs an ordering cost of Rs 10 per order.
The store also incurs carrying cost of Rs 0.50 per book per day. The inventory
carrying cost is calculated on the basis of stock at the time of each day.
The manager of the book store wishes to take his inventory decisions based on
‘Order 5 books when the inventory at the beginning of the day plus orders
outstanding less than 8 books.
Currently (beginning of the 1 st day) the store has a stock of 8 books plus 6 books
ordered 2 days ago and expected to arrive next day. Using Monte carlo simulation
for 10 cycles, recommend which option the manager should choose.
The two digit random numbers are given below:
89, 34, 78, 63, 61, 81, 39, 16, 13, 73.
Solution:

Demand Prob Cum Prob Random No’s


0 0.05 0.05 00-04
1 0.10 0.15 05-14
2 0.30 0.45 15-44
3 0.45 0.90 45-89
4 0.10 1.00 90-99

Stock in hand = 8 and Stock on order = 6 (Expected next day)


Random Demand Opt.stock Receipt Cl. Stock Opt. stock Order Cl. Stock
No’s sales in hand in hand on order Quantity on order
89 3 8 - 5 6 - 6
34 2 5 6 9 - - -
78 3 9 - 6 - 5 5
63 3 6 - 3 5 - 5
61 3 3 - 0 5 5 10
81 3 0 5 2 5 5 10
39 2 2 - 0 10 - 10
16 2 0 5 3 5 - 5
13 1 3 5 7 0 5 5
73 3 7 - 4 5 - 5

No. of orders = 4 (ordering cost) = 4 x10 = Rs 40.


Closing stock of 10 days = 39, carrying cost = 39 x 0.50 = Rs 19.50
Cost for 10 days = Rs 59.50
Prob: The director of finance for a farm cooperative is concerned about the yields per acre she can expect from
this year’s corn crop. The probability distribution of the yields for the current weather conditions is given
below: Yield in Kg 120 140 160 180
per acre

Probability 0.18 0.26 0.44 0.12

She would like to see a simulation of the yield she might expect over the next 10 years for weather conditions
similar to those she is new experiencing.
i) Simulate the average yield she might expect per acre using the following random numbers: 20, 72, 34, 54,
30, 22, 48, 74, 76, 02
She is also interested in the effect of market price fluctuations on the cooperatives farm revenue she makes
this estimate of per kg prices for corn.
Price per kg (Rs) 2.00 2.10 2.30 2.30 2.40 2.50

Probabilities 0.05 0.15 0.30 0.25 0.15 0.10

ii) Simulate the price she might expect to observe over the next 10 years using the following random numbers;
82, 95, 18, 96, 20, 84, 56, 11, 52, 03
Solution: If the numbers 0-99 are allocated in proportion to the probabilities associated
With each category of yield per acre, then various kinds of yields can be sampled using
Random number table.
Yield in Kg, Probability Cum. Prob. Random
per acre No’s
assigned
120 0.18 0.18 00-17
140 0.25 0.44 18-42
160 0.44 0.88 43-87
180 0.12 1.00 88-99

i) Let us now simulate the yield per acre for the next 10 years based on the random no’s given
Year 1 2 3 4 5 6 7 8 9 10
Random No 20 72 34 54 30 22 48 74 76 02
Simulated 140 160 140 160 140 140 160 160 160 120
Yield

The average yield = 1480/10 = 148 kg/acre


ii) Let is now simulate the price she might expect in the next 10 years based on the Random no’s given:

Price/kg Probability Cum. Prob. Random No’s assigned


2.00 0.05 0.05 00-04
2.10 0.15 0.50 05-19
2.20 0.30 0.50 20-49
2.30 0.25 0.75 50-74
2.40 0.15 0.90 75-89
2.50 0.10 1.00 90-99

These simulated prices are developed using random no’s given for next 10 years
Year 1 2 3 4 5 6 7 8 9 10
Random No 82 95 18 96 20 84 56 11 52 03
Price (Rs.) 2.40 2.50 2.10 2.50 2.20 2.40 2.30 2.10 2.30 2.00
Simulated Yield 140 160 140 160 140 140 160 160 160 120
Revenue/acre (Rs) 336 400 294 400 308 336 368 336 368 240

Avg. revenue per acre = Rs. 3386/10 = Rs 338.60


Prob: An investment corporation wants to study the investment projects based on three factors:
market demand in units, Price per unit minus cost per unit, and investment required. These factors
are felt to be independent of each other. In analyzing a new consumer product, the corporation
estimates the following probability distributions:

Annual Probabili Price Probabili Investme Probabili


demand ty cost per ty nt ty
unit (Rs)
(Rs)
25,000 0.05 3.00 0.10 27,50,000 0.25
30,000 0.10 5.00 0.20 30,00,000 0.50
35,000 0.20 7.00 0.40 35,00,000 0.25
40,000 0.30 9.00 0.20    
45,000 0.20 10.00 0.10    
50,000 0.10        
55,000 0.05        

Using simulation process, repeat the trial 10 times. Compute the return on investment for each trial,
taking these factors into account. Approximately, what is the most likely return? Use the following
random numbers for annual demand, price cost and the investment required?
28, 57, 60, 17, 64, 20, 27, 58, 61, 30; 19, 07, 90, 02, 57, 28, 29, 83, 58, 41; 18, 67, 16, 71, 43, 68,
47, 24, 19, 97
Solution: The yearly return can be determined by the formula:
Return (R) = Price cost – No. of units demand/Investment
To determine a cumulative probability distribution corresponding to each of the three Factors.

Annual Prob. Cum. Prob Random No


demand
25000 0.05 0.05 00-04
30000 0.10 0.15 05-14
35000 0.20 0.35 15-34
40000 0.30 0.65 35-64
45000 0.20 0.85 65-84
50000 0.10 0.95 85-94
55000 0.05 1.00 95-99
Price Prob. Cum. Prob Random No
cost/unit
3 0.10 0.10 00-09
5 0.20 0.30 10-29
7 0.40 0.70 30-69
9 0.20 0.90 70-89
10 0.10 1.00 90-99

Investment Prob. Cum. Prob Random No


Required
2750000 0.25 0.25 00-24
3000000 0.50 0.75 25-74
3500000 0.25 1.00 75-99
We prepare a simulation for 10 trails
Trials Random Simulated Random no for Simulated Random Simulated Simulated
No of Demand profit cost profit number for Investment Return (%) =
demand (‘000) (Price investment (‘000) Demand x
cost/unit) Profit per
unit/investment
x 100
1 28 35 19 5.00 18 2750

2 57 40 07 3.00 67 3000

3 60 40 90 10.00 16 2750

4 17 35 02 3.00 71 3000

5 64 40 57 7.00 43 3000

6 20 35 28 5.00 68 3000

7 27 35 29 5.00 47 3000

8 58 40 83 9.00 24 2750

9 61 40 58 7.00 19 2750

10 30 35 41 7.00 97 3500

You might also like