Question

Question 6 Consider a random walk in the XY plane where at each time step you walk one step (one unit) either to the left, right, up or down, at random.

Starting from the origin, generate plots for two random walks with at least n=1000 random steps (n=10,000 is much better). So first create a list of n values P = [[0, 0], [x1,y1]· [X2,y2 ]---; (xn,yn ]] - You can also use an array of points here here instead of a Maple list. Then you can simply graph them using the plot(P, style=line ); command. To get random numbers from 1,2,3,4 use the following > R = rand (1..4): Now when you call R() you will get one of 1,2,3,4 at random, e.g.. > R(), R(), R(); 3,3,2