# SCI:PHYS:random walk

Eugene Leitl (Eugene.Leitl@lrz.uni-muenchen.de)
Sun, 12 Jan 1997 16:24:27 +0100 (MET)

P.W. Atkins, "Physical chemistry", 3rd ed., Oxford University Press (1987),
pp. 681-683

27.3(d) The statistical view of diffusion

An intuitive picture of diffusion is that the particles move in a series
of small steps and gradually migrate from their original positions. We
shall explore this idea by building a model by assuming that the
particles can jump through a distance d in a time \tau, so that the
distance traveled by a particle in a time t is (t/ \tau)d. This does not
mean the particle will be found at that distance from the origin. The
direction of each step may be different, and the net distance travelled
must take this into account. If we simplify the discussion by allowing
the particles to travel only along a straight line (the x axis), and for
each step (to the left or the right) to be through the same distance d
each time, we obtain the one-dimensional random walk, the process first
met in Appendix 25.1 [check out this one, as well -- 'gene ]

Appendix 27.1 The random walk

Our task is to calculate the probability that a particle will be found at
a distance x from the origin after a time t. During that time it will have
taken n steps, with n=t / \tau. If n_R of these are steps to the right,
and n_L are steps to the left (with n_L + n_R = n), then the net distance
travelled is x = (n_R-n_L)d. That is, to arrive at x, we must ensure that

n_R = 1/2(n+s) and n_L = 1/2(n-s) (27.A1.1)

with s=x/d. The probability of being at x after n steps of length d is
therefore the probability that, when n random steps are taken, the
numbers to the right and the left are as given above.

The total number of different journeys for a walk of n steps is equal to
2^n, because each step can be in either of two directions. The number of
journeys in which exactly n_R steps are taken to the right is equal to
the number of ways of choosing n_R objects from n possibilities
irrespective of the order: this is n!/n_R!(n-n_R)!. As a check, consider
all journeys of four steps: there are 2^4 possible journeys (figure
omitted). There are six ways of taking two steps to the right and two to
the left, which tallies with the expression 4!/2!2!=6. The probability
that the particle is back at the origin after four steps is therefore
6/16. The probability that it is out at x= + 4d is only 1/16 because, in
order to be there, all four steps must be to the right, and since
4!/4!0!=1 the chance of that occuring is 1/16.

Returning now to the general case, the probability of being at x after n
steps is

P=(Number of journeys with n_R steps to the right)/(Total number of
journeys)={n!/n_R!(n-n_R)!}/2^n={n!/[0.5(n+s)]! [0.5(n-s)]!}/2^n. (27.A1.2)

At this stage the expression of the probability does not seem to resemble
the Gaussian, [...], obtained by solving the diffusion equation. However,
consider the case when so much time has elapsed that the particles have
taken many steps. Then the factorials may be approximated using
Stirling's approximation (in the more precise form given in the footnote
on p. 509)

ln N! = (N+1/2) ln N - N + ln \sqrt{2\pi} (27.A1.3)

Taking the logarithm of eqn (27.A1.2) then leads (after quite a lot of
algebra) to

ln P = ln n!-ln[0.5(n+s)]! - ln [0.5(n-s)]! - n ln 2
= ln \sqrt{2/\pi n} - 0.5(n+s+1) ln (1+s/n)-0.5(n-s+1)ln(1-s/n).

As long as s/n<< 1 (which is equivalent to x not being at a great
distances from the origin) we can use the approximation ln(1+z)\approx z,
and obtain

ln P = ln \sqrt{2/ \pi n} - s^2/2n, or P = \sqrt{2/ \pi n} e^{-s^2/2n}
(27.A1.4)
Finally, replace s by x/d and n by t/ \tau, and obtain

P=\sqrt{2\tau/ \pi t} e^{-x^2\tau /2td^2}

P=\sqrt{2\tau/ \pi t} e^{-x^2\tau /2td^2}

This is the equation used in the text [...]