Queueing Model: A Brief Introduction

Let us think about a queue (waiting line) most of us have seen, the line at Orin’s place café in Paccar hall. Let us consider the simplest case, one line in front of a single cashier. For now, ignore the role of second cashier (occasionally open) and the barista. We will discuss in class the wide applicability (not just cafes) of the insights we draw from this model.

Inputs

Customers arrive at the café and join the line. The time between any two customer arrivals is variable and uncertain but we can say, for example, on average two customers join the line every minute. The rate at which customers join the line is what we call arrival rate (symbol lambda ). This is the same as workload arrival in chapter 1. In this case, arrival rate lambda is 2 per minute. This also means that the average time between two arrivals is ½ minute; we call this interarrival time.

The time cashier takes to serve one customer is called service time. This too changes from customer to customer and is, therefore, variable and uncertain. Let us say, on average, service time for a customer is 15 seconds = ¼ minute. This also means that the one cashier can serve customers at the rate of 1/(1/4) = 4 customers per minute; this is what we call service rate (symbol mu ).

Since there is only one cashier, number of cashiers is 1. We use symbol m for this. In case cafe opens another cashier and if a single line is used to feed both servers, we will say number of serversm is 2. In case there are two different lines in front of two cashiers then we will say that these are two different queues, each with m=1. For now, let us go with our original scenario of single queue with single server.

To summarize, at least three inputs are needed to define a queue: arrival rate (lambda), service rate (mu) and number of servers (m). Note that we are interested in expressing our inputs in terms of rates (per minute, for example) and not in time (minutes, for example).

Depending on the situation, we may need other inputs describing the extent of variability in arrivals and service. For this basic model, we assume certain type of variability (Poisson distribution for number of arrivals and Exponential distribution for service times) and not worry about it for now.

Outputs

First output we can get is the utilization of our resource, the cashier. We use the symbol rho for the utilization. This is equal to the ratio of the rate at which work arrives and the capacity of the station. The idea is exactly the same as utilization computation in chapter 1.We know that the rate at which work arrives is arrival rate lambda . One cashier can service the work at the rate of service rate . If there are more than one servers (that is, if number of servers m is more than 1) then total rate at which work can be served, station capacity, will be m multiplied by. Therefore, utilization rho can be calculated as lambda divided by (m multiplied by). . Make sure arrival rate and service rate are expressed in same unit of time; for example, both should be per minute or per hour. In the case of Orin café, . Our cashier is busy 50% of the times. For our calculations to work, utilization rho must be less than 1.

Second output is number of customers waiting. We use the symbol Lq for this. Note that this excludes the person who is actually getting serviced by the cashier. We have a simple table to find this value. The table is attached. To look at the table we need two things: first, (arrival rate/service rate, that is lambda/mu ) and second, number of servers m. In Orin café’s case is 2/4=0.5 and m is 1. You will find one row in the table that corresponds to these two values. In this row, read the number in column titled Lq. You will see that the number is 0.5. This means that, on an average, the number of people waiting in line Lq is 0.5.

Only in the special case when there is only one server, m=1, we can also use a simple formula to compute the number of customers waiting Lq. (The table works for all values of m, including m=1). For m=1: . For example, in this case =0.5, same as that we got from table.

Third output is the time an average customer waits in line to receive service. We use the symbol Wq for this. We have a simple formula to convert number-of-customers-waiting Lq into time-a-customer-waits Wq. To get Wq, divide Lq by arrival rate lambda (Little’s law) In Orin cafe, the time-a-customer-waits min = 15 seconds.

Sometimes we want to think about the whole system, that is, not just waiting but both waiting and getting service. We would like to know the time-a-customer-spends-in-the-system (we use symbol Ws for this)including both time for waiting and time for service. Clearly, this is equal to time-a-customer-waits Wq plus service time. In Orin café’s case, Ws is just equal to the sum of waiting time (15 sec.) and service time (15 sec.). Ws=30sec = 0.5 min.

There is also the question of the number-of-customers-in-system (symbol Ls), including both, customers who are waiting and who are getting service. Another application of Little’s law shows that to get number-of-customers-in-system symbol Ls, multiply time-in-system Ws by arrival rate lambda . In Orin café’s case, .

Finally, to compute the chance that system is idle, that is, there is no customer in the system, we can read the column titled P0 from the table, just the way we read Lq. For Orin café, P0=0.5, that is 50% chance that cashier is free.

Other Performance Measures

For single-server case, some other performance measures can be computed as following:

Probability that there are n customers in system

Probability that wait is greater than t =

Probability that time-in-system is greater than t =

For more than one server, spreadsheets are available to compute these measures.

Determining Capacity

If we increase capacity (by increasing m or by increasing ), we expect that the cost of providing that capacity will increase. We also expect, however, that the customers will wait less and that the cost of customer waiting will decrease. This suggests that we should look at the total cost = (cost of providing service + cost of customer waiting) in order to make decision about how much capacity to provide.

For example, if Orin café pays $15 per hour to a cashier then adding one more cashier increases the cost of providing capacity by $15 per hour. But it also reduces the number of customer in system from (see above) to ( from table for m=2 and then repeat the above steps to get ). If we assume that a customer’s time is worth $20 per hour then system saves (1-0.533)*$20 per hour = $9.34. Therefore, in this example, from total system cost perspective, we should not add another server.

Other Extensions

Without making much fuss about it, we have made two significant assumptions about the pattern of variability in arrivals and service: Poisson distribution for number of arrivals and Exponential distribution for service times. These assumptions mean the following: coefficient of variation =(standard deviation / mean) for interarrival times and

coefficient of variation =(standard deviation / mean) for service times . But what if based on measurement of real data, they are not 1? We call this the case of general arrivals and service.

It is easy to compute Lq in this more general case as follows:

Starting from , other performance measures can be computed in the same way as earlier.

Summary

Arrival rate lambda = 1 / (interarrival time, that is time between two arrivals)

Service rate mu = 1 / service time

Number of servers m

Utilization rho

Assume arrivals Poisson distribution and service time are exponentially distributed.

Average number in waiting line Lq can be obtained from table (given and m)

In case number of servers m=1, we can also use

Average waiting time from Little’s Law

Average time-in-system (waiting time +service time)

Average number-in-system (waiting+getting served)

Probability that there is nobody in the system P0 is available in table.

For single-server case, m=1, we have following three formulas:

Probability that there are n customers in system

Probability that wait is greater than t =

Probability that time-in-system is greater than t =

Determination of capacity is a trade-off between cost of service capacity and cost of customer waiting.

Coefficient of variation of interarrival times Ca = (Std.dev./mean of interarrival times)

Coefficient of variation of service times Cs = (Std.dev./mean of service times)

If , modify Lq from above by multiplying it with

Queueing Model: Practice Problems

1. A small town with one hospital has two ambulances to supply ambulance service. Requests for ambulances during non-holiday weekend averages 0.8 per hour and tend to be Poisson distributed. Travel and assistance time averages one hour per call and follows an exponential distribution. What is the utilization of ambulances? On an average, how many requests are waiting for ambulances? How long will a request have to wait for ambulances? What is the probability that both ambulances are sitting idle at a given point in time?

2. At a bank’s ATM location with a single machine, customers arrive at the rate of one every other minute. This can be modeled using a Poisson distribution. Each customer spends an average of 90 seconds completing his/her transactions. Transaction time is exponentially distributed. Determine (1) the average time customers spend from arriving to leaving, (2) the chance that the customer will not have to wait, (3) the average number waiting to use the machine.

3. The last two things that are done before a car is completed are engine marriage (station 1) and tire installation (station 2). On average 54 cars per hour arrive at the beginning of these two stations. Three servers are available for engine marriage. Engine marriage requires 3 minutes. The next stage is a single server tire installation. Tire installation requires 1 minute. Arrivals are Poisson and service times are exponentially distributed.

(1) What is the queue length at each station?

(2) How long does a car spend waiting at the final two stations?

4. A machine shop leases grinders for sharpening their machine cutting tools. A decision must be made as to how many grinders to lease. The cost to lease a grinder is $50 per day. The grinding time required by a machine operator to sharpen his cutting tool has an exponential distribution, with an average of one minute. The machine operators arrive to sharpen their tools according to a Poisson process at a mean rate of one every 20 seconds. The estimated cost of an operator being away from his machine to the grinder is 10¢ per minute. The machine shop is open 8 hours per day. How many grinders should the machine shop lease?

5. (a) Consider a queue with a single server, arrival rate of 5 per hour and service rate of 10 per hour. Assuming Poisson arrivals and exponential service time, what is the waiting time in queue?

(b) Actual measurements show that interarrival time standard deviation is 24 minutes and service time standard deviation is 3 minutes. What is the waiting time in queue?

Queueing Model Practice problems:Solutions

1. A small town with one hospital has two ambulances to supply ambulance service. Requests for ambulances during non-holiday weekend averages 0.8 per hour and tend to be Poisson distributed. Travel and assistance time averages one hour per call and follows an exponential distribution. What is the utilization of ambulances? On an average, how many requests are waiting for ambulances? How long will a request have to wait for ambulances? What is the probability that both ambulances are sitting idle at a given point in time?

Ambulances are resources or servers servicing the requests that are coming in (customers). Two ambulances mean m=2. Requests arrival rate =0.8 per hour. Service time = one hour. Service rate = (1/service time) = 1 per hour.

Utilization

=0.8 and m=2.

From table:,

On an average, how many requests are waiting for ambulances =

How long will a request have to wait for ambulances

What is the probability that both ambulances are sitting idle at a given point in time..

Other Performance measures include .

Time spent by a call in system

Number of requests in system =

2. At a bank’s ATM location with a single machine, customers arrive at the rate of one every other minute. This can be modeled using a Poisson distribution. Each customer spends an average of 90 seconds completing his/her transactions. Transaction time is exponentially distributed. Determine (1) the average time customers spend from arriving to leaving, (2) the chance that the customer will not have to wait, (3) the average number waiting to use the machine.

Solution:

One every other minute means arrival rate

Service rate

(we an use the formula because m=1; table should give the same result)

(1) the average time customers spend from arriving to leaving = waiting + service time = Wq+ 90 sec = 4.5min+1.5min= 6 minutes

(2) the chance that the customer will not have to wait that is the chance that there are 0 customers in system= =0.25 (the formula is for m=1 case) (3) the average number waiting to use the machine =2.25

3. The last two things that are done before a car is completed are engine marriage (station 1) and tire installation (station 2). On average 54 cars per hour arrive at the beginning of these two stations. Three servers are available for engine marriage. Engine marriage requires 3 minutes. The next stage is a single server tire installation. Tire installation requires 1 minute. Arrivals are Poisson and service times are exponentially distributed.

(a) What is the queue length at each station?

(b) How long does a car spend waiting at the final two stations?

(a) We can analyze these two stations as independent queues. One queue at station 1 followed by another queue at station 2.

Station 1: Engine Marriage

m=3

 = 54 per hour

 = 20 per hour

=54/20=2.7,

(1) From the table we know that Lq=7.354

Waiting time at station 1Wq==7.354/54=0.1362 hours.

Station 2: Tire assembly

The arrival rate at station 2 is the rate of departure from station 1. If 54 cars per hour arrive at station 1 then, just for the system to be stable, on an average 54 cars must depart from station 1. Thus, arrival rate at station 2:

 = 54 per hour

 = 60 per hour

= 54/(60) = 0.90

(1) From table, Lq =8.1.

Waiting time at station 2Wq==8.1/54=0.15 hour

(b) Total wait time is therefore 0.1362 hr + 0.15 hr = 0.2862 hr

4. A machine shop leases grinders for sharpening their machine cutting tools. A decision must be made as to how many grinders to lease. The cost to lease a grinder is $50 per day. The grinding time required by a machine operator to sharpen his cutting tool has an exponential distribution, with an average of one minute. The machine operators arrive to sharpen their tools according to a Poisson process at a mean rate of one every 20 seconds. The estimated cost of an operator being away from his machine to the grinder is 10¢ per minute. The machine shop is open 8 hours per day. How many grinders should the machine shop lease?

Solution:

The data for this problem are as follows:

The trade-off is between costs of providing service (lease cost) and the cost of customer waiting (waiting cost). Note that customers are our own employees and therefore it is possible to have a good estimate of waiting cost as above. We will focus on minimizing the sum of these two costs so that the trade-off can be resolved optimally. Let us call the sum total cost per hour. Let us try three options for leasing: 4 grinders, 5 grinders and 6 grinders.

M=4:

Note that 4 grinders result in a cost of providing service equal to $6.25*4 per hour. Since, on average, there are 4.528 operators away from their machines, the cost of customer waiting (being away from machine) is $6*4.528 per hour. The operator being services is also away from his machine

M=5:

M=6:

5 grinders should be leased, since this yields the lowest total cost per hour ($51.37).

5. (a) Consider a queue with a single server, arrival rate of 5 per hour and service rate of 10 per hour. Assuming Poisson arrivals and exponential service time, what is the waiting time in queue?

(b) Actual measurements show that interarrival time standard deviation is 24 minutes and service time standard deviation is 3 minutes. What is the waiting time in queue?

(a) Arrivals follow Poisson distribution. This means that interarrival time standard deviation is equal to interarrival time mean and that coefficient of variation (=standard deviation/mean) of interarrival time Ca=1. Service time follows exponential distribution. This means that service time standard deviation is equal to service time mean and that coefficient of variation (=standard deviation/mean) of service time Cs=1. This means that for part (a) we can use standard table or formulas to compute performance.

; m=1