Page 1 of 1

Assignment 2: Write code to model random walks and find , and the variance - ^2 The goal o

Posted: Tue Sep 07, 2021 7:09 am
by answerhappygod
Assignment 2 Write Code To Model Random Walks And Find R 2 T R T And The Variance R 2 T R T 2 The Goal O 1
Assignment 2 Write Code To Model Random Walks And Find R 2 T R T And The Variance R 2 T R T 2 The Goal O 1 (265.23 KiB) Viewed 213 times
use java to solve
Assignment 2: Write code to model random walks and find <r^2(t)>, <r(t)> and the variance <r^2(t)> - <r(t)>^2 The goal of this homework is to model random walk in 2 and 3 dimensions. Random walks are useful models in many biological problems including folding of proteins and development of natural habitats of animals. At each discrete time step labeled by the variable i a "random walker" can make a step in random direction (left, right, back or forth in 2D, or left, right, back, forth, up or down in 3D). The code computes the distance to the origin at all discrete instances of time and then plots these dependencies. The plots represent the distance a random walker made at a given time from the origin (that is, where the random walk has started). Note that in 2D a random walker will visit the origin again with probability 1; in 3D, the random walker will visit the origin again with a nonzero probability that is less than 1 (this probability is one of the random walk constants). This means that in 3D some "random walkers" will never return to the origin; in 2D all random walkers return to the origin sooner or later. 1/3 The main part of the homework is to find (estimate, fit to the data) the average distance (r(t)) and (r?(t)) that a random walker has to the origin after timet. Note that time is discrete and represented by the variable i in the codes. The individual trajectories of random walkers will be very noisy and it will be difficult to find the above dependence. The suggested approach is to generate many independent trajectories, say, labeled byj, and compute the average distance (and squared distance) to origin. When more and more trajectories get included in averaging, the resulting data set (r(t)), will look increasingly smooth. (a) Find the functions (r(t)) and (r?(t)) numerically. (b) Fit them to power functions using nonlinear regression (explained in the lectures) (c) Find the variance of the distance, (r?(t)) - (r(t))?