Skip to main content
1 of 3

Programming a 2D random walk

I have these functions

Randomwalk1[n_] :=Accumulate[2*RandomInteger[{0, 1}, n] - 1]; Randomwalk2[n_] := NestList[# + 2*RandomInteger[{0, 1}] - 1 &, 0, n] 

that are random walks in 1D and I have to modify them to get a random walk in 2D, the walker can move right, left, step back or move forward with same probability 1/4 .. I'm a beginner and really don't know how to do that..

Thanks