Professional Documents
Culture Documents
Service Time
Consider service time distribution shown here (Minutes)
Probability
1 0.4
To obtain a random service time, we need to map an appropriate number of 2 0.35
intergers from 0 to 99 to each service time, according to the probability. 3 0.2
4 0.05
Assume that we have random integers ' Uniformly distributed' in range '0 - 99'
Service Time
Obtained using Excel formula (Minutes)
Probability Mapping
1 0.4 0 - 39
TRUNC(100*RAND()) 2 0.35 40 -74
RANDBETWEEN(0,99) 3 0.2 75 - 94
4 0.05 95 - 99
Monte Carlo Simulation:
Random Number Mapping Method
Simulation of a Queuing System: A doctor's office has one nurse and one doctor. Patients arrive
randomly. Each patient first goes through a check-up with the nurse and then proceeds for a full
check-up by the doctor. Patient may have to wait before being served by the nurse as well as before
being served by the doctor. Service priority is first-in first-out (FIFO). The service time of the nurse
is always 7 minutes, but the service time of the doctor is random. The distributions of the time
between arrivals and the service time of the doctor are given below:
Determine the average time a patient spends in the doctor's office from the arrival till leaving using
simulation
Monte Carlo Simulation:
Random Number Mapping Method
Simulation of a Queuing System:
What is the average time a patient spends in the doctor's office from the arrival till leaving?
Nurse Doctor
Inter-
Arrival Arival Time Waiting Random Service Waiting Time in
Customer Random Number Start Service Time Finish Start Finish
Time (Cumulative) Time Number Time Time System
(Minutes)
1 48 5 5 5 7 12 0 12 5 4 16 0 11
2 42 5 10 12 7 19 2 19 53 8 27 0 17
3 74 10 20 20 7 27 0 27 55 8 35 0 15
4 51 10 30 30 7 37 0 37 57 8 45 0 15
5 52 10 40 40 7 47 0 47 80 12 59 0 19
1 98 15 15 15 7 22
2 35 5 20 22 7 29
3 48 5 25 29 7 36
4 99 15 40 40 7 47
5 40 5 45 47 7 54
6 25 5 50 54 7 61
7 72 10 60 61 7 68
8 48 5 65 68 7 75
9 71 10 75 75 7 82
10 68 10 85 85 7 92
11 69 10 95 95 7 102
12 64 10 105 105 7 112
13 91 15 120 120 7 127
14 13 5 125 127 7 134
15 93 15 140 140 7 147
16 5 5 145 147 7 154
17 52 10 155 155 7 162
18 71 10 165 165 7 172
19 90 15 180 180 7 187
20 11 5 185 187 7 194
rse Doctor
Waiting Random Service Waiting Time in
Start Finish
Time Number Time Time System
0 22 47 8 30 0 15
2 30 9 4 34 1 14
4 36 91 12 48 0 23
0 48 64 8 56 1 16
2 56 71 8 64 2 19
4 64 93 12 76 3 26
1 76 99 12 88 8 28
3 88 39 8 96 13 31
0 96 73 8 104 14 29
0 104 64 8 112 12 27
0 112 24 4 116 10 21
0 116 65 8 124 4 19
0 127 61 8 135 0 15
2 135 46 8 143 1 18
0 147 39 8 155 0 15
2 155 59 8 163 1 18
0 163 73 8 171 1 16
0 172 39 8 180 0 15
0 187 66 8 195 0 15
2 195 44 8 203 1 18
Average time in System = 19.9
Average Customer in system (per hour) = 2.34
Time between arivals [min] Probability Mapping (0-99)
5 0.5 0-49
10 0.3 50-79
15 0.2 80-99
Expected time between arrivals [min] = 8.5 =SUMPRODUCT(R5:R7,Q5:Q7)
Arrival rate [customers/min] = 0.1176 =1/8.5
Arrival rate [customer/hour] = 7.059 =0.1176*60
n 10
mean 19.44
stdev 3.240