Slide set 22 Stat 330 (Spring 2015) Last update: March 22, 2015

advertisement
Slide set 22
Stat 330 (Spring 2015)
Last update: March 22, 2015
Stat 330 (Spring 2015): slide set 22
The M/M/1 Queue: Example
Printer Queue (continued) A certain printer in the Stat Lab gets jobs with
a rate of 3 per hour. On average, the printer needs 15 min to finish a job.
Let X(t) be the number of jobs in the printer and its queue at time t. We
know already: X(t) is a Birth & Death Process with constant arrival rate
λ = 3 and constant death rate µ = 4.
The properties of interest for this printer system then are:
L
Ws
0.75
a
=
=3
1−a
0.25
=
E[X(t)] =
=
1
= 0.25 hours = 15 min
µ
W
=
Wq
=
L
3
= = 1 hour
λ
3
W − Ws = 0.75 hours = 45 minutes
Lq
=
Wq λq = 0.75 · 3 = 2.25
1
Stat 330 (Spring 2015): slide set 22
The M/M/1 Queue: Example (cont’d)
On average, a job has to spend 45 min in the queue. What is the probability
that a job has to spend less than 20 min in the queue?
We denoted the waiting time in the queue by q(t).
q(t) has the cumulative distribution function 1 − aey(µ−λ).
The probability asked for is
P (q(t) < 2/6) = 1 − 0.75 · e−20/60·(1/1) = 0.4626.
2
Stat 330 (Spring 2015): slide set 22
The M/M/1/K queue
An M/M/1 queue with limited size K is a lot more realistic than the one
with infinite queue.
Unfortunately, it’s computationally slightly harder to deal with.
X(t) is modelled as a Birth & Death Process with states {0, 1, ..., K}.
Its state diagram looks like:
Since X(t) has only a finite number of states, it’s a stable process
independently from the values of λ and µ.
3
Stat 330 (Spring 2015): slide set 22
The M/M/1/K queue (cont’d)
The steady state probabilities pk are:
pk
= = ak p0
p0 = S −1 =
where a =
λ
µ,
1−a
1 − aK+1
2
K
the traffic intensity and S = 1 + a + a + ... + a
=
1−aK+1
1−a .
The expected number of individuals in the system L then is:
L = E[X(t)] = 0 · p0 + 1 · p1 + 2 · p2 + ... + K · pK
=
K
X
k=0
kpk =
K
X
k=0
a
(K + 1)aK+1
ka · p0 = ... =
−
1−a
1 − aK+1
k
4
Stat 330 (Spring 2015): slide set 22
The M/M/1/K queue (cont’d)
Another interesting property of a queuing system with limited size is the
number of individuals that get turned away.
From a marketing perspective they are the ”expensive” ones - they are most
likely annoyed and less inclined to return.
It’s therefore a good strategy to try and minimize this number.
Since an incoming individual is turned away, when the system is full, the
probability for being turned away is pK .
The rate of individuals being turned away therefore is pK · λ.
For the expected total waiting time W , we used Little’s theorem:
L
W =
λ̄
where λ̄ is the average arrival rate into the system.
5
Stat 330 (Spring 2015): slide set 22
The M/M/1/K queue (cont’d)
At this point we have to be careful when dealing with limited systems: λ̄ is
NOT equal to the arrival rate λ.
We have to adjust λ by the rate of individuals who are turned away.
The adjusted rate λa of individuals entering the system is:
λa = λ − pK λ = (1 − pK )λ.
Theerefore, the expected total waiting time is then W = L/λa
Similarly, the expected length of the queue is Lq = Wq · λa.
6
Stat 330 (Spring 2015): slide set 22
Example
Convenience Store: In a small convenience store there’s room for only
4 customers. The owner himself deals with all the customers - he likes
chatting a bit. On average it takes a customer 4 minutes to pay for his/her
purchase. Customers arrive at an average of 1 per 5 minutes. If a customer
finds the shop full, he/she will go away immediately.
1. What fraction of time will the owner be in the shop on his own?
The number of customers in the shop can be modeled as a B & D
Process with arrival rate λ = 0.2 per minute and µ = 0.25 per minute
and upper size K = 4.
The probability (or fraction of time) that the owner will be alone is
0.2
1−a
p0 = 1−a
K+1 = 1−0.85 = 0.2975.
7
Stat 330 (Spring 2015): slide set 22
Example (cont’d)
2. What is the expected number of customers in the store?
(K + 1)aK+1
a
−
= 1.56.
L=
K+1
1−a
1−a
3. What is the rate of individuals being turned away?
p4λ = 0.84·0.2975·0.2 per minute = 0.0243 per minute = 1.46 per hour
4. What is the expected time a customer has to spend for check-out?
W =
L
= 1.56/(0.2 − 0.0243) = 8.88 minutes .
λa
8
Download