This was a little program I wrote to test the accuracy of statistical estimation in solving the German Tank Problem:
"Suppose one is an Allied intelligence analyst during World War II, and one has some serial numbers of captured German tanks. Further, assume that the tanks are numbered sequentially from 1 to N. How does one estimate the total number of tanks?"
The results were surprisingly accurate, giving a standard deviation of less than 10%, when the upper limit was calculated from 10 random numbers within the range.
estimator.cpp : http://pastebin.com/f79223e97
The program was originally written for GCC, but when I tried running it on Mingw (Windows) the rand() function returned only a 16-bit result. So I went for the Boost random number library to get sufficiently large random numbers for the test.
Just saw this post. I wrote an estimating function in R for my blog recently How many tanks? MC testing the German tank problem
ReplyDeleteCheers!