## A Simple Problem in Statistical Physics

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.

Follow @telescoper

July 11, 2011 at 11:17 pm

I’m only commenting so that I can get this to give me updates on future posts…

July 12, 2011 at 9:14 am

Use the RSS feeds for posts and comments (two separate feeds).

July 12, 2011 at 5:18 am

The probability is $3^{-D}$.

July 12, 2011 at 8:56 am

It’s much simpler than that. You have a set of 3^D independent random values (the center value and its 3^D-1 neighbors.) What is the probability that the center value is the largest one? Obviously, 1/3^D.

July 12, 2011 at 9:07 am

Yes, I said there were quicker ways. I went through this to show how you could relate it to the product rule for probabilities and marginalisation.

The long-winded approach is also the only way to deal with the general case in which the lattice values are correlated. There you have to use conditional probabilities for the neighbours, but the logic remains the same.

July 12, 2011 at 10:21 am

“The probability that any particular one is the largest of the set is just 1/27”

But it needs to be the largest of the set of which it is the central member.

I was going to say (1/2)^26, as the probability that a randomly chosen member is greater than another randomly chosen member is 1/2.

But now I’ll read your solution in more detail…

Anthony

July 12, 2011 at 10:37 am

Okay, I’ve seen why I’m wrong: it’s not 1/2 x 1/2 x 1/2 x 1/2, but 1/2 x 2/3 x 3/4 x 4/5 x … x 26/27 = 1/27.

July 14, 2011 at 8:58 pm

There are regularity conditions that F(x) need to satisfy before you can go from [integral sign] f(x) F(x)^26 dx to [integral sign] f(x) dx F(x)^26.

July 15, 2011 at 11:28 pm

Peter did say that his analysis assumed a reasonably continuous form for F. But his symmetry argument which also led to the answer shows that it makes no difference, ie there is no discontinuous F(x) for which the answer is not 1/27.

July 16, 2011 at 10:38 am

If it’s a discrete variable then the probability of two neighbouring sites being equal is not zero, so then the answer may be different.