Statistically-independent realizations of the random walk process

Simulate m statistically-independent realizations of the random walk process involving n steps each. You can enter these two parameters at runtime from the keyboard: write the code generally to allow such input. The random walker will make steps of unit length in random direction in 3D space. Make sure the direction is sampled uniformly over a sphere. To this end, the azimuthal angle co should be uniformly distributed in (0, 27r) and the cosine of the polar angle, cos B (not the angle itself!), should be uniformly distributed in (-1, 1). For each discrete time instance. i (0 < i < n). find the averages (R;) = (V X? + 17,2 + ) and (1? = (X? +y:2 + 42). Then compute the variance Vi= (V) — (R4)2. Plot the variance as a function of the time index and check whether it approaches the theoretical result derived in Lecture 11a. The following parameters should be easy to implement: n = 103,104 and m = 1,10,102,103,104,105. When m51, variance is zero. You should see the variance approaching a linear dependence when the number of trials becomes close to the number of time steps. When the number of trials is much larger that the number of time steps, the dependence should fit a straight line closely.
The write-up should contain a table of simulation parameters used. a few plots. and a brief conclusion.

find the cost of your paper

This question has been answered.

Get Answer