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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!