A random walk in two dimensions is the following game


Question: A random walk in two dimensions is the following game played on the x-J 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 I 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: A random walk in two dimensions is the following game
Reference No:- TGS02478884

Now Priced at $15 (50% Discount)

Recommended (92%)

Rated (4.4/5)