# 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 $x=0$. When the particle moves, it does it either to the left with probability $p=0.5$ or to the right with probability $q = 1-p = 0.5$. 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 $i$, $t_w^i$, follows a exponential distribution, that is,

where $\lambda$ is the mean rate.

• Simulate 10 random walks assuming that $\lambda = 0.2\ s^{-1}$ up to $t = 200\ s$.

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 $t_1 = 200\ s$ and $t_2 = 800\ s$.

Calculate the sample mean $\bar{x} = \langle x\rangle$ and variance $\langle (x-\bar{x})^2\rangle$ for each of those times.

• Repeat the simulation, but changing the wait time constant to $\lambda = 20.0\ s^{-1}$. Again report the sample mean and variance.

Can you infer the expressions of the mean and variance as a function of $t$ and $\lambda$?

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 ($N$) is always identical to the number of time steps, that is $t/\tau = N$. In other words, at a given time $t$ all sampled trajectories have experienced the same number $N=t/\tau$ of left/right moves.

Then the probability of being at position $x$, after time $t/\tau=N$ is (as we discussed in class) given by

where of the $N$ total moves, $\frac{N-x}{2}$ where in the left direction and $\frac{N+x}{2}$ 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 $x$ at time $t$, $P(x\mid t)$, could be the result of an arbitrary number of $N$ moves,

The first term is the same as for the simpler case, that is a Binomial distribution that calculates of being at position $x$ after $N$ total moves.

The second term, calculates the probability that at time $t$, the particle has experienced $m$ 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 $N=\frac{t}{\tau}$, 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 $t/\lambda$ (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 “$x$” is only in the “binomial” component, and you can change the order in which you perform the sum in “$x$” and the sum in “$N$”.

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).