You are on page 1of 108

Queueing Theory

Specification of a Queue
Source
• Finite
• Infinite
Arrival Process
Service Time Distribution
Maximum Queueing System Capacity
Number of Servers
Queue Discipline
What is Queuing Theory?

• Mathematical analysis of queues and waiting times in


stochastic systems.
– Used extensively to analyze production and service processes
exhibiting random variability in market demand (arrival times) and
service times.
• Queues arise when the short term demand for service
exceeds the capacity
– Most often caused by random variation in service times and the
times between customer arrivals.
– If long term demand for service > capacity the queue will explode!

3
Why is Queuing Analysis Important?
• Capacity problems are very common in industry and one
of the main drivers of process redesign
– Need to balance the cost of increased capacity against the gains of
increased productivity and service
• Queuing and waiting time analysis is particularly important
in service systems
– Large costs of waiting and of lost sales due to waiting

Prototype Example – ER at County Hospital


• Patients arrive by ambulance or by their own accord
• One doctor is always on duty
• More and more patients seeks help  longer waiting times
➢ Question: Should another MD position be instated?
4
A Cost/Capacity Tradeoff Model

Total
cost
Cost

Cost of
service

Cost of waiting

Process capacity

5
Examples of Real World Queuing Systems?

• Commercial Queuing Systems


– Commercial organizations serving external customers
– Ex. Dentist, bank, ATM, gas stations, plumber, garage …
• Transportation service systems
– Vehicles are customers or servers
– Ex. Vehicles waiting at toll stations and traffic lights, trucks or ships
waiting to be loaded, taxi cabs, fire engines, elevators, buses …
• Business-internal service systems
– Customers receiving service are internal to the organization providing
the service
– Ex. Inspection stations, conveyor belts, computer support …
• Social service systems
– Ex. Judicial process, the ER at a hospital, waiting lists for organ
transplants or student dorm rooms … 6
Components of a Basic Queuing Process

Input Source The Queuing System

Served
Calling Jobs Service Jobs
Queue Mechanism
Population
leave the
system

Arrival Queue
Process Discipline
Service
Queue
Process
Configuration
7
Components of a Basic Queuing Process (II)

❖ The calling population


– The population from which customers/jobs originate
– The size can be finite or infinite (the latter is most
common)
– Can be homogeneous (only one type of customers/ jobs)
or heterogeneous (several different kinds of
customers/jobs)
❖ The Arrival Process
– Determines how, when and where customer/jobs arrive to
the system
– Important characteristic is the customers’/jobs’ inter-
arrival times
– To correctly specify the arrival process requires data
collection of interarrival times and statistical analysis.
8
Components of a Basic Queuing Process (III)

❖ The queue configuration


– Specifies the number of queues
• Single or multiple lines to a number of service
stations
– Their location
– Their effect on customer behavior
• Balking and reneging
– Their maximum size (# of jobs the queue can hold)
• Distinction between infinite and finite capacity

9
Example – Two Queue Configurations

Multiple Queues Single Queue


Servers Servers

10
Multiple v.s. Single Customer Queue
Configuration
Multiple Line Advantages Single Line Advantages

1. The service provided can 1. Guarantees fairness


be differentiated – FIFO applied to all arrivals
– Ex. Supermarket express lanes 2. No customer anxiety
2. Labor specialization possible regarding choice of queue
3. Customer has more flexibility 3. Avoids “cutting in” problems
4. Balking behavior may be 4. The most efficient set up for
deterred minimizing time in the queue
– Several medium-length lines are 5. Jockeying (line switching) is
less intimidating than one very avoided
long line

11
Components of a Basic Queuing Process (IV)

❖ The Service Mechanism


– Can involve one or several service facilities with one or several
parallel service channels (servers) - Specification is required
– The service provided by a server is characterized by its service time
• Specification is required and typically involves data gathering and
statistical analysis.
• Most analytical queuing models are based on the assumption of
exponentially distributed service times, with some generalizations.
❖ The queue discipline
– Specifies the order by which jobs in the queue are being served.
– Most commonly used principle is FIFO.
– Other rules are, for example, LIFO, SPT, EDD…
– Can entail prioritization based on customer type.

12
Mitigating Effects of Long Queues

1. Concealing the queue from arriving customers


– Ex. Restaurants divert people to the bar or use pagers, amusement parks
require people to buy tickets outside the park, banks broadcast news on
TV at various stations along the queue, casinos snake night club queues
through slot machine areas.
2. Use the customer as a resource
– Ex. Patient filling out medical history form while waiting for physician
3. Making the customer’s wait comfortable and distracting their
attention
– Ex. Complementary drinks at restaurants, computer games, internet
stations, food courts, shops, etc. at airports
4. Explain reason for the wait
5. Provide pessimistic estimates of the remaining wait time
– Wait seems shorter if a time estimate is given.
6. Be fair and open about the queuing disciplines used 13
A Commonly Seen Queuing Model (I)

The Queuing System

The Service Facility

C S = Server
The Queue C S
Customers (C)
CCC…C •

Customer =C C S

14
Name Models Covered
(Kendall Notation) Example
Simple system Customer service desk in a
(M / M / 1) store
Multiple server Airline ticket counter
(M / M / s)
Constant service Automated car wash
(M / D / 1)
General service Auto repair shop
(M / G / 1)
Limited population An operation with only 12
(M / M / s / ∞ / N) machines that might break
Queueing Theory(cont.)
Specification of a Queue(cont.)
Traffic Intensity (l/m)
Note: E[s] / E[t] = lE[s] = l/m
Server Utilization
Probability that N customers are in the system
at time t.
Queueing Theory(cont.)
Relationships:
L = lW (L: avg # in the system)
Lq = lWq (Lq : avg # in queue)
W = Wq + 1/m (W: avg waiting time in sys.)
(Wq: avg waiting time in queue)

Note: All four(L, Lq, W , Wq) can be determined


after ONE is found
Birth-And-Death Process
State:
l0 l1 lN-2 lN-1 lN

0 1 2 .... N-2 N-1 N N+1 ....


m1 m2 mN-1 mN mN+1

In the long run, we have:


Rate IN = Rate Out Principle
Birth-And-Death Process(cont.)
Equation Expressing This:
State Rate In = Rate Out
0 m1P1 = l0P0
1 l0P0 + m2P2 = (l1 + m1) P1
2 l1P1 + m3P3 = (l2 + m2) P2
.... ...................
N-1 lN-2PN-2 + mNPN = (lN-1 + mN-1) PN-1
N lN-1PN-1 + mN+1PN+1 = (lN + mN) PN
.... ...................
Birth-And-Death Process(cont.)
Finding Steady State Process:
State
0: P1 = (l0 / m1) P0
1: P2 = (l1 / m2) P1 + (m1P1 - l0P0) / m2
= (l1 / m2) P1 + (m1P1 - m1P1) / m2
= (l1 / m2) P1
l1l 0
= P0
m 2 m1
Birth-And-Death Process(cont.)
Finding Steady State Process(cont.):
State
n-1: Pn = (ln-1 / mn) Pn-1 + (mn-1Pn-1- ln-2Pn-2) / mn
= (ln-1 / mn) Pn-1 + (mn-1Pn-1- mn-1Pn-1) / mn
= (ln-1 / mn) Pn-1
l n-1l n-2  l 0
= P0
m nm n-1 m1
Birth-And-Death Process(cont.)
Finding Steady State Process(cont.):
N: Pn+1 = (ln / mn+1) Pn+ (mnPn - ln-1Pn-1) / mn+1
= (ln / mn+1) Pn
l n l n-1  l 0
= P0
m n +1m n m1

To Simplify:
Let C = (ln-1 ln-2 .... l0) / (mn mn-1 ......... m1)
Then Pn = Cn P0 , N = 1, 2, ....
M/M/1
Recall:
 = l/ m < 1 (for steady-state)
Cn = (l / m)n = n , for n = 1, 2, ...
Pn = Cn · P0 
The requirement that  Pn = 1
 n =0
[1 + C
n =1
n ]P0 = 1

P0 = 1 /(1 +  C n )
n =1

= 1/(1 +  )
 n

n =1

= 1/( 0 +  n
) (0 = 1)
n =1

M/M/1(cont.)
P0 = 1 (   n )
n =0
−1
 

=   n 
 n =0 
= 1 (1 −  )
−1

=1−

Thus, Pn = (1 - ) n , for n = 0, 1, 2,...


Note:
n
1)  X i = (1 − X n +1 ) /(1 − X ) , for any x,
i =0

2)  X n = 1 /(1 − X ), if |x| < 1.
i =0
M/M/1(cont.)
Consequently,

L =  n (1 − )n
n =0

d n d   n
= (1 − )  = (1 − )    
n = 0 d d  n =0 
d 1 1
= (1 − ) = (1 − )
d (1 − ) (1 − ) 2
=  (1 − )
or
= l (m − l)
M/M/1(cont.)
Similarly,

L q =  (n - 1)Pn
n =1
 
=  nPn −  Pn
n =1 n =1
 
=  nPn − (  Pn − P0 )
n =0 n =0

= L − 1(1 − P0 )
=  /(1 − ) − 1 + (1 − )
=  2 /(1 − ), or
= l2 / m(m − l )
M/M/1 Example I
Traffic to a message switching center for one of the
outgoing communication lines arrive in a random
pattern at an average rate of 240 messages per
minute. The line has a transmission rate of 800
characters per second. The message length
distribution (including control characters) is
approximately exponential with an average length
of 176 characters. Calculate the following
principal statistical measures of system
performance, assuming that a very large number
of message buffers are provided:
M/M/1 Example I (cont.)

(a) Average number of messages in the system


(b) Average number of messages in the queue
waiting to be transmitted.
(c) Average time a message spends in the system.
(d) Average time a message waits for transmission
(e) Probability that 10 or more messages are
waiting to be transmitted.
(f) 90th percentile waiting time in queue.
M/M/1 Example I (cont.)

E[s] = Average Message Length / Line Speed


= {176 char/message} / {800 char/sec}
= 0.22 sec/message or
m = 1 / 0.22 {message / sec}
= 4.55 message / sec
l = 240 message / min
= 4 message / sec
 = l E[s] = l / m
= 0.88
M/M/1 Example I (cont.)
(a) L=  / (1 - ) = 7.33 (messages)
(b) Lq = 2 / (1 - ) = 6.45 (messages)
(c) W = E[s] / (1 - ) = 1.83 (sec)
(d) Wq =  × E[s] / (1 - ) = 1.61 (sec)
(e) P [11 or more messages in the system]
= 11 = 0.245
(f) pq(90) = W ln{(100-90) }
= W ln(10)
= 3.98 (sec)
M/M/1 Example II
A branch office of a large engineering firm has one
on-line terminal that is connected to a central
computer system during the normal eight-hour
working day. Engineers, who work throughout the
city, drive to the branch office to use the terminal
to make routine calculations. Statistics collected
over a period of time indicate that the arrival
pattern of people at the branch office to use the
terminal has a Poisson (random) distribution, with
a mean of 10 people coming to use the terminal
each day. The distribution of time spent by an
engineer at a terminal is exponential, with a
M/M/1 Example II (cont.)
mean of 30 minutes. The branch office receives
complains from the staff about the terminal
service. It is reported that individuals often wait
over an hour to use the terminal and it rarely takes
less than an hour and a half in the office to
complete a few calculations. The manager is
puzzled because the statistics show that the
terminal is in use only 5 hours out of 8, on the
average. This level of utilization would not seem
to justify the acquisition of another terminal. What
insight can queueing theory provide?
M/M/1 Example II (cont.)
{10 person / day}×{1 day / 8hr}×{1hr / 60 min}
= 10 person / 480 min
= 1 person / 48 min
==> l = 1 / 48 (person / min)
30 minutes : 1 person
= 1 (min) : 1/30 (person)
==> m = 1 / 30 (person / min)
 = l / m = {1/48} / {1/30} = 30 / 48
=5/8
M/M/1 Example II (cont.)
Arrival Rate
l = 1 / 48 (customer / min)
Server Utilization
 = l / m = 5 / 8 = 0.625
Probability of 2 or more customers in system
P[N  2] = 2 = 0.391
Mean steady-state number in the system
L = E[N] =  / (1 - ) = 1.667
S.D. of number of customers in the system
sN = sqrt() / (1 - ) = 2.108
M/M/1 Example II (cont.)
Mean time a customer spends in the system
W = E[w] = E[s] / (1 - ) = 80 (min)
S.D. of time a customer spends in the system
sw = E[w] = 80 (min)
Mean steady-state number of customers in queue
Lq = 2 / (1 - ) = 1.04
Mean steady-state queue length of nonempty Qs
E[Nq | Nq > 0] = 1 / (1 - ) = 2.67
Mean time in queue
Wq = E[q] = ×E[s] / (1 - ) = 50 (min)
M/M/1 Example II (cont.)
Mean time in queue for those who must wait
E[q | q > 0] = E[w] = 80 (min)
90th percentile of the time in queue
pq(90) = E[w] ln (10 )
= 80 * 1.8326
= 146.6 (min)
90th percentile of the time in system
pw(90) = 2.3 * E[w] = 184 (min)
M/M/1 Example II (cont.)
Defined by equation P[w  pw(90)] = 0.9
response time of system pw(90) - amount of time
in the system such that 90% of all arriving
customers spend less than this amount of time in
the system
Example of M/M/1 Queue Analysis
(1 of 2)
• Network gateway, 4 Mbps, packet size
1000 bytes, Arrival rate of 125
packets/sec
– What is the probability of overflow with
only 12 buffers?
– How many buffers are needed to keep
packet loss to 1 in 1,000,000?

38
Example of M/M/1 Queue Analysis
(2 of 2)
• Arrival rate l=125 pps • Probability of n packets in
• Service rate: gateway
4000000/8 Pr(n) = (1-) =.75(.25)
n n

= 500000 Mbytes/sec • Mean time in gateway:


500000/1000 = 500 pps (1/m) / (1-)
So, m=500 pps = (1/500)/(1-.25) = 2.66ms
• Utilization (traffic • Prob of overflow = Pr(13+)
intensity): = 13 = .2513 = 1.49x10-8
 = l/m = 125/500 = .25  15 packets/billion
• Mean packets in • To limit to less than 10-6
gateway: n10-6
/(1-) = .25/.75 = .33 n > log(10-6)/log(.25)
> 9.96
39
– So, 10 buffers
Another Example of M/M/1 Queue
Analysis (1 of 2)
• Web server. Time between requests
exponential with mean time between 8 ms.
Time to process exponential with average
service time 5 ms.
A) What is the average response time?
B) How much faster must the server be to
halve this average response time?
C) How big a buffer so only 1 in 1,000,000,000
requests are lost?

40
Another Example of M/M/1 Queue
Analysis (2 of 2)
• Request rate
l = 1000 / 8 = 0.125 • To halve, want
requests per ms (1/m) / (1-) = 6.665
• Service rate – Assume l fixed, so
change m
m = 1000 / 5 = 0.2 m = 1/6.665 + 0.125 = .257
requests per ms B) So, (.275-.2)/.2 * 100
• Utilization = 37.5% faster
 = l/m= .125/.2 = .625 • 1 in 1 billion errors
– So, 62.5% of capacity – Buffer size k:
A) Avg response time Pr(k)  10-9
(1/m) / (1-) k  10-9
C) So,
= (1/.2)/(1-.625)
k > log(10-9) / log(.625)
= 13.33 ms
k  44
41
M/M/s (s > 1)
Recall: ln = l, for n = 0, 1, 2,.....
mn = n m, for n = 1, 2,..., s
= s m, for n = s, s+1,...
Rate Diagram
l l l l l l

0 1 2 3 ... s-2 s-1 s s+1 ...

m 2m 3m (s-1)m sm sm
M/M/s (cont.)
State Rate In = Rate Out
0 mP1 = lP0
1 2mP2 + lP0 = (l + m) P1
2 3mP3 + lP1 = (l + 2m) P2
.... ...................
s-1 smPs + lPs-2 = {l + (s-1)m} Ps-1
s smPs+1 + lPs-1 = (l + sm) Ps
s+1 smPs+2 + lPs = (l + sm) Ps+1
.... ...................
M/M/s (cont.)
Now, solve for P1 , P2, P3... in terms of P0
P1 = (l / m) P0
P2 = (l / 2m) P1 = (1/2!) × (l / m)2 P0
P3 = (l / 3m) P2 = (1/3!) × (l / m)3 P0
.........
Ps = (1/s!) × (l / m)s P0

Ps+1 = (1/s) × (l / m) Ps =
(l m ) s
l
 P0
s! sm
M/M/s (cont.)

2
(l / m ) s
l
Ps + 2 = (1 / s)  (l / m)Ps +1 =   P0
s!  sm 

j
(l / m ) s
l
Ps + j = (1 / s)  (l / m)Ps + j−1 =   P0
s!  sm 

M/M/s (cont.)

Therefore, if we denote Pn = Cn× P0 ,


(l / m) n
then Cn = , for n = 1, 2, ...., s.
n!
n −s
(l / m ) s
l
and C n =   , for n = s+1, s+2,...
s!  sm 

=
(l m)
n

s!s n −s
M/M/s (cont.)
So, if l < sm =>
P0 = 1
 s−1 (l m )n (l m )s  n −s 
 +  (l sm ) 
 n =0 n! s! n =s 
= 1
 s −1 (l m )n (l m )s 1 
 + 
 n =0 n! s! 1 − (l sm) 
(l m ) n
Pn = P0 , if 0  n  s
n!
(l m ) n
= n −s
P0 , if s  n
s!s
M/M/s (cont.)
Now solve for Lq: Note,  = l / sm

L q =  (n - s)Pn
n =s

=  jPs + j ; Note, n = s + j
j= 0

 (l / m ) s j
=  j  P0
j= 0 s!
(l / m ) s  d j
= P0  
s! j = 0 d
M/M/s (cont.)
(l / m )s
d  j
L q = P0  
s! d j=0
(l / m ) s d 1
= P0 
s! d (1 − )
(l / m ) s 
= P0
s! (1 − ) 2
M/M/s (cont.)
(l / m ) s 
L q = P0 ,  = l / sm
s! (1 − ) (Lq : avg # in queue)
2

Wq = Lq / l (Wq: avg waiting time in Q)

W = Wq + 1 / m (W: avg waiting time in sys.)

L = l (Wq + 1/m) (L: avg # in the system)

= Lq + l / m
Steady-State Parameters of
M/M/s Queue
 = l / sm
−1
 s −1 (l / m )   l  1 sm  
n s

P0 =   +   
 n =0 n!   m  s! sm − l  
−1
 s −1 (s)  
n
1  
 + (s)
s 1
=    
 n =0 n!   s! 1 −   
P(L()  s) = {(l/m)s P0} / {s!(1- l/sm)}
= {(s)s P0} / {s! (1 - )}
Steady-State Parameters of
M/M/s Queue (cont.)
L = s + {(s)s+1 P0} / {s (s!) (1 - )2}
= s + { P (L()  s) } / {1 - }
W =L/l
Wq = W - 1/m
Lq = l Wq
= {(s)s+1 P0} / {s (s!) (1 - )2}
= { P (L()  s) } / {1 - }
L - Lq = l / m = s
M/M/s Case Example I
Example:
M/M/2 ; s = 2
l = 1/ 10, m = 1/8 (=service rate/server)
1/10 1/10 1/10 1/10

0 1 2 3 .......

1/8 2(1/8) 2(1/8) 2(1/8)

 = l / sm = {1/10} / {2(1/8) } = 0.4


M/M/s Case Example I (cont.)
P0 = 1
 (0.8)0 (0.8)1 (0.8)2 1 
 + +  
 0! 1! 2! 1 − 0.4 
= 0.429 (@ 43% of time, system is empty)
as compared to s = 1: P0 = 0.20
(l / m ) s

Lq = P0
s! (1 −  ) 2
= 0.429  {0.8  0.4} /{2!(1 − 0.4) }
2 2

= 0.152
M/M/s Case Example I (cont.)
Wq = Lq / l = 0.152 / (1/10) = 1.52 (min)
W = Wq + 1 / m = 1.52 + 1 / (1/8) = 9.52 (min)
What proportion of time is both repairman busy?
(long run)
P(N  2) = 1 - P0 - P1
= 1 - 0.429 - 0.343
= 0.228 (Good or Bad?)
M/M/s Example II
Many early examples of queueing theory applied to
practical problems concerning tool cribs.
Attendants manage the tool cribs while mechanics,
assumed to be from an infinite calling population,
arrive for service. Assume Poisson arrivals at rate
2 mechanics per minute and exponentially
distributed service times with mean 40 seconds.
M/M/s Example II (cont.)
l = 2 per minute, and m = 60/40 = 3/2 per minute.
Since, the offered load is greater than 1, that is,
since, l / m = 2 / (3/2) = 4/3 > 1, more than one
server is needed if the system is to have a
statistical equilibrium. The requirement for steady
state is that s > l / m = 4/3. Thus, at least s = 2
attendants are needed. The quantity 4/3 is the
expected number of busy server, and for s  2,
 = 4 / (3s) is the long-run proportion of time each
server is busy. (What would happen if there were
only s = 1 server?)
M/M/s Example II (cont.)
Let there be s = 2 attendants. First, P0 is calculated as
−1
 1 (4 / 3)   4  1 2(3 / 2)  
n 2

P0 =   +   
 n =0 n!   3  2! 2(3 / 2) − 2  
= {1 + 4/3 + (16/9)(1/2)(3)} -1
= {15 / 3}-1 = 1/5 = 0.2
The probability that all servers are busy is given by
P(L()  2) = {(4/3)2 (1/5)} / {2!(1- 2/3)}
= (8/3) (1/5) = 0.533
M/M/s Example II (cont.)
Thus, the time-average length of the waiting line of
mechanics is
Lq = {(2/3)(8/15)} / (1 - 2/3) = 1.07 mechanics
and the time-average number in system is given by
L = Lq+ l/m = 16/15 + 4/3 = 12/5 = 2.4 mechanics
Using Little’s relationships, the average time a
mechanic spends at the tool crib is
W = L / l = 2.4 / 2 = 1.2 minutes
while the avg time spent waiting for an attendant is
Wq = W - 1/m = 1.2 - 2/3 = 0.533 minute
M/M/c Example (1 of 2)
• How does response time for previous
M/M/1 Web server change if number of
servers increased to 4?
– Can model as M/M/4

60
M/M/c Example (2 of 2)
• Request rate l=0.125 • Erlang’s C formula
• Service rate m=0.2 –  = (4x0.1563)4 (0.5352)
• Traffic intensity
4!(1-.01563)
= .0040326
–  = m/(cl) = 0.1563
• So, average response
• Probability of idle time:
• P0 = ____1_________ E[r] = 1/m + /cm(1-)
[(c)n/n!] + = 1/.2 + .004326/(4)(.2)(1-
(c)c/(c!(1-)) P0 .1563)
= 0.532 = 5.01 ms
• Thus, increasing servers
by 4 reduces response
time by appx 62%

61
Another M/M/c Example (1 of 2)
• Students arrive at computer lab, 10 per
hour. Spend 20 minutes at a terminal
(assume exponentially distributed) and
then leave. Center has 5 terminals.
A) How many terminals can go down and still
be able to service the students?
B) What is the probability all terminals are
busy?
C) How long is the average student in center?

62
Another M/M/c Example (2 of 2)
• Arrival rate l=.167 per min, m=.05 per min
• Utilization = l/(mc) = .167/(.05x5) = .67
A) Find c s.t. U > 1, so 1 > l/(mc) → c > l/u  4
– One terminal only can go down
• Prob all idle, P0
= [1 + (5x.67)5/[5!(1-.67)] + (5x.67)1/1!
+ (5x.67)2/2! + (5x.67)3/3! + + (5x.67)4/4!]-1
= 0.0318
B) Prob busy → Erlang’s C formula ()
Pr(>c jobs) = [(cp)c]/[c!(1-)] P0
= [(5x.67)5] / [5!(1-.67)] x .0318 = .33
– So, 1/3 of the time you’ll need to wait upon arriving
C) Time to wait: E[w] = /[mm(1- )]
63 = .33/(5x.05x(1-.67)) = 4 minutes
lanjutan

Analisis antrian pada kasus di atas adalah mana yang menghasilkan


biaya total optimal apakah satu kelompok, dua kelompok atau tiga
kelompok tenaga kerja.
Identifikasi masalah:
I. Kondisi awal (satu kelompok tenaga kerja terdiri 3 orang):
✓ Rata-rata kedatangan λ = 4 truk perjam
✓ Rata-rata pelayanan μ = 6 truk perjam
✓ Biaya $ 6 per orang per jam, 3 orang $ 18
II.Kondisi kedua (dua kelompok tenaga kerja terdiri 6 orang):
✓ Rata-rata kedatangan λ = 4 truk perjam
✓ Rata-rata pelayanan μ = 12 truk perjam
✓ Biaya $ 6 per orang per jam, 6 orang $ 36
III.Kondisi kedua (dua kelompok tenaga kerja terdiri 9 orang):
✓ Rata-rata kedatangan λ = 4 truk perjam
✓ Rata-rata pelayanan μ = 18 truk perjam
✓ Biaya $ 9 per orang per jam, 6 orang $ 54
Langkah analisis:
i. Kondisi awal (satu kelompok tenaga kerja):
1. Rata-rata jumlah truk dalam antrian Lq
Lq = λ2 / (μ – λ) = 42 / 6(6-4) = 1,333
2. Rata-rata jumlah truk dalam sistem L
L = λ / (μ – λ) = 4 / (6-4) = 2
3. Rata-rata waktu truk dalam antrian Wq
Wq = λ / μ (μ – λ) = 4 / 6(6-4) = 0.333
4. Rata-rata waktu truk dalam sistem W
W = 1 / (μ – λ) = 1 / (6-4) = 0.5
5. Tingkat intensitas pelayanan U
U = λ / μ = 4 / 6 =0,667
lanjutan

ii. Kondisi kedua (dua kelompok tenaga kerja):


1. Rata-rata jumlah truk dalam antrian Lq
Lq = λ2 / (μ – λ) = 42 / 12(12-4) = 0,167
2. Rata-rata jumlah truk dalam sistem L
L = λ / (μ – λ) = 4 / (12-4) = 0,5
3. Rata-rata waktu truk dalam antrian Wq
Wq = λ / μ (μ – λ) = 4 / 12(12-4) = 0.042
4. Rata-rata waktu truk dalam sistem W
W = 1 / (μ – λ) = 1 / (12-4) = 0.125
5. Tingkat intensitas pelayanan U
U = λ / μ = 4 / 12 =0,333
lanjutan

iii. Kondisi ketiga (tiga kelompok tenaga kerja):


1. Rata-rata jumlah truk dalam antrian Lq
Lq = λ2 / (μ – λ) = 42 / 18(18-4) = 0,063
2. Rata-rata jumlah truk dalam sistem L
L = λ / (μ – λ) = 4 / (18-4) = 0,286
3. Rata-rata waktu truk dalam antrian Wq
Wq = λ / μ (μ – λ) = 4 / 18(18-4) = 0.016
4. Rata-rata waktu truk dalam sistem W
W = 1 / (μ – λ) = 1 / (18-4) = 0.071
5. Tingkat intensitas pelayanan U
U = λ / μ = 4 / 18 =0,222
lanjutan

Hasil analisis antrian secara ringkas adalah:

Karakteristik antrian 1 kelompok 2 kelompok 3 kelompok


tenaga kerja tenaga kerja tenaga kerja
Rata-rata jumlah truk dalam antrian (Lq) 1,333 0,167 0,063
Rata-rata jumlah truk dalam sistem (L) 2,000 0,500 0,286
Rata-rata waktu truk dalam antrian (Wq) 0.333 0.042 0.016
Rata-rata waktu truk dalam sistem (W) 0.500 0.125 0.071
Probabilitas fasilitas Pelayanan sibuk (U) 0,667 0,333 0,222
Analisis perbandingan total biaya pada tiap kelopok
Biaya
Biaya Truk per hari Biaya tenaga kerja per hari total
1 kelompok 2 x 8 jam x $20 = $320 3 x $6 x 8 jam = $144 $464
2 kelompok 0,5 x 8 jam x $20 = $ 80 6 x $6 x 8 jam = $288 $368
3 kelompok 0,286 x 8 jam x $20 = 46 9 x $6 x 8 jam = $432 $478

Dari perhitungan biaya total seperti tampak pada tabel di atas terlihat
bahwa biaya total paling rendah jika perusahaan mempekerjakan 2
kelompok tenaga kerja. Dengan demikian disarankan agar perusahaan
tersebut menambah satu kelompok tenaga kerja.
M/M/c versus M/M/1 (1 of 2)
• Consider what would happen if the
terminals were distributed in separate
labs, one per lab, across campus.
A) Would you wait longer?
• Can model as separate M/M/1 systems and
compare to M/M/c system

70
M/M/c versus M/M/1 (2 of 2)
• For M/M/1 l=.167 / 5 = .0333 and m=.05
– =.0333/.05 = .67
• Expected waiting time:
E[w] = E[nq]/l = [2 / (1-)] / l
= [(.67)2/(1-.67)] / (.033)
 41 minutes
A) Yes. A lot longer.
• What is the model ignoring that may make
the answer seem better?

71
M/M/1/N (single server)
Undefined
Rate Diagram
l l l l l 0

0 1 2 3 ... N-2 N-1 N N+1

m m m m m 0

Undefined
M/M/1/N (cont.)
1. Form Balance Equations:
2. Solve
N
for P 0 :

n =0
Pn = 1 or
P0 + (l/m)1 P0 +    + (l/m)N P0 = 1
P0 {1+ (l/m)1 +    + (l/m)N } = 1
N
P0 = 1 / {  (l / m) n }
n =0

= 1
1 − (l / m) N +1 
 
 1 − (l / m ) 
= (1 - ) / (1 - N+1)
M/M/1/N (cont.)
 1 −   n , for n = 0, 1, 2, ..., N
So, Pn =  N +1 

1 −  
Hence,
N
L =  nPn
n =0

1−  N
d n
N +1 
=  
1−  n = 0 d

1−  d N n
= N +1
 
1−  d =0 n
M/M/1/N (cont.)

1−  d 1 −  N +1 
L= N +1
  
1−  d  1 −  
N +1
− ( N + 1) + N + 1
N
=
(1 −  N +1 )(1 − )
 ( N + 1) N +1
= − N +1
(1 − ) (1 −  )
M/M/1/N (cont.)
As usual (when s = 1)
Lq = L - (1- P0)
W = L / le , where le = l (1 - PN)
Wq = Lq / le
M/M/1/N Example
The unisex barbershop can hold only three
customers, one in service and two waiting.
Additional customers are turned away when the
system is full. Determine the measures of
effectiveness for this system. The traffic intensity
is l / m = 2 / 3.
The probability that there are three customers in the
system is computed by
Pn = P3 = {(1-2/3) (2/3)3} / { 1 - (2/3)4} = 8 / 65
= 0.123
M/M/1/N Example (cont.)
The expected # of customers in the shop is given by
2 / 3{1 − 4(2 / 3) 3 + 3(2 / 3) 4 } 66
L= =
{1 − (2 / 3) }(1 − 2 / 3)
4
65
= 1.015(customers )
Now, the effective arrival rate, le , is given by
le = l (1 - Pn) = 2(1 - 8/65) = 2 × 57 / 65 =114/65
= 1.754 (customers/hour)
Then W can be calculated as
W = L / le = 1.015 / 1.754 = 0.579 (hour)
M/M/1/N Example (cont.)
In order to calculate Lq, first determine P0 as
P0 = (1 - ) / (1 - N+1) = (1 - 2/3) / {1 - (2/3)4}
= {1/3} / {65/81} = 27 / 65
= 0.415
Then the average length of the queue is given by
Lq = L - (1- P0) = 1.015 - (1 - 0.415)
= 0.43 (customer)
M/M/1/N Example (cont.)
Note that 1- P0 = 0.585 is the average number of
customers being served, or equivalently, the
probability that the single server is busy. Thus the
server utilization, or proportion of time the server
is busy in the long run, is given by
 = 1- P0 = le / m = 0.585
Finally, the waiting time in the queue is determined
by Little’s equation as
Wq = Lq / le = 0.43 / 1.754 = 0.245 (hour)
M/M/1/N Example (cont.)
The reader should compare these results to those of
the unisex barbershop before the capacity
constraint was placed on the system. Specifically,
in systems with limited capacity, the traffic
intensity l / m can assume any positive value and
no longer equals the server utilization  = le / m.
Note that server utilization decreases from 67% to
58.5% when the system imposes a capacity
constraint.
M/M/1/N Example (cont.)

Since P0 and P3 have been computed, it is easy to check


N
the value of L using equation L =  nPn
n =0
To make the check requires computation of P1 & P2: P1
= {(1 - 2/3)(2/3)} / {1- (2/3)4} = 18/65 = 0.277
Since P0 + P1 + P2 + P3 = 1, P2
= 1 - P0 - P1 - P3 = 1 - 27/65 - 18/65 - 8/65
= 12 / 65
= 0.185
M/M/1/N Example (cont.)
N
L =  nP
n =0
n

= 0×(27/65) + 1×(18/65) + 2×(12/65) + 3×(8/65)


= 66 / 65
= 1.015 (customer)

which is the same value as the expected number


computed.
M/M/s/N
Undefined
Rate Diagram
l l l l l 0

0 1 2 ... s-1 s s+1 ... N-1 N N+1

m 2m sm sm sm 0

Undefined
Steady-State Parameters of
M/M/s/N
P0 = 1
 s ( l / m ) n ( l / m )s N 
1+ 
 n =1 n!
+ 
s! n =s+1
n −s
( l / sm ) 


(l / m) n
Pn = P0 , for n = 1, 2, ... s
n!
(l / m ) n
= n −s
P0 , for n = s, s+1, ... N
s!s
= 0, for n > N
Steady-State Parameters of
M/M/s/N (cont.)
s −1 s −1
L =  nPn + L q + s(1 −  Pn )
n =0 n =0

Lq =
P0 (l / m) s 
s!(1 − ) 2
1−  N −s
− ( N − s ) N −s
(1 − ) 
Note: W and Wq are obtained from these
quantities just as shown for the single server
case.
Steady-State Parameters of
M/G/1 Queue
 =l/m
L =  + {l2 (m−2 + s2)} / {2 (1 - )}
=  + {2 (1 + s2 m2)} / {2 (1 - )}
W = m−1 + {l (m−2 + s2)} / {2 (1 - )}
Wq = {l (m−2 + s2)} / {2 (1 - )}
Lq = {l2 (m−2 + s2)} / {2 (1 - )}
= {2 (1 + s2 m2)} / {2 (1 - )}
P0 = 1 - 
M/G/1 Example
There are two workers competing for a job. Able
claims an average service time which is faster than
Baker’s, but Baker claims to be more consistent, if
not as fast. The arrivals occur according to a
Poisson process at a rate of l= 2 per hour. (1/30
per minute). Able’s statistics are an average
service time of 24 minutes with a standard
deviation of 20 minutes. Baker’s service statistics
are an average service time of 25 minutes, but a
standard deviation of only 2 minutes. If the
average length of the queue is the criterion for
hiring, which worker should be hired?
M/G/1 Example (cont.)
For Able,
l = 1/30 (per min), m−1 = 24 (min),
 = l / m = 24/30 = 4/5
s2 = 202 = 400(min2)
Lq = {l2 (m−2 + s2)} / {2 (1 - )}
= {(1/30)2 (242 + 400)} / {2 (1-4/5)}
= 2.711 (customers)
For Baker,
l = 1/30 (per min), m−1 = 25 (min),
 = l / m = 25/30 = 5/6
s2 = 22 = 4(min2)
Lq = {(1/30)2 (252 + 4)} / {2 (1-5/6)}
= 2.097 (customers)
M/G/1 Example (cont.)
Although working faster on the average, Able’s
greater service variability results in an average
queue length about 30% greater than Baker’s. On
the other hand, the proportion of arrivals who
would find Able idle and thus experience no delay
is P0 = 1 -  = 1 / 5 = 20%, while the proportion
who would find Baker idle and thus experience no
delay is P0 = 1 -  = 1 / 6 = 16.7%. On the basis of
average queue length, Lq , Baker wins.
Steady-State Parameters of
M/Ek/1 Queue
l 1+ k l2 1+ k  2
L= + =+
m 2k m ( m − l ) 2k 1 − 

1+ k
1 l 1 + k m −1
W = + = m −1 +
m 2k m ( m − l ) 2k 1 − 

1+ k l 1 + k m −1
Wq = =
2k m ( m − l ) 2k 1 − 

1+ k l2 1+ k  2
Lq = =
2k m ( m − l ) 2k 1 − 
M/Ek/1 Example
Patient arrive for a physical examination according
to a Poisson process at the rate of one per hour.
The physical examination requires three stages,
each one independently and exponentially
distributed with a service time of 15 minutes. A
patient must go through all three stages before the
next patient is admitted to the treatment facility.
Determine the average number of delayed patients
,Lq , for this system.
M/Ek/1 Example (cont.)
If patients follow this treatment pattern, the service-
time distribution will be Erlang of order k=3. The
necessary treatment parameters are l = 1/60 per
minute and m = 1/45 per minute; thus

1+ k l2 1+ 3 (1 / 60) 2
Lq = =
2k m ( m − l ) 2  3 (1 / 45)(1 / 45 − 1 / 60)
2 135 3
= = ( patients )
3 60 2
Steady-State Parameters of
M/D/1 Queue
l 1 l2 1 2
L= + =+
m 2 m (m − l ) 2 1− 

11 l 1 m −1
W = + = m −1 +
m 2 m (m − l ) 2 1− 

1 l 1 m −1
Wq = =
2 m (m − l ) 2 1 − 

1 l2 1 2
Lq = =
2 m (m − l ) 2 1 − 
M/D/1 Example
Arrivals to an airport are all directed to the same
runway. At a certain time of the day, these arrivals
are Poisson distributed at a rate of 30 per hour.
The time to land an aircraft is a constant 90
seconds. Determine Lq, Wq, L and W for this
airport. In this case l= 0.5 per minute, and 1/m =
1.5 minutes, or m = 2/3 per minute.
M/D/1 Example (cont.)
The runway utilization is
 = l / m = (1/2) / (2/3) = 3/4
The steady-state parameters are given by
Lq = {(3/4) 2} / {2 (1 - 3/4)}
= 9 / 8 = 1.125 aircraft
Wq = Lq / l = (9/8) / (1/2) = 2.25 minutes
W = Wq + 1 / m = 2.25 + 1.5 = 3.75 minutes
L = Lq + l / m = 1.125 + 0.75 = 1.875 aircraft
Steady-State Parameters of
M/G/ Queue
P0 = e-l/m
Pn = {e-l/m (l/m)n} / n! , n = 0, 1,...
W =1/m
Wq =0
L =l/m
Lq =0
M/G/ Example
Prior to introducing their new on-line computer
information service, The Connection must plan
their system capacity in terms of the number of
users that can be logged on simultaneously. If the
service is successful, customers are expected to
log on at a rate of l = 500 per hour, according to a
Poisson process, and stay connected for an
average of 1/m = 20 minutes (or 1/3 hour). In the
real system there will be an upper limit on
simultaneous users, but for planning purpose The
M/G/ Example (cont.)
Connection can pretend that the number of
simultaneous users is infinite. An M/G/ model of
the system implies that the expected number of
simultaneous users is L = l/m = 500(3) = 1500, so
a capacity greater than 1500 is certainly required.
To ensure that they have adequate capacity 95% of
the time, The Connection could allow the number
of simultaneous users to be the smallest value s
such that
M/G/ Example (cont.)
s
P(L()  s) =  Pn
n =0
s
=  {e −1500 (1500) n } / n! 0.95
n =0

A capacity of s=1564 simultaneous users satisfies


this requirement.
Steady-State Parameters of
M/M/s/K/K Queue
−1
 s −1  K  l  n
K
K! l
n

P0 =     +   
n −s 

 n =0  n  m  n =s (K − n )!s!s  m  
n
 K  l 
Pn =    P0 , n = 0, 1, ..., s-1
 n  m 
n
K! l
=   P0 , n = s, s+1, ... K
n −s 
(K − n )!s!s  m 
Steady-State Parameters of
M/M/s/K/K Queue (cont.)
K
L =  nPn
n =0
K
L q =  (n − s)Pn
n =s +1
K
l e =  (K − n )lPn
n =0
W = L / le
Wq = Lq / le
 = (L - Lq) / s
= le / sm
M/M/s/K/K Example
There are two workers that are responsible for 10
milling machines. The machines run on the
average of 20 minutes, then require an average 5-
minute service period both times exponentially
distributed. Therefore, l = 1/20 and m = 1/5.
Determine the various measures of performance
for this system.
M/M/s/K/K Example (cont.)
All of the performance measures depend on P0
−1
 2−1 10  5  n 10
10!  5 
n

P0 =     +  n −2   
 n =0  n  20  n =2 (10 − n )!2!2  20  
= 0.065
Using P0 we can obtain the other Pn, from which
we can compute the average number of machines
waiting for service
10
L q =  (n − 2)Pn
n = 2 +1

= 1.46(machines )
M/M/s/K/K Example (cont.)
The effective arrival rate
K
l e =  (K − n )lPn
n =0
10
=  (10 − n )(1 / 20)Pn
n =0

= 0.342(machines / min)
and the average waiting time in the queue
Wq = Lq / le = 4.27 (minutes)
Similarly, we can compute the expected number of
machines being serviced or waiting to be served
K 10
L =  nPn =  nPn = 3.17(machines)
n =0 n =0
M/M/s/K/K Example (cont.)
The average number of machines being serviced is
given by
L - Lq = 3.17 - 1.46 = 1.71 (machines)
since the machines must be running, waiting to be
served, or in service, the average number of
running machines is given by
K - L = 10 - 3.17 = 6.83 (machines)
A frequently asked question is: What will happen if
the number of servers is increased or decreased?
M/M/s/K/K Example (cont.)
If the number of workers in this example increases to
three(s=3), then the time-average number of
running machines increases to
K - L = 7.74 (machines)
an increase of 0.91 machine, on the average.
Conversely, what happens if the number of servers
decreases to one? Then the time-average number
of running machines decreases to
K - L = 3.98 (machines)
M/M/s/K/K Example (cont.)
The decrease from two to one server has resulted in a
drop of nearly three machines running, on the
average.
This example illustrates several general relationships
that have been found to hold for almost all queues.
If the number of servers is decreased, delays,
server utilization, and the probability of an arrival
having to wait to begin service all increase.

You might also like