Random walknbspsimulate the wandering of an intoxicated


Random walk use classes for the grid and the drunkard.

Random walk. 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
Business Management: Random walknbspsimulate the wandering of an intoxicated
Reference No:- TGS01488552

Now Priced at $30 (50% Discount)

Recommended (90%)

Rated (4.3/5)