In the statistical theory of estimation, the German tank problem consists of estimating the maximum of a discrete uniform distribution from sampling without replacement. In simple terms, suppose there exists an unknown number of items which are sequentially numbered from 1 to N. A random sample of these items is taken and their sequence numbers observed; the problem is to estimate N from these observed numbers.
The problem can be approached using either frequentist inference or Bayesian inference, leading to different results. Estimating the population maximum based on a single sample yields divergent results, whereas estimation based on multiple samples is a practical estimation question whose answer is simple (especially in the frequentist setting) but not obvious (especially in the Bayesian setting).
The problem is named after its historical application by Allied forces in World War II to the estimation of the monthly rate of German tank production from very limited data. This exploited the manufacturing practice of assigning and attaching ascending sequences of serial numbers to tank components (chassis, gearbox, engine, wheels), with some of the tanks eventually being captured in battle by Allied forces.
The adversary is presumed to have manufactured a series of tanks marked with consecutive whole numbers, beginning with serial number 1. Additionally, regardless of a tank's date of manufacture, history of service, or the serial number it bears, the distribution over serial numbers becoming revealed to analysis is uniform, up to the point in time when the analysis is conducted.
Assuming tanks are assigned sequential serial numbers starting with 1, suppose that four tanks are captured and that they have the serial numbers: 19, 40, 42 and 60.
A frequentist approach (using the minimum-variance unbiased estimator) predicts the total number of tanks produced will be:
N ≈ 74
A Bayesian approach (using a uniform prior over the integers in
[4,\Omega]
\Omega
Nmed ≈ 74.5
whereas the Bayesian mean predicts that the number of tanks produced would be:
Nav ≈ 89
Let equal the total number of tanks predicted to have been produced, equal the highest serial number observed and equal the number of tanks captured.
The frequentist prediction is calculated as:
N ≈ m+
m | |
k |
-1=74
The Bayesian median is calculated as:
Nmed ≈ m+
mln(2) | |
k-1 |
=74.5
The Bayesian mean is calculated as:
Nav ≈ (m-1)
k-1 | |
k-2 |
=89
These Bayesian quantities are derived from the Bayesian posterior distribution:
\Pr(N=n)=\begin{cases} 0&ifn<m\\
k-1 | |
k |
\binom{m-1 | |
k-1 |
This probability mass function has a positive skewness, related to the fact that there are at least 60 tanks. Because of this skewness, the mean may not be the most meaningful estimate. The median in this example is 74.5, in close agreement with the frequentist formula. Using Stirling's approximation, the posterior may be approximated by an exponentially decaying function of n,
\Pr(N=n) ≈ \begin{cases} 0&ifn<m\\ (k-1)mk-1n-k&ifn\gem, \end{cases}
which results in the following approximation for the median:
Nmed ≈ m+
mln(2) | |
k-1 |
and the following approximations for the mean and standard deviation:
\begin{align} N& ≈ \mu\pm\sigma=89\pm50,\\[5pt] \mu&=(m-1)
k-1 | |
k-2 |
,\\[5pt] \sigma&=\sqrt{
(k-1)(m-1)(m-k+1) | |
(k-3)(k-2)2 |
During the course of the Second World War, the Western Allies made sustained efforts to determine the extent of German production and approached this in two major ways: conventional intelligence gathering and statistical estimation. In many cases, statistical analysis substantially improved on conventional intelligence. In some cases, conventional intelligence was used in conjunction with statistical methods, as was the case in estimation of Panther tank production just prior to D-Day.
The allied command structure had thought the Panzer V (Panther) tanks seen in Italy, with their high velocity, long-barreled 75 mm/L70 guns, were unusual heavy tanks and would only be seen in northern France in small numbers, much the same way as the Tiger I was seen in Tunisia. The US Army was confident that the Sherman tank would continue to perform well, as it had versus the Panzer III and Panzer IV tanks in North Africa and Sicily. Shortly before D-Day, rumors indicated that large numbers of Panzer V tanks were being used.
To determine whether this was true, the Allies attempted to estimate the number of tanks being produced. To do this, they used the serial numbers on captured or destroyed tanks. The principal numbers used were gearbox numbers, as these fell in two unbroken sequences. Chassis and engine numbers were also used, though their use was more complicated. Various other components were used to cross-check the analysis. Similar analyses were done on wheels, which were observed to be sequentially numbered (i.e., 1, 2, 3, ..., N).[1]
The analysis of tank wheels yielded an estimate for the number of wheel molds that were in use. A discussion with British road wheel makers then estimated the number of wheels that could be produced from this many molds, which yielded the number of tanks that were being produced each month. Analysis of wheels from two tanks (32 road wheels each, 64 road wheels total) yielded an estimate of 270 tanks produced in February 1944, substantially more than had previously been suspected.[2]
German records after the war showed production for the month of February 1944 was 276. The statistical approach proved to be far more accurate than conventional intelligence methods, and the phrase "German tank problem" became accepted as a descriptor for this type of statistical analysis.
Estimating production was not the only use of this serial-number analysis. It was also used to understand German production more generally, including number of factories, relative importance of factories, length of supply chain (based on lag between production and use), changes in production, and use of resources such as rubber.
According to conventional Allied intelligence estimates, the Germans were producing around 1,400 tanks a month between June 1940 and September 1942. Applying the formula below to the serial numbers of captured tanks, the number was calculated to be 246 a month. After the war, captured German production figures from the ministry of Albert Speer showed the actual number to be 245.
Estimates for some specific months are given as:
Month | Statistical estimate | Intelligence estimate | German records | |
---|---|---|---|---|
June 1940 | 169 | 1,000 | 122 | |
June 1941 | 244 | 1,550 | 271 | |
August 1942 | 327 | 1,550 | 342 |
Similar serial-number analysis was used for other military equipment during World War II, most successfully for the V-2 rocket.
Factory markings on Soviet military equipment were analyzed during the Korean War, and by German intelligence during World War II.
In the 1980s, some Americans were given access to the production line of Israel's Merkava tanks. The production numbers were classified, but the tanks had serial numbers, allowing estimation of production.
The formula has been used in non-military contexts, for example to estimate the number of Commodore 64 computers built, where the result (12.5 million) matches the low-end estimates.[3]
To confound serial-number analysis, serial numbers can be excluded, or usable auxiliary information reduced. Alternatively, serial numbers that resist cryptanalysis can be used, most effectively by randomly choosing numbers without replacement from a list that is much larger than the number of objects produced, or by producing random numbers and checking them against the list of already assigned numbers; collisions are likely to occur unless the number of digits possible is more than twice the number of digits in the number of objects produced (where the serial number can be in any base); see birthday problem. For this, a cryptographically secure pseudorandom number generator may be used. All these methods require a lookup table (or breaking the cypher) to back out from serial number to production order, which complicates use of serial numbers: a range of serial numbers cannot be recalled, for instance, but each must be looked up individually, or a list generated.
Alternatively, sequential serial numbers can be encrypted with a simple substitution cipher, which allows easy decoding, but is also easily broken by frequency analysis: even if starting from an arbitrary point, the plaintext has a pattern (namely, numbers are in sequence). One example is given in Ken Follett's novel Code to Zero, where the encryption of the Jupiter-C rocket serial numbers is given by:
The code word here is Huntsville (with repeated letters omitted) to get a 10-letter key.[4] The rocket number 13 was therefore "HN", and the rocket number 24 was "UT".
For point estimation (estimating a single value for the total,
\widehat{N}
\widehat{N}=m(1+k-1)-1,
where m is the largest serial number observed (sample maximum) and k is the number of tanks observed (sample size).[5] Note that once a serial number has been observed, it is no longer in the pool and will not be observed again.
This has a variance
\operatorname{var}\left(\widehat{N}\right)=
1 | |
k |
(N-k)(N+1) | |
(k+2) |
≈
N2 | |
k2 |
forsmallsamplesk\llN,
so the standard deviation is approximately N/k, the expected size of the gap between sorted observations in the sample.
The formula may be understood intuitively as the sample maximum plus the average gap between observations in the sample, the sample maximum being chosen as the initial estimator, due to being the maximum likelihood estimator, with the gap being added to compensate for the negative bias of the sample maximum as an estimator for the population maximum, and written as
\widehat{N}=m+
m-k | |
k |
=m+mk-1-1=m(1+k-1)-1.
This can be visualized by imagining that the observations in the sample are evenly spaced throughout the range, with additional observations just outside the range at 0 and N + 1. If starting with an initial gap between 0 and the lowest observation in the sample (the sample minimum), the average gap between consecutive observations in the sample is
(m-k)/k
-k
This philosophy is formalized and generalized in the method of maximum spacing estimation; a similar heuristic is used forplotting position in a Q–Q plot, plotting sample points at, which is evenly on the uniform distribution, with a gap at the end.
Instead of, or in addition to, point estimation, interval estimation can be carried out, such as confidence intervals.These are easily computed, based on the observation that the probability that k observations in the sample will fall in an interval covering p of the range (0 ≤ p ≤ 1) is pk (assuming in this section that draws are with replacement, to simplify computations; if draws are without replacement, this overstates the likelihood, and intervals will be overly conservative).
Thus the sampling distribution of the quantile of the sample maximum is the graph x1/k from 0 to 1: the p-th to q-th quantile of the sample maximum m are the interval [''p''<sup>1/''k''</sup>''N'', ''q''<sup>1/''k''</sup>''N'']. Inverting this yields the corresponding confidence interval for the population maximum of [''m''/''q''<sup>1/''k''</sup>, ''m''/''p''<sup>1/''k''</sup>].
For example, taking the symmetric 95% interval p = 2.5% and q = 97.5% for k = 5 yields 0.0251/5 ≈ 0.48, 0.9751/5 ≈ 0.995, so the confidence interval is approximately [1.005''m'', 2.08''m'']. The lower bound is very close to m, thus more informative is the asymmetric confidence interval from p = 5% to 100%; for k = 5 this yields 0.051/5 ≈ 0.55 and the interval [''m'', 1.82''m''].
More generally, the (downward biased) 95% confidence interval is [''m'', ''m''/0.05<sup>1/''k''</sup>] = [''m'', ''m''·20<sup>1/k</sup>]. For a range of k values, with the UMVU point estimator (plus 1 for legibility) for reference, this yields:
k | Point estimate | Confidence interval | |
---|---|---|---|
1 | 2m | [''m'', 20''m''] | |
2 | 1.5m | [''m'', 4.5''m''] | |
5 | 1.2m | [''m'', 1.82''m''] | |
10 | 1.1m | [''m'', 1.35''m''] | |
20 | 1.05m | [''m'', 1.16''m''] |
Immediate observations are:
Note that m/k cannot be used naively (or rather (m + m/k − 1)/k) as an estimate of the standard error SE, as the standard error of an estimator is based on the population maximum (a parameter), and using an estimate to estimate the error in that very estimate is circular reasoning.
The Bayesian approach to the German tank problem[6] is to consider the posterior probability
(N=n\midM=m,K=k)
N
n
K
k
M
m
The answer to this problem depends on the choice of prior for
N
For brevity, in what follows,
(N=n\midM=m,K=k)
(n\midm,k)
The rule for conditional probability gives
(n\midm,k)(m\midk)=(m\midn,k)(n\midk)=(m,n\midk)
The expression
(m\midn,k)=(M=m\midN=n,K=k)
M
m
N
n
K
k
It is
(m\midn,k)= \binom{m-1}{k-1}\binom{n}{k}-1[k\lem][m\len]
\binomnk
[k\len]
The expression can be derived as follows:
(m\midn,k)
m
k
n
One can think of the sample of size
k
k
m
d
As can be seen from the right-hand side, this expression is independent of
d
d\leqk
m
k
m
k
The expression
(m\midk)=(M=m\midK=k)
m
k
The expression
(m\midk)
n
\begin{align} (m\midk)
infty(m,n\mid | |
&=\sum | |
n=0 |
k)\\
infty(m\mid | |
&=\sum | |
n=0 |
n,k)(n\midk) \end{align}
We assume that
k
k
k
The expression
(n\midk)=(N=n\midK=k)
N
n
K
k
(n\midk)=(\Omega-k)-1[k\len][n<\Omega]
The upper limit
\Omega
f(n)=\lim\Omega\rarrinfty(\Omega-k)-1[k\len][n<\Omega]=0
\Omega
Provided that
\Omega>m
(n\midm,k)=(m\mid
\Omega-1 | |
n,k)\left(\sum | |
n=m |
(m\midn,k)\right)-1[m\len][n<\Omega]
As
\Omega → infty
infty(m\mid | |
\sum | |
n=m |
n,k)
\Omega
(n\midm,k) ≈ (m\mid
infty | |
n,k)\left(\sum | |
n=m |
(m\midn,k)\right)-1[m\len]
For k ≥ 2, the credibility that the number of enemy tanks is equal to
n
(N=n\midm,k)=(k-1)\binom{m-1}{k-1}k-1\binomnk-1[m\len]
The credibility that the number of enemy tanks, N, is greater than n, is
(N>n\midm,k)=\begin{cases} 1&ifn<m\\
\binom{m-1 | |
k-1 |
For k ≥ 3, N has the finite mean value:
(m-1)(k-1)(k-2)-1
For k ≥ 4, N has the finite standard deviation:
(k-1)1/2(k-2)-1(k-3)-1/2(m-1)1/2(m+1-k)1/2
The following binomial coefficient identity is used below for simplifying series relating to the German Tank Problem.
infty | |
\sum | |
n=m |
1 | |
\binomnk |
=
k{k | 1} | |
- |
1 | |
\binom{m-1 |
{k-1}}
This sum formula is somewhat analogous to the integral formula
infty | |
\int | |
n=m |
dn | |
nk |
=
1{k | 1} | |
- |
1{m | |
k |
These formulas apply for k > 1.
Observing one tank randomly out of a population of n tanks gives the serial number m with probability 1/n for m ≤ n, and zero probability for m > n. Using Iverson bracket notation this is written
(M=m\midN=n,K=1)=(m\midn)=
[m\len] | |
n |
This is the conditional probability mass distribution function of
m
When considered a function of n for fixed m this is a likelihood function.
l{L}(n)=
[n\gem] | |
n |
The maximum likelihood estimate for the total number of tanks is N0 = m, clearly a biased estimate since the true number can be more than this, potentially many more, but cannot be fewer.
The marginal likelihood (i.e. marginalized over all models) is infinite, being a tail of the harmonic series.
\sumnl{L}(n)=
infty | |
\sum | |
n=m |
1 | |
n |
=infty
but
\begin{align} \sumnl{L}(n)[n<\Omega] &=
\Omega-1 | |
\sum | |
n=m |
1 | |
n |
\\[5pt] &=H\Omega-1-Hm\end{align}
where
Hn
The credibility mass distribution function depends on the prior limit
\Omega
\begin{align} &(N=n\midM=m,K=1)\\[5pt] ={}&(n\midm)=
[m\len] | |
n |
[n<\Omega] | |
H\Omega-Hm |
\end{align}
The mean value of
N
\begin{align} \sumnn ⋅ (n\midm)&=
\Omega-1 | |
\sum | |
n=m |
1 | |
H\Omega-Hm |
\\[5pt] &=
\Omega-m | |
H\Omega-Hm |
\\[5pt] & ≈
\Omega-m | ||||
|
\end{align}
If two tanks rather than one are observed, then the probability that the larger of the observed two serial numbers is equal to m, is
(M=m\midN=n,K=2)=(m\midn)=[m\len]
m-1 | |
\binom{n |
{2}}
When considered a function of n for fixed m this is a likelihood function
l{L}(n)=[n\gem]
m-1 | |
\binom{n |
{2}}
The total likelihood is
\begin{align} \sumnl{L}(n)&=
m-1 | |
1 |
infty | |
\sum | |
n=m |
1 | |
\binomn2 |
\\[4pt] &=
m-1 | |
1 |
⋅
2 | |
2-1 |
⋅
1 | |
\binom{m-1 |
{2-1}}\\[4pt] &=2 \end{align}
and the credibility mass distribution function is
\begin{align} &(N=n\midM=m,K=2)\\[4pt] ={}&(n\midm)\\[4pt] ={}&
l{L | |
(n)}{\sum |
nl{L}(n)}\\[4pt] ={}&[n\gem]
m-1 | |
n(n-1) |
\end{align}
\tilde{N}
\sumn[n\ge\tilde{N}](n\midm)=
1 | |
2 |
so
m-1 | |
\tildeN-1 |
=
1 | |
2 |
and so the median is
\tilde{N}=2m-1
but the mean value of
N
\mu=\sumnn ⋅ (n\midm)=
m-1 | |
1\sum |
infty | |
n=m |
1 | |
n-1 |
=infty
The conditional probability that the largest of k observations taken from the serial numbers, is equal to m, is
\begin{align} &(M=m\midN=n,K=k\ge2)\\ ={}&(m\midn,k)\\ ={}&[m\len]
\binom{m-1 | |
k-1 |
The likelihood function of n is the same expression
l{L}(n)=[n\gem]
\binom{m-1 | |
k-1 |
The total likelihood is finite for k ≥ 2:
\begin{align} \sumnl{L}(n) &=
\binom{m-1 | |
k-1 |
The credibility mass distribution function is
\begin{align} &(N=n\midM=m,K=k\ge2)=(n\midm,k)\\ ={}&
l{L | |
(n)}{\sum |
nl{L}(n)}\\ ={}&[n\gem]
k-1 | |
k |
\binom{m-1 | |
k-1 |
The complementary cumulative distribution function is the credibility that N > x
\begin{align} &(N>x\midM=m,K=k)\\[4pt] ={}&\begin{cases} 1&ifx<m\\
infty | |
\sum | |
n=x+1 |
(n\midm,k)&ifx\gem \end{cases}\\ ={}&[x<m]+[x\ge
infty | |
m]\sum | |
n=x+1 |
k-1 | |
k |
\binom{m-1 | |
k-1 |
The cumulative distribution function is the credibility that N ≤ x
\begin{align} &(N\lex\midM=m,K=k)\\[4pt] ={}&1-(N>x\midM=m,K=k)\\[4pt] ={}&[x\gem]\left(1-
\binom{m-1 | |
k-1 |
The order of magnitude of the number of enemy tanks is
\begin{align} \mu&=\sumnn ⋅ (N=n\midM=m,K=k)\\[4pt] &=\sumnn[n\gem]
m-1 | |
n |
\binom{m-2 | |
k-2 |
The statistical uncertainty is the standard deviation
\sigma
\sigma2+\mu2=\sumnn2 ⋅ (N=n\midM=m,K=k)
So
\begin{align} \sigma2+\mu2-\mu&=\sumnn(n-1) ⋅ (N=n\midM=m,K=k)\\[4pt] &=
infty | ||
\sum | n(n-1) | |
n=m |
m-1 | |
n |
m-2 | |
n-1 |
k-1 | |
k-2 |
\binom{m-3 | |
k-3 |
and
\begin{align} \sigma&=\sqrt{
m-1 | |
1 |
m-2 | |
1 |
k-1 | |
k-3 |
+\mu-\mu2}\\[4pt] &=\sqrt{
(k-1)(m-1)(m-k+1) | |
(k-3)(k-2)2 |
The variance-to-mean ratio is simply
\sigma2 | |
\mu |
=
m-k+1 | |
(k-3)(k-2) |