Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started