Lecture Note 6
Lecture Note 6
Statistical
simulation
1
A queuing system is described by its calling population, the nature of the arrivals,
the service mechanism, the system capacity and the queuing discipline.
In a queuing system, customers arrive from time to time and join a queue or
waiting line, are eventually served and finally leave the system.
2
Eg:
Single
channel / server
queue
3
Some important points-:
Nonempty Empty
5
Example 1:
• Let’s consider a single channel queuing simulation.
• Here inter-arrival times and service times are generated from the distributions of these random
variables.
• Table l contains a set of five inter-arrival times, and these are used to compute the arrival times of six
6
Example 1 cont…
Table 1: Inter arrival and Clock Times Table 2: Service Times
Customer Inter arrival time Arrival time on clock Customer Service Time
1 2
1 - 0
2 1
2 2 2
3 3
3 4 6
4 2
4 1 7
5 1
5 2 9
6 4
6 6 15
7
Example 1 cont…
Event Type Customer Clock Time
Number
Arrival 1 0
Departure 1 2
Arrival 2 2
Departure 2 3
Table 3: Chronological Ordering of Events Arrival 3 6
Arrival 4 7
Departure 3 9
Arrival 5 9
Departure 4 11
Departure 5 12
Arrival 6 15
Departure 6 19
8
Example 1 cont…
Table 4: Summarizing Table Emphasizing Times
Customer Arrival time Time service Service Time Server Idle Waiting
number (Clock) begins Time Service Time Time
(Duration) Ends(Clock)
1 0 0 2 2 0 0
2 2 2 1 3 0 0
3 6 6 3 9 3 0
4 7 9 2 11 0 2
5 9 11 1 12 0 2
6 15 15 4 19 3 0
9
Example 1 cont…
Answers :
10
Example 2:
A small grocery store has only one checkout counter. Customers arrive at this checkout counter at random times
that are from 1 to 8 minutes apart. Each possible value of inter-arrival time has the same probability of
occurrence, as shown in table 1. The service times vary from 1 to 6 minutes, with the probabilities shown in table
2. The problem is to analyze the system by simulating the arrival and service of 10 customers.
Then find
1. The average waiting time of a customer.
2. The probability that a customer has to wait in the queue.
3. The proportion of idle time of the server.
11
Example 2 cont…
Table 1: Distribution of Time between Arrivals Table 2: Service Times
Time Probability Cumulative Random
between Probability Digit Service Probability Cumulative Random
arrivals Assignment Time(Min) Probability Digit
(Min) Assignment
1 0.125 0.125 000-124 1 0.10 0.1 00-09
2 0.125 0.250 125-249 2 0.20 0.3 10-29
3 0.125 0.375 250-374 3 0.30 0.6 30-59
4 0.125 0.500 375-499
4 0.25 0.85 60-84
5 0.125 0.625 500-624
5 0.10 0.95 85-94
6 0.125 0.750 625-749
7 0.125 6 0.05 1.00 95-99
0.875 750-874
8 0.125 1.000 875-999
12
Example 2 cont…
Inter arrival time Service time
Customer Random Digit Time between Customer Random Digit Service Time
Number arrivals Number
1 - - 1 84 4
2 913 8 2 09
10 1
3 727 6 3 74 4
4 15 1 4 53 3
5 948 8 5 17 2
6 309 3 6 79 4
7 412 4 7 42 3
8 102 1 8 61 4
9 545 5 9 32 3
10 300 3 10 98 6
13
Example 2 cont…
Summarizing Table Emphasizing Times
Customer Inter Arrival time Service Time Waiting Time service Time Idle time of
Number arrival (Clock time) time service time end (Clock spent in server
time begins time) system
(Clock time)
1 - 0 4 0 0 4 4 0
2 8 8 1 8 0 9 1 4
3 6 14 4 14 0 18 4 5
4 1 15 3 18 3 21 6 0
5 8 23 2 23 0 25 2 2
6 3 26 4 26 0 30 4 1
7 4 30 3 30 0 33 3 0
8 1 31 4 33 2 37 6 0
9 5 36 3 37 1 40 4 0
10 3 39 6 40 1 46 7 0
14
Example 2 cont…
Answers:
𝑇𝑜𝑡𝑎𝑙 𝑡𝑖𝑚𝑒 𝑐𝑢𝑠𝑡𝑜𝑚𝑒𝑟𝑠 𝑤𝑎𝑖𝑡 𝑖𝑛 𝑞𝑢𝑒𝑢𝑒
1. Average waiting time for a customer =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑢𝑠𝑡𝑜𝑚𝑒𝑟𝑠
7
= = 0.7 minutes
10
15
more than one service channels
Example 3:
.
Consider a computer technical support center where personnel take calls and provide service. The time
between calls ranges from 1 to 4 minutes, with distribution as shown in Table1. There are two technical
support perons-: Able and Baker. Able is more experienced and can provide service faster than Baker.
The distributions of their service times are shown in Tables 2 and Table 3. Problem is to find out how
well the current arrangement is working.
16
Example 3 cont…
17
Example 3 cont…
18
Summarizing Table Emphasizing Times
Custome Random Time Arrival Random Able Baker Time in
r digits between time digits queue
number for arrivals (Clock for Time Service Time Time Service Time
arrivals time) service service time service service time service
begins ends begins ends
1 - - 0 95 0 5 5 0
2 26 2 2 21 2 3 5 0
3 98 4 6 51 6 3 9 0
4 90 4 10 92 10 5 15 0
5 26 2 12 89 12 6 18 0
6 42 2 14 38 15 3 18 1
7 74 3 17 13 18 2 20 1
8 80 3 20 61 20 4 24 0
9 68 3 23 50 23 4 27 0
10 22 1 24 49 24 3 27 0
19
Example 3 cont…
20
21