The purpose of this document is to provide an overview of M/M/1 queuing systems, and in particular calculations involved with those systems. A few examples and R code will demonstrate some of the calculations. M/M/1 queues, and queuing systems in general are also easily studied with simulation. The Georgia Tech course Simulation Analysis (ISYE 6644) goes over queuing systems, and also how to construct simulations of these systems using Arena. As queuing systems become more complex, the ability to analyze them using “closed form” or numerical solutions becomes more difficult. Simulation techniques provide a way to tackle more complex problems. This document will focus only on M/1/1 queues, which are among the most basic forms of queuing systems studied in operations research.
The contents included here are NOT part of a homework assignment, or exam, but rather just a “re-working” of the examples used in the course content. Georgia Tech is very much concerned about academic integrity and honesty. My goal is not to cheat, but rather the help others understand the lecture notes.
The original work was done by Bob Myers, Lecturer, Georgia Institute of Technology, MGMT-6203 Data Analytics for Business, Summer 2020.
M/M/1 Queues can be easily described using a diagram:
MM1 Queue - Georgia Tech MGMT 6203
There are several assumptions about M/M/1 queues:
Given arrival rate=\(\lambda\) and service times=\(\mu\), the following metrics can be computed for a given M/M/1 system in closed (numerical) form, and without requiring simulation:
Utilization: \(\rho=\frac{\lambda}{\mu}\)
Average num. of customers in the system: \(L_s=\frac{\lambda}{\mu-\lambda}\)
Average num. of customers in the queue: \(L_q=\frac{\lambda^2}{\mu(\mu-\lambda)}=L_s*\rho\)
Average time a customer spends in the system: \(W_s=\frac{1}{\mu-\lambda}=\frac{L_s}{\lambda}\)
Average time a customer spends in the queue: \(W_q=\frac{\lambda}{\mu(\mu-\lambda)}=\frac{L_q}{\lambda}\)
Probability of n units in the system: \(P_n=(1-\frac{\lambda}{\mu})(\frac{\lambda}{\mu})=(1-\rho)(\rho)^n\)
The utilization for X% service level: \(1-\rho^n=X\)%
The following R code will calculate the above metrics based on the given values of \(\lambda=15\), \(\mu=20\), and \(n=3\):
rm(list=ls())
mm1_metrics <- function(lambda, mu, n, sl){
rho <- lambda/mu
Ls <- lambda/(mu-lambda)
Lq <- lambda**2/(mu*(mu-lambda))
Ws <- 1 / (mu-lambda)
Wq <- Lq/lambda
Pn <- (1-rho)*(rho)**n
X <- data.frame(rho, Ls, Lq, Ws, Wq, Pn)
names(X)<-c('rho','Ls','Lq','Ws','Wq','Pn')
return(X)
}
mm1_metrics(15, 20, 3)
## rho Ls Lq Ws Wq Pn
## 1 0.75 3 2.25 0.2 0.15 0.1054688
Note that if the above inputs are in hours, then the Ws and Wq values will also be in hours. We would need to multiply these by 60 to get the number of minutes.
Consider the following:
Because of limited space, the banker would like to ensure with a 95% confidence (or service level) that no more than 3 cars will be in the system at any time. What confidence exists currently for no more than 3 cars? What rate would the teller need to operate at in order to meet a 95% service level? What would be the utilization at this point?
The following R code will compute the probability of a maximum of n customers in the system given an arrival rate of \(\lambda=15\) and an average service rate of \(\mu=20\).
prob_of_max_n_in_system <- function(lambda, mu, maxn) {
p=0
for(n in seq(0,maxn)){
px <- mm1_metrics(lambda, mu, n)
p = p + px$Pn
}
return(p)
}
prob_of_max_n_in_system(15,20,3)
## [1] 0.6835938
To answer the second part of the question, namely what rate would the teller need to operate at in order to meet a 95% service level and what would the utilization be at this point, we have the following:
required_rate_and_utilization <- function(lambda, n, p){
r = (1-p)**(1/(n+1))
m = lambda / r
X = data.frame(r, m)
names(X) <- c('rho','mu')
return(X)
}
required_rate_and_utilization(15, 3, .95)
## rho mu
## 1 0.4728708 31.72114
This concludes this write-up on how to do M/M/1 Queue calculations.