Home > Python > Application in Statistical Mechanics

Ch. 21.1 Study of Random Numbers and Time Series

Chapters Index
Program 1

Study of Random Numbers and Time Series

Python 3.11 Ready

                                
Click "Run Code" to execute script and render figures.

Mathematical Problem Formulation

Introduction to numpy.random
Program 2

Study of Random Numbers and Time Series

Python 3.11 Ready

                                
Click "Run Code" to execute script and render figures.

Mathematical Problem Formulation

Generation of uniform random number between (0,1) using LCG method
Program 3

Study of Random Numbers and Time Series

Python 3.11 Ready

                                
Click "Run Code" to execute script and render figures.

Mathematical Problem Formulation

Create a random variate on the interval (a, b)
Program 4

Study of Random Numbers and Time Series

Python 3.11 Ready

                                
Click "Run Code" to execute script and render figures.

Mathematical Problem Formulation

plot the autocorrelation of a random series
Program 5

Study of Random Numbers and Time Series

Python 3.11 Ready

                                
Click "Run Code" to execute script and render figures.

Mathematical Problem Formulation

statistical parameters such as mean, median, mode, and standard deviation for a random time series
Theoretical Principles & Computational Physics Guide

Study of Random Numbers and Time Series: Statistical Physics & Stochastic Modeling

Dr. Alorika Chatterjee & Dr. Anirban Shaw Science & Physics Learners Python 3 / NumPy / SciPy

1. Core Principles & Theoretical Framework

Stochastic Processes: Simulates random physical phenomena including Brownian diffusion, radioactive decay, and thermal fluctuations.
Ensemble Averages: Computes macroscopic thermodynamic observables as statistical ensemble averages over microscopic configurations.
Monte Carlo Convergence: Statistical error scales inversely with the square root of trial count: $\sigma \propto 1/\sqrt{N}$.

2. Mathematical Formulation & Algorithmic Pipeline

Random walk diffusive spreading and Monte Carlo error scaling:

$$ \langle x(t) \rangle = 0, \quad \langle x^2(t) \rangle = 2 D t, \quad \text{Statistical Uncertainty: } \sigma_N = \frac{\sigma}{\sqrt{N}} $$

3. Numerical Mechanics & Implementation Logic

  • Random Number Seeding: Initialize pseudo-random generators with fixed seeds to ensure reproducible simulation results.
  • Ensemble Sampling: Execute $M$ independent trials of $N$ steps each to build accurate probability distributions.
  • Histogramming: Bin particle final positions to verify convergence toward Gaussian/Poisson distributions.

4. Relevant Computational Practice Exercises

Exercise 1
Simulate $M = 1000$ independent random walk trajectories and confirm that root-mean-square displacement scales as $\sqrt{t}$.
Exercise 2
Apply Monte Carlo integration to estimate $\pi$ using hit-or-miss circle sampling and plot error vs trial count $N$.
Exercise 3
Model radioactive nuclear decay for $N_0 = 10^4$ nuclei and compare against the continuous decay law $N(t) = N_0 e^{-\lambda t}$.
Standard Literature & References:
  • F. Reif, "Fundamentals of Statistical and Thermal Physics", Waveland Press (2009).
  • Mark Newman, "Computational Physics", University of Michigan (2013).