How do i generate a RandomWalk with n dimensions?
I already have some examples for a 1 or 2 dimensional random walk but now i have to code a random walk with n dimensions and i seriously don't know how.
here are 2 examples for 2 dimensions:
RandomWalk2DLattice[n_] :=
Accumulate[Through[{Cos, Sin}[# \[Pi]/2]] & /@ RandomInteger[3, {n}]]
rw = RandomWalk2DLattice[500];
Show[Graphics[{Line[rw], {PointSize[.02], Point[rw[[{-1}]]],
Point[{0, 0}]}}, Axes -> True], AspectRatio -> Automatic]
Does anyone have an answer?