Count five, know them all

Things made in a factory are numbered in order: taxis, bicycles, tanks. You see a handful of them. From those few numbers, how many are there altogether? There is a rule that gets remarkably close, and it is not the one most people try first.

The rules, all of them. There are N things numbered 1 to N. You see k of them at random. Three guesses are made from the numbers seen: the biggest one; double the average (minus one); and the biggest plus the average gap between the numbers, which works out as biggest × (1 + 1/k) − 1.

The biggest number seen is always too low. Doubling the average is right on average but swings wildly. The third guess is right on average too and swings far less: its typical error is exactly √((N − k)(N + 1) ÷ (k(k + 2))), which the experiments confirm. With 1,000 things and only 10 seen, it is within 10% of the truth 86 times in 100. In the Second World War, Allied statisticians used serial numbers from captured German tanks in just this way, and their estimates of monthly production turned out far closer to the factories' own records than the figures from intelligence. What it leaves out: real serial numbers come in blocks, with gaps, and you never see a truly random handful.