You are on page 1of 71

Lecture Day 14

Queuing Models

Single-Server Model
with Arbitrary Service Times
Used when the analyst has determined
that arrivals to the system are Poissondistributed but cannot accept the
hypothesis that service times are
distributed.
exponentially
The assumptions
of this model
are:
Poisson arrival process
Infinite calling population
Infinite queue
FCFS service discipline
Single server
The distribution of service time is
unknown, but it has a mean, 1/, and
a variance, 2. These parameters are
known.

Single-Server Model
with Arbitrary Service Times
Statistics to be determined:
Expected number of calling units in the
queue:L = (22 + 2) / [2 (1 )]
q

The proportion of time the server is busy:

= /

Expected number of calling units in the


system:
Ls = + Lq

Single-Server Model
with Arbitrary Service Times
Statistics to be determined
(cont.):
Expected time waiting in line:
Wq = Lq /

Expected time in the system:


Ws = Wq + (1/)

The probability of 0 calling units in the


system:
P(0) = 1 -

In this model, as 2 increases, Lq, Ls, Wq,


and Ws would also increase. This means
that the performance of the queuing
system is not solely dependent on mean
service time but on the variance in service
time
as well.
Consequently,
a server with a longer
mean service time may still be the
more productive if it is also the more
consistent.

Example:
A savings and loan association is
opening a branch in a nearby suburb. This
branch is expected to need savings
counselors, but management wants to have
descriptive queuing statistics to confirm an
intuition that only one savings counselor is
actually necessary. Plans are to transfer one
savings counselor from the main office. Data
concerning this particular counselors time
spent with a customer have been collected,
but goodness-of-fit tests indicate that these
service times are not exponentially
distributed. It is further estimated that the
mean service time is 1/4 hour and variance is
1/6 hour2. Customers are expected to arrive in
a Poisson manner at a rate of two per hour.

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2

Single-Server Model
with Arbitrary Service Times
Statistics to be determined:
Expected number of calling units in the
queue:L = (22 + 2) / [2 (1 )]
q

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
Lq = (22 + 2) / [2 (1 )]

Single-Server Model
with Arbitrary Service Times
Statistics to be determined:
Expected number of calling units in the
queue:L = (22 + 2) / [2 (1 )]
q

The proportion of time the server is busy:

= /

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
Lq = (22 + 2) / [2 (1 )]

= /
= 2/4
= 1/2

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
= 1/2
Lq = (22 + 2) / [2 (1 )]
= (22) (1/6) + (1/2)2
2 (1 1/2)
= (4) (1/6) + (0.25)
2 (1/2)
= 0.916
1
= 0.916 customer

Single-Server Model
with Arbitrary Service Times
Statistics to be determined:
Expected number of calling units in the
queue:L = (22 + 2) / [2 (1 )]
q

The proportion of time the server is busy:

= /

Expected number of calling units in the


system:
Ls = + Lq

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
= 1/2
Lq = 0.916 customer
Ls = + Lq
= (1/2) +
0.916
= 1.416 customers

Single-Server Model
with Arbitrary Service Times
Statistics to be determined
(cont.):
Expected time waiting in line:
Wq = Lq /

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
= 1/2
Lq = 0.916 customer
Ls = 1.416
customers
W
=L /
q

= 0.916 / 2
= 0.453 hr.
= 27.5 min.

Single-Server Model
with Arbitrary Service Times
Statistics to be determined
(cont.):
Expected time waiting in line:
Wq = Lq /

Expected time in the system:


Ws = Wq + (1/)

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
= 1/2
Lq = 0.916 customer
Ls = 1.416
customers
W
= 27.5 min.
q
Ws = Wq + (1/)
= 0.453 + (1/4)
= 0.703 hr.
= 42.2 min.

Single-Server Model
with Arbitrary Service Times
Statistics to be determined
(cont.):
Expected time waiting in line:
Wq = Lq /

Expected time in the system:


Ws = Wq + (1/)

The probability of 0 calling units in the


system:
P(0) = 1 -

= 2 customers/hr.
= 4 customers/hr.
2= 1/6 hr.2
= 1/2
Lq = 0.916 customer
Ls = 1.416
customers
W
= 27.5 min.
q
Ws = Wq + (1/)
= 0.453 + (1/4)
= 0.703 hr.
= 42.2 min.

P(0) = 1 -
= 1 1/2
= 1/2
= 50%

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
The assumptions of this model
are:
Poisson arrival process
Infinite calling population
Infinite queue
The queue discipline divides calling units
into classes, and service is FCFS within
each priority class.
Single server
The service time distribution for each
priority class is unknown, but the mean
service time and variance are known for
each priority class.

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline

This model might be used to evaluate


the desirability of a priority queue
discipline as opposed to a FCFS queue
discipline.

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined:
The expected waiting time for a calling
unit in priority class k :
m

Wqk =

i [(1/i)2 + i2]

i=1

2(1 Sk-1) (1 Sk)

where:
i = arrival rate of priority class i
i = service rate of priority class i
i2= variance in service time of priority
class i

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
k

Sk =

i < 1, k = 1, 2, , m

i=1

S0 = 0

m = number of priority classes

The proportion of time the server is busy


in priority class k:
k = k / k

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected number of calling units in the
queue for priority class k:
Lqk = kWqk

Expected number of calling units in the


system for priority class k:
Lsk = Lqk + k

Expected waiting time in the system for


priority class k:
Wsk = Wqk + (1/k)

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected waiting time for any customer:
m

Wq

(k/) Wqk where =

k=1

k=1

Expected time spent in the system for any


customer:m
Ws
= (k/) Wsk
k=1

Example:
Jobs to be run on a computer system
are
of two types and hence two different
priorities. Only one job can run at one
time. Both types of jobs arrive according to
a Poisson process, but service time
distributions are normal, with means of 1/12
hour and 1/4 hour. Variances for the two
priority classes are 1/12 (hour)2 and 1/24
(hour)2, respectively. Type I jobs arrive at a
rate of three per hour, and type II jobs arrive
at a rate of two per hour. What are the
applicable queuing statistics?

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined:
The expected waiting time for a calling
unit in priority class k :
m

Wqk =

i [(1/i)2 + i2]

i=1

2(1 Sk-1) (1 Sk)

where:
i = arrival rate of priority class i
i = service rate of priority class i
i2= variance in service time of priority
class i

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
k

Sk =

i < 1, k = 1, 2, , m

i=1

S0 = 0

m = number of priority classes

The proportion of time the server is busy


in priority class k:
k = k / k

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
k = k / k
1 = 1 / 1
2 = 2 / 2
= 3/12
= 2/4
= 1/4
= 1/2

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
k

Sk =

i < 1, k = 1, 2, , m

i=1

S0 = 0

m = number of priority classes

The proportion of time the server is busy


in priority class k:
k = k / k

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
k

Sk =
1

S1 =

i=1

i=1

= 1/4

S2 =

i=1
1

= + 2
= 1/4 + 1/2
= 3/4

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined:
The expected waiting time for a calling
unit in priority class k :
m

Wqk =

i [(1/i)2 + i2]

i=1

2(1 Sk-1) (1 Sk)

where:
i = arrival rate of priority class i
i = service rate of priority class i
i2= variance in service time of priority
class i

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
m

Wqk =

i [(1/i)2 + 2i]

i=1

2(1 Sk-1) (1 Sk)

Wq1 =

i [(1/i)2 + 2i]

i=1

2(1 S1-1) (1 S1)

= {1 [(1/1)2 +
+ {2 [(1/2)2 + 22]}
21]}
2 (1 S0) (1 S1)
= {3 [(1/12)2 +
+ {2 [(1/4)2 + (1/24)]}
(1/12)]}
2 (1 0) (1 1/4)

Wqk =

i [(1/i)2 + 2i]

i=1

2(1 Sk-1) (1 Sk)

Wq1 =

i [(1/i)2 + 2i]

i=1

2(1 S1-1) (1 S1)

= {1 [(1/1)2 +
+ {2 [(1/2)2 + 22]}
21]}
2 (1 S0) (1 S1)
= {3 [(1/12)2 +
+ {2 [(1/4)2 + (1/24)]}
(1/12)]}
2 (1 0) (1 1/4)
= (3)(0.09027) + (2)
(0.10416) 2 (1) (3/4)
= 0.47916
1.5
= 0.3194 hr.
= 19.17 min.

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
0.3194m
Wqk =

i [(1/i)2 + 2i]

i=1

2(1 Sk-1) (1 Sk)

Wq2 =

i [(1/i)2 + 2i]

i=1

2(1 S2-1) (1 S2)

Wqk =

i [(1/i)2 + 2i]

i=1

2(1 Sk-1) (1 Sk)

Wq1 =

i [(1/i)2 + 2i]

i=1

2(1 S1-1) (1 S1)

= {1 [(1/1)2 +
+ {2 [(1/2)2 + 22]}
21]}
2 (1 S0) (1 S1)
= {3 [(1/12)2 +
+ {2 [(1/4)2 + (1/24)]}
(1/12)]}
2 (1 0) (1 1/4)
= (3)(0.09027) + (2)
(0.10416) 2 (1) (3/4)
= 0.47916
1.5
= 0.3194 hr.
= 19.17 min.

Type I (m = 2) Type II
2
1 = 3 jobs/hr. 2 = 2 jobs/hr. Wq2 = i [(1/i)2 + 2i]
i=1
1=12 jobs/hr. 2=4 jobs/hr.
2(1 S2-1) (1 S2)
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
=
0.47916
S1= 1/4
S2 = 3/4
2 (1 1/4) (1 3/4)
Wq1 =
= 0.47916
0.3194
2 (3/4) (1/4)
= 0.47916
0.375
= 1.27 hrs.
= 1 hr. & 16.67
mins.

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected number of calling units in the
queue for priority class k:
Lqk = kWqk

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
Wq2 = 1.27
0.3194
Lqk = kWqk
Lq1 = 1Wq1
= (3) (0.3194)
= 0.9583
job

Lq2 = 2Wq2
= (2) (1.27)
= 2.5 jobs

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected number of calling units in the
queue for priority class k:
Lqk = kWqk

Expected number of calling units in the


system for priority class k:
Lsk = Lqk + k

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
Wq2 = 1.27
0.3194
Lq1 = 0.9583 Lq2 = 2.5
Lsk = Lqk + k
Ls1 = Lq1 + 1
Ls2 = Lq2 + 2
= 0.9583 + (1/4)
= 2.5 + (1/2)
= 1.2083 jobs
= 3.05 jobs

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected number of calling units in the
queue for priority class k:
Lqk = kWqk

Expected number of calling units in the


system for priority class k:
Lsk = Lqk + k

Expected waiting time in the system for


priority class k:
Wsk = Wqk + (1/k)

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
Wq2 = 1.27
0.3194
Lq1 = 0.9583 Lq2 = 2.5
Ls1 = 1.2083
Ls2 = 3.05
Wsk = Wqk + (1/k)
Ws1 = Wq1 + (1/1)
Ws2 = Wq2 + (1/2)
= 0.3194 + (1/12)
= 1.27 + (1/4)
= 0.4027 hr.
= 1.527 hrs.
= 24.17 mins.
= 1 hr. & 31.66

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected waiting time for any customer:
m

Wq

(k/) Wqk where =

k=1

k=1

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
Wq2 = 1.27
0.3194
Lq1 = 0.9583 Lq2 = 2.5
Ls1 = 1.2083
Ls2 = 3.05
Ws1 =
Ws2 = 1.527
0.4027

=
k k = 1

=
k k = 1

= 1 + 2
=3+2
=5

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected waiting time for any customer:
m

Wq

(k/) Wqk where =

k=1

k=1

Type I (m = 2) Type II
1 = 3 jobs/hr. 2 = 2 jobs/hr.
1=12 jobs/hr. 2=4 jobs/hr.
21=1/12 hr.2 22=1/24 hr.2
1 = 1/4
2 = 1/2
S1= 1/4
S2 = 3/4
Wq1 =
Wq2 = 1.27
0.3194
Lq1 = 0.9583 Lq2 = 2.5
Ls1 = 1.2083
Ls2 = 3.05
Ws1 =
Ws2 = 1.527
0.4027
=5

Wq =

(k/) Wqk

k=1
2

(k/) Wqk

k=1

= (1/)Wq1 +
(2/)Wq2
= (3/5)
(0.3194)
+ (2/5)(1.27)
= 0.7027 hr.
= 42.17 mins.

Single-Server Model with Arbitrary Service


Times and a Priority Queue Discipline
Statistics to be determined
(cont.):
Expected waiting time for any customer:
m

Wq

(k/) Wqk where =

k=1

k=1

Expected time spent in the system for any


customer:m
Ws
= (k/) Wsk
k=1

Type I (m = 2) Type II
m
1 = 3 jobs/hr. 2 = 2 jobs/hr. Ws = (k/) Wsk
1=12 jobs/hr. 2=4 jobs/hr.
k=1
2
21=1/12 hr.2 22=1/24 hr.2
k
=

(
/)
W
k
s
1 = 1/4
2 = 1/2
k=1
S1= 1/4
S2 = 3/4
1
2
=
(
/)W
+
(
/)W
1
s
2
s
Wq1 =
Wq2 = 1.27
= (3/5)
1
2
0.3194
Lq = 0.9583 Lq = 2.5
(0.4027)
+ (2/5)
1
2
Ls = 1.2083
Ls = 3.05
(1.527)
=
0.8527 hr.
1
2
Ws =
Ws = 1.527
= 51.17 mins.
0.4027
=5
Wq = 0.7027 hr. or 42.17 mins.

Single-Server Model with a Finite Queue

If queue length is limited either by


customer attitude or the physical
facilities, it is not desirable to use any
of the earlier models.

The assumptions of this model are


identical to the basic single-server
model except that the assumption of
an infinite queue capacity no longer
applies.

Single-Server Model with a Finite Queue


Statistics to be determined:
The probability of 0 calling units in the
system: P(0) = 1 (/)
1 - (/)M+1
where M = maximum number of calling
units allowed in the system and the
maximum queue length is M 1.

The probability of n calling units in the


system:
P(n) = P(0) (/)n for n = 0, 1, ,
M

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
Expected number of calling units in the
queue:
Lq = Ls + P(0) 1
Expected time waiting in line:
Wq =

Lq

[1 P(M)]
Expected time in the system:
Ws = Wq + (1/)

Example:
A basic programming course includes
a lab at which a student consultant is on
duty to help students debug their programs.
It can be assumed that no student will get in
line for help if there are three other students
waiting. Students arrive at the lab according
to a Poisson process at an average rate of
four per hour. Service times are
exponential, and the mean service time is
10 minutes. Because the class is large, an
infinite calling population can be assumed.
What are the applicable queuing statistics?

= 4
students/hr.
= 10
min./student
= 6 students/hr.

Single-Server Model with a Finite Queue


Statistics to be determined:
The probability of 0 calling units in the
system: P(0) = 1 (/)
1 - (/)M+1
where M = maximum number of calling
units allowed in the system and the
maximum queue length is M 1.

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =

1 (/)

1 - (/)M+1
= 1 (4/6)
1 - (4/6)4+1
=
2/6
=

1 - (4/6)5
0.33

0.86831276
= 0.38388625
= 38.39%

Single-Server Model with a Finite Queue


Statistics to be determined:
The probability of 0 calling units in the
system: P(0) = 1 (/)
1 - (/)M+1
where M = maximum number of calling
units allowed in the system and the
maximum queue length is M 1.

The probability of n calling units in the


system:
P(n) = P(0) (/)n for n = 0, 1, ,
M

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
Expected number of calling units in the
queue:
Lq = Ls + P(0) 1
Expected time waiting in line:
Wq =

Lq

[1 P(M)]
Expected time in the system:
Ws = Wq + (1/)

Single-Server Model with a Finite Queue


Statistics to be determined:
The probability of 0 calling units in the
system: P(0) = 1 (/)
1 - (/)M+1
where M = maximum number of calling
units allowed in the system and the
maximum queue length is M 1.

The probability of n calling units in the


system:
P(n) = P(0) (/)n for n = 0, 1, ,
M

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =
0.38388625
P(n) = P(0) (/)n
P(4) = P(0) (4/6)4
= 0.38388625 (0.19753086)
=
0.07582938
= 7.58%

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =
0.38388625
P(4) =
0.07582938
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
=
4/6
- (4 + 1)(4/6)4+1
1 (4/6)
1 - (4/6)4+1
=
0.66
- (5)
(0.13168724)
0.33
0.8683127
5
= 1.24170617
students

Ls =

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
Expected number of calling units in the
queue:
Lq = Ls + P(0) 1

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =
0.38388625
P(4) =
L0.07582938
= 1.24170617
s
students
Lq = Ls + P(0) 1
= 1.24170617 + 0.38388625
10.62559242
=
student

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
Expected number of calling units in the
queue:
Lq = Ls + P(0) 1
Expected time waiting in line:
Wq =

Lq
[1 P(M)]

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =
0.38388625
P(4) =
L0.07582938
= 1.24170617
s
students
Lq = 0.62559242
student

Wq =

Lq

[1 P(M)]
=
0.62559242
4[1 0.07582938)]
= 0.62559242
3.69668248
= 0.16923077
hr.10.15
=

Single-Server Model with a Finite Queue


Statistics to be determined
(cont.):
Expected number of calling units in the
system:
Ls =
/
- (M + 1)(/)M+1
1 (/)1 - (/)M+1
Expected number of calling units in the
queue:
Lq = Ls + P(0) 1
Expected time waiting in line:
Wq =

Lq

[1 P(M)]
Expected time in the system:
Ws = Wq + (1/)

= 4
students/hr.
= 10
min./student
= 6 students/hr.
M = 4 students
P(0) =
0.38388625
P(4) =
L0.07582938
= 1.24170617
s
students
Lq = 0.62559242
Wstudent
q = 0.16923077
hr. = 10.15
minutes

Ws = Wq + (1/)
= 0.16923077 +
(1/6)
= 0.16923077 +
(0.16)
= 0.33589744 hr.
= 20.15 minutes

End of Lecture Day


14