Menu

[Solved]Task 1 Simulating Discrete Random Walk Grid Task Simulate Discrete Random Walk Two Dimensi Q37152220

MATLAB ONLY

Task 1: Simulating a Discrete Random Walk on a Grid For this task, you will simulate a discrete random walk on a two dimensio

Task 1: Simulating a Discrete Random Walk on a Grid For this task, you will simulate a discrete random walk on a two dimensional grid. The following figure shows an example of a particle “randomly walking” on an 8×8 grid. For this particular random walk, the particle can only move to surrounding points on the grid, giving each of those points an equal probability of being chosen (uniform random walk) 1. The objective of this task is to write a function that can simulate the discrete uniform random walk on a two dimensional grid. The input arguments to the function are: height of the grid, width of the grid, starting point of the particle, and the number of time steps to run the random walk. The function should return the positions of the particle at each time instant (stored in one big matrix) Assume that the bottom left corner of the grid is (0,0). 2. Using the function you wrote in the previous question, you will simulate the uniform random walk on an 5×5 grid where the starting point is (0,0) and the number of time steps is T 10000. Run these simulations 10000 times. 3. For each simulation, store the number of time steps it took to reach the point (4, 4). Histogram these samples and use the method of moments (moment matching) method from the previous project to fit them to a lognormal distribution. Furtermore, report the mean, variance, and skewness of the samples 4. For a single simulation, determine (on average) how many times the state (2,5) is visited. Divide this number by T to obtain the probability that the random walk is in that state. Will this be the same for all of the states? Why or why not? Show transcribed image text Task 1: Simulating a Discrete Random Walk on a Grid For this task, you will simulate a discrete random walk on a two dimensional grid. The following figure shows an example of a particle “randomly walking” on an 8×8 grid. For this particular random walk, the particle can only move to surrounding points on the grid, giving each of those points an equal probability of being chosen (uniform random walk) 1. The objective of this task is to write a function that can simulate the discrete uniform random walk on a two dimensional grid. The input arguments to the function are: height of the grid, width of the grid, starting point of the particle, and the number of time steps to run the random walk. The function should return the positions of the particle at each time instant (stored in one big matrix) Assume that the bottom left corner of the grid is (0,0). 2. Using the function you wrote in the previous question, you will simulate the uniform random walk on an 5×5 grid where the starting point is (0,0) and the number of time steps is T 10000. Run these simulations 10000 times. 3. For each simulation, store the number of time steps it took to reach the point (4, 4). Histogram these samples and use the method of moments (moment matching) method from the previous project to fit them to a lognormal distribution. Furtermore, report the mean, variance, and skewness of the samples 4. For a single simulation, determine (on average) how many times the state (2,5) is visited. Divide this number by T to obtain the probability that the random walk is in that state. Will this be the same for all of the states? Why or why not?

Expert Answer


Answer to Task 1: Simulating a Discrete Random Walk on a Grid For this task, you will simulate a discrete random walk on a two dim… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *