---
title: "Queueing theory"
chunk: 2/4
source: "https://en.wikipedia.org/wiki/Queueing_theory"
category: "reference"
tags: "science, encyclopedia"
date_saved: "2026-05-05T03:56:55.531499+00:00"
instance: "kb-cron"
---

  
    
      
        
          P
          
            n
          
        
        =
        
          
            
              
                λ
                
                  n
                  −
                  1
                
              
              
                λ
                
                  n
                  −
                  2
                
              
              ⋯
              
                λ
                
                  0
                
              
            
            
              
                μ
                
                  n
                
              
              
                μ
                
                  n
                  −
                  1
                
              
              ⋯
              
                μ
                
                  1
                
              
            
          
        
        
          P
          
            0
          
        
        =
        
          P
          
            0
          
        
        
          ∏
          
            i
            =
            0
          
          
            n
            −
            1
          
        
        
          
            
              λ
              
                i
              
            
            
              μ
              
                i
                +
                1
              
            
          
        
      
    
    {\displaystyle P_{n}={\frac {\lambda _{n-1}\lambda _{n-2}\cdots \lambda _{0}}{\mu _{n}\mu _{n-1}\cdots \mu _{1}}}P_{0}=P_{0}\prod _{i=0}^{n-1}{\frac {\lambda _{i}}{\mu _{i+1}}}}
  
.
The condition 
  
    
      
        
          ∑
          
            n
            =
            0
          
          
            ∞
          
        
        
          P
          
            n
          
        
        =
        
          P
          
            0
          
        
        +
        
          P
          
            0
          
        
        
          ∑
          
            n
            =
            1
          
          
            ∞
          
        
        
          ∏
          
            i
            =
            0
          
          
            n
            −
            1
          
        
        
          
            
              λ
              
                i
              
            
            
              μ
              
                i
                +
                1
              
            
          
        
        =
        1
      
    
    {\displaystyle \sum _{n=0}^{\infty }P_{n}=P_{0}+P_{0}\sum _{n=1}^{\infty }\prod _{i=0}^{n-1}{\frac {\lambda _{i}}{\mu _{i+1}}}=1}
  
 leads to

  
    
      
        
          P
          
            0
          
        
        =
        
          
            1
            
              1
              +
              
                ∑
                
                  n
                  =
                  1
                
                
                  ∞
                
              
              
                ∏
                
                  i
                  =
                  0
                
                
                  n
                  −
                  1
                
              
              
                
                  
                    λ
                    
                      i
                    
                  
                  
                    μ
                    
                      i
                      +
                      1
                    
                  
                
              
            
          
        
      
    
    {\displaystyle P_{0}={\frac {1}{1+\sum _{n=1}^{\infty }\prod _{i=0}^{n-1}{\frac {\lambda _{i}}{\mu _{i+1}}}}}}
  

which, together with the equation for 
  
    
      
        
          P
          
            n
          
        
      
    
    {\displaystyle P_{n}}
  
 
  
    
      
        (
        n
        ≥
        1
        )
      
    
    {\displaystyle (n\geq 1)}
  
, fully describes the required steady state probabilities.

=== Kendall's notation ===

Single queueing nodes are usually described using Kendall's notation in the form A/S/c where A describes the distribution of durations between each arrival to the queue, S the distribution of service times for jobs, and c the number of servers at the node. For an example of the notation, the M/M/1 queue is a simple model where a single server serves jobs that arrive according to a Poisson process (where inter-arrival durations are exponentially distributed) and have exponentially distributed service times (the M denotes a Markov process). In an M/G/1 queue, the G stands for general and indicates an arbitrary probability distribution for service times.

=== Example analysis of an M/M/1 queue ===
Consider a queue with one server and the following characteristics:

  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
: the arrival rate (the reciprocal of the expected time between each customer arriving, e.g. 10 customers per second)

  
    
      
        μ
      
    
    {\displaystyle \mu }
  
: the reciprocal of the mean service time (the expected number of consecutive service completions per the same unit time, e.g. per 30 seconds)
n: the parameter characterizing the number of customers in the system

  
    
      
        
          P
          
            n
          
        
      
    
    {\displaystyle P_{n}}
  
: the probability of there being n customers in the system in steady state
Further, let 
  
    
      
        
          E
          
            n
          
        
      
    
    {\displaystyle E_{n}}
  
 represent the number of times the system enters state n, and 
  
    
      
        
          L
          
            n
          
        
      
    
    {\displaystyle L_{n}}
  
 represent the number of times the system leaves state n. Then 
  
    
      
        
          |
          
            
              E
              
                n
              
            
            −
            
              L
              
                n
              
            
          
          |
        
        ∈
        {
        0
        ,
        1
        }
      
    
    {\displaystyle \left\vert E_{n}-L_{n}\right\vert \in \{0,1\}}
  
 for all n. That is, the number of times the system leaves a state differs by at most 1 from the number of times it enters that state, since it will either return into that state at some time in the future (
  
    
      
        
          E
          
            n
          
        
        =
        
          L
          
            n
          
        
      
    
    {\displaystyle E_{n}=L_{n}}
  
) or not (
  
    
      
        
          |
          
            
              E
              
                n
              
            
            −
            
              L
              
                n
              
            
          
          |
        
        =
        1
      
    
    {\displaystyle \left\vert E_{n}-L_{n}\right\vert =1}
  
).
When the system arrives at a steady state, the arrival rate should be equal to the departure rate.
Thus the balance equations

  
    
      
        μ
        
          P
          
            1
          
        
        =
        λ
        
          P
          
            0
          
        
      
    
    {\displaystyle \mu P_{1}=\lambda P_{0}}
  

  
    
      
        λ
        
          P
          
            0
          
        
        +
        μ
        
          P
          
            2
          
        
        =
        (
        λ
        +
        μ
        )
        
          P
          
            1
          
        
      
    
    {\displaystyle \lambda P_{0}+\mu P_{2}=(\lambda +\mu )P_{1}}
  

  
    
      
        λ
        
          P
          
            n
            −
            1
          
        
        +
        μ
        
          P
          
            n
            +
            1
          
        
        =
        (
        λ
        +
        μ
        )
        
          P
          
            n
          
        
      
    
    {\displaystyle \lambda P_{n-1}+\mu P_{n+1}=(\lambda +\mu )P_{n}}
  

imply

  
    
      
        
          P
          
            n
          
        
        =
        
          
            λ
            μ
          
        
        
          P
          
            n
            −
            1
          
        
        ,
         
        n
        =
        1
        ,
        2
        ,
        …
      
    
    {\displaystyle P_{n}={\frac {\lambda }{\mu }}P_{n-1},\ n=1,2,\ldots }
  

The fact that 
  
    
      
        
          P
          
            0
          
        
        +
        
          P
          
            1
          
        
        +
        ⋯
        =
        1
      
    
    {\displaystyle P_{0}+P_{1}+\cdots =1}
  
 leads to the geometric distribution formula

  
    
      
        
          P
          
            n
          
        
        =
        (
        1
        −
        ρ
        )
        
          ρ
          
            n
          
        
      
    
    {\displaystyle P_{n}=(1-\rho )\rho ^{n}}
  

where 
  
    
      
        ρ
        =
        
          
            λ
            μ
          
        
        <
        1
      
    
    {\displaystyle \rho ={\frac {\lambda }{\mu }}<1}
  
.

=== Simple two-equation queue ===
A common basic queueing system is attributed to Erlang and is a modification of Little's Law. Given an arrival rate λ, a dropout rate σ, and a departure rate μ, length of the queue L is defined as:

  
    
      
        L
        =
        
          
            
              λ
              −
              σ
            
            μ
          
        
      
    
    {\displaystyle L={\frac {\lambda -\sigma }{\mu }}}
  
.
Assuming an exponential distribution for the rates, the waiting time W can be defined as the proportion of arrivals that are served. This is equal to the exponential survival rate of those who do not drop out over the waiting period, giving:

  
    
      
        
          
            μ
            λ
          
        
        =
        
          e
          
            −
            W
            
              μ
            
          
        
      
    
    {\displaystyle {\frac {\mu }{\lambda }}=e^{-W{\mu }}}
  

The second equation is commonly rewritten as:

  
    
      
        W
        =
        
          
            1
            μ
          
        
        
          l
          n
        
        
          
            λ
            μ
          
        
      
    
    {\displaystyle W={\frac {1}{\mu }}\mathrm {ln} {\frac {\lambda }{\mu }}}
  

The two-stage one-box model is common in epidemiology.

== History ==

In 1909, Agner Krarup Erlang, a Danish engineer who worked for the Copenhagen Telephone Exchange, published the first paper on what would now be called queueing theory. He modeled the number of telephone calls arriving at an exchange by a Poisson process and solved the M/D/1 queue in 1917 and M/D/k queueing model in 1920. In Kendall's notation: