Simulating the wandering of an intoxicated person


Assignment:

Random walk.

Question 1. Simulate the wandering of an intoxicated person in a square street grid. Draw a grid of 20 streets horizontally and 20 streets vertically. Represent the simulated drunkard by a dot, placed in the middle of the grid to start. For 100 times, have the simulated drunkard randomly pick a direction (east, west, north, south), move one block in the chosen direction, and draw the dot. (One might expect that on average the person might not get anywhere because the moves to different directions cancel one another out in the long run, but in fact it can be shown with probability 1 that the person eventually moves outside any finite region. Use classes for the grid and the drunkard.

Solution Preview :

Prepared by a verified Expert
Basic Statistics: Simulating the wandering of an intoxicated person
Reference No:- TGS01824609

Now Priced at $30 (50% Discount)

Recommended (97%)

Rated (4.9/5)