Assignment 2  

 

We explore the physics of random walks in more detail. Since the first assignment was really easy, this time I'm giving you two simulation exercises.

 

1. Random walk with a reflecting barrier

 

Set up a simulation of a 1-d random walk on a lattice with p_right = p_left = 0.5. Put a reflecting wall at x = -1, so that a walker who tries to step on x = -1 gets reflected back to x=0. Perform 10,000 walks of length 20 steps.

 

Make a graph of  <x> vs time for t=0,1,2,3...20. Make another graph showing log <x> vs log t. Is it a straight line?

 

Note: The late Stephen Jay Gould argued that evolution is a random walk along a 1-d axis of biological complexity. That is, random mutations lead any organism to produce offspring which are slightly more complex or slightly less complex, with equal probability.

 

However there is a lower bound on this one-dimensional complexity axis, the minimum biological complexity below which no organism can evolve. Gould argued that this lower bound is a kind of reflecting wall along the axis of complexity. His assumption implies that evolution will produce--on average --upward progress, even though the individual steps are random.

 

Your simulation demonstrates this general principle. Your random walker, though completely unbiased, drifts on average toward the right, simply due to the presence of the reflecting boundary.

 

Please turn in: your code, your graph, and the answer to this question:

 

Following Gould's line of reasoning: what would be the result of evolution if Gould's lower boundary represented an absorbing wall (that is, a trap) instead of a reflecting wall? (Please explain in words. No equations or graphs needed.)

 

 

2. Random walk in 2-d with randomly distributed traps

 

This one is a little more challenging!

 

Set up a 50x50 two-dimensional square lattice of sites, and let the origin be in the middle.

Distribute traps with density p_trap=0.1 on this lattice, except do NOT put a trap at the origin.

 

Start a random walk at the origin and let it go north, south, east, west with equal probability, for up to 20 steps. If it lands on a trap, stop! That walk is now "dead." Run your code for at least 10,000 walks, generating a new trap configuration on the lattice for each walk.

 

Please make two graphs:

1. A measure of how many walks are still "alive" at  1, 2, 3.... 20 steps.

2. The mean square displacement as a function of time, averaging over all the "still alive" walks.

 

Please turn in your simulation code and these two graphs.