Responsive Navbar with Google Search
Application in Statistical Mechanics: 1D Random Walk Simulation

1D Random Walk Simulation: Program 1

Simulation of 1D Random Walk: The random walk is defined as a series of steps taken in either the positive or negative direction with equal probability.

Output 1

1D Random Walk Simulation: Program 2

Simulation of 1D RW

Output 2

1D Random Walk Simulation: Program 3

Simulation to generate \( N = 10,000 \) random walks, each consisting of \( T = 1,000 \) time steps. Each step should be a random integer that can either be +1 or -1, representing random walk in one dimension.

Calculate the root mean square (RMS) of the positions, which is the measure of the average displacement from the origin.

Output 3

One-Dimensional Random Walk

In a one-dimensional random walk, an object starts at a fixed position (usually the origin, \( x = 0 \)). At each time step, it takes a step of fixed size (often taken as 1 unit) in either the positive or negative direction. The step direction is determined randomly, with equal probability for each direction.

Mathematically, at each time step \( t \), the position \( X(t) \) can be expressed as:

\[ X(t) = X(t-1) + S(t) \]

where \( S(t) \) is a random variable that takes the value +1 or -1 with equal probability (i.e., \( P(S(t) = +1) = 0.5 \) and \( P(S(t) = -1) = 0.5 \)).

Number of Walks:

In this simulation, \( N = 10,000 \) random walks are generated. Each random walk consists of \( T = 1,000 \) time steps, which allows for a large dataset to analyze the properties of the random walk statistically.

Cumulative Position Calculation:

The cumulative position of the walker after each step can be computed using the cumulative sum of the steps taken. This gives a time series of positions for each random walk.

Root Mean Square (RMS) of Positions

The root mean square (RMS) is a statistical measure used to quantify the magnitude of a varying quantity. It provides an average value that takes into account the variability of the data.

For a set of values \( x_1, x_2, \ldots, x_T \), the RMS is calculated as:

\[ R_{\text{rms}} = \sqrt{\frac{1}{T} \sum_{i=1}^{T} x_i^2} \]