Write a program that performs 100 independent random walks


Question: A random walk in two dimensions is the following game played on the x-y coordinate system. Starting at the origin (0, 0), each iteration consists of a random step either 1 unit left, up, right, or down. The walk terminates when the walker returns to the origin. (The probability of this happening is 1 in two dimensions but less than 1 in three dimensions.) Write a program that performs 100 independent random walks and computes the average number of steps taken in each direction.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program that performs 100 independent random walks
Reference No:- TGS02462270

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)