Question: Exercise 3 Random walk [10 points] Write a simulation of a random walk of a particle in a 2d square grid. This simulation will be
Exercise 3 Random walk [10 points] Write a simulation of a random walk of a particle in a 2d square grid. This simulation will be similar to the one you wrote during the lab: The particle starts in the center of the grid. It can move to one of the neighboring cells: up, down, left, or right. The particle cannot move outside the grid: choose a new random direction instead. The only difference is that now not all directions are equally probable: the particle is twice as likely to move up than to move in any of the other three directions (the latter are still equally probable). Perform ten thousand steps on a 101 101 lattice and plot the trajectory of the particle. Extra credit [5 points]: Make an animation of the random walk
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
