Stellar Grove · Research

Stellar Grove · Concrete Mathematical Modelling

Random arrivals at the checkout

If customers arrive at random at 1.8 a minute, how lumpy is the flow, and can we tell from a day's data?

Chapter 5 · Birth and death: probabilistic dynamics. 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. The day of arrivals on this page is simulated from a Poisson process with a known rate, so the estimate and the goodness-of-fit test can be checked against the truth.

Headline: Even at a steady average of 1.8 a minute, 17% of minutes see nobody and 4% see five or more. One simulated day pins the rate to 1.84 (1.72–1.96), and the Poisson shape fits (p = 0.65).

The problem

A store manager plans checkout staffing. Customers don't coordinate: each arrival is independent of the others, and the chance of one in any short instant is the same all day. What does that imply about how many arrive per minute and about the gaps between them?

The model

Assume that in a short interval δt one arrival happens with probability λδt, independently of the past. The probability of n arrivals by time t then satisfies a pure-birth chain of forward equations:

dp0dt=−λp0,dpndt=λpn−1−λpn

Solving them one after another gives the Poisson distribution, and the time to the next arrival is exponential:

P(N(t)=n)=e−λt(λt)nn!,P(gap>s)=e−λs

The maximum-likelihood rate from n gaps is λ^=n/∑si, with an exact interval from 2λ∑si~χ2n2. A χ² test then compares observed minute-counts with the fitted Poisson.

Arrivals per minute over the simulated day against the fitted Poisson probabilities
Arrivals per minute over the simulated day against the fitted Poisson probabilities

Try it

Arrivals per interval

Drag the sliders; hover the chart to read values.

Key findings

Truth checks

CheckResult
95% interval for the rate covers the true 1.8pass
χ² test does not reject the (true) Poisson model at 5%pass
import numpy as np
from books.concrete_mathematics import birth_death as bd, estimation as es
times = bd.poisson_process(rate=1.8, t_max=480, rng=2024)
gaps = np.diff(np.concatenate([[0.0], times]))
print(len(times), [round(x, 3) for x in es.exponential_rate_ci(gaps)])
print(round(bd.prob_no_event(1.8, 1.0), 3))

# → 882 [1.838, 1.719, 1.961]
# → 0.165

Assumptions and extensions