Question: Write a program RandomWalkers.java that takes two integer command-line arguments N and T. In each of T independent experiments, simulate a random walk of N

Write a program RandomWalkers.java that takes two integer command-line arguments N and T. In each of T independent experiments, simulate a random walk of N steps and compute the squared distance. Output the mean squared distance (the average of the T squared distances).

% java RandomWalkers 100 10000 - mean squared distance = 101.446

% java RandomWalkers 400 2000 - mean squared distance = 383.12

% java RandomWalkers 100 10000 - mean squared distance = 99.1674

% java RandomWalkers 800 5000 mean squared distance = 811.8264

% java RandomWalkers 200 1000 - mean squared distance = 195.75

% java RandomWalkers 1600 100000 - mean squared distance = 1600.13064

As N increases, we expect the random walker to end up farther and farther away from the origin. But how much farther? Use RandomWalkers to formulate a hypothesis as to how the mean squared distance grows as a function of N. Use T = 100,000 trials to get a sufficiently accurate estimate.

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 Databases Questions!