You are on page 1of 61

Ch 07: M/M/m

ELEXM 621 Random Process and Queuing


Theorem
Assoc. Prof. Dr. Rashid A. Saeed
MSC Comp and Comm
Elex, FoE, SUST,
Project

Design a M/M/1 using


Matlab by GUI utility?

2
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Contents

3
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Discrete-time Markov chain for the
M/M/1 system

M/M/1
‫مراجعة‬

m Process and Queuing Theory


Dr. Rashid A. Saeed By taking the limit in this equation as δ 0, we obtain 4
M/M/1 System

m Process and Queuing Theory


Dr. Rashid A. Saeed 5
Global balance equations

m Process and Queuing Theory


Dr. Rashid A. Saeed 6
M/ M/ m: The m-Server Case
 The M / M / m queueing system is identical to the M / M / I
system except that there are m servers
 A customer at the head of the queue is routed to any server
that is available.

7
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Proof

9
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
P{Queuing}
 The probability that an arrival will find all servers busy and
will be forced to wait in queue is an important measure of
performance of the M /M /m system.

10
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Example 1
 The Erlang-C calculations are described step by step below,
using and example of 360 calls per half hour, with an average
call duration of 4 minutes, and 55 agents. The target answer
time for service level is 15 seconds.

11
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
12
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Average No. of packets in the
buffer
 The expected number of customers waiting in queue (not in
service) is given by

Calculate the NQ for Example 1

13
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
average time W a customer
has to wait in queue:

14
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Calculate the T for Example 1

Calculate service level: Frequently we want to calculate the


probability that a call will be answered in less than a target
waiting time (15 Sec).
15
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Calculate the T for Example 1

16
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/m Example 2

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.
1. Find P0
2. Find the probability that all servers are busy

17
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/s Example (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 m > l / m =
4/3. Thus, at least m = 2 attendants are needed. The
quantity 4/3 is the expected number of busy server, and
for m  2, r = 4 / (3m) is the long-run proportion of
time each server is busy. (What would happen if there
were only m = 1 server?)

18
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/m Example (cont.)
Let there be m = 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(Q) = {(4/3)2 (1/5)} / {2!(1- 2/3)}
= (8/3) (1/5) = 0.533
19
ELEXM 621 Random Process and Queuing Theory
M/M/s Case Example II
Example:
M/M/2 ; m = 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

r  l /mm  {1/10} / {21/8 }  0.4


1. Find P0, PQ, NQ ,W,
20
2. What proportion of time is both repairman busy? (long run)
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/s Case Example II (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)

(l / m ) m r
N Q  P0
m! (1  r ) 2
 0.429  {0.82  0.4} /{2!(1  0.4) 2 }
21
 0.152
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/s Case Example II (cont.)

W= NQ / l = 0.152 / (1/10) = 1.52 (min)


T = W + 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
Which is same of PQ

22
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
23
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
24
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
25
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Proof

26
27
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
28
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
29
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
30
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
m

31
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
32
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/N (cont.)
1. Form Balance Equations:
2. Solve for P0:
N


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 - r) / (1 - rN+1)

33
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Home Work

Draw Erlang B and C


graphs using Matlab

34
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Exercise 1
 A 7 cell cluster (with N= 7) has 28 MHz allocated to it for
forward channels and each channel is 200 kHz. Assume blocked-
called-delayed and a probability of delay of 1%, and each user
makes one10 minute call every 3 hours. (a) What is the number
of users that can be supported? (b) What is P[delay>10]
seconds? (c) What if it was a blocked-calls-cleared system with
QOS of 1%?

35
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Exercise 2
 In a certain cellular system, an average
subscriber places two calls per hour during
a busy hour and the average holding time is
3 min. Each cell has 100 channels. If the
blocked calls are cleared, how many
subscribers can be serviced by each cell at 2
% GoS?

36
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Exercise 3
 How many users can be supported for 0.5%
blocking probability for the following
number of trunked channels in a blocked
calls cleared system? (a) 5, (b) 10. Assumed
that each user generates 0.5 Erlangs of
traffic.

37
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
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

38
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/N (cont.)
So,  1  r  n, for n = 0, 1, 2, ..., N
Pn   N 1 
r
1  r 
Hence,
N
L   nPn
n 0 
L   n (1  r)r n
1 r N d
r r
n 0
 N 1

n 
d n d   n
 (1  r)r r  (1  r)r   r 
1 r n  0 dr n  0 dr dr  n 0 
d 1 1
1 r d N  (1  r)r  (1  r)r
 r  r n dr (1  r) (1  r) 2
1  r N 1 dr n 0  r (1  r)
or
39  l (m  l)
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/N (cont.)

1 r d 1  r N1 
L N 1
r  
1 r dr  1  r 
N 1
 ( N  1)r  Nr  1
N
r
(1  r N 1 )(1  r)
r ( N  1)r N 1
  N 1
(1  r) (1  r )

40
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/N (cont.)

As usual (when m = 1) System busy


Lq = L - (1- P0)
W = L / le , where le = l (1 - PN)
Wq = Lq / le

41
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
 1 r  n
M/M/1/3 Example Pn   N 1 
r
1  r 

The unisex barbershop can hold only three customers, one


in service and two waiting. Additional customers are
turned away when the system is full. Known that Arrival
rate is 2 and departure rate is 3?
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
42
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
r ( N  1) r N 1
L 
M/M/1/3 Example (cont.) (1  r ) (1  r N 1 )

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)
43
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/3 Example (cont.)

In order to calculate Lq, first determine P0 as


P0 = (1 - r) / (1 - rN+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)

44
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/3 Example (cont.)

Finally, the waiting time in the queue is determined by


Little’s equation as
Wq = Lq / le = 0.43 / 1.754 = 0.245 (hour)

45
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
M/M/1/3 Example (cont.)

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


N
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  1 r  n
Pn   N 1 
r
1 Dr.rRashid A. Saeed

47
ELEXM 621 Random Process and Queuing Theory
M/M/1/3 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.

48
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
49
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
50
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
51
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
52
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
53
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
54
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
55
56
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Multidimensional Markov chains usually
involve K customer types.

57
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
58
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
59
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
60
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
61
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
62
ELEXM 621 Random Process and Queuing Theory Dr. Rashid A. Saeed
Thank You

63
ELEXM 621 Random Process and Queuing Theory
Dr. Rashid A. Saeed

You might also like