Professional Documents
Culture Documents
Outline
Deterministic Stochastic
Probability Distribution
Chulalongkorn University
Queuing Theory
A mathematical study of queues Queue is a waiting line especially of persons or vehicles awaiting processing A queue forms when current demand for a service exceeds the current capacity to provide that service Help provide decision or guideline on system capacity
Chulalongkorn University
It is often impossible to predict accurately when and how many customers will show up, and how long it will take to service each customer
E.g., checkout queues at supermarkets
Providing too much capacity costs money Providing too little capacity leads to long wait in queues, which in turn leads to other undesirable consequences
Chulalongkorn University
Queuing theory itself does not directly provide optimal solution Rather, it provides vital information about various characteristics of the queue to decision makers
Average waiting time Average queue length
Chulalongkorn University
Applications
Traffic analysis Industrial plants Retail stores Service-Oriented Industries Telephone switchboard Aircraft Takeoff/Landing Sequence Expressway Toll Plaza
Manoj Lohatepanont 2007 6
Chulalongkorn University
Queue
Chulalongkorn University
Queuing System
Queuing System Server 2
Server 1
Queue
Chulalongkorn University Manoj Lohatepanont 2007 8
Queuing System
Queue
Servers
Served Customers
Queuing System
Chulalongkorn University
Input Source
Infinite (Unlimited)
The size of input source is relatively large Implicit assumption of most queuing models
Finite (Limited)
The size of input source is relatively small This assumption should be used when the rate at which
the input source generates new customers is significantly affected by the number of customers in the queuing system
Chulalongkorn University Manoj Lohatepanont 2007 10
Arrival Process
Interarrival Time
Chulalongkorn University
11
Queue
Queue Capacity
Infinite
Queue size can grow relatively large Implicit assumption of most queuing models
Finite
Queue size is limited by a relatively small number This assumption should be used when there is a relatively
small limit on how large the length of the queue can grow
Chulalongkorn University
12
Queue Discipline
The order in which members of the queue are selected for service
Chulalongkorn University
13
Servers
Number of Servers
One (s = 1) Multiple (s > 1) Elapsed time from the commencement of service to its completion for a customer
Service Time
1/ time/customer
10 min/customer
1/
1/ Time
1/
customers/time unit
0.1 customers/min
Chulalongkorn University
14
Deterministic Queue
Suppose
users
2 1 0 1 2 3 4 5 6 7 8 Time (min)
15
Chulalongkorn University
If >
In deterministic case
4
users
3 2 1 0 1 2 3 4 5 6 7 8 Time (min)
16
Chulalongkorn University
Probabilistic Queue
Queue can occur even when < in stochastic case because of randomness In fact, that < is one of the requirements for the study of queuing theory
For < , steady state can be achieved It is nave to set = . This could lead to very large queues! If >= , queue becomes excessively large and uncontrollable
Chulalongkorn University
17
Steady State
If the queuing system is allowed to operate for a long time, it can be expected, under certain conditions, to reach an equilibrium or steady state Steady state means that the probability that you will observe a certain state of the system does not depend on the time at which you monitor the system
Chulalongkorn University
18
Utilization
= s
where s is the number of servers
Chulalongkorn University
Queuing Taxonomy
A/B/m
Chulalongkorn University Manoj Lohatepanont 2007 20
Probability Distribution of
Interarrival Time (A) Service Time (B)
Common Distributions
D: Deterministic M: [Negative] Exponential Distribution Ek: kth-order Erlang Distribution Hk: kth-order Hyperexponential Distribution G: general Distribution
Chulalongkorn University
21
M/M/1
For example, M/M/1 queuing system refers to the queuing system that has
One server
Chulalongkorn University
22
Exponential Distribution
Unsymmetrical distribution
2.5 2
=2
1.5 f(t) 1 0.5 0 0 1 2 t 3 4
E(T) = 1/ = 0.5
Chulalongkorn University
f(t) = e-t
t >= 0
23
Example
If the interarrival time is exponentially distributed and its mean interarrival time is 0.5 min (arrival rate = 2 customers/min)
Customers arrive on average every 0.5 minute ~2/3 of the customers arrive less than 0.5 minute apart ~1/3 of the customers arrive more than 0.5 minute apart
Chulalongkorn University
24
The probability distribution of the remaining time until the next event (e.g., arrival) occurs is always the same, regardless of how much time has passed (i.e., it does not remember how much time has passed)
If the interarrival time of a bus is exponentially distributed, then this property implies that the probability that a bus will arrive in the next minute is the same no matter how long you have waited at the bus stop
Chulalongkorn University
25
If the interarrival time is exponentially distributed with parameter , then the number of arrivals (e.g., customers) (X) in a specified length of time T has a Poisson distribution with parameter T
e-T(T)n Prob(X = n) = n!
Chulalongkorn University Manoj Lohatepanont 2007 26
Poisson Distribution
We can use Poisson distribution to verify our assumption of exponentially distributed interarrival time
By comparing the number of users that arrive for service during a specific period of time with the number that the Poisson distribution suggests
Chulalongkorn University
27
Quantities of Interest
Chulalongkorn University
28
Basic Characteristics
Utilization
= s
Chulalongkorn University
Littles Law
John D.C. Little at MIT is generally credited with being the first to prove these steady-state relationships formally in 1961
L = W Lq = Wq
Chulalongkorn University Manoj Lohatepanont 2007 30
M/M/1
Assumptions
Interarrival time is exponentially distributed Service time is exponentially distributed One Server FCFS
Chulalongkorn University
31
M/M/1
Pn = (1 )
Therefore, the expected number of users in the system (at steady state) is
L = nPn = n(1 ) =
n n =0 n =0
32
Chulalongkorn University
M/M/1
Once L is known all other quantities of interest can be computed from Littles Law and the following relationships
W = Wq + 1
L = Lq +
These equations are bridges between the two equations in Littles Law
Manoj Lohatepanont 2007 33
Chulalongkorn University
M/M/1
Results can be summarized as follows 1 W= L= 2 Wq = Lq = ( ) ( ) Note also that the probability that the system is idle is P0 = 1
Chulalongkorn University
34
Example 1
At a small grocery store, customers arrive according to Poisson process with a mean of 15 customers per hour. The length of time it takes to checkout is exponentially distributed with mean equals 3 minutes.
M/M/1 = 15 customer/hr = 20 customer/hr
Chulalongkorn University
35
Example 1
Compute
Chulalongkorn University
36
Example 1
Example 1
Chulalongkorn University
38
Example 1
Suppose it costs the operator 3 Baht for each minute that a customer spends waiting in the queue. What is the average cost per customer?
Lq = Wq Lq 2.25 = = 0.15 hr / customer Wq = 15 Cost = 0.15 60 3 = 27 baht / customer
Chulalongkorn University
39
Example 1
For an additional of 400 Baht per hour, the operator can decrease the average service time to 2 minutes. Is the additional expenditure worthwhile?
= 30 customer/hr
Example 1
Alternative solution
BEFORE AFTER
Lq = 2.25
Cost = 2.25 60 3 = 405 baht / hr
Lq = 0.5
Cost = 0.5 60 3 = 90 baht / hr
M/G/1
Assumptions
Interarrival time is exponentially distributed Service time is described only by - an average service time, and - a variance One Server FCFS
Chulalongkorn University Manoj Lohatepanont 2007 42
M/G/1
2 2 + 2 Lq = 2 (1 )
Chulalongkorn University Manoj Lohatepanont 2007 43
M/G/1
As in the previous case, all other quantities of interest can be calculated using Littles Law and the following relationships
1
Example 2
Aircraft arrivals and departures at Bangkok International Airport can be approximated as a Poisson process at the average rate of 40 plane/hr. It takes the air traffic controller 1.2 min on average to land or dispatch an aircraft with variance equals to 1.96 min2. Assume FCFS queue discipline.
Chulalongkorn University
45
Example 2
2 2 + 2 Lq = 2 (1 )
40 0.00054 + ( = 2 (1 40 50 )
2 40 50
= 3.78 plane
Chulalongkorn University Manoj Lohatepanont 2007 46
Example 2
Lq = Wq
3.78 Wq = = = 0.094 hr / plane 40 Lq
Chulalongkorn University
47
Example 2
It is estimated that it costs 81,000 baht per hour for an aircraft to wait in the queue. What is the total cost of aircraft waiting to land or takeoff at the airport?
Chulalongkorn University
48
Example 2
Common mistakes
Lq = 3.78 plane
Cost = 0.094 81,000 = 7,650 baht / hr / plane Cost = 7,650 3.78 = 28,900 baht / hr 28,900 baht / hr << 306,000 baht / hr
Chulalongkorn University Manoj Lohatepanont 2007 49
M/M/s
Assumptions
Interarrival time is exponentially distributed Service time is exponentially distributed There are s servers FCFS
Chulalongkorn University
50
M/M/s
When there are s servers, all with the same service rate
s 1 ( ) n ( ) s + P0 = 1/ s! n =0 n !
s +1
1 1 s
( ) Lq = P0 2 ( s 1) ! ( s )
Chulalongkorn University Manoj Lohatepanont 2007 51
M/M/s
As in the previous cases, all other quantities of interest can be calculated using Littles Law and the following relationships
W = Wq + 1
L = Lq +
= s
52
Chulalongkorn University
Example 3
At a Burger Mary outlet, mean arrival rate of customers is 60 customers per hour and each takes on average 3 minutes to complete order. Arriving customers form one sneak queue in front of 4 cashiers. Assume interarrival and service times are exponentially distributed.
Chulalongkorn University
Example 3
How would the average queue length and time in the system change if a fifth cashier is opened.
60 = = = 0.75 s 4 20
Chulalongkorn University Manoj Lohatepanont 2007 54
n 60 4 3 ( 60 ( 20 ) 20 ) = 1/ + 4! n =0 n ! = 1/ [13 + 3.375 4]
= 1/ 26.5 = 0.038
Chulalongkorn University Manoj Lohatepanont 2007 55
= 1/ 21.44 = 0.047
Chulalongkorn University Manoj Lohatepanont 2007 57
S=4
Lq
S=5
Lq
Balking
Occur when a customer arrives at a finite queue that is fully occupied Or when a customer decides not to join the queue because it is too long Occur when a customer leaves the system without being served Occur when a customer switches between queues thinking s/he will receive service faster by so doing
Manoj Lohatepanont 2007 60
Reneging
Jockeying
Chulalongkorn University
Final Question
Chulalongkorn University
61