Random Walk
Random Walk
Many of the processes in biophysics, and specifically the processes of population evolution, can be described by the mathematics of a random walk. This is a simple way to understand how a population changes from generation to generation. First we’ll learn about the basics of random walks. Picture you are standing on a one dimensional grid and can at any point step forward or back. You choose which way to go based on the flip of a coin. This might result in you making a trip like that in the animation below.
Now imagine that there are a large number of people, each on his or her own grid as above. Also imagine that instead of being a grid six squares long as above each person stands on an infinitely long grid so that no matter where he or she is, there is always the option to step forward or back. You start them all at the same position, which you label “0,” then ask them to start flipping coins and moving according to the results: heads=forward, tails=backward. After each flip you take a poll of all your walkers and count up the number that are currently at each possible position, then you make a plot of number of walkers vs. position. This plot will evolve in time as shown in the movie below
Let’s consider what is happening here. We know that at any time each walker has an even chance of moving forward or backwards since the direction he or she moves is determined only by the flip of a coin. There is some small probability that some person will flip his coin and get heads every time, so will continue to move forwards step after step and end up far from the “0” position. There is some other probability that a combination of heads and tails results will result in the walker being closer to “0.” How do we determine these probabilities, and what does it have to do with how our random walkers move?
Let’s start thinking about this by thinking about the coin flip. There is a 50% probability that the first toss will end up heads. We’ll set p=0.5, which is our probability of tossing heads and moving forward. When we’re dealing with independent events (events where the outcome of one does not affect the outcome of another) if the probability of one event is r and the probability of another event is s (where r and s are probabilities between 0 and 1) then the probability of both r and s occurring is r*s. The probability to get heads in four consecutive flips and thus to be four steps forward from “0” after four coin throws, will be p4=p*p*p*p=p^4. For more information on basic probability math, see the “Handbook for Probability Calculations” on pages 5 and 6 of http://ocw.mit.edu/courses/biology/7-03-genetics-fall-2004/lecture-notes/lecture4.pdf. But wait a minute, how does this matter? Heads and tails are equally likely, so the probability of someone throwing heads, tails, heads, tails (HTHT) and ending up back at “0” after four throws will also be p^4. The answer to this lies in that there are multiple ways to get back to “0” after four throws. How many are there? The answer is that there are 6 ways: HHTT, TTHH, HTHT, THTH, THHT, HTTH. So it is 6 times more likely that a random walker will end up back at his or her original location after four throws/steps than that they will end up four steps forward after four throws/steps.
If we have a large number of people throwing coins and walking on grids (a large number being 10,000s or more) we can predict the number of people that will end up at each position by the probability of making the coin flips to get to that position. If there are N people on grids, the number at a position where the probability of coin flips that lead to that position is p(x) will be N(x)=N*p(x). So there will be fewer people far away from the original position of the walkers than near the original position. However, since it is possible (however improbable) for someone to get one step further from “0” at each throw, the distribution of walkers will get broader with time. In fact, the width of the distribution will be proportional to (equal to a constant multiplied by) time.