Skip to content

German tank problem

Posted on:

Equipment rolls off a production line carrying serial numbers 1,2,,N1, 2, \ldots, N, and NN is a secret. You capture kk of the NN units, drawn at random from the whole run rather than in production order, look at their serials, and want to estimate NN. This is the German tank problem, named for its most consequential application, and it is a small parade of estimation theory: the obvious estimator is provably bad, the good one has a two-line derivation, and there is a theorem saying nothing better exists.

Model the capture as a uniform random sample of kk distinct serials from {1,,N}\{1, \ldots, N\}, and write MM for the largest serial observed. Intuition already says MM carries the information: knowing the smaller serials tells you about the layout below the maximum, not about how far the line continues above it. (The formal version: MM is a sufficient statistic for NN, meaning the conditional distribution of the rest of the sample given MM does not involve NN.) The maximum-likelihood estimate is MM itself: among all values of NN, the sample in hand is most probable when N=MN = M, since larger NN spreads probability over more possible samples. But MNM \le N always. An estimator that can never overshoot must undershoot on average, and the interesting question is by how much, and what to add back.

The distribution of the maximum

All (Nk)\binom{N}{k} subsets are equally likely. The maximum equals xx exactly when the subset contains xx and its other k1k-1 elements come from {1,,x1}\{1, \ldots, x-1\}:

P(M=x)=(x1k1)(Nk),x=k,,N.\mathbb{P}(M = x) = \frac{\binom{x-1}{k-1}}{\binom{N}{k}}, \qquad x = k, \ldots, N.

The expectation comes out of the hockey-stick identity, x=kN(xk)=(N+1k+1)\sum_{x=k}^{N} \binom{x}{k} = \binom{N+1}{k+1}, which counts the (k+1)(k+1)-subsets of {1,,N+1}\{1, \ldots, N+1\} by their largest element. Using x(x1k1)=k(xk)x \binom{x-1}{k-1} = k \binom{x}{k},

E[M]=x=kNx(x1k1)(Nk)=k(N+1k+1)(Nk)=k(N+1)k+1.\mathbb{E}[M] = \sum_{x=k}^{N} x\, \frac{\binom{x-1}{k-1}}{\binom{N}{k}} = k\, \frac{\binom{N+1}{k+1}}{\binom{N}{k}} = \frac{k(N+1)}{k+1}.

So the maximum sits, on average, a fraction k/(k+1)k/(k+1) of the way up: five captured tanks put MM near 56N\tfrac{5}{6}N, and using MM as the estimate is systematically 17% short.

The gap estimator

The correction has a derivation that needs no algebra at all. The kk observed serials cut {1,,N}\{1, \ldots, N\} into k+1k+1 gaps of unobserved serials: the run below the smallest observation, the k1k-1 runs between consecutive observations, and the run above the maximum. By symmetry the k+1k+1 gap lengths are exchangeable (relabeling the line from the top renumbers the gaps but not the sampling), so each gap has the same expected length, (Nk)/(k+1)(N - k)/(k+1).

The one gap you cannot see the end of is the run above MM, and its expected length matches the gaps you can see. Below and including the maximum there are mkm - k unobserved serials spread over kk gaps, an average of (mk)/k(m-k)/k per gap. Extend the line above the maximum by one average gap:

N^=m+mkk=m(1+1k)1.\widehat{N} = m + \frac{m - k}{k} = m\left(1 + \frac{1}{k}\right) - 1.

The expectation computed above certifies the guess: E[N^]=k+1kk(N+1)k+11=N\mathbb{E}[\widehat{N}] = \frac{k+1}{k} \cdot \frac{k(N+1)}{k+1} - 1 = N, exactly unbiased. And this is not merely one good estimator among many: MM is a complete sufficient statistic for this family, so by the Lehmann–Scheffé theorem, N^\widehat{N} is the unique minimum-variance unbiased estimator; the analysis goes back to Goodman’s 1952 paper. Concretely: four captured tanks with a highest serial of 60 give N^=60541=74\widehat{N} = 60 \cdot \tfrac{5}{4} - 1 = 74, where maximum likelihood would have said 60.

The variance

A second pass through the hockey-stick identity, applied to E[M(M+1)]\mathbb{E}[M(M+1)], yields the exact variance, and hence

Var(N^)=(Nk)(N+1)k(k+2)    N2k2for kN.\operatorname{Var}(\widehat{N}) = \frac{(N - k)(N + 1)}{k(k + 2)} \;\approx\; \frac{N^2}{k^2} \quad \text{for } k \ll N.

The standard error is roughly N/kN/k. That 1/k1/k is worth staring at: estimators built from averages improve like 1/k1/\sqrt{k}, and this one improves like 1/k1/k, because an extreme order statistic hugs the boundary it estimates far more tightly than any average does. The comparison can be made exact. The estimator 2Xˉ12\bar{X} - 1, twice the sample mean minus one, is also unbiased for NN, and a standard finite-population computation gives it variance (N+1)(Nk)/(3k)N2/(3k)(N+1)(N-k)/(3k) \approx N^2/(3k). The ratio of variances is about k/3k/3: with twelve captured tanks, the maximum-based estimator is four times as precise, and the advantage keeps growing with every capture.

In the four-tanks example, the standard error attached to N^=74\widehat{N} = 74 is (744)(74+1)/(46)15\sqrt{(74-4)(74+1)/(4 \cdot 6)} \approx 15: two dozen tanks of uncertainty, from four serial numbers.

The Bayesian version

Treating NN as the unknown in a posterior needs only one identity. Given NN, the observed sample has probability 1/(Nk)1/\binom{N}{k} for every NmN \ge m, so under a flat prior the posterior is proportional to 1/(Nk)1/\binom{N}{k}. The telescoping identity

1(Nk)=kk1[1(N1k1)1(Nk1)]\frac{1}{\binom{N}{k}} = \frac{k}{k-1} \left[ \frac{1}{\binom{N-1}{k-1}} - \frac{1}{\binom{N}{k-1}} \right]

collapses the normalizing sum to Nm(Nk)1=kk1(m1k1)1\sum_{N \ge m} \binom{N}{k}^{-1} = \frac{k}{k-1} \binom{m-1}{k-1}^{-1} (the prior is improper, but the posterior is proper as soon as k2k \ge 2), and the tail probabilities inherit the same closed form:

P(Nxm)=(m1k1)(x1k1)    (mx)k1.\mathbb{P}(N \ge x \mid m) = \frac{\binom{m-1}{k-1}}{\binom{x-1}{k-1}} \;\sim\; \left(\frac{m}{x}\right)^{k-1}.

The posterior has a power-law tail with exponent k1k - 1: heavy for small samples, and in fact the posterior mean is infinite for k=2k = 2. For k3k \ge 3 it exists and is again closed-form,

E[Nm]=(m1)(k1)k2.\mathbb{E}[N \mid m] = \frac{(m-1)(k-1)}{k-2}.

For the running example (k=4k = 4, m=60m = 60): posterior mean 593/2=88.559 \cdot 3 / 2 = 88.5, noticeably above the unbiased 74 because of that heavy tail, and P(N120m)=(593)/(1193)0.12\mathbb{P}(N \ge 120 \mid m) = \binom{59}{3} / \binom{119}{3} \approx 0.12. A production run twice the highest observed serial is a live possibility at k=4k = 4; it takes more captures, not more cleverness, to rule it out.

All four numbers, for any kk and mm, from the closed forms above:

captured k = 4
highest serial m = 60
max likelihood: 60unbiased N̂: 74.0std. error: 14.8posterior mean: 88.5

The historical record

During the Second World War, analysts in the Economic Warfare Division of the American embassy in London, working with British counterparts, estimated German war production from the markings on captured and destroyed equipment: serial numbers and maker’s codes on gearboxes, chassis, engines, and tyre moulds. Their post-war account (Ruggles and Brodie, 1947) includes the comparison that made the method famous. Monthly German tank production, three ways:

MonthSerial-number estimateConventional intelligenceGerman records
June 19401691000122
June 19412441550271
August 19423271550342

Conventional intelligence, extrapolating from prewar industrial capacity and relying on reports and rumor, overestimated production by factors of four to six. The serial-number estimates landed within about 10% in two of the three months and within 40% in the worst one, using arithmetic a page long. The postwar audit of Speer-ministry records is the rare case where an estimator meets its ground truth decades ahead of declassification.

The practice was messier than the model. Serial numbers did not always start at 1, several factories numbered in separate blocks, and some sequences had deliberate gaps; a large part of the actual work in Ruggles and Brodie is reconstructing the numbering scheme before any formula applies. The estimator itself is indifferent to the application, and the same arithmetic applies whenever sequential identifiers leak: invoice numbers, database row IDs, order numbers on receipts. Issuing sequential serial numbers in public is a quiet way of publishing your production figures.

References



Next Post
Pendulum period