You are on page 1of 14

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/346624978

Random walk study using simulations and experimental analysis

Article · August 2018

CITATIONS READS

0 3,688

2 authors, including:

Kaushick Parui

25 PUBLICATIONS 3 CITATIONS

SEE PROFILE

All content following this page was uploaded by Kaushick Parui on 07 December 2020.

The user has requested enhancement of the downloaded file.


Statistical Mechanics Project
S.PHY.6.01
Kaushick Parui1,2, 152060
Arun Emil Minj1, 142516
1
Department of Physics, St. Xavier’s College-Autonomous, Mumbai- 400001, India.
2
kaushick.parui@xaviers.edu.in

Aim: To study random walks using simulations and experimental analysis.


Abstract: Random walk is a fundamental model of statistical mechanics, describing the
movement of a particle in a highly disordered and inhomogeneous medium as a random walk
with random jump probabilities. It is a simple but powerful model for a variety of complex
large-scale disordered phenomena arising from fields such as physics, biology and engineering.
This project is primarily divided into 3 parts, dealing with one-dimensional, two-dimensional
and simulations of random walks respectively using MATLAB software. Each part consists of
an experimental setup. For one dimensional random walk, a particle was allowed to move
randomly along one axis based upon the outcome of tossing a coin. For two-dimensional
random walk, the particle was allowed to move randomly along two axes based upon the
outcome of throwing two dices. With the data collected from the above experiments, a
probability distribution curve was plotted each for 50 steps, 100 steps, 200 steps and 400 steps
respectively. The simulations were observed in the MATLAB software and after experimental
analysis of the above experiments, the concept of random walk was studied.
Keywords: Random walks, Statistical Mechanics, Brownian motion, Probability distribution,
Markov chain.
Introduction: A “classic” problem in statistical physics is the random walk problem. Random
walk – the stochastic process formed by successive summation of independent, identically
distributed random variables – is one of the most basic and well-studied topics in probability
theory. It is directly related to many real-world problems ranging from physics (diffusion of
gases, electron motion in solids) to biology (various problems in genetics and ecology) to
economics (price fluctuations). Many physics problems that lack an exact solution can
nonetheless be well understood by looking at the statistics of many randomly generated events.
The traditional statement of the random walk problem refers to a drunk trying to make his way
down a narrow street. He’s so inebriated that he’s equally likely to take a step to the right (one
way along the street) or the left (the opposite way). If he starts underneath the lamp post, what
can we say about where he’s likely to end up? Most classic random walk problems involve
“The monkey at the cliff”, “The gambler’s ruin” and “The counting paths”.

1
Method & Material: Coin, Two different colour dice (Blue & Green), Reference particle,
MATLAB software.

This Project is basically divided into 3 Parts:

Part 1: Here, in Part 1 we are dealing with only 1-D random walk wherein a reference particle
is kept at origin (0), and the motion of the particle is determined by the outcome of tossing a
coin. If Heads (H) is the outcome of the tossing of the coin then the particle is allowed to move
to a distance +1 towards the positive X-axis and simultaneously if Tails (T) then the particle
moves a distance -1 towards the negative X-axis. With this, the particle movement is done, and
the position of the particle is noted after 50 steps, 100 steps and 200 steps respectively. Later,
a probability distribution curve is plotted for the random motion of the particle and then the
graphical analysis of the particle position after increasing number of steps was done.

Part 2: Here, in Part 2 we are dealing with 2-D random walk wherein a reference particle is
kept at origin (0,0), and the motion of the particle is determined by the outcome of throwing
two dice of different colours (Blue & Green). If the outcome of throwing two dice is such that
the Blue die gives an odd number and the Green die gives an odd number as well (OO), then
the particle is allowed to move to a distance +1 towards the positive X-axis and simultaneously
if the outcome of the throwing two dice is such that the Blue die gives an odd number and the
Green die gives an even number (OE), then the particle moves a distance -1 towards the
negative X-axis. Similarly, if the outcome of throwing two dice is such that the Blue die gives
an even number and the Green die gives an odd number (EO), then the particle is allowed to
move a distance +1 towards the positive Y- axis, and simultaneously if the outcome of the dice
is such that the Blue die gives an even number and the Green die gives an even number (EE),
then the particle is allowed to move a distance -1 towards the negative Y-axis. With this, the
particle movement is done, and the position of the particle is noted after 50 steps and 100 steps
respectively. Later, a probability distribution curve is plotted for the random motion of the
particle and then the graphical analysis of the particle position is done in order to predict the
most probable motion of the particle and the average displacement done by the particle.

Part 3: It basically involves the computer simulations which was obtained with the help of
MATLAB software for random walks in both two & three dimensions.

2
Fig.1: Experimental setup of random walk

Observation & Data:

Random Walk in 1-D:

The following data was collected for random walk in 1-D with the reference particle initially
located at position at the origin (x = 0).

For 50 Trials:

Table.1:

Particle Position (x) Number of Trials Probability


-3 2 2/50
-2 5 5/50
-1 8 8/50
0 16 16/50
1 9 9/50
2 4 4/50
3 3 3/50
4 3 3/50

3
For 100 Trials:

Table.2:

Particle Position (x) Frequency (f)


0 3

1 6
2 8
3 9
4 8
5 10
6 13
7 12
-1 9
-2 9
-3 7
-4 6
7 12
-1 9
-2 9
-3 7
-4 6

4
For 200 Trials:

Table.3:

Particle Position (x) Number of Trials Probability


-6 8 8/200

-5 15 15/200
-4 12 12/200
-3 16 16/200
-2 15 15/200
-1 21 21/200
0 22 22/200
1 19 19/200
2 16 16/200
3 15 15/200
4 18 18/200
5 12 12/200
6 11 11/200

Random Walk in 2-D:

The following data was collected for random walk in 1-D with the reference particle initially
located at position at the origin (x = 0, y = 0). Data was tabulated for every 10 trials and the
displacement, position and outcome was noted.

Table.4:

No. of Trials 10 10 10 10 10 10 10 10 10 10
Outcome
OO 1 7 0 4 2 2 4 1 3 1
OE 2 1 4 3 4 3 3 4 3 3
EO 2 0 1 2 1 3 3 2 2 2
EE 5 2 5 1 3 2 0 3 2 4
Position (-1,-1) (5,-3) (1,-7) (2,-5) (0,-7) (-1,- (0,-3) (-3,- (-3,- (-5,-
6) 4) 4) 6)

5
Displacement x = -1 x=6 x = -4 x=1 x = -2 x = -1 x=1 x = -3 x=0 x = -2
y = -1 y = -2 y = -4 y=2 y = -2 y=1 y=3 y = -1 y=0 y = -2

Table.5:

No. of Trials 10 10 10 10 10 10 10 10 10 10
Outcome
OO 2 2 6 3 0 4 3 2 6 1
OE 2 5 1 2 6 1 2 3 2 3
EO 2 0 1 2 3 3 1 3 1 5
EE 4 3 2 3 1 1 4 2 1 1
Position (-5,-8) (-8,-11) (-3,-12) (-2,-13) (-8,-11) (-5,-10) (-4,-13) (-5,-12) (-1,-12) (-3,-8)

Displacement x=0 x = -3 x=5 x=1 x = -6 x=3 x=1 x = -1 x=4 x = -2


y = -2 y = -3 y = -1 y = -1 y=2 y=1 y = -3 y=1 y=0 y=4

Data-analysis & Result:


Random walk in 1-D:

Theoretical analysis:

One dimensional random walk is the random walk on the number line, which starts at 0 and
at each step moves +1 or −1 with equal probability.
Considering, independent random variables Z1,Z2,…., where each variable is either 1 or −1,
with a 50% probability for either value, and

The series {Sn} is called the simple random walk on Z. The expectation E(Sn) of Sn is 0. That
is, the mean of all coin flips approaches zero as the number of flips increases. This follows by
the finite additivity property of expectation:

6
Consider the probability, U2n, of being back at the origin after exactly 2n steps. Well, in 1-d,
we have one coordinate, and we need the number of right-moves to be equal to the number of
left-moves. This means we're looking at your chances of flipping precisely n heads and n tails
in 2n flips of a fair coin. So you're interested in the ratio of 2nCn. That ratio is roughly (1/√n)

U2n = (1/√n)

Considering, the theoretical and probabilistic approach to the random walk in 1-D, the
following table was formulated giving probability of the particle at that particular position
after n steps. (Here, n = 0,1,2,3,4,5)

Table.6:

Probability P (-5) P (-4) P (-3) P (-2) P (-1) P (0) P (1) P (2) P (3) P (4) P (5)
Steps

0 1

1 1/2 1/2

2 1/4 2/4 1/4

3 1/8 3/8 3/8 1/8

4 1/16 4/16 6/16 4/16 1/16

5 1/32 5/32 10/32 10/32 5/32 1/32

7
Experimental analysis:

For 50 Trials, the PDF was obtained as shown in the graph below:

Fig.2: PDF of Random walk in 1-D (50 Trials)

For 100 Trials, the PDF was obtained as shown in the graph below:

8
Fig.3: PDF of Random walk in 1-D (100 Trials)

For 200 Trials, the PDF was obtained as shown in the graph below:

Fig.4: PDF of Random walk in 1-D (200 Trials)

9
From the Fig.2,3 & 4 it was quite evident that as the number of trials increases i.e. as the number
of steps increases the randomness (entropy) of the system also increases. So, we can conclude
that for 1-D random walk there are two cases:

Case 1: n = 0

Fig.5: PDF of Random walk in 1-D (n = 0)

From the graph, it is quite evident that as n → 0 the probability of the particle position is at the
origin and the randomness is minimum.

Case 2: n = ∞

10
Fig.6: PDF of Random walk in 1-D (n = ∞)

From the graph, it is quite evident that as n → ∞ the probability of the particle position is
everywhere and the randomness increases tremendously.

Random walk in 2-D:

Theoretical analysis:

In 2-D, we need both the X coordinate and the Y coordinate to be balanced in this way. So,
we roughly need two independent things each of which has probability (1√n) to
simultaneously happen; the probability of that is 1/√n × 1/√n = 1/n

U2n = 1/√n × 1/√n = 1/n

Experimental analysis:
For 2-D random walk, the total outcome can be tabulated as follows:
Table.6:

11
Outcome Number of trials Probability
OO 54 54/200
OE 57 57/200
EO 40 40/200
EE 49 49/200

Also, a graph was plotted by considering table 6 , in order to show the motion of the particle
in a 2-D random walk which is as follows:

Fig.7: Motion of Random walk in 2-D based on outcome


From the above graph it is quite evident that the particle motion is quite random and it actually
has a 1/4 probability to move in any of the 4 directions.
Considering the displacement done by the particle and formulating the data in a tabulated
format we get:
Table.7:

Average displacement per 10 trials


X – coordinate -0.15

12
Y – coordinate -0.4

From the above table, it can be understood that with the average displacement, the particle’s
positions after n steps can be predicted, which here from the above table states will be in the
III quadrant as both x & y are negative.
The simulations that were obtained using MATLAB software enables us to understand more
about the random walk in 2-D & 3-D. Also, the relation of random walk with Brownian motion
and as a fractal can be seen.
Conclusion:

From, the above analysis and discussions the concept of random walk in 1-D, 2-D and 3-D
was studied. Also, it was well-understood that a 2-D random walk is recurrent as there is a
1/n probability that the particle will be back to the starting position(origin) after 2n steps.
However, the 3-D random walk is transient as in the 3-dimensional case, chances of being
back at the origin after 2n number of steps is roughly equal to (1/n3/2 ). The standard random
walk takes steps of size one at every integer time point, and it's equally likely to go up or
down with no dependence on its past history. If instead the particle takes steps of size √h at
times which are multiples of h and then take the limit as h→0, we get a Brownian
motion. This is a special case of a much more general result regarding the convergence of
Markov chains to diffusion processes when similar scaling is used. Random walk problem is
one of the classical problem in modern day physics and has various applications viz.
In Digital Image Processing, random walks are used to determine the labels to associate with
each pixel. This algorithm is typically referred to as the random walker segmentation
algorithm. Also, in computer networks, random walks can model the number of transmission
packets buffered at a server, etc.

References:
1. W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1 (Wiley,
New York, 1957).
2. http://www.pas.rochester.edu/~stte/phy104-F00/n9/notes-9a.html
3. https://www.maplesoft.com/applications/view.aspx?SID=7168&view=html
4. http://mtdevans.com/projects/physics-problems/random-walk-of-two-drunks/
5. http://mathworld.wolfram.com/RandomWalk1-Dimensional.html
6. http://mathworld.wolfram.com/RandomWalk2-Dimensional.html

13

View publication stats

You might also like