Stellar Grove · Research

Stellar Grove · Concrete Mathematical Modelling

How many checkouts to open

Customers arrive at 1.8 a minute and take 2 minutes each to serve. How many lanes keep the wait reasonable?

Chapter 6 · Stationary distributions. A worked example rebuilt from the chapter's topic in Mike Mesterton-Gibbons, *A Concrete Approach to Mathematical Modelling*; the scenario and numbers are our own illustration, not the book's text.

Headline: The work needs 3.6 cashiers on average, but 4 lanes leave customers waiting 3.9 minutes on average. Opening one more cuts that to 0.6; meeting '80% start within 2 minutes' takes 5 lanes.

The problem

Shoppers reach the checkouts at random, λ=1.8 a minute (a Poisson process, as in Chapter 5), and service takes an exponentially distributed time with mean 2 minutes (μ=0.5). The load is a=λ/μ=3.6 busy cashiers' worth of work. With c lanes and one shared line, how long do people wait?

The model

The number of customers in the store's checkout area is a birth-death chain: arrivals at rate λ, departures at rate μmin(n,c). In the long run it settles into a stationary distribution found from the balance equations λπn−1=μmin(n,c)πn. Summing the tail gives Erlang's C formula, the probability that an arrival has to wait:

C(c,a)=acc!11−ρ∑k=0c−1akk!+acc!11−ρ,ρ=ac<1

The waiting time is zero with probability 1−C, and otherwise exponential with rate cμ−λ:

Wq=C(c,a)cμ−λ,P(wait>t)=C(c,a)e−(cμ−λ)t,Lq=λWq

Results

LanesUtilisationP(wait at all)Mean wait (min)P(wait > 2 min)Mean queue length
490%79%3.9453%7.09
572%41%0.5910%1.06
660%20%0.162%0.29
751%9%0.050%0.09
845%3%0.020%0.03
Share of customers still waiting after t minutes, by number of open lanes
Share of customers still waiting after t minutes, by number of open lanes

Try it

Checkout queue explorer

Bars show how many customers are at the checkouts (in service plus waiting), in the long run.

Key findings

from books.concrete_mathematics import stationary as st
q = st.mmc(lam=1.8, mu=0.5, c=4)
print(round(q.Wq, 2), round(q.p_wait, 3), round(q.L, 2))
print(st.servers_needed(1.8, 0.5, max_wait=2, prob=0.8))

# → 3.94 0.788 10.69
# → 5

Assumptions and extensions