Random Walk in 1D and 2D
Guillem Cucurull
20 March 2022
1 Purpose
The purpose of this project is to simulate an object or person’s random walk
algorithm for one dimension and two dimensions. We will find the statistics of
the walk and its probability distribution.
2 Random walk
The simple random walk is the trajectory of a particle or person along a line
when each step is taken at random. An illustration of this could be a coin toss
and its equal chance of getting heads or tails. Consider this case: a man who is
lost in thereabouts takes a guess in taking the next step or which direction to
take. The probability of that man to be one step closer to the end goal is 50%
if there were two options: left and right. This constitutes the first dimension
ground. This probability is represented by Equation (1) and (2):
Nlef t 1
Plef t = lim = (1)
N →∞ N 2
Nright 1
Pright = lim = (2)
N →∞ N 2
Now if a step is labelled by an index i and happens Ni times in N trials,
then the probability is represented by Equation (3).
Ni
Pi = lim (3)
N →∞ N
where the sum of probabilities in N steps is
N
X
=1 (4)
i=1
Given the position xn at time N
xN +1 = xN + rN (5)
1
Guillem Cucurull
20 March 2022
1 Purpose
The purpose of this project is to simulate an object or person’s random walk
algorithm for one dimension and two dimensions. We will find the statistics of
the walk and its probability distribution.
2 Random walk
The simple random walk is the trajectory of a particle or person along a line
when each step is taken at random. An illustration of this could be a coin toss
and its equal chance of getting heads or tails. Consider this case: a man who is
lost in thereabouts takes a guess in taking the next step or which direction to
take. The probability of that man to be one step closer to the end goal is 50%
if there were two options: left and right. This constitutes the first dimension
ground. This probability is represented by Equation (1) and (2):
Nlef t 1
Plef t = lim = (1)
N →∞ N 2
Nright 1
Pright = lim = (2)
N →∞ N 2
Now if a step is labelled by an index i and happens Ni times in N trials,
then the probability is represented by Equation (3).
Ni
Pi = lim (3)
N →∞ N
where the sum of probabilities in N steps is
N
X
=1 (4)
i=1
Given the position xn at time N
xN +1 = xN + rN (5)
1