4 Markov chains

4.7 Ehrenfest model of diffusion and its invariant distribution

(From Grimmett and Stirzaker) Two containers A and B are placed adjacent to each other and gas is allowed to pass through a small aperture joining them. A total of m gas molecules is distributed between the containers. We assume that at each time-step one molecule, picked uniformly at random from the m available, passes through this aperture.

Let Xn be the number of molecules in container A after n units of time have passed. Clearly {Xn} is a Markov chain with transition matrix

Pi,i-1=im,  1≤i≤m⁢Pi,i+1=1-im,  0≤i≤m-1.

i.e.

(01000…0001/m01-1/m00…00002/m01-2/m0…000………………………00000…1-1/m01/m00000…010)

(Check that the formula makes sense for the end points!) Another interpretation for this model is as follows. Consider an urn containing m balls each of which is either of colour A or colour B. A ball is drawn from the urn at random and is replaced by a ball of the other colour. Let Xn denote the number of balls of colour A after the n-th draw.

We could find the stationary distribution by solving π⁢P=π; this involves solving a rather unfriendly second order difference equation. Alternatively it seems sensible that when at equilibrium someone observing a video of the system would be unable to tell whether or not it was being shown backwards, and so the system should satisfy detailed balance equations; Theorem 4.4.10 confirms this.

πi⁢Pi,i+1=πi+1⁢Pi+1,i,i.e.⁢πi⁢(1-im)=πi+1⁢i+1m,  0≤i≤m-1,

or equivalently

πi+1=m-ii+1⁢πi,  0≤i≤m-1.

Thus

π1 = m1⁢π0
π2 = m-12⁢π1=m⁢(m-1)2×1⁢π0
π3 = m-23⁢π2=m⁢(m-1)⁢(m-2)3×2×1⁢π0.

In general

πi=m!i!⁢(m-i)!⁢π0.

So

1=∑i=0mπi=π0⁢∑i=0mm!i!⁢(m-i)!=π0⁢(1+1)m.

Therefore π0=1/2m and

πi=12m⁢(mi),   0≤i≤m,

which is the binomial probability with parameters m and 1/2.

This is the chance if the objects were allocated at random we would end up with i in A and m-i in B.

In a large system at equilibrium it is very likely that X≈m/2 since this is the mean of the binomial distribution.

The next topic is of interest on its own and is related to the existence of the stationary distribution.