3.7 The tramcar problem
3.7.1 The discrete uniform distribution
Occasionally, we encounter problems to do with the discrete uniform distribution. We say that x has a discrete uniform distribution on and write
if
One context in which it arises was cited by Jeffreys (1961, Section 4.8). He says,
The following problem was suggested to me several years ago by Professor M. H. A. Newman. A man travelling in a foreign country has to change trains at a junction and goes into the town, of the existence of which he has only just heard. He has no idea of its size. The first thing that he sees is a tramcar numbered 100. What can he infer about the number of tramcars in the town? It may be assumed for the purpose that they are numbered consecutively from 1 upwards.
Clearly, if there are tramcars in the town and you are equally likely to see any one of the tramcars, then the number n of the car you observe has a discrete uniform distribution . Jeffreys suggests that (assuming is not too small) we can deal with this problem by analogy with problems involving a continuous distribution . In the absence of prior information, the arguments of Section 3.7suggest a reference prior in the latter case, so his suggestion is that the prior for in a problem involving a discrete uniform distribution should be, at least approximately, proportional to . But if
then by Bayes’ Theorem
It follows that
In particular, the posterior probability that is approximately
Approximating the sums by integrals and noting that , this is approximately . Consequently, the posterior median is 2n, and so 200 if you observed tramcar number 100.
The argument seems rather unconvincing, because it puts quite a lot of weight on the prior as opposed to the likelihood and yet the arguments for the prior are not all that strong, but we may agree with Jeffreys that it may be ‘worth recording’. It is hard to take the reference prior suggested terribly seriously, although if you had a lot more data, then it would not matter what prior you took.