# German tank problem

{{ safesubst:#invoke:Unsubst||$N=Use dmy dates |date=__DATE__ |$B= }}

In the statistical theory of estimation, the problem of estimating the maximum of a discrete uniform distribution from sampling without replacement is known in English as the **German tank problem**, due to its application in World War II to the estimation of the number of German tanks.

The analyses illustrate the difference between frequentist inference and Bayesian inference.

Estimating the population maximum based on a *single* sample yields divergent results, while the estimation based on *multiple* samples is an instructive practical estimation question whose answer is simple but not obvious.

## Example

Suppose an intelligence officer has spotted *k* = 4 tanks with serial numbers, 2, 6, 7, and 14, with the maximum observed serial number, *m* = 14. The unknown total number of tanks is called *N*.

The formula for estimating the total number of tanks suggested by the *frequentist* approach outlined below is

Whereas, the *Bayesian* analysis below yields (primarily) a probability mass function for the number of tanks

from which we can estimate the number of tanks according to

This distribution has positive skewness, related to the fact that there are at least 14 tanks.

## Historical problem

During the course of the 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 perform well against the Panzer III and IV tanks that they expected to meet.^{[N 1]} Shortly before D-Day, rumors indicated that large numbers of Panzer V tanks were being used.

To ascertain if this were 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 tires, which were observed to be sequentially numbered (i.e., 1, 2, 3, ..., *N*).Template:SfnTemplate:Efn^{[2]}^{[3]}

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 produced in February 1944, substantially more than had previously been suspected.^{[4]}

German records after the war showed production for the month of February 1944 was 276.Template:Sfn^{[N 2]} 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.

### Specific data

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.^{[2]}

Estimates for some specific months are given as:Template:Sfn^{[5]}

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 analyses

Similar serial number analysis was used for other military equipment during World War II, most successfully for the V-2 rocket.Template:Sfn

During World War II, German intelligence analyzed factory markings on Soviet military equipment, and during the Korean War, factory markings on Soviet equipment were analyzed. The Soviets also estimated German tank production during World War II.Template:Sfn

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.Template:Sfn

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 official figures quite well.^{[6]}

### Countermeasures

{{ safesubst:#invoke:Unsubst||$N=Unreferenced section |date=__DATE__ |$B= {{ safesubst:#invoke:Unsubst||$N=Unreferenced |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} }} To prevent 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 (compare the one-time pad), or produce random numbers and check 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.Template:Efn 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, which allows easy decoding, but then there is a known-plaintext attack: 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 described as:

H | U | N | T | S | V | I | L | E | X |

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |

The code word here is Huntsville (with repeated letters omitted) to get a 10-letter key. The rocket number 13 was therefore "HN", or the rocket number 24 was "UT".

## Frequentist analysis

### Minimum-variance unbiased estimator

For point estimation (estimating a single value for the total()), the minimum-variance unbiased estimator (MVUE, or UMVU estimator) is given by:Template:Efn

where *m* is the largest serial number observed (sample maximum) and *k* is the number of tanks observed (sample size).Template:Sfn^{[7]}^{[8]} 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 ofTemplate:Sfn

so a standard deviation of approximately *N*/*k*, the (population) average size of a gap between samples; compare *m*/*k* above.

#### Intuition

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,Template:Efn with the gap being added to compensate for the negative bias of the sample maximum as an estimator for the population maximum,Template:Efn and written as

This can be visualized by imagining that the samples are evenly spaced throughout the range, with additional samples just outside the range at 0 and *N* + 1. If starting with an initial gap between 0 and the lowest sample (sample minimum), the average gap between samples is ; the being because the samples themselves are not counted in computing the gap between samples.Template:Efn

This philosophy is formalized and generalized in the method of maximum spacing estimation.

#### Derivation

The probability that the sample maximum equals *m* is , where is the binomial coefficient.

The expected value of the sample maximum is

Then

is an unbiased estimator of *N*.

To show that this is the UMVU estimator:

- first show that the sample maximum is a sufficient statistic for the population maximum, using a method similar to that detailed at sufficiency: uniform distribution (but for the German tank problem we must exclude the outcomes in which a serial number occurs twice in the sample);
- Next, show that it is a complete statistic.
- Then the Lehmann–Scheffé theorem states that the sample maximum, corrected for bias as above to be unbiased, is the UMVU estimator.

### Confidence intervals

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* samples will fall in an interval covering *p* of the range (0 ≤ *p* ≤ 1) is *p*^{k} (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 *x*^{1/k} from 0 to 1: the *p*th to *q*th quantile of the sample maximum *m* are the interval [*p*^{1/k}*N*, *q*^{1/k}*N*]. Inverting this yields the corresponding confidence interval for the population maximum of [*m*/*q*^{1/k}, *m*/*p*^{1/k}].

For example, taking the symmetric 95% interval *p* = 2.5% and *q* = 97.5% for *k* = 5 yields , so a confidence interval of approximately . The lower bound is very close to *m,* so more informative is the asymmetric confidence interval from *p* = 5% to 100%; for *k* = 5 this yields so the interval [*m*, 1.82*m*].

More generally, the (downward biased) 95% confidence interval is . For a range of *k,* with the UMVU point estimator (plus 1 for legibility) for reference, this yields:

k |
point estimate | confidence interval |
---|---|---|

1 | ||

2 | ||

5 | ||

10 | ||

20 |

Immediate observations are:

- For small sample sizes, the confidence interval is very wide, reflecting great uncertainty in the estimate.
- The range shrinks rapidly, reflecting the exponentially decaying likelihood that
*all*samples will be significantly below the maximum. - The confidence interval exhibits positive skew, as
*N*can never be below the sample maximum, but can potentially be arbitrarily high above it.

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.

In some fields, notably futurology, estimation of confidence intervals in this way, based on a single sample – considering it as a randomly sampled quantile (by mediocrity principle) – is known as the Copernican principle. This is particularly applied to estimate lifetimes based on current age, notably in the doomsday argument, which applies it to estimate the expected survival time of the human race.

## Bayesian analysis

The Bayesian approach to the German tank problem is to consider the credibility that the number of enemy tanks is equal to the number , when the number of observed tanks, is equal to the number , and the maximum serial number is equal to the number .

The rule for conditional probability gives

The expression is the conditional probability that the maximum serial number observed is equal to , when the number of enemy tanks is known to be equal to , and enemy tanks have been observed. It is

where the binomial coefficient is the number of -sized samples from an -sized population.

The expression is the probability that the maximum serial number is equal to *m* once *k* tanks have been observed but before the serial numbers have actually been observed. can be re-written in terms of the other quantities by marginalizing over all possible .

The expression is the credibility that the total number of tanks is equal to *n* when *k* tanks have been observed but before the serial numbers have actually been observed. Assume that it is some discrete uniform distribution

The upper limit must be finite, because the function

is which is not a probability mass distribution function.

Then

If , then the unwelcome variable disappears from the expression.

For *k* ≥ 1 the mode of the distribution of the number of enemy tanks is *m*.

For *k* ≥ 2, the credibility that the number of enemy tanks is *equal to* , is

and the credibility that the number of enemy tanks, , is *greater than* , is

For *k* ≥ 3, has the finite mean value:

For *k* ≥ 4, has the finite standard deviation:

These formulas are derived below.

### Summation formula

The following binomial coefficient identity is used below for simplifying series relating to the German Tank Problem.

This sum formula is somewhat analogous to the integral formula

These formulas apply for *k* > 1.

### One tank

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

This is the conditional probability mass distribution function of .

When considered a function of *n* for fixed *m* this is a likelihood function.

The maximum likelihood estimate for the total number of tanks is *N*_{0} = *m*.

The total likelihood is infinite, being a tail of the harmonic series.

but

where is the harmonic number.

The credibility mass distribution function depends on the prior limit :

### Two tanks

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

When considered a function of *n* for fixed *m* this is a likelihood function

The total likelihood is

and the credibility mass distribution function is

The median satisfies

so

and so the median is

but the mean value of *N* is infinite

### Many tanks

#### Credibility mass distribution function

The conditional probability that the largest of *k* observations taken from the serial numbers {1,...,*n*}, is equal to *m*, is

The likelihood function of *n* is the same expression

The total likelihood is finite for *k* ≥ 2:

The credibility mass distribution function is

The complementary cumulative distribution function is the credibility that *N* > *x*

The cumulative distribution function is the credibility that *N* ≤ *x*

#### Order of magnitude

The order of magnitude of the number of enemy tanks is

#### Statistical uncertainty

The statistical uncertainty is the standard deviation *σ*, satisfying the equation

So

and

The variance-to-mean ratio is simply

## See also

- Capture-recapture, other method of estimating population size
- Maximum spacing estimation, which generalizes the intuition of "assume uniformly distributed"
- Copernican principle, analogous prediction of lifetime assuming one sample (current age).
- The Doomsday argument, application to estimate expected survival time of the human race.

### Other discussions of the estimation

- Maximum likelihood#Bias
- Bias of an estimator#Maximum of a discrete uniform distribution
- Likelihood function#Example 2

## References

- Notes

- ↑ An Armored Ground Forces policy statement of November 1943 concluded: "The recommendation of a limited proportion of tanks carrying a 90mm gun is not concurred in for the following reasons: The M4 tank has been hailed widely as the best tank of the battlefield today....There appears to be no fear on the part of our forces of the German Mark VI (Tiger) tank. There can be no basis for the T26 tank other than the conception of a tank-vs.-tank duel-which is believed to be unsound and unnecessary."
^{[1]} - ↑ Ruggles & Brodie is largely a practical analysis and summary, not a mathematical one – the estimation problem is only mentioned in footnote 3 on page 82, where they estimate the maximum as "sample maximum + average gap"

- Citations

- ↑ AGF policy statement. Chief of staff AGF. November 1943. MHI
- ↑
^{2.0}^{2.1}Template:Cite web - ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=book }}
- ↑ Template:Cite web
- ↑ Template:Cite web, not sufficient.
- ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}
- ↑ Template:Cite web

- Bibliography

- REDIRECT Template:Probability distributions