Diffusion and random walks


The phenomenon of diffusion

Source: Wikimedia Commons

We all have experienced the result of someone opening a perfume bottle or smoking a cigarette in the corner of a large room. Within a fairly short amount of time, everyone in the room can smell the perfume or the smoke. Now a lot of the time, the molecules that are responsible for the smell are carried to us by the physical flow of the air that is moving -- gentle breezes of convection.  But sometimes, the air is still and the smell still gets to us. In this case, we say that the perfume or the smoke has diffused from a region of the room in which it was highly concentrated to a region of room in which its concentration was initially low. 

Diffusion is the process by which molecules naturally move from regions where they are highly concentrated to regions where they are not as concentrated.  But there is something unsatisfying about this description. How is it that a particular molecule "knows" to move from high to low concentration?  And once they have diffused to fill the room, they seem to "know" not to all go back to where they started.  In light of our model of the random motion of molecules in a gas, this seems peculiar.

At first glance, it is not entirely clear why the molecules do not re-coalesce in the corner of the room.   After all, all the physical principles that we have thus far discussed in this course (Newton's Laws, etc.) are symmetric with respect to time.  What this means is that we could replace "t" in any of our equations that describe the motion of a molecule with "-t" and still get the same physical laws and rules... it should not matter in which temporal direction a process proceeds!  And yet, the smoke/perfume example suggests that just the opposite is true... there IS a temporal asymmetry in the world!  Let's figure out where that asymmetry comes from.

As a smoke molecule moves about the room, it is not moving in a vacuum.  It quickly undergoes countless collisions with the air particles in the room.  As a result, it is forced to wander around:  to execute a random walk.  If a number of such particles were initially confined in a small region of space, they would wander about in all directions and spread out, as shown in the figure at the right.  In order to understand what's going on and how to characterize this diffusive spreading more precisely, let's reduce the problem at first to its barest essentials, and consider only the motion of particles along one spatial direction, say the "x" direction. 

One-dimensional random walks

Let's consider a set of distinguishable particles (perfume) moving along a one-dimensional line (an x axis) while it is imbedded in a fluid of rapidly fluctuating molecules (air). The molecules of air strike the perfume molecule and drive it back and forth along the x axis. Let's model this with a simple mathematical model.

The perfume particles start at time $t = 0$ at position $x = 0$ and execute a random walk as a result of their interaction with the air, which we model by having the perfume molecule move randomly to the left or right. We describe this with three simple rules:

  1. Each particle steps to the right or to the left every $ΔT$ seconds, moving at a velocity $v_0$ for a distance $v_0ΔT$.
  2. The probability of going to the right at each step is 1/2, and the probability of going to the left at each step is 1/2.  Successive steps are statistically independent (that is, what they do does not depend on what has gone before).
  3. Each particle moves independently of all the other particles.  The particles do not interact with one another.  (This is will be true to a good approximation in practice provided that the suspension of particles is sufficiently dilute.)

Using these simple (and intuitively satisfying!) rules, it is not hard to show that the probability of finding particles at different points x at different times t is represented by Figure 2.  Each figure was generated by taking a certain number of time steps (15, 30, 45, and 60) and doing that number of steps 1001 times. The histograms represent the number of times the final distance was as shown.

What you see in this figure is that for a random walk in 1D, the most probable result is that you will come back to where you started, but that probability falls as you take more steps and the distribution gets wider -- but not very fast.

You can use a probability analysis to get the distribution that you would expect if you made a very large (infinite) number of trials with $N$ steps.  If the parameters of the 1D stepping are: $v_0$ (the speed of the particles) and $ΔT$ (the time step), then we define

  •  $λ = v_0ΔT$, the step size or mean free path; 
  • $D = λ v_0$, the diffusion constant.

then the mathematical result for the probability of traveling a distance $x$ after a time $t$ is proportional to ($\propto$)

$$P(x) \propto \frac{1}{\sqrt{t}} e^{-\big(\frac{x^2}{4Dt}\big)}$$

This has to be multiplied by a constant to adjust it to the fact that the probability of finding any value of $x$ is 1 (100%). (You have to integrate this function over $x$ from minus $-\infty$ to $+\infty$ and then divide by whatever you find.) (If you are curious as to how this result follows from these simple rules, please refer to one of the derivations of this on the web.  Understanding that derivation is not necessary, however, in order to follow what follows.) 

To see what's going on, consider the standard Gaussian function,

$$g(x) = e^{-\big(\frac{x^2}{\sigma^2}\big)}$$

When x is equal to the standard deviation, sigma, the value of the function has fallen by a factor of 1/e = 1/2.718... = 0.37... This is shown in the figure at the right.  (This distribution is also sometimes called the normal distribution or the bell curve.)

Comparing our probability function, we see that the equivalent of the standard deviation is

$$\sigma = \sqrt{4Dt}$$

so as time goes on, the width of the Gaussian curve increases like the square root of time. The particles diffuse out from their original position at the origin, even though the "average" position of the particles is still at the origin! This tells us that if we go to the 1/e point of our distribution and move out so that $x^2/t$ stays constant, we will stay at the 1/e point of the distribution.  If we use our probability function to calculate the average value of $x^2$ from the equation

$$\langle x^2 \rangle = \int_{-\infty}^{+\infty} x^2 P(x) dx$$

we will find that the average distance the peak has spread increases like the square root of time.

$$\langle x^2 \rangle = 2Dt$$


distance distribution has spread = $\sqrt{\langle x^2 \rangle} = \sqrt{2Dt}$

Notice that this is NOT like a velocity. The increase of the distance is NOT proportional to the time but to the square root of the time. A lot of interesting biological problems can be solved to remarkable accuracy using only this simple relation between root mean square distance and time!

Two- and Three-Dimensional Random Walks

The analysis we have just described can quite naturally be extended to the case of particles free to diffuse in two or three dimensions. This is tricky to think about. One of the best ways is to look at the function that describes how a point source spreads out in time: $e^{-\big(\frac{x^2}{4Dt}\big)}$. If we're random walking in three dimensions, our probability of finding something at the position $(x,y,z)$ is the product

$$P(x,y,z) \propto e^{-\big(\frac{x^2}{4Dt}\big)}e^{-\big(\frac{y^2}{4Dt}\big)}e^{-\big(\frac{z^2}{4Dt}\big)}$$,

Since when we multiply exponentials, the exponents add:

$$P(x,y,z) \propto e^{-\big(\frac{x^2+y^2+z^2}{4Dt}\big)} =e^{-\big(\frac{r^2}{4Dt}\big)}$$.

So the distribution in $r$ in 3 dimensions (and in 2) looks similar to the distribution of $x$ in 1D (except there are additional factors of $1/\sqrt(t)$ for each added dimension).

Since each of the dimensions spread in the same way, the average square displacement, $\langle r^2 \rangle$, will also satisfies

distance distribution has spread in 2D = $\sqrt{\langle r^2 \rangle} = 4Dt$

since in 2D,

$$\langle r^2 \rangle = \langle x^2 \rangle + \langle y^2 \rangle = 2Dt + 2Dt = 4Dt$$ 

and in 3D

$$\langle r^2 \rangle = \langle x^2 \rangle + \langle y^2 \rangle +\langle z^2 \rangle= 2Dt + 2Dt + 2Dt= 6Dt$$ 

A computer simulation of a two-dimensional random walk results in the picture shown at the top of the page. Notice, in examining that figure, that the particles tend to explore a given region of space rather thoroughly before wandering away.  This is a result of the random walk behavior. When a particle does wander away, it may blindly explore new regions . A particle moving at random has no tendency to move toward regions of space that it has not occupied before; it has absolutely no inkling of the past!  And yet, the overall pattern is clear:  the particles diffuse to fill out the space they occupy, and no matter how long you wait, you are very unlikely to see the particles all locate themselves again at their original departure point. 

More sophisticated versions of the random walk model take into account the possibility that the particles step different distances when they move to the left or right, and consider "biased" diffusive processes in which the particles are subject to an external force (such as gravity).  While these more complicated models produce some interesting results, the general outcome is always the same: particles undergoing random walk behavior as a result of collisions with the molecules of the medium, will tend to spread out to fill the space they occupy, with the width of the distribution expanding like the square root of the time.

Workout: Diffusion and random walks (Excel)


Workout: Diffusion and random walks (Plinko)


Ben Geller & Joe Redish 12/1/11


Article 395
Last Modified: July 7, 2021