Parameters
Random Walk Type
Initial Condition
Actions
Display Options
Presets
Animation Speed
30 FPSAverage Position ⟨x⟩
Mean Square Displacement ⟨x²⟩
Diffusion Coefficient D
Variance σ²
Position Distribution
Mean Square Displacement vs Time
Mathematical Analysis
Displacement Distribution
P(x,t) = (4πDt)^(-1/2) × exp(-x²/4Dt)
Gaussian distribution with variance 2Dt
Einstein Relation
⟨x²⟩ = 2Dt
Mean square displacement grows linearly with time
Geometric Brownian Motion
dS = μS dt + σS dW_t
S_t = S_0 × exp((μ - σ²/2)t + σW_t)
Stock price model (Black-Scholes)
Simple Random Walk
S_{n+1} = S_n + ξ_n, ξ_n ∈ {-1, +1}
Var(S_n) = n
Discrete version converges to Brownian motion
Wiener Process Properties
- W₀ = 0 (starts at origin)
- Independent increments
- Wₜ - Wₛ ~ N(0, t-s)
- Continuous paths (almost surely)
Scaling Law
x ~ √t (diffusion scaling)
To double displacement, need 4× time
From Pollen to Stock Prices
Robert Brown's Discovery
Scottish botanist Robert Brown observed erratic motion of pollen grains in water under a microscope. He first suspected a biological life force, but later found the same motion in inorganic particles.
Bachelier's Thesis
Louis Bachelier built a theory of stock price fluctuations using random walks, five years before Einstein. His work Théorie de la Spéculation laid the foundation for mathematical finance.
Einstein's Theory
Albert Einstein explained Brownian motion through kinetic theory, derived the diffusion equation, and obtained the relation ⟨x²⟩ = 2Dt. This became key evidence for atomic theory.
⟨x²⟩ = 2Dt = (k_B T / 3πηr) × t
Perrin's Experiments
Jean Perrin carried out precise experiments that verified Einstein's predictions and won the 1926 Nobel Prize. His results convinced many remaining skeptics of the existence of atoms.
Wiener's Mathematical Formalization
Norbert Wiener gave Brownian motion a rigorous mathematical basis by constructing Wiener measure and proving path properties. This work became central to stochastic calculus.
Black-Scholes Formula
Fisher Black, Myron Scholes, and Robert Merton developed the option pricing formula using geometric Brownian motion and transformed modern financial markets.
C = S·N(d₁) - K·e^(-rT)·N(d₂)
Mathematical Foundation
1. Simple Random Walk (Discrete)
The simplest random process: at each step, move ±1 with equal probability.
S_0 = 0, S_{n+1} = S_n + ξ_n
P(ξ_n = +1) = P(ξ_n = -1) = 0.5
E[S_n] = 0, Var(S_n) = n
After n steps, the typical displacement scales like √n.
2. Continuum Limit (Scaling)
Take many small steps with step size ε and time step δ while keeping ε²/δ = 2D constant.
lim_{n→∞} S_{[nt]} / √n → W_t (Wiener process)
By the Central Limit Theorem, the limit becomes Gaussian.
3. Brownian Motion (Wiener Process)
A continuous-time stochastic process with Gaussian increments.
W_0 = 0
W_t - W_s ~ N(0, t-s) for t > s
Independent increments: W_t - W_s ⊥ W_s
Continuous paths (almost surely)
Its paths are continuous but nowhere differentiable.
4. Diffusion Equation (Fokker-Planck)
The probability density evolves according to the heat equation.
∂P/∂t = D ∂²P/∂x²
P(x,t) = (4πDt)^(-1/2) × exp(-x²/4Dt)
The solution is Gaussian with variance 2Dt.
5. Itô Calculus (Stochastic Integration)
Processes driven by Brownian noise require a new calculus.
dX_t = μ dt + σ dW_t
Itô Lemma: df(X,t) = f_x dX + (1/2)f_xx σ² dt + f_t dt
(dW_t)² = dt (quadratic variation)
The second-order term matters because (dWₜ)² = dt.
6. Geometric Brownian Motion
A stock-price model with positive values and log-normal distribution.
dS/S = μ dt + σ dW_t
S_t = S_0 × exp((μ - σ²/2)t + σW_t)
E[S_t] = S_0 e^{μt}
Var(S_t) = S_0² e^{2μt}(e^{σ²t} - 1)
log(Sₜ/S₀) follows a normal distribution.
Financial Applications
Why Geometric Brownian Motion for Stocks?
- Prices remain positive because of the exponential form.
- Returns, rather than prices, are modeled as additive and independent.
- A log-normal price distribution is often a useful approximation.
- The model stays simple enough for analytical solutions.
Drift μ vs. Volatility σ
μ is the expected return or trend, while σ measures randomness and risk.
High σ means larger price swings and a higher risk premium.
High μ means a stronger upward trend and higher expected return.
Black-Scholes Option Pricing
A European call option gives the right to buy a stock at strike K at time T.
C = S·N(d₁) - K·e^(-rT)·N(d₂)
d₁ = [ln(S/K) + (r + σ²/2)T] / (σ√T)
d₂ = d₁ - σ√T
N(·) is the standard normal CDF. The key insight is to build a risk-free hedge.
Risk-Neutral Valuation
In complete markets, price equals the discounted expected payoff under the risk-neutral measure.
Price = e^(-rT) × E_Q[Payoff]
Replace the real drift μ with the risk-free rate r.
The Greeks (Risk Measures)
- Δ (Delta): ∂Price/∂S (hedging ratio)
- Γ (Gamma): ∂²Price/∂S² (convexity)
- ν (Vega): ∂Price/∂σ (volatility sensitivity)
- Θ (Theta): ∂Price/∂T (time decay)
- ρ (Rho): ∂Price/∂r (interest rate sensitivity)
Monte Carlo Simulation
When no closed-form solution is available, simulate many random paths.
S_{i+1} = S_i × exp((μ - σ²/2)dt + σ√dt·Z)
where Z ~ N(0,1)
This visualization uses Monte Carlo path simulation.
Virtual Laboratory
Experiment 1: Verify Einstein Relation
Test whether ⟨x²⟩ = 2Dt holds in the simulation.
- Set D = 1.0 and dt = 0.01.
- Start with 50 particles at the origin.
- Run until T = 10.0 (1000 steps).
- Check the regression slope in the MSD plot.
- Expected slope: 2D = 2.0.
Experiment 2: Central Limit Theorem
Watch a Gaussian distribution emerge from simple ±1 steps.
- Choose Simple Random Walk.
- Use 100 particles starting at the origin.
- Observe the histogram after 100, 500, and 1000 steps.
- Compare it with the theoretical Gaussian curve.
Experiment 3: Effect of Drift
How does a constant drift change the distribution?
- Set drift μ = 0.5 and D = 1.0.
- Run the simulation and watch ⟨x⟩.
- Expected result: ⟨x⟩ = μt.
- The variance remains 2Dt, so drift changes location but not spread.
Experiment 4: Stock Price Simulation
Compare different market scenarios.
- Switch to Finance Mode.
- Try different μ and σ combinations.
- Bull market example: μ = 0.15, σ = 0.2.
- Bear market example: μ = -0.05, σ = 0.3.
- Compare the probability of profit and loss.
Experiment 5: Option Pricing
Use simulation to understand Black-Scholes pricing.
- Set S₀ = 100, K = 100, and T = 1 year.
- Simulate 1000 price paths.
- Compute the call payoff max(Sₜ - K, 0).
- Average and discount it: e^(-rT) × E[payoff].
- Compare the result with the Black-Scholes formula.