Question: Use python code for this problem: (A) A random walker starts at the origin (x, y) = (0, 0) and takes N steps. In each

Use python code for this problem:

  1. (A) A random walker starts at the origin (x, y) = (0, 0) and takes N steps. In each step, he moves one meter east (positive x-direction) or north (positive y-direction) or west or south; all four directions are equally probable. Plot the path taken by the walker for N = 100 steps. Indicate the starting position (the origin) by a circle and the final position by a star. Calculate and print out the distance between the initial and final points. (B) Now assume there are 100 walkers that start at the origin. Each executes 1000 steps as described above. Write a code which calculates the average distance between the initial and final point (calculate the distance for each of the 100 walkers and take the average).

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!