Question: A) A random walker starts at the origin (x, y) = (0, 0) and takes N steps. In each step, he moves one meter east
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).
Doing this in Python would be much appreciated!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
