MCB111: Mathematics in Biology (Fall 2019)
week 09:
Random Walks in Biology
A more realistic Brownian motion that includes random steps in time
You are going to implement a more sophisticated 1D random walk than the one we discussed in class.
Particles emit from a fixed point, that we define as . When the particle moves, it does it either to the left with probability or to the right with probability . Nothing new so far.
The difference is that instead of moving with the tick of a clock, the particle can wait in a given position for a while before making the next move. We are going to assume that the time a particle waits at a position , , follows a exponential distribution, that is,
where is the mean rate.

Simulate 10 random walks assuming that up to .
To do this simulation, you may want to first sample the wait time using the exponential distribution, and later decide on the direction to take.

Now simulate 100 walks, but instead of looking at the individual trajectories, we are going to collect the positions at two different time points and .
Calculate the sample mean and variance for each of those times.

Repeat the simulation, but changing the wait time constant to . Again report the sample mean and variance.
Can you infer the expressions of the mean and variance as a function of and ?
I can give you a hint about this last question.
For the simple random walks we described in class, where every time the clock ticked, there was a movement left or right. The number of total (left or right) moves () is always identical to the number of time steps, that is . In other words, at a given time all sampled trajectories have experienced the same number of left/right moves.
Then the probability of being at position , after time is (as we discussed in class) given by
where of the total moves, where in the left direction and where in the right direction.
We also derived that the mean and variance of this unbiased random walk is given by
That property is not true anymore when we introduce a wait time. At a given time, each sampled trajectory could have experienced a different number of total moves, depending on the actual wait times experienced.
That is, the number of left/right moves of the particles at a given time is a “hidden variable”, thus using again marginalization!
The probability of being at position at time , , could be the result of an arbitrary number of moves,
The first term is the same as for the simpler case, that is a Binomial distribution that calculates of being at position after total moves.
The second term, calculates the probability that at time , the particle has experienced left/right moves.
In the simpler case we studied in class of no wait time,
where the delta function indicates that the probabity takes value one for , and zero otherwise.
For our case in which the wait times follow an exponential distribution, that probability density is given by a Poisson distribution of parameter (not an obvious result that you can find for instance here, bottom of page 2).
Combining the two together we have
Using this distribution, you can calculate the analytic expression for the mean and variance and compare with your experimental results.
It may look intimidating, but think about it, the dependence in “” is only in the “binomial” component, and you can change the order in which you perform the sum in “” and the sum in “”.
The type of Brownian motion described here, and even more general cases with different wait time distributions are referred to as continuous time random walks (CTRW).