Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Queuing Theory

Maris Buikis, RTU (LV)


Any system that has units or customers, waiting for service is a

waiting line or queuing system.

To describe a queuing system , an input process and an output process must


be specified.

Example 1. Bank. Customers arrive at bank. Tellers serve the


customers

Example 2. Pizza parlor. Requests for pizza delivery are received. Pizza
parlor sends out truck to deliver pizzas.

Example 3. Naval shipyard. Ships at sea break down and are sent to
shipyard for repairs. Ships are repaired and return to sea.

The Input or Arrival Process

All objects that wait in lines to be served, loaded, checked out, or unloaded
is called as arrivals, or customers.

The input process is called the arrival process.

The units in the queues may be things rather than people.

We assume that no more than one arrival can occur at a given instant. For a
case like a restaurant, this is a very unrealistic assumption. If more than one
arrival can occur at a given instant, we say that bulk arrivals are allowed.

We assume that the arrival process is unaffected by the number of customers


present in the system. In the context of a bank, this would imply that
whether there are 500 or 5 people at a bank, the process governing arrivals
remains unchanged.
In some situation arrival process may depend on the number of customer.
There are two common situations in which the arrivals may depend on the
number of customers present. The first occurs when arrivals are drawn from
a small population. Suppose that there are only four ships in a naval
shipyard. If all four ships are being repaired, then no ship can break down in
the near future. On the other hand, if all four ships are at sea, a breakdown
has a relatively high probability of occurring in the near future. Models in
which arrivals are drawn from a small population are called finite source
models.
Another situation in which the arrival process depends on the number of
customers present occurs when the rate at which customers arrive at the
facility decreases when the facility becomes too crowed. For example, if you
see that the bank parking lot is full, you might pass by and come another
day. If a customer arrives but fails to enter the system, we say that the
customer has balked.
If the arrival process is unaffected by the number of customers present, we
usually describe it by specifying a probability distribution that governs the
time between successive arrivals.

The Output or Service Process

The individuals or machines that perform the service for which the arrivals
are waiting are reffered to as servers.

The place where the service takes place is the service facility.

The service time distribution - governs a customer’s service time.

Two arrangements of servers: servers in parallel and servers in series.

Queuing system configurations:

- Single channel, single server;


- Single channel, multiservers;
- Parallel multichannel, multiserver;
- Multichannel, single server;
- Sequential (multistage).
Queue Discipline

The Queue Discipline describes the method used to determine the order
in which customers are served.

The most common queue discipline is the FCFS discipline (FIFO) – first
come, first served.

LCFS discipline – last come, first served.

SIRO discipline – service in random order.

Priority queuing disciplines – classifies each arrival into one of several


categories. Each category is then given a priority level.

Queuing Problems

We concentrate primarily on the economic aspects of queues on the various


methods used for the solution of queuing problems like the following:

1. What fraction of the time is each server idle?

2. What is expected number of customers present in the queue?

3. What is the expected time that a customer spends in the queue?

4. What is probability distribution of the number of customers present in


the queue?

5. What is the probability distribution of a customer’s waiting time?


6. If a bank manager wants to ensure that only 1% of all customers will
have to wait more than 5 minutes for a teller, how many tellers
should be employed?
Models of queuing systems

Arrival rate – number of customers per time period.

Arrival time – the number of time units between arrivals.

Constant arrivals and service

The simplest queuing system is the single – channel system with constant
arrival and service.

When the arrival rate is greater than service rate, a waiting line will form.
When the arrival and service rates are constant and the arrival rate is greater,
the waiting line will continue to increase in length until either:
(1) the service rate increases (perhaps by the addition of another server),
or
(2) the arrival rate decreases (as customers, seeing the long line, turn
away)

Poisson arrivals and exponential service times

In order to discuss more complex queuing system, we must specify the


arrival and service paterns. Unless arrivals have been scheduled, it is
convient to assume that they are random. We assume that at most one arrival
can occur at a given instant of time.
We define ti to be the time at which the i th customer arrives. For i ≥ 1 , we
define Ti = ti +1 − ti to be the i th interarrival time.
We assume that the Ti ’s are independent, continuous random variables
described by the random variable A.
In most applications of queuing, an important question is how to chose A to
reflect reality and still be computationally tractable.
The most common choice for A is the exponential distribution.

An exponential distribution with parameter λ has a density

f (t ) = λ e − λt , t ≥ 0.
We define λ to be the arrival rate, which will have units of arrivals per
hours.

Can be show that the average or mean interarrival time E (A) and variance is
given by

1
E ( A) =
λ

1
Var ( A) =
λ2

No-Memory Property of the Exponential Distribution

The reason the exponential distribution is often used to model interarrival


times is embodied in the following lemma.

Lemma. If A has an exponential distribution, then for all nonnegative


values of t and h ,

P ( A > t + h / A ≥ t ) = P ( A > h)

It can be proved that no other density function can satisfy this relation.
The no-memory property of the exponential distribution is important
because it implies that if we want to know the probability distribution of the
time until the next arrival, then it does not matter how long it has been since
the last arrival.

Relation Between Poisson Distribution and Exponential Distribution

A discrete random variable N has a Poisson distribution with parameter λ


if, for n=0,1,2, . . .

e −λ λn
P ( N = n) = (n=0,1,2, . . .)
n!

For Poisson random variable N


EN = VarN = λ
If interarrival times are exponential, the probability distribution of the
number of arrivals occurring in any time interval of length t is given by the
following theorem.

Theorem. Interarrival times are exponential with parameter λ if and only


if the number of arrivals to occur in an interval of length t follows a Poisson
distribution with parameter λt .

An average of λt arrivals occur during a time interval of length t , so λ


may be thought of as the average number of arrivals per unit time, or the
arrival rate.

The Erlang Distribution

If interarrival times do not appear to be exponential, they are often modeled


by an Erlang distribution. An Erlang distribution is a continuous random
variable (call it T) whose density function f (t ) is specified by two
parameters: a rate parameter R and a shape parameter k > 0 . Given values
of R and k , the Erlang density has the following probability density
function:

R ( Rt ) k −1 e − Rt
f (t ) = t≥0
(k − 1)!

k k
ET = , VarT =
R R2
The Kendall-Lee Notation for Queuing Systems

Each queuing system is described by six characteristics:

1/2/3/4/5/6

The first characteristic specifies the nature of the arrival process. The
following standard abbreviations are used:

M = Interarrival times are independent, identically distributed (iid)


random variables having an exponential distribution.
D = Interarrival times are iid and deterministic .
Ek = Interarrival times are iid Erlangs with shape parameter k.
GI = Interarrival times are iid and governed by some general
distribution.
The second characteristic specifies the nature of the service times:

M = Service times are iid and exponentially distributed .


D = Service times are iid and deterministic.
Ek = Service times are iid Erlangs with shape parameter k .
G = Service times are iid and follow some general distribution.
The third characteristic is the number of parallel servers. The fourth
characteristic describes the queue discipline:

FCFS = First come, first served


LCFS = Last come, first served
SIRO = service in random order
GD = General queue discipline.

The fifth characteristic specifies the maximum allowable number of


customers in the system (including customers who are in service). The sixth
characteristic gives the size of the population from which customers are
drawn. Unless the number of potential customers is of the same order of
magnitude as the number of servers, the population size is considered to be
infinite. In many important models 4/5/6 is GD/∞/∞. If this is the case, then
4/5/6 is often omitted.
Birth – Death Processes

We use birth-death processes to answer questions about several different


types of queuing systems.

A birth – death process is a continuous – time stochastic process for which


the system’s state at any time is a nonnegative integer. If a birth – death
process is in state j at time t , then the motion of this process is governed by
the following laws.
- with probability ≈ λ j ∆t , a birth occurs between time t and time t + ∆t .
A birth increases system state by 1, to j + 1 . The variable λ j is called
the birth rate in state j . In most queuing systems, a birth is simply an
arrival.
- with probability ≈ µ j ∆t , a death occurs between time t and time t + ∆t .
A death decreases system state by 1, to j − 1 . The variable µ j is called
the death rate in state j . In most queuing systems, a death is a
service completion.
- births and deaths are independent of each other.

We define the number of people present in any queuing system at time t to


be state of the queuing system at time t . For t = 0 , the state of the system
will equal the number of people initially present in the system.. Of great
interest to us is the quantity Pij (t ) which is defined as the probability that j
people will be present in the queuing system at time t, given that at time 0, i
people are present.
Note that Pij (t ) is analogous to the n − step transition probability Pij ( n) - the
probability that after n transitions, a Markov chain will be in state j , given
that the chain began in state i .
For most Markov chains, the Pij (n) approached a limit π j , which was
independent of the initial state i . Similarly, it turns out that for many
queuing systems, Pij (t ) will, for large t , approach a limit π j , which is
independent of the initial state i .

We call π j the steady state, or equilibrium probability, of state j .


The question of how large t must be before the steady state is approximately
reached is difficult to answer. The behavior of Pij (t ) before the steady state
is reached is called the transient behavior of the queuing system.
Notation for Characteristics of Queuing Systems

π j = steady-state probability that j customers are in system

L = expected number of customers in system

Lq = expected number of customers in line (queue)

Ls = expected number of customers in service

W= expected time a customer spends in system

Wq = expected time a customer spends waiting in line

WS = expected time a customer spends in service

λ =average number of customers per unit time

µ = average number of service completions per unit time (service rate)

λ
ρ= = traffic intensity

The M / M / 1/ GD / ∞ / ∞ Model

If ρ ≥ 1 , no stedy state exists. For ρ < 1 ,

π j = ρ j (1 − ρ ) j = 0,1, 2, . . .
λ
L=
µ −λ

λ2
Lq =
µ (µ − λ )

Ls = ρ

L = λW
1
W =
µ −λ

λ
Wq =
µ (µ − λ)

1
Ws =
µ
Example.
An average of 10 cars per hour arrive at a single – server drive-in teller.
Assume the average service time for each customer is 4 minutes, and both
interarrival times and service times are exponential. Questions:
1. What is the probability that the teller is idle?
2. What is the average number of cars waiting in line for the teller? (A
car that is being served is not considered to be waiting in line).
3. What is the average amount of time a drive-in customer spends in the
bank parking lot (including time in service)?
4. On the average, how many customers per hour will be served by the
teller?

Solution
By assumption, we are dealing with an M / M / 1/ GD / ∞ / ∞ queuing system
10 2
which λ = 10 cars per hour and µ = 15 cars per hour. Thus, ρ = = .
15 3
2 1
1. π 0 = 1 − ρ = 1 − = . Thus, the teller will be idle an average of one-third
3 3
of the time.
ρ2 4
2. We seek Lq . Lq = = customers.
1− ρ 3
L ρ
3. We seek W. W = . L= = 2 customers.
λ 1− ρ
2 1
Thus, W = = hour =12 min utes.
10 5
4. If the teller were always busy, he would serve an average of µ = 15
customers per hour. From part (1), we know that teller is onlybusy two-
thirds of the time. Thus, during each hour, the teller will serve an average of


2
(15) = 10 customers. This must be the case, because in the steady state, 10


3
customers are arriving each hour, so each hour, 10 customers must leave the
system.
The M / M /1/ GD / c / ∞ Model

If λ ≠ µ ,

1− ρ
π0 =
1 − ρ c +1

π j = ρ j π0 j = 1, 2, 3, . . ., c

πj =0 j = c, c + 1, c + 2, . . .

ρ [1 − (c + 1) ρ c + c ρ c +1 ]
L=
(1 − ρ c +1 )(1 − ρ )
If λ = µ
1
πj = j = 0,1, 2, . . ., c
c +1
c
L=
2
For all values of λ and µ
Ls = 1 − π 0
Lq = L − Ls
L
W=
λ (1 − π c )

Example A one-men barber shop has a total of 10 seat. Interarrival


time are exponentially distributed, and an average of 20
prospective customers arrive each hour at5 the shop. Those
customers who find the shop full do not enter. The barber
taken an average of 12 minutes to cut each customer’s hair.
Haircut time are exponentially distributed.

1 On the average , how many haircuts per hour will the barber
complete ?
2 On the average, how much time will be spent in the shop by a
customer who enters?

Solution 1 A fraction π10 of all arrivals will find the shop is full. Thus,
an average of λ (1-π10) will enter the shop each hour. All
entering customers will receive a haircut , so the barber will
give an average of λ (1-π10) haircuts per hour. From our
problem c=10, λ=20 customers per hour, and µ=5 customers
20
per hour. Then ρ = = 4, and (34) yields
5
1− 4
π0 =
1 − 411
and

1− 4 − 3(410 )


π 10 = 4 = = .75


10

1 − 411 1 − 411


3
Thus , an average of 20(1 − ) = 5 customers per hour will
4
receive haircuts. This means that an average of 20-5=15
prospective customers per hour will not enter the shop.
2 To determine W , we use (35) and (37). From (35),

L =
[
4 1 − 11 ( 4 10 ) + 10 ( 4
11
)
] = 9 , 67 customers
(1 − 4 11 )( 1 − 4 )

Then (37) yields


9.67.
W= = 1.93 hours .
3
20(1 − )
4
This barber shop is crowded, and the barber would be well
advised to hire at least one more barber!
Machine Repair (M/M/R/GD/K/K) model

λ
ρ=
µ
L = expected number of broken machines
Lq =expected number of machines waiting for service
W = average time a machine spends broken
Wq = average time a machine spends waiting for service
πj = steady-state probability that j machines are broken
λ = rate at which machine breaks down
µ = rate at which machine is repaired

π j = C Kj ρ j π 0 j = 0,1, 2, . . ., R

C Kj ρ j j!π 0
πj = j = R + 1, R + 2, . . ., K
R! R j − R

K
L= jπ j
j =0

Lq =  ( j − R) π j

λ = λ ( K − L)
L
W =
λ
Lq
Wq =
λ

Example The Police Department has 5 patrol cars. A patrol car breaks
down and requires service once every 30 days. The police department has
two repair workers, each of whom takes an average of 3 days to repair a
car. Breakdown times and repair times are exponential.

1. Determine the average number of police cars in good condition.


2. Find average down time for a police car that needs repairs.
3. Find the fraction of the time a particular repair worker is idle.
1
Solution This is a machine repair problem with K = 5, R = 2, λ = car
30
1
per day, and µ = car per day. Then
3
1
1
ρ = 30 =
1 10
3


1
π1 = C π 0 = 0.5π 0


1
5 

10

2
1
π2 = C π 0 = 0.1π 0



2
5 

10

3
1 3!
π 3 = C53 π 0 = 0.015π 0


10 2!2

4
1 4!
π4 = C π 0 = 0.0015π 0
 

4
5
2!2 2


10

5
1 5!
π5 = C π 0 = 0.000075π 0
 

5
5
2!23


10

Then π 0 (1 + 0.5 + 0.1 + 0.015 + 0.0015 + 0.000075) = 1, or π 0 = 0.619

π 0 = 0.619
π 1 = 0.310
π 2 = 0.062
Now we yields
π 3 = 0.009
π 4 = 0.001
π5 = 0
1. The expected number of cars in good condition is K − L , which is
given by
5
K− j π j = 5 − (0 ⋅ 0.619 + 1 ⋅ 0.310 + 2 ⋅ 0.062 + 3 ⋅ 0.009 + 4 ⋅ 0.001 + 5 ⋅ 0 = 4.535 cars
j =o

in good conditions

L
2. We seek W = . λ= λ (5 − j )π j = 0.151 car per day
λ


4.535
or λ = λ ( K − L) = = 0.151 car per day.
30

0.465
Since L = 0.465 car, we find that W = = 3.08 days.
0.151

3. The fraction of the time that a particular repair worker will be idle is

π 0 + 0.5π 1 = 0.774

If there were three repair people, the fraction of the time that a particular
server would be idle would be
2 1
π0 + π1 + π2
 

 

 

3 3

You might also like