Stochastic Networks I: Erlang's Formula for a Single LinkTextbook
Motivation
In the early twentieth century Agner Krarup Erlang worked for the Copenhagen Telephone Company and faced a sizing question that every shared-resource operator still faces: how many parallel circuits must a telephone link carry so that an arriving call is almost never turned away? The answer he published — the Erlang loss formula — is still the standard dimensioning tool for circuit-switched links, call centres, hospital beds, rental fleets, and any system in which a customer who finds every server occupied leaves rather than waits.
The formula is the first capstone of Frank Kelly and Elena Yudovina's Stochastic Networks (Cambridge University Press, 2014), where it closes Chapter 1 and supplies the building block for the loss networks of Chapter 3. It is also the cleanest possible demonstration of the book's method: write down the transition rates of a Markov process, guess that the process is reversible, solve the detailed balance equations, and read the answer off the normalizing constant. This mission formalizes that chapter: the reversibility apparatus, the birth-and-death chain of the loss link, and Erlang's formula itself.
Setting
A link carries parallel circuits. Calls arrive as a Poisson process of rate and each call, while it lasts, occupies one circuit for an exponentially distributed holding time of parameter ; holding times are independent of one another and of the arrival times. A call that arrives to find all circuits busy is lost — it does not queue.
Let be the number of busy circuits. Then is a Markov process with transition rates
and otherwise. A collection of numbers is in detailed balance with rates when
and satisfies the equilibrium (full balance) equations when
Detailed balance is the statement that, in equilibrium, transitions from to occur as frequently as transitions from to . Writing for the traffic intensity, Erlang's formula is
Formalization targets
Goal — Erlang's formula
The goal fixes no numerical constant: it says that whatever probability vector solves the detailed balance equations of the loss link assigns exactly to the blocking state. The hypothesis is detailed balance rather than full balance, which is what the book's derivation actually uses and is the stronger assumption to discharge.
Supporting levels
together with the reversibility results that justify the method: detailed balance implies full balance, the reversed process of Proposition 1.1 has rates and retains as an equilibrium distribution, and holds exactly when and are in detailed balance.
Significance
The result itself. is the blocking probability of the link, so it converts a traffic measurement and a target grade of service into a circuit count. It is insensitive: the same formula holds for any holding-time distribution with mean , which is why it survives as an engineering tool far outside the exponential model that produces it here. Chapter 3 of the book builds loss networks on top of it, and the Erlang fixed point that approximates a whole network is a system of coupled copies of this one formula. The derivative identity is the ingredient that makes tractable in optimization: it shows is increasing in , and the recursion it encodes is how the formula is evaluated numerically without overflow.
Formalizing it. Nothing here is open mathematics; the value of the mission is a
machine-checked statement of the loss model and a reusable reversibility layer. Mathlib has no
theory of detailed balance or of reversible Markov processes over a countable state space, so
this mission contributes the first: the predicates DetailedBalance and FullBalance, the
reversed rate matrix, and the three structural facts relating them. Those are shared by every
later mission in this series — the migration processes of Chapter 2 and the loss networks of
Chapter 3 are all proved reversible or quasi-reversible by exactly these means.
Difficulty
The obvious route to is to solve the equilibrium equations directly, and for a
birth-and-death chain that is a three-term recursion whose general solution needs two boundary
conditions. Detailed balance replaces it with a two-term recursion and one boundary condition,
and the whole content of the reversibility section is that the substitution is legitimate.
The remaining work is bookkeeping that Lean makes less forgiving than the page does: the
detailed balance equations must be indexed so that the and boundaries are not
silently assumed away, the normalizing sum must be shown positive before it can be inverted,
and the induction that produces has to carry the Fin (C+1) index through
Nat.factorial. For the derivative identity, the naive differentiation of a quotient gives
in the numerator, and recognizing it as
times the denominator is the step that produces the stated form.
Formalization scope
The state space is Fin (C + 1), so the link with circuits has states and finiteness
is built in; is a plain function Fin (C + 1) → ℝ constrained by hypotheses rather than a
PMF, so that the normalization appears explicitly wherever it is used.
FullBalance is written with unconditional sums (tsum) over an arbitrary state space, so the
same predicate serves the countable chains of later chapters; over a Fintype it is the finite
sum. Rates are real-valued and q j j = 0 by construction, matching the book's convention that
a Markov process must change state when it jumps.
The rates carry as hypotheses. This rules out the degenerate reading in which
makes every downward rate vanish: with the detailed balance equations force
for , so the only normalized solution is the point mass at , and
while Lean evaluates for ; the goal would be false.
Erlang's formula is stated for the last state Fin.last C, not for an unconstrained index, so
it cannot be satisfied by a degenerate reindexing.
Contributions welcome beyond the listed items: the insensitivity of to the holding time distribution, the recursion , the finite-source variant and the PASTA statement that an arriving call in that model sees , and the parking-space identity of Exercise 1.9.
Selected references
- Frank Kelly and Elena Yudovina, Stochastic Networks, Cambridge University Press, 2014, Chapter 1 (pp. 13–21), equations (1.2), (1.4), (1.5), Proposition 1.1, Exercises 1.7 and 1.8. DOI 10.1017/cbo9781139565363
- A. K. Erlang, Solution of some problems in the theory of probabilities of significance in automatic telephone exchanges, Elektrotkeknikeren 13 (1917), 5–13.
- Frank Kelly, Reversibility and Stochastic Networks, Cambridge University Press, 2011 (reissue of the 1979 edition), Chapter 1.
- J. R. Norris, Markov Chains, Cambridge University Press, 1998. DOI 10.1017/CBO9780511810633