In physics we often have to resort to computer simulations in which continuously varying quantities are modelled on a discrete lattice. We also have recourse from time to time to model physical properties of a system as random quantities with some associated probability distribution. The following problem came up in a conversation recently, and I think it’s rather cute so thought I’d post it here.

Consider a regular three-dimensional Cartesian grid, at each vertex of which is defined a continuous variable which varies from site to site with the same probability distribution function at each location. The value of at any vertex can be assumed to be statistically independent of the others.

Now define a local maximum of the fluctuating field defined on the lattice to be a point at which the value of is higher than the value at all surrounding points, defined so that in dimensions there are neighbours.

What is the probability that an arbitrarily-chosen point is a local maximum?

Solution

Well, the most popular answer is in fact the correct one but I’m quite surprised that a majority got it wrong! Like many probability-based questions there are quick ways of solving this, but I’m going to give the laborious way because I think it’s quite instructive (and because I’m a bit slow).

Pick a point arbitrarily. The probability that the associated value lies between and is , where is the probability density function. According to the question there are neighbours of this point. The probability that all of these are less than is 26 times, i.e. becauses they are independent. Note that this is a continuous variable so the probability of any two values being equal is zero. The probability of the chosen point being a local maximum with a given value of is therefore . The probability of it being a local maximum with any value of is obtained by integrating this expression over all allowed values of , i.e. . But the integrand can be re-written

because at the upper limit of integration and at the bottom.

So you don’t need to know the form of – but the calculation does rely on it being a continuous distribution.

This long-winded method demonstrates the applicability of the product rule and the process of marginalising over variables, but the answer should tell you a much quicker way of getting there. The central point and the 26 neighbours constitute a set of 27 points. The probability that any particular one is the largest of the set is just 1/27, as each is equally likely to be the largest. This goes for the central value too, hence the answer.