2D random walk. A two-dimensional random walk simulates the behavior of a particle moving in a grid...

Question:

2D random walk. A two-dimensional random walk simulates the behavior of a particle moving in a grid of points. At each step, the random walker moves north, south, east, or west with probability equal to 1/4, independent of previous moves. Write a program RandomWalker that takes an integer command-line argument n and estimates how long it will take a random walker to hit the boundary of a 2n-by-2n square centered at the starting point.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: