A small probability story

Waiting for the last bowl

Three bowls begin with one marker each. Choose one of all the markers uniformly, put it back, and add a new marker to the same bowl. Repeat.

Let T be the first step when every bowl has received at least one new marker. The median wait is 9 steps. Every bowl eventually receives one with probability 1 — yet the theoretical average wait is infinite.

Those statements can both be true: very long waits become unlikely, but not quite quickly enough for their contribution to the average to add up to a finite number.

Stop the clock

Choose a cutoff. If the last bowl has not received a new marker by then, count the wait as the cutoff rather than waiting longer.

additions
—chance all bowls have received a new marker by N
—chance at least one is still waiting
—average capped wait, E[min(T, N)]

The blue bar shows the chance of completion by the cutoff. It is a probability, not a sample of actual trials.

The slow climb

The capped average is always finite. Raising the cap lets more of the rare, long waits count; there is no finite number it approaches.

Average capped wait versus cutoffA line connects six calculated points as the cutoff grows from 3 to 10,000. The horizontal axis is logarithmic; the vertical axis shows the average capped wait in additions. A gold point marks the selected cutoff.500average capped wait310,000cutoff N (log scale)

The line connects six calculated cutoffs; the values between them are not separately plotted.

Why does the average diverge?

After n additions, all nonnegative count triples are equally likely: a particular ordered sequence leading to counts (a,b,c) has probability a!b!c!/(3·4···(n+2)), and there are n!/(a!b!c!) such sequences. The factorials cancel.

There are binom(n+2, 2) triples in total and, for n ≥ 1, binom(n−1, 2) with all three counts positive (taking that count as zero when n is 1 or 2). So

P(T > n) = 6n / [(n+1)(n+2)] ~ 6/n.

The tail approaches zero, giving eventual completion with probability 1. But the expected wait is the sum of the tail probabilities, and these behave like a constant times the divergent harmonic series.

For a finite cutoff N, the tail sum instead gives E[min(T,N)] = 6HN + 12/(N+1) − 11, where HN is the Nth harmonic number.