0% found this document useful (0 votes)
42 views

Queues

The document discusses queue modeling and analysis. It describes: - Queues form when customers arrive at a service point like an ATM and wait in line to be served. - The number of customers in the queue over time can be modeled as a Poisson process. Service and inter-arrival times are modeled as exponential distributions. - Differential equations can be set up to model the probability of having n customers at time t. In steady state, this becomes a geometric distribution. - The traffic density ρ = λ/μ where λ is the arrival rate and μ is the service rate. If ρ < 1, a steady state is reached. - Key metrics include the probability of an

Uploaded by

DANISH ELCHI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Queues

The document discusses queue modeling and analysis. It describes: - Queues form when customers arrive at a service point like an ATM and wait in line to be served. - The number of customers in the queue over time can be modeled as a Poisson process. Service and inter-arrival times are modeled as exponential distributions. - Differential equations can be set up to model the probability of having n customers at time t. In steady state, this becomes a geometric distribution. - The traffic density ρ = λ/μ where λ is the arrival rate and μ is the service rate. If ρ < 1, a steady state is reached. - Key metrics include the probability of an

Uploaded by

DANISH ELCHI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

 Queues appear in many aspects of life.

 Some are clearly visible, as in the queues at


supermarket check-out tills: others may be less
obvious as in

 information telephone lines, or


 in hospital waiting lists.
 In the latter an individual waiting may have no idea
how many persons are in front of him or her in the
hospital appointments list.
 Generally, we are interested in the long-term behavior
of queues for future planning purposes
 —does a queue increase with time or
 does it have a steady state, and if it does have a steady
state, then, on average, how many individuals are there
in the queue and
 what is the mean waiting time?
Imagine an ATM machine
there are some customers here in line in a queue
every once in a while, a new customer arrives and
when ATM is empty then the first customer in the line will be served
He spend some time at the ATM and then he leaves
then the next customer is served
of course, new customers keep coming
 there can be multiple ATM here so as long as one ATM
is empty customer can be served at the same time in
parallel
 We want to modeling this queue
 The number of customers in a queue are modeled by
the Poisson Process
The probability that there are n customers in the queue
(include the customer being served at the server). this is
modeled by the Poisson distribution
 The time between two arrivals two consecutive arrivals
of customers
 is modeled by the exponential distribution
 The time spent at the server is modeled by exponential
distribution
 The density function of the time spent at a server
The problem of a single server queue

There's one ATM


the probability that a new customer arrives
this probability the customer will leave from the server during

we model the number of customers in the q

including the one being served

by the random variable n

N(t)
 Based on these assumptions we are going to set up a
set of differential difference equations

the probability that there are n customers at time t,


in the queue

there are no customers at time


We want to find, there are no customers at time

First state is: there are no customers at time

So, suppose there are no customers at time t , the


probability is
And, should be no new customers arriving
So, the probability will be
Suppose, there are no customer being served because that number of customers zero
so no customer will leave during that time

Or
if there are only one customer then that customer must be leave during de
so that probability is
 So we have
 in general, suppose there are n customers at time t
plus delta t
 the possible scenario at time t, n customer, n-1
costumer or n+1 customer
 N customer at n customer at t

no customer leaves

no new customer arrives


 n customer at t
one customer leaves

one customer arrives


( + )
 N-1 customer at t
the new customer should arrive
and no customer should leave 1-
 N+1, customer at t
no new customer arrives
one customer leave
 So
let's rearrange this different
difference equations
Limiting Processes
 In the limiting process we look at the long-term
behavior of the queue
 Assuming that it has a limiting state. Not all queues
do:
 if rate of arrivals is large compared with the service
time then we might expect the queue to continue to
grow without bound as time progresses.
 For the moment let us assume that there is a limiting
state, that
 λ < μ, and that we can write

The probabilities now approach a constant distribution which does not depend
on time. In this case it is reasonable to assume that
 Equations now become

This is a second-order difference equation. It is easy to solve iteratively


since
 and, with n = 1, in

 We have
 With substituting
 We have

 The next iterate is

and, in general,

and at this point the value of p0 is unknown


 so how can we determine this value of p 0
 before determining the value of p 0 let us define a
quantity called the traffic density
 traffic density

 ρ=

 Actually if we define
 as the service time and
 I as the inter arrival time of new customers
 then this traffic density is this expectation value of the
over expectation value of inter arrival time


 pn is expressed as

this is probability mass function of the number of customers


 the sum of all pn and ranging from 0 to infinity should
add up to 1
 but the geometric series on the left will only converge
if

Hence,
 which is the probability mass function of a geometric
distribution with parameter

then the series does not converge and {pn} cannot represent a probability
distribution. In this case the queue simply increases in length to infinity as t → ∞
whatever its initial length. On the other hand if
and the rate of arrivals is less than the average service time with the
result that a steady state should be achieved as we might expect.
Notice that, if

the queue grows in length although there appears to be equilibrium’ between


arrivals and service.
(i) Server free. The probability that the server is free
when a customer arrives is
 (ii) Length of queue. The mean length of the queue
(including the person being served) is, if N represents
a random variable of the number in the queue,
 (iii) Waiting time. How long will a customer expect to
wait for service on arrival at the back of the queue, and
how long will the customer expect to queue and be
served?
 A customer arrives and finds that there are n
individuals ahead including the person being served

the random variable representing
the time for the service of
customer i.

each of them will be served with


 n for ti seconds
the sum of the random variables of service times of the first n queuing
customers.
These random variables are independent, each with an exponential
density function with the same parameter
 the sum of independent identical distributed
exponential random variables follow a gamma
distribution
 density function is given by
 Notice that this is the density function for Sn which is
the waiting time given that there are n customers in
the queue
 But usually we don't care about how many customers
are there , we only care how long we have to wait
 We want to actually calculate the probability density
function for the waiting time irrespective of the
number of customers so let's say this a random
variable of waiting time irrespective of customers is S
 So we want to first calculate the distribution function
for this this random variable
Using the law of total probability, the probability that S is greater than t is
given by

WE KNOW
 we put all these together in this equation
 Hence,

this distribution function of waiting time


irrespective of the number of customers
 this equation means this is application of the partition
theorem so if there are n customers that the
distribution function is this
 the density function of S is the derivative of
cumulative distribution function with respect to time t
 Cumulative distribution function is
< t)
The associated density function is
 Finally, the expected value of S is

With n customers ahead the next customer could expect to wait for a time

to reach the server. Until service is completed the customer could expect
to spend time
 the horizontal axis is the time from some point and
the vertical axis is the number of customers so this
shows the evolution of the number of customers after
some point in time
 at first there are no customers so which is called the
slack period
 at time t one customer arrives so now the system
enters the busy period so if the server is occupied
with at least one customer it is in the busy period
 now we are interested in the average duration of the
busy period
 we represent each slack period by the duration of each
slack period by s i s1 s2 s3 and so on and the duration
of the busy periods are represented by b1 b2 b3 and so
on

and periods when the server is busy, namely


 The times t1, t3, t5, . . . are the times when a new
customer arrives when the server is free, and
 t2, t4, t6, . . . are the times at which the server becomes
free.
 The periods denoted by b1, b2, . . . are known as busy
periods.
 A question whose answer is of interest is: what is the
expected length of a busy period?
 what is the expected length of a busy period?
 Suppose that the server is free at time t = t2.
 The arrivals form a Poisson process with parameter λ,
 The expected time until the next customer arrives is
1/λ, (the density function is exponential. )

 The average lengths of a large number n of slack


periods should approach 1/ λ.
: the probability that the server is free

the probability that the server is busy


:

Hence the ratio of the average lengths of the slack


periods to that of the busy periods is

s/b =
s = b
which is the mean length of the busy
periods
 The mean length of the busy periods

b
 Server free. The probability that the server is free when
a customer arrives is
 p0 = 1 − ρ.
 Length of queue. The mean length of the queue
(including the person being served) is, if N represents
a random variable of the number in the queue,
 traffic density
 S and I are independent random variables of the
service and inter-arrival times, respectively. When S
and I are both exponentially distributed, then
 E(S) = 1 /µ and E(I) = 1/λ

 ρ = E(S)/ E(I) ,
 Waiting time
Queues with multiple servers

 In many practical applications of queueing models,


there is more than one server

 in banks, supermarkets, and hospital admissions.


1 2 3 r
 we consider a single queue so there is only one queue
and as a server becomes free then customer is served at
the server which server doesn't matter but as long as
it's free then a customer is served
 we also consider the service time follows the
exponential distribution
 the number of customers including those that are
being served is represented by this random variable n
of
 Suppose that the queue faces r servers.
 the arrivals form a Poisson process with parameter λ
 the service time at each counter has exponential
distribution with rate μ
 pn(t) be the probability that there are n people in the
queue at time t including those being served
 If all counters will be occupied by a
customer
 If some counters will be free
 Each server has the probability of becoming free with

 There are r servers that are being so the total


probability should be

the probability of busy server
 we can derive the following incremental equations:

this is the same as the single server case

this is the case where


what is different from
the single server
 With the usual limiting process. we obtain the time-
dependent equations for the queuing process
 Assuming that the derivatives tend to zero as t → ∞(as
in the previous section), the corresponding limiting
process (if it exists) for the queue with r servers is
 There are three main factors which characterize
queues:

 the probability distributions controlling arrivals,

 service times, and

 the number of servers.


 arrival distribution, G1/ service distribution, G2 /
number of servers, n

 If G1 and G2 are exponentials with λ and µ


 (that is, both are Poisson processes),
 then both processes are Markov with parameters λ and
µ, respectively
 The Markov property means that the probability of the
next arrival or the probability of service being
completed are independent of any previous
occurrences.
 We denote the processes by M(λ) and M(µ)

 . the single-server queue is denoted by


 M(λ)/M(µ)/1, and
 the n-server queue by
 M(λ)/M(µ)/n.
 single-server queue with Markov inter-arrival but fixed
service time τ
 M(λ)/D(τ)/1, where D stands for deterministic.
 If the service time for a single-server queue has a
uniform distribution

 M(λ)/U(µ)/1

 service time for a single-server queue has a uniform


distribution with density function
 µ 0 ≤ t ≤ 1/µ,
 0 elsewhere,

You might also like