Professional Documents
Culture Documents
Queuing Theory
Handout #25
February 19, 2002
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
examples:
M/M/1 queue
M/M/S queue
M/M/1/C queue
Markovian queues with general state definition
security checkpoint
Safeway checkout lines
two law practices
Stanford post office
shoeshine shop
examples:
car wash
Wards Berry Farm
roommate network
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
input customers
source
queue
Arrival Process
Queue
service
mechanism
served
customers
Service Process
input customers
source
queue
service
mechanism
served
customers
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
input customers
source
service
mechanism
queue
served
customers
Queue Characteristics:
finite or infinite
queue discipline:
FCFS = first-come-first-served
Priority service order
input customers
source
queue
service
mechanism
served
customers
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
distribution of
interarrival times
M = iid exponential
D = iid and deterministic
Ek = Erlang with shape parameter k
GI = iid with general distribution
M/M /S/
M/M /1/C/
M/M /1/K/K
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
in the system
Pn n
n =0
For general queues, the steady state probabilities Pn can be difficult to compute.
However, if the queue is a continuous time Markov Chain, then Pn= n (if a
steady-state distribution exists).
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
L = LS + LQ
W = WS + WQ
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
L=W
Littles Law
A quick diversion
A few topics I want to weave in before we proceed with Littles Law and
its variations:
The superposition and decomposition of Poisson processes
Poisson arrivals see time averages
Computing steady state-equations: rate in = rate out
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
k =1
p k = 1.
Then the arrivals of customers of type k follow a Poisson process with rate pk.
An example: suppose arriving customers to a system balk with fixed probability
p independent of the number of people in the system. If the arrival process is
Poisson with rate , the arrivals who stay follow a Poisson process with rate
(1-p). The customers who balk do so according to a Poisson process with rate
p.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1/
1/ 1/
1/
1/ 1/
1/
1/ 1/
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i=0
i q ij = 0 for
j= 0 ,...,S
i q ij
i j
1
1
State
= 0
+ 2
= ( 1 + 1 )
...
n
...
n-1
...
n 2
n 1
n 1
n2
+ n
n +1
n +1
= ( n 1 +
n 1
= (
...
n 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
State
= ( + )
...
n
...
n-1
...
n2
n 1
n +1
= ( + )
= ( + )
...
Littles Law
L=W
n 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
number of people in
system at time s. t
1
L = lim N ( s ) d s
t t
0
Q (t )
= lim
t
t
t Q (t )
time in system
i =1
1
1 Q (t )
=
N
s
ds
(
)
I ( Ai s D i )ds
t 0
t 0 i = 1
lim
1
t
1 Q (t )
I ( Ai s D i ) ds
t i = 1 0
1 Q (t )
Q (t ) 1
W i = t Q (t )
t i =1
N ( s ) ds
0
= lim
Q (t ) 1
t Q (t )
Q (t )
W
i =1
Q (t )
W
i =1
L=W
LQ = WQ
MS&E 121
Introduction to Stochastic Processes & Models
By assuming instead that each customer pays $1 per unit time that
they are in service, we have
the average rate at which the system earns = LS
the average amount an entering customer pays = WS
The basic cost identity amounts to:
LS = WS
Handout #25
February 19, 2002
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i = f o r a l l i 0
i = fo r a ll i 1
Define =/. This quantity is typically called the traffic intensity for the M/M/1
queue. We assume henceforth that <1, in which case we know a steady state
distribution exists and is given by:
Pj =
= j ( 1 ) f o r j = 0 ,1 , . . .
j= 0
jPj =
j= 0
= (1 )
j= 0
= (1 )
(1 - )
( - )
(1 - )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
( j 1)P
j = 1
( j 1)
j = 1
j = 1
j = 1
(1
j = 0
=
=
L
(
- )
2
( - )
j = 1
= 1
( )e
t
n=0
( )e
0
( t)
dt
n!
n=0
( t) n
= e t )
n!
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
n =1
n =1
( t)
d t n ( 1- )
(
n 1) !
n =1 a
( ) t ( t) n 1
e
dt
=
n = 1 ( n 1) !
a
=
n 1
WQ is not exponentially
distributed, but the
conditional distribution of
WQ, given that WQ>0, is!
To see this...
( ) t t
e e dt
a
= e ( )a
P (W Q > a | W Q > 0 ) =
P (W Q > a )
P (W Q > 0 )
= e ( )a
It is easy to verify that we get the same result by taking the expected value of W.
Using LQ = WQ we can compute the expected time a customer spends in
the queue:
L Q
L Q
2
1
W Q =
=
=
( )
( )
Verify by taking the expected value of WQ !
The expected time a customer spends in the service is:
W
L S
obvious!
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
5
6
2
=
( - )
1 0 0
=
1 2 (1 2 1 0 )
2 5
6
1
2
minute
/ n
( n )
1 0
1 2 n 1 0
The expected average cost of operation plus passenger delays per hour that
the airline faces when they have n checkpoints open is then
F ( n ) = 100
n +
4 L
= 100
n +
4 ( nL
) = 100
n +
12
40 n
n 10
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1 0 0 n
F ' ( n ) = 1 0 0
F ''(n ) =
4 0 n
1 2 n 1 0
4 0 0
(1 2 n 1 0 )
9 6 0 0
(1 2 n 1 0 )
Clearly the function F(n) is convex, so to find its minimum we need only to set its
derivative equal to zero.
F '(n*) = 0
(1 2 n * 1 0 ) 2 = 4
= 1
Since we must have at least one checkpoint, the optimal number of checkpoints is 1.
.
S-1
(S-1)
S+1
S
S
i = f o r a l l i 0
i = m in { S , i} fo r a ll i 1
Define =/S as the traffic intensity for the M/M/S queue. To ensure the existence
of a steady state distribution, we assume that <1. In this case:
P0 =
K
(1 + K ) 1 fo r j S
j! j
=
j
(1 + K ) 1 fo r j > S
S ! S j S j
j
Pj =
where
= (1 + K ) 1
S 1
i=1
i
i!
S
S !
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
j= S
( j S ) P j = (1 + K ) 1 ( j S )
j= S
= (1 + K )
= (1 + K ) 1
= (1 + K ) 1
i= 0
( ) j
S ! S j S
) i+ S
S !S i
( )S
i i
S!
i=0
( )S
S!
(1 ) 2
Now we can apply Littles law and our other identities to compute:
WQ = LQ /
W = WQ + (1/)
L= W
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i=1
i!
S !
( )S
S!
(1 ) 2
(Recall = S )
WQ = LQ / = LQ / = 0.675/18 = 0.0375
From this and the fact that W = WQ + (1/), we find that the average length
of time a person waits in the register area is W = 0.104 hours, and the average
number of people in the register area is L = W = W = 1.8738.
Since each open checkout line costs Safeway $20 per hour, and each hour that a
customer waits costs $15, the expected average costs per hour are
$20S + $15L = $68.11
WQ = LQ / = LQ / = 0.0879/18 =0.0049
and
The expected average costs per hour in the 3 server case are
$20S + $15L = $79.33
The additional cost of the third checkout line exceeds the benefit of shorter
lines, so two checkout lines is preferable to three. In fact, 2 is the optimal
number of checkout lines. (Why?)
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i =
f o r i = 1 ,2 , . . . , C
Once again we let = /. Since the queue is finite, a steady state distribution
exists regardless of whether <1, and can be derived using Theorem 2 from
CTMCs. If <1, then the steady state distribution is:
1
j f o r j = 0 ,1 , . . . , C
Pj = j =
1 C +1
(The case =1 is left as an exercise for the reader.)
The average arrival rate of entering customers (when <1) is then:
j = 0
C 1
j = 0
(1
1
= 1
1 C +1
PC )
C
1 C
1 C +1
j=0
jPj =
j=0
=
=
1
1 C +1
1
1 C +1
j=0
C
j=0
d
(
d
1
d
1 C +1
d
j=0
1
d 1 C +1
=
C +1
1
d 1
=
( C + 1) C +1
1
1 C +1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
( j 1)P
j = 1
( j 1)
j = 1
j = 1
j = 1
(1
j = 0
= L (1
= 0
j = 1
= 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1 = (1P1) =
=
1 2
F1 = 1
1 C
=
1 C +1
1
0 .0 0 0 2
=
=
0 .0 3
+
1 +
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
(1,0)
.
3
(0,1)
0
( 1, 0 ) 1
( 0 ,1) 2
Q =
2 0
3 0
4 0
( + 1 )
0
0
0
2
0
0
( + 2 )
1
0
0
1+2
( + 1 + 2 )
( 1 + 2 )
0
1+2
0
0
0
( + 1 + 2 )
( 1 + 2 )
0
0
0
0
( 1 +
2 )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1 P( 1 , 0 )
0=
0=
+ 2 P( 0 ,1 )
P0 ( + 1 ) P( 1 , 0 )
P( 1 , 0 )
+ 2 P2
( + 2 ) P( 0 ,1 )
+ 1 P2
+ P( 0 ,1 )
( + 1 + 2 ) P2
+ ( 1 + 2 ) P3
P2 ( + 1 + 2 ) P3 + ( 1 + 2 ) P4
P3 ( 1 + 2 ) P4
0=
0=
1 = P0 + P( 1 , 0 ) + P( 0 ,1 ) + P2 + P3 + P4
Suppose = 2=1 per minute and 1=2 per minute. In this case, solving with Matlab
gives us:
( P0 , P ( 1 , 0 ) , P ( 0 , 1 ) , P 2 , P3 , P4 ) = ( 0 .5 2 9 4 , 0 . 2 1 1 8 , 0 .1 0 5 9 , 0 .1 0 5 9 , 0 . 0 3 5 3 , 0 . 0 1 1 8 )
P ( 1 , 0 ) + P2 + P 3 + P4 = 0 . 3 6 4 7
P( 0 , 1 ) + P2 + P3 + P4 = 0 . 2 5 8 8
(2) What is the average number of customers in service at the Post Office?
L = 0 P0 + 1 ( P( 0 , 1 ) + P ( 0 ,1 ) ) + 2 ( P2 + P 3 + P4 ) = 0 .6 8 2 4
(3) What is the average time a customer spends in service at the Post Office?
= ( P 0 + P ( 0 , 1 ) + P ( 1 , 0 ) + P 2 + P 3 ) = 1 ( 1 P 4 ) = 0 .8 9 4 1
W = L /
= 0 . 6 8 2 4 / 0 .8 9 4 1 = 0 . 7 6 3 2
minutes
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
(1,0)
1
0
2
(0,1)
(1,1)
1
.
(b,1)
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Q = ( 0 ,1) 2
( 1,1)
( b ,1)
1
( + 2 )
( 1 + 2 )
1
2
P ( 0 ,1 ) + P( 1 , 0 ) + 2 ( P ( 1 ,1 ) + P( b ,1 ) )
( P0 + P ( 0 ,1 ) )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Solution:
P( 1 , 0 ) = P0 + 2 P( 1 , 1 )
P0 =
3 P( 0 , 1 ) = P( 1 , 0 ) + 2 P( b , 1 )
P( 0 , 1 ) = 3 P( 1 , 1 )
P( 0 , 1 )
P( 1 , 1 ) = 2 P( b , 1 )
P( b , 1 )
P 0 + P ( 0 , 1 ) + P ( 1 , 0 ) + P( 1 , 1 ) + P ( b , 1 ) = 1
12
16
, P( 1 , 0 ) =
37
37
6
2
=
, P( 1 ,1 ) =
37
37
1
=
37
L =
22
3
28
+ 2(
) =
37
37
37
(3) W
P0 + P( 0 ,1 ) =
28
L
=
( P 0 + P ( 0 ,1 ) )
37
18
37
37
18
14
9
Solution:
2 P( 1 , 0 ) = P0 + P( 1 , 1 )
P0 =
2 P( 0 , 1 ) = 2 P( 1 , 0 ) + P( b , 1 )
P( 0 , 1 ) = 3 P( 1 , 1 )
P( 0 , 1 )
2 P( 1 , 1 ) = P( b , 1 )
P( b , 1 )
P 0 + P ( 0 , 1 ) + P ( 1 , 0 ) + P( 1 , 1 ) + P ( b , 1 ) = 1
3
2
, P( 1 , 0 ) =
11
11
3
1
, P( 1 , 1 ) =
=
11
11
2
=
11
L =
5
3
+ 2(
) = 1
11
11
(3)
W =
6
11
L
11
11
= 1
=
6
6
( P 0 + P ( 0 ,1 ) )
Having the server for the second chair server be faster leads to loss of more potential
customers, but shorter average waits and fewer customers in the shop on average.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Poisson
arrivals
with rate
S servers,
each with
service
times
~exp()
Poisson
departures
with rate
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
=30/hr .
wash
(1 server)
1=60/hr
wax
(1 server)
2=45/hr
(1,0)
(0,1)
(2,0)
1
(1,1)
(3,0)
(2,1)
(3,1)
(0,2)
(1,2)
(2,2)
(3,2)
.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
(0,1)
2
rate out
0,0
( + 1)n1,0
( + 2)0,n2
( + 1 + 2)n1,n2
state
(0,0)
(n1,0); n1>0
(0,n2); n2>0
(n1,n2); n1,n2>0
(1,1)
(0,2)
(2,1)
(2,2)
(3,1)
1
(1,2)
(3,0)
(2,0)
(1,0)
(3,2)
.
(0,0)
=
rate in
20,1
2n1,1 + n1-1,0
20,n2+1 + 11,n2-1
2n1,n2+1 + 1n1+1,n2-1 + n1-1,n2
=
=
=
=
n1 = 0 n 2 = 0
Pn 1 , n 2 =
n1 = 0 n 2 = 0
n1 , n 2
=1
P ( n 1 a t w a sh s ta tio n ) =
1
n1
P ( n 2 a t w a x s ta tio n ) =
1
= 1 n 1 (1 1 )
1
n2
1
= 2n 2 ( 1 2 )
2
Now, if it were true that the number of cars at the wash and wax stations at
any time were independent random variables, then we would know that
Pn1 ,n 2 = P ( n1 at wash station and n 2 at wax station )
= P ( n1 at wash station) P ( n 2 at wax station ) = 1n1 (1 1 ) 2n 2 (1 2 )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
rate out
P0,0
( + 1) Pn1,0
( + 2) P0, n2
( + 1 + 2) Pn1,n2
and
=
=
=
=
n1 = 0 n 2 = 0
=
rate out
2P0,1
2Pn1,1 + Pn1-1,1
2P0,n2 +1 + 1P1,n2 -1
2Pn1,n2 +1 + 1Pn1+1,n2 -1 + Pn1-1,n2
Pn 1 , n 2 = 1
P n 1 , n 2 = 1n 1 ( 1 1 ) 2n 2 ( 1 2 )
is called the product form solution for the steady state distribution of the state
of the queueing network.
What is its significance? It tells us that the numbers of cars at the wash and wax
stations at any given time are, in fact, independent random variables!
This result depends heavily on the fact that the queue in front of each station has
infinite capacity. If not, the numbers of cars at the two stations would not be
independent.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
n1 = 0 n 2 = 0
n1 = 0
n1 = 0
( n 1 + n 2 ) Pn 1 , n 2 =
n 1 1n 1 ( 1 1 )
n1 = 0 n 2 = 0
( n 1 + n 2 ) 1n 1 ( 1 1 ) 2n 2 ( 1 2 )
2n ( 1 2 ) +
2
n2 = 0
n 1 1n 1 ( 1 1 ) +
= (1 1 )
=
n2 = 0
n2 = 0
n 2 2n 2 ( 1 2 ) 1n 1 ( 1 1 )
n1 = 0
n 2 2n 2 ( 1 2 )
1
2
+ (1 2 )
(1 1 ) 2
(1 2 ) 2
1
2
+
1 1
1 2
+
1
2
30
30
=
+
= 3
30
15
=
1
2
1
1
1
=
+
=
h o u r = 6 m in
30
15
10
W =
What made the computation of L and W easy in this example was the product
form solution of the steady state distribution. It turns out that there is a much more
general framework under which a product form solutions are available. These are
called Jackson networks.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
an infinite queue
m
j =1
p ij
2: Berry Weighing
Station
1 server
1 =2/hr
p12=1
a1 =10/hr
p24 =0.6
2 =60/hr
p21=0.1
3: Farmstand
(self-service)
a =30/hr
3 =6/hr
p23 =0.3
p34 =0.9
0.1
4: Cashiers
3 servers
4 =20/hr
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i = a i +
j =1
p ji fo r i = 1, 2 , ... , m
total arrival
external arrival
rate into
rate
into station i
station i
i = a i +
j =1
p ji fo r i = 1, 2 , .. . , m
1 = a 1 +
2 = a 2 +
3 = a 3 +
4 = a 4 +
j=1
m
j=1
m
j=1
m
j=1
j p j 1 = 1 0 + ( 0 .1 ) 2
j p j 2 = 1
j p j 3 = 3 0 + ( 0 .3 ) 2
j p j 4 = ( 0 . 6 ) 2 + ( 0 .9 ) 3
100
9
3 100
100
3 = 3 0 +
=
10 9
3
6 100
9 100
110
4 =
+
=
10 9
10 3
3
1 = 2 =
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
nm customers at station m.
It turns out that if i /sii <1 for each station i=1,2,,m, then, as in the
car wash example, the steady state distribution has a product form
solution:
Product Form Solution for Open Jackson Networks
Pn 1 , n 2 ,..., n m = P ( n 1 a t s t a t i o n 1 , n 2 a t s t a t i o n 2 , . . . n m a t s t a t i o n m )
= P ( n 1 a t s t a t i o n 1 ) P ( n 2 a t s t a t i o n 2 ) P ( n m a t s t a t i o n m )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
( 1
1)
j!
P ( j a t s ta tio n 2 ) = (1 2
(4 4 )
j!
P ( j a t s ta tio n 4 ) =
(4 4 )
3!3 j3
w h ere K =
(4
i= 0
2 )(2
3)
j!
P ( j a t s ta tio n 3 ) =
(3
2 )
(1 + K )
(1 + K )
4 )i
(4 4 )
+
i!
3!
fo r 0 j 3
fo r j 4
1 (4 3 4 )
Pn 1 , n 2 , n 3 , n 4
= P ( n 1 a t s ta tio n 1 ) P ( n 2 a t s ta tio n 2 ) P ( n 3 a t s ta tio n 3 ) P ( n 4 a t s ta tio n 4 )
=
( 1 1 ) n 1 1
e
n1 !
(1 2 2 ) ( 2 2 ) n 2
( 4 4 ) n 4
( 1 + K ) 1 if 0 n 4 3
( 3 3 )
n4 !
3 3
e
n4
n3 !
( 4 4 ) ( 1 + K ) 1 if n 4
4
3 ! 3 n 4 3
This looks cumbersome but is easily evaluated for any particular state vector
(n1, n2, n3, n4). An example is (n1, n2, n3, n4) = (0,0,0,0):
n3
P0 , 0 , 0 , 0 = e
1 1
= e
5 . 556
(1 2 2 ) e
= 1 . 4962
3 3
(1 0 . 185 ) e
10
(1 + K ) 1
5 . 556
(1 + 7 . 11 ) 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
j =1
p ji fo r i = 1, 2 , .. . , m
(4) The steady state probability that there are n1 customers at station 1,
n2 customers at station 2,., nm customers at station m is just
Pn 1 , n 2 ,..., n m = P ( n 1 a t s ta t io n 1 ) P ( n 2 a t s t a t io n 2 ) P ( n m a t s t a t io n m )
= n11 n22 nmm
j =1
p ji fo r i = 1, 2 , .. . , m
i
j
= ( 1 i )( i )
(4) The steady state probability that there are n1 customers at station 1,
n2 customers at station 2,., nm customers at station m is just
Pn 1 , n 2 ,..., n m = n11 n22 nmm = ( 1 1 ) ( 1 ) n 1 ( 1 2 ) ( 2 ) n 2 ( 1 m ) ( m ) n m
=
i=1
(1 i ) ( i ) ni
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
where
L1 =
100/9
1
=
2
1
= 5 . 56
Thus, their average hourly income from the berry field alone is $83.40.
+ L3 + L
L1 =
L
L3
L
= (1 + K
L = L1 + L
3!
+ L3 + L
)3
4
(1
)2
= . 20
where 4 =
4
4
=
3 4
S 4
= 11 . 6
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
where represents the average total external arrival rate to the entire
system, i.e.,
= a1 + a
+ a
+ a
= 10 + 30
= 40
= L / = 11 . 6 / 40 = . 29
an infinite queue
m
j =1
p ij = 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
i =
j =1
i =1
p ji fo r i = 1, 2 , . .. , m
=1
j =1
p ji fo r i = 1,2 , .. . , m ,
i =1
=1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Pn 1 , n 2 ,..., n m
1
n1
if n1 + n 2 + ... n m n
0
n22 nmm
1
j1
j 1 , j 2 ,..., j m 0
j 1 + j 2 + ... + j m = n
2
j2
m
jm
if n1 + n 2 + ... n m = n
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
j =1
1
2
3
1
=
=
=
+
p ji fo r i = 1 , 2 , .. . , m ,
i =1
=1
p12=0.8
2 + ( 0 .6 ) 3
( 0 .8 ) 1 + ( 0 . 4 ) 3
( 0 .2 ) 1
2 + 3 = 1
2
Barbara
(2=2/3)
1
You
(1=1)
p21=1
p13=0.2
p31=.6
p32=.4
3
Joyce
(3=1/2)
22
5
25
, 2 =
, 3 =
52
52
52
1 =
station 1 (you): 1j =
52 52
station 2 (Barbara):
station 3 (Joyce):
3
j
2
j
19 33
=
52 52
42 10
=
52 52
(3) Now we want to compute the steady state probability that each of your
roommates has a Gameboy. This probability is denoted by P 0 , 1 , 1
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Pn 1 , n 2 , n 3
if n1 + n 2 + n 3 2
0
n1 n2 n3
1
j1
j1 , j 2 , j 3 0
j1 + j 2 + j 3 = 2
if n1 + n 2 + n 3 = 2
2
j2
3
j3
1
j1
j1 , j 2 , j 3 0
j1 + j 2 + j 3 = 2
2
j2
3
j3
1
j1
2
j2
3
j3
were using:
27 25 19 42
52 52 52 52
2
27 19 33 42
=
52 52 52 52
2
27 19 42 10
=
52 52 52 52
(2, 0, 0)
21 02 03 =
(0, 2, 0)
01 22 03
(0, 0, 2)
01 02 23
(1, 1, 0)
11 12 03 =
1
2
3
1 0 1 =
1
2
3
0 1 1 =
(1, 0, 1)
(0, 1, 1)
27
52
27
52
27
52
25
52
25
52
19
52
19
52
19
52
33
52
33
52
42
52
42
52
42
52
10
52
10
52
1
j
27 25
=
52 52
2
j
19 33
=
52 52
3
j
42 10
=
52 52
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1
j1
j1 , j 2 , j 3 0
j1 + j 2 + j 3 = 2
2
j2
3
j3
27 25 19
52 52 52
2
27 19 33
=
52 52 52
42
52
42
52
21 02 03 =
01 22 03
27 19 42 10
01 02 23 =
52 52 52 52
11 12 03 =
1
2
3
1 0 1 =
01 12 13 =
+
+
27
52
27
52
27
52
25
52
25
52
19
52
19
52
19
52
33
52
33
52
42
52
42
52
42
52
10
52
10
52
= 0.1824
Pn 1 , n 2 , n 3
if n1 + n 2 + n 3 2
0
n1 n2 n3
1
j1
j1 , j 2 , j 3 0
j1 + j 2 + j 3 = 2
if n 1 + n 2 + n 3 = 2
2
j2
3
j3
The probability that each of your roommates has a Gameboy and you dont is
P 0 ,1 ,1 =
1
0
12 13
1
j1
j1 , j 2 , j 3 0
j1 + j 2 + j 3 = 2
2
j2
3
j3
0 .0 1 8 7
= 0 .1 0 2 5
0 .1 8 2 4
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
M/G/1 queue
M/D/1 queue
M/Ek/1 queue
Nonexponential Service:
The M/G/1 Queue
Poisson input process with rate
single server
arbitrary service time distribution (iid for all customers)
with mean 1/ and variance 2
infinite capacity queue
2
+ 2
2 2 + 2
2 (1 )
if =/<1.
Additional quantities of interest (W, WQ, L , LS) can be derived from LQ and P0.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
LQ
LQ
2 2 + 2
( 0 .5 ) 2 ( 0 .7 5 ) + ( 0 .7 5 ) 2
=
= 3 m in u te s
2 (1 )
2 ( 0 .5 )( 0 .2 5 )
2 2 + 2
+
2 (1 )
( 0 .5 ) 2 ( 0 .7 5 ) + ( 0 .7 5 ) 2
+ ( 0 .7 5 ) = 2 .2 5 c a rs
2 ( 0 .2 5 )
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Nonexponential Service:
The M/D/1 Queue
2 (1 )
2
2 (1 )
where =/
LQ
so
LQ
( 0 .5 ) 2 ( 0 .7 5 ) + ( 0 .7 5 ) 2
2 2 + 2
=
= 3 m in u te s
2 (1 )
2 ( 0 .5 ) ( 0 .2 5 )
W = W Q + W S = 3 + 1 .5 = 4 .5 m in u te s
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
LQ
LQ
2
( .7 7 5 ) 2
=
= 2 .6 6 9 4 m i n u t e s
2 (1 )
2 ( 0 .5 ) ( . 2 2 5 )
W = W Q + W S = 2 .6 6 9 4 + 1 .5 5 = 4 .2 1 9 4 m i n u t e s
Although Anns average service time is faster, Jims consistency leads to shorter
waits.
Nonexponential Service:
The M/Ek/1 Queue
Now we consider another special case of the M/G/1 queue, namely the
M/ Ek/1 queue. The notation Ek stands for the Erlang distribution with shape
parameter k. To motivate this type of queue, we first mention some important
facts about the Erlang distribution.
The Erlang Distribution
A random variable X having an Erlang distribution with parameters (,
k) has probability density function
f (x) =
( k ) k x k 1e
( k 1) !
E ( X ) =
k x
fo r
V ar( X ) =
x 0
1
k
The Erlang (,k) random variable is also called a Gamma (k,k) random
variable.
Note: if k = 1, then X is exponentially distributed with parameter
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
Nonexponential Service:
The M/Ek/1 Queue
2 / k 2 + 2
2 (( 1 / k ) + 1)
=
2 (1 )
2 (1 )
2 (( 1 / k ) + 1 )
2 (1 )
if =/<1.
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
2 (( 1 / n ) + 1 )
( 7 / 2 0 ) 2 (( 1 / 7 ) + 1 )
7
=
=
2 (1 )
2 (1 3 / 2 0 )
65
We also know
L S = 1 ( 1 P0 ) = =
7
20
20
260
65
= 2 7 .4 6 m in u te s = 0 .4 5 7 7 h o u rs
MS&E 121
Introduction to Stochastic Processes & Models
Handout #25
February 19, 2002
1 P0 = =
3n
n
=
=
0 .1
60
20
n 2