2 ms·
I thought multidimensional random walkers would make random choices on all dimensions, so: step = [random.choice([-1,0,1]) for _d in range(n_dimensions)]
by atoav 1y ago
I thought multidimensional random walkers would make random choices on all dimensions, so:
step = [random.choice([-1,0,1]) for _d in range(n_dimensions)]
At least this is how I did 2D random walks as this allows for diagonal steps (with the downside that the walker travels longer steps in that direction).
- smokel 1y agoThe common definition for random walks moves only by unit vectors. Unfortunately, the information on Wikipedia is somewhat limited. The book "Random Walk: A Modern Introduction" (2010) by Gregory Lawler describes things in the first chapter, and is available online for free [1]. [1] https://www.math.uchicago.edu/~lawler/srwbook.pdf https://www.math.uchicago.edu/~lawler/srwbook.pdf