### QUEUING THEORY

 [M/M/S and M/M/S/K]Queuing theory for servers performing per an exponential distribution and for customers arriving per a Poisson process, with a cap for customers present in the system.Using material from Frederick S. Hiller, Gerald J. Lieberman. Introduction to Operations Research. New York: McGraw Hill, 2005. Print.INPUTL: Mean entry rate follows POISSON input processU: Mean service rate follows EXPONENTIAL distributionS: Number of serversK: Number of waiting placesFIRST COME FIRST SERVED ASSUMPTIONOUTPUTA: Average number of customers in the systemB: Average number of customers in the queueC: Average waiting time in the systemD: Average waiting time in the queueP: Likelihood that mean entry rate will yield this N customers in the system =================================================`OUTPUT “Specify mean entry rate using quantity/minute”`` INPUT L``OUTPUT “Specify mean service rate using quantity/minute”`` INPUT U``OUTPUT “Specify number of servers, at least 1”`` INPUT S``OUTPUT “Specify 1 if there is a maximum quantity permitted in the system, specify 2 otherwise”`` INPUT X``IF X = 1`` THEN`` OUTPUT “Specify number of waiting places”`` INPUT K`` K + S → K`` OUTPUT “Maximum quantity permitted in the system”`` OUTPUT K`` ELSE`` 0 → K``END``L/(S*U) → R``IF R => 1`` THEN`` OUTPUT “Input rates yield utilization beyond 100%, decrease rates of entry or increase either quantity of servers or service rate”`` ELSE`` IF K = 0`` THEN`` IF S = 1`` THEN`` L/(U - L) → A`` (L^2)/U*(U-L)) → B`` A/L → C`` B/L → D`` OUTPUT “Specify quantity present in system”`` INPUT N`` (1 - R) → Q`` (R^N)*Q → P`` OUTPUT “Likelihood that mean entry rate will yield this quantity”`` OUTPUT P`` ELSE`` S - 1 → M`` 0 → Z`` FOR(N,0,M,1)`` Z + ((L/U)^N)/N! → Z`` END`` 1/(Z+((L/U)^S)/(S!*(1-R)) ) → Q`` Q*((L/U)^S)*R/(S!*(1-R)^2) → B`` B + L/U → A`` B/L → D`` A/L → C`` OUTPUT “Specify quantity present in system”`` INPUT N`` IF N S`` THEN`` Q*((L/U)^N)/(S!*S^(N-S))→P`` ELSE`` Q*((L/U)^N)/N! → P`` END`` ELSE`` 0 → P`` END``OUTPUT “Likelihood that mean entry rate will yield this quantity”``OUTPUT P``END ``OUTPUT “Average number of customers in the system”``OUTPUT A``OUTPUT “Average number of customers in the queue”``OUTPUT B``OUTPUT “Average waiting time in the system”``OUTPUT C``OUTPUT “Average waiting time in the queue”``OUTPUT D`