1. For an M/M/1 queue with mean interarrival time 1.25 minutes and mean service time 1 minute, find all five of \(W_q\), \(W\), \(L_q\), \(L\) and \(\rho\).
Distribution:
Kendall notation
Known values:
mit <- 1.25 # mean interarrival time (minutes)
mst <- 1 # mean service time (minute)
c <- 1 # number of servers
lambda <- 1/mit # arrival rate
mu <- 1/mst # service rate
rho <- lambda/(c * mu) # utilization of servers
L_q <- (rho)**2/(1-rho) # avg no. of entities in queue
L <- (rho)/(1-rho) # avg no. of entities in system
W_q <- rho/(mu * (1-rho)) # avg time in queue
W <- 1/(mu * (1-rho)) # avg time in system
M/M/1 | Value | |
---|---|---|
\(\lambda\) | \(\frac{1}{E(interarrival-time)}\) | 0.8 |
\(\mu\) | \(\frac{1}{E(service-time)}\) | 1 |
\(\rho\) | \(\frac{\lambda}{c\cdot\mu}\) | 0.8 |
\(W_q\) | \(\frac{\rho}{\mu\cdot(1-\rho)}\) | 4 |
\(W\) | \(\frac{1}{\mu\cdot(1-\rho)}\) | 5 |
\(L_q\) | \(\frac{\rho^2}{1-\rho}\) | 3.2 |
\(L\) | \(\frac{\rho}{1-\rho}\) | 4 |
This queue system has single server with exponential interarrival and service times.
\(\rho\): With mean interarrival of 1.25 minutes and mean service time of 1 minute, the server has 80% chance of being busy.
\(W_q\): The average time an entity spends waiting in queue is 4 minutes.
\(W\) : The average time an entity spends both in queue and in service is 5 minutes
\(L_q\): The average number of entities waiting in queue are 3.
\(L\): The average number of entities waiting in queue and in system are 4.
2. Repeat problem 1, except assume that the service times are not exponentially distributed, but rather (continuously) uniformly distributed between a=0.1 and b=1.9. Note that the expected value of this uniform distribution is \(\frac{a+b}{2}=1\), the same as the expected service time in problem 1. Compare all fieve of your numerical results to those from Problem 1 and explain intuitively with respect to this change in the service-time distribution (but with its expected value remaining at 1).
Distribution:
Kendall notation
Known values:
This model has interarrival time exponentially distributed and service time is continuously uniformly distributed with a single server.
The \(\lambda=0.8\) and \(\mu=1\) remain the same as in Problem 1.
The standard deviation of the service-time is:
\[\sqrt{(b-a)^2/12}\] \[\sqrt{(1.9 - 0.1)^2/12} = 0.52\] \[\sigma^2=0.27\]
Standard deviation value is further used to find other parameter values
# standard deviation
sd <- sqrt((1.9 - 0.1)^2/12)
var <- sd**2
W_q2 <- (lambda*(var + (1/mu**2)))/(2*(1-(lambda/mu)))
W2 <- W_q2 + 1
L_q2 <- lambda * W_q2
L2 <- lambda * W2
Prob #1 - M/M/1 | Prob #2 - M/G/1 | |
---|---|---|
\(\lambda\) | 0.8 | 0.8 |
\(\mu\) | 1 | 1 |
\(\rho\) | 0.8 | 0.8 |
\(W_q\) | 4 | 2.54 |
\(W\) | 5 | 3.54 |
\(L_q\) | 3.2 | 2.032 |
\(L\) | 4 | 2.832 |
The weight time in queue depends on variance. Since the variance is small in this case, the weight time in queue is small as well. Also, the number of entities is less than in Problem 1, indicating there is less time to wait for service if you are at the end of the queue.
3. Repeat problem 1, except assume that the service times are triangularly distributed between a=0.1 and b=1.9 and with the mode at m=1.0. Note that the expected value of this uniform distribution is \(\frac{a+b}{2}=1\), the same as the expected service time in problem 1. Compare all five of your results to those from Problem 1 and 2.
Distribution:
Kendall notation
Known values:
This model has interarrival time exponentially distributed and service time is continuously uniformly distributed with a single server.
The \(\lambda=0.8\) and \(\mu=1\) remain the same as in Problem 1.
The standard deviation of the service-time is:
\[\sqrt{(a^2 + m^2 + b^2 - am - ab-bm/18}\] \[\sqrt{(1.9 - 0.1)^2/12} = 0.37\] \[\sigma^2=0.14\]
Standard deviation value is further used to find other parameter values
# given values: a, b & m
a <- 0.1
m <- 1
b <- 1.9
# avg service time
mu3 <- (a + m + b)/3
# utilization
rho3 <- lambda/mu3
# standard deviation
sd3 <- sqrt((a**2 + m**2 + b**2 - a*m -a*b -b*m)/18)
var3 <- sd3**2
W_q3 <- (lambda*(var3 + (1/mu3**2)))/(2*(1-(lambda/mu3)))
W3 <- W_q3 + 1
L_q3 <- lambda * W_q3
L3 <- lambda * W3
Prob #1 - M/M/1 | Prob #2 - M/M/1 | Prob #3 - M/G/1 | |
---|---|---|---|
\(\lambda\) | 0.8 | 0.8 | 0.8 |
\(\mu\) | 1 | 1 | 1 |
\(\rho\) | 0.8 | 0.8 | 0.8 |
\(W_q\) | 4 | 2.54 | 2.27 |
\(W\) | 5 | 3.54 | 3.27 |
\(L_q\) | 3.2 | 2.032 | 1.816 |
\(L\) | 4 | 2.832 | 2.616 |
Since variance is even smaller than Problem 2, the weight time in queue drops as well with triangular distribution.
5. Repeat Problem 1, except for an M/M/3 queue with mean interarrival time 1.25 minutes and mean service time 3 minutes at each of the three servers.
Distribution:
Kendall notation
Known values:
Program mmc.exe is used to obtain results
Prob #1 - M/M/1 | Prob #2 - M/G/1 | Prob #3 - M/G/1 | Prob #5 - M/M/3 | |
---|---|---|---|---|
\(\lambda\) | 0.8 | 0.8 | 0.8 | 0.8 |
\(\mu\) | 1 | 1 | 1 | 0.3333333 |
\(\rho\) | 0.8 | 0.8 | 0.8 | 0.8 |
\(W_q\) | 4 | 2.54 | 2.27 | 3.24 |
\(W\) | 5 | 3.54 | 3.27 | 6.24 |
\(L_q\) | 3.2 | 2.032 | 1.816 | 2.59 |
\(L\) | 4 | 2.832 | 2.616 | 4.99 |
With three servers, the wait and service time would have improved if mean service time had remained 1. Since it is 3, the queue system behaves similarly to problem 1.
Problem 12. Urgent care clinic
# service time means for all nodes
means12 <- c(3,5,90,16,15)
# service rates for all nodes
mu12 <- 1/means12
# number of servers
servers12 <- c(2,1,2,3,2)
# lambda for each node
lms <- 1/6 #sign-in lambda
lmr <- 0.9*lms #registration lambda
lmtra <- 0.1*lms #trauma room lambda
lme <- 0.9*lms #exam room lambda
lmtre <- 0.9*0.6*lms + 0.1*lms #treatment room lambda
lambda12 <- c(lms, lmr, lmtra, lme, lmtre)
# traffic intensity
rho12 <- lambda12/(servers12 * mu12)
# add all values to data frame
uc <- data.frame(servers12, means12, mu12,lambda12, rho12)
rownames(uc) <- c("Sign-in", "Registration", "Trauma Room", "Exam Room", "Treatment Room")
colnames(uc) <- c("Servers", "Mean", "Service Rate","Arrival Rate", "Traffic Intensity")
knitr::kable(uc)
Servers | Mean | Service Rate | Arrival Rate | Traffic Intensity | |
---|---|---|---|---|---|
Sign-in | 2 | 3 | 0.3333333 | 0.1666667 | 0.25 |
Registration | 1 | 5 | 0.2000000 | 0.1500000 | 0.75 |
Trauma Room | 2 | 90 | 0.0111111 | 0.0166667 | 0.75 |
Exam Room | 3 | 16 | 0.0625000 | 0.1500000 | 0.80 |
Treatment Room | 2 | 15 | 0.0666667 | 0.1066667 | 0.80 |
Sign-in
Registration
|
Trauma Room
Exam Room
Treatment Room
The utilization for all servers at each node is less than 1 so the whole system looks to be stable. Upon examining the queue systems for each node, it appears that trauma room can use another server to balance the load there. ****