Question: **Please do it in Matlab!** Write a program that performs M random walks of N steps in two dimensions on a square lattice, assuming that
**Please do it in Matlab!**

Write a program that performs M random walks of N steps in two dimensions on a square lattice, assuming that each step is chosen at random, and each of the four possible directions are equally probable. Run the program for M-1000 walkers who are all originally at the origin. Allow the walkers to take at least 1000 steps a) b) c) What is the qualitative nature of the distribution of walkers at the end of the simulation? Use a plotting program to draw maps of several independent random walks and discuss. Compute the mean displacement vector by ensemble averaging xy and yN over the M random walks, for different values of N. Plot as a function of N. d) Compute the mean square displacement by ensemble averaging Ry over the M random walks, for different values of N. Plot as a function of N on a linear-linear plot, and a log-log plot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
