Statistics Homework 11 — Brownian Motion

Problem Statement

In previous homeworks, we explored discrete random walks (Homework 7) with steps of \(\pm 1\) at discrete time points, and Poisson processes (Homework 10) that introduced continuous time with discrete jumps. Now we take the final step: a continuous-time, continuous-space random walk—the celebrated Brownian motion (also known as the Wiener process).

Brownian motion is the mathematical limit of a random walk as both the time step and the spatial step size approach zero in a coordinated manner. Instead of discrete \(\pm 1\) jumps, each increment follows a Normal (Gaussian) distribution. This process is fundamental in fields ranging from mathematical finance (modeling stock prices) to physics (describing diffusion) to cybersecurity (modeling stochastic attack patterns and system reliability).

The recursive formula for our simulation is: \[ Y_t = Y_{t-1} + Z_t, \quad Z_t \sim \mathcal{N}(\mu, \sigma^2) \] where \(Z_t\) represents the normally-distributed increment at each time step.

From Discrete to Continuous: The Limiting Process

The Discrete Random Walk Revisited

Recall the simple symmetric random walk from Homework 7, where at each discrete time step \(n\), the position changes by \(\pm 1\) with equal probability (analogous to a fair coin flip): \[ S_n = S_{n-1} + X_n, \quad X_n \in \{-1, +1\} \text{ with } P(X_n = +1) = P(X_n = -1) = \frac{1}{2} \]

The key statistics of this process after \(n\) steps are:

Donsker's Invariance Principle

Donsker's theorem (also called the Functional Central Limit Theorem) establishes that the properly rescaled random walk converges to Brownian motion. Specifically, if we define the rescaled process: \[ W^{(n)}(t) = \frac{1}{\sqrt{n}} S_{\lfloor nt \rfloor}, \quad t \in [0, 1] \] then as \(n \to \infty\), the process \(W^{(n)}(t)\) converges in distribution to a standard Brownian motion \(W(t)\).

The rescaling factor \(\frac{1}{\sqrt{n}}\) is crucial: it ensures that the variance at time \(t = 1\) remains equal to 1, regardless of the number of steps \(n\).

Standard Brownian Motion: Definition

A standard Brownian motion (or Wiener process) \(\{W(t)\}_{t \geq 0}\) is a continuous-time stochastic process satisfying:

  1. Initial condition: \(W(0) = 0\) almost surely
  2. Independent increments: For \(0 \leq s < t\), the increment \(W(t) - W(s)\) is independent of the process up to time \(s\)
  3. Gaussian increments: For \(0 \leq s < t\), we have \(W(t) - W(s) \sim \mathcal{N}(0, t - s)\)
  4. Continuous paths: The sample paths \(t \mapsto W(t)\) are continuous almost surely

These properties imply that:

Brownian Motion with Drift

General Form

The Brownian motion with drift extends the standard Wiener process by adding a deterministic linear trend: \[ Y(t) = \mu t + \sigma W(t) \] where:

Statistical Properties

For the process with drift: \[ \mathbb{E}[Y(t)] = \mu t \] \[ \text{Var}(Y(t)) = \sigma^2 t \] \[ Y(t) \sim \mathcal{N}(\mu t, \sigma^2 t) \]

The drift parameter \(\mu\) controls the expected direction of the trajectory:

Discrete-Time Simulation

To simulate Brownian motion on a computer, we discretize time into \(n\) steps with time increment \(\Delta t = T/n\). At each step: \[ Y_{t+\Delta t} = Y_t + \mu \Delta t + \sigma \sqrt{\Delta t} \cdot Z, \quad Z \sim \mathcal{N}(0, 1) \]

Equivalently, the increment at each step follows: \[ \Delta Y \sim \mathcal{N}(\mu \Delta t, \sigma^2 \Delta t) \]

The factor \(\sqrt{\Delta t}\) in the noise term is essential for correct scaling—it ensures that the variance of the process grows linearly with time, as required by the continuous-time limit.

Generating Normal Random Variables: The Box-Muller Transform

The Challenge

Simulating Brownian motion requires generating normally distributed random numbers. However, most programming environments provide only uniformly distributed random numbers on \([0, 1]\). The Box-Muller transform is an elegant method to convert uniform random variables into standard normal random variables.

Mathematical Derivation

Given two independent uniform random variables \(U_1, U_2 \sim \text{Uniform}(0, 1)\), the Box-Muller transform produces two independent standard normal random variables: \[ Z_1 = \sqrt{-2 \ln U_1} \cdot \cos(2\pi U_2) \] \[ Z_2 = \sqrt{-2 \ln U_1} \cdot \sin(2\pi U_2) \]

The proof relies on the polar representation of two-dimensional Gaussian distributions. If \(Z_1\) and \(Z_2\) are independent \(\mathcal{N}(0,1)\) random variables, then:

The Box-Muller transform inverts this relationship: from uniform radius and angle, we recover Cartesian coordinates that are standard normal.

General Normal Generation

To generate \(X \sim \mathcal{N}(\mu, \sigma^2)\) from a standard normal \(Z \sim \mathcal{N}(0, 1)\): \[ X = \mu + \sigma Z \] This is a linear transformation that shifts the mean and scales the variance appropriately.

Alternative Methods

Other methods for normal generation include:

Properties of Brownian Motion Paths

Continuity and Non-Differentiability

Brownian motion paths exhibit a remarkable dichotomy:

This non-differentiability arises because the increments over any interval, no matter how small, have non-trivial variance. Intuitively, the path exhibits high-frequency fluctuations at every scale.

Self-Similarity and Scaling

Brownian motion exhibits statistical self-similarity: zooming in on any portion of a path reveals structure that is statistically identical to the whole path. Mathematically: \[ \{W(ct)\}_{t \geq 0} \stackrel{d}{=} \{c^{1/2} W(t)\}_{t \geq 0} \] for any \(c > 0\). This property is fundamental to fractal geometry and has deep implications in mathematical finance.

Quadratic Variation

Unlike smooth functions, Brownian motion has non-zero quadratic variation. For a partition \(0 = t_0 < t_1 < \cdots < t_n = T\): \[ \sum_{i=1}^{n} [W(t_i) - W(t_{i-1})]^2 \xrightarrow{n \to \infty} T \] almost surely. This property is crucial in stochastic calculus (Itô calculus) and financial mathematics.

Recurrence and Transience

In one dimension, Brownian motion is recurrent: the process returns to any neighborhood of its starting point infinitely often with probability 1. However, in dimensions \(\geq 3\), Brownian motion is transient: it eventually escapes to infinity.

Applications in Cybersecurity and Computer Science

Modeling System Performance

Brownian motion models are used to analyze:

Stochastic Models for Security

In security contexts, Brownian motion appears in:

Financial Cryptography

The famous Black-Scholes model for option pricing assumes that asset prices follow geometric Brownian motion: \[ dS_t = \mu S_t \, dt + \sigma S_t \, dW_t \] This model underpins much of modern quantitative finance, including cryptocurrency derivatives and DeFi protocols.

Randomized Algorithms

Brownian motion provides theoretical foundations for:

Interactive Simulation: Brownian Motion Trajectories

This simulation generates multiple realizations of Brownian motion with drift. Each trajectory follows \(Y_t = Y_{t-1} + Z_t\) where \(Z_t \sim \mathcal{N}(\mu \Delta t, \sigma^2 \Delta t)\). The Normal increments are generated using the Box-Muller transform from uniform random numbers. Adjust the parameters to explore how drift, volatility, and time discretization affect the process behavior.

0.0

Expected rate of change per unit time

1.0

Standard deviation of increments (diffusion coefficient)

10

Total simulation time [0, T]

1000

Discretization fineness (Δt = T/n)

30

Number of independent realizations

For reproducible simulations

Click "Generate Trajectories" to begin simulation...

Trajectory Visualization

Visualization of Brownian motion trajectories. Each path represents an independent realization of the stochastic process with normally-distributed increments.

Final Position Distribution

The empirical distribution of \(Y(T)\) values across all trajectories (bars) compared with the theoretical \(\mathcal{N}(\mu T, \sigma^2 T)\) density (red curve).

Histogram of final position distribution compared with theoretical Normal density.

Box-Muller Transform Demonstration

This visualization shows the transformation from uniform random pairs \((U_1, U_2)\) to normal random pairs \((Z_1, Z_2)\) using the Box-Muller method.

Uniform Input (U₁, U₂)
Normal Output (Z₁, Z₂)

Understanding the Simulation: Each trajectory starts at \(Y(0) = 0\) and evolves via normally-distributed increments \(Z_t \sim \mathcal{N}(\mu \Delta t, \sigma^2 \Delta t)\). The drift \(\mu\) tilts trajectories upward (\(\mu > 0\)) or downward (\(\mu < 0\)), while volatility \(\sigma\) controls the spread. As the number of time steps \(n\) increases, the discretization becomes finer, yielding smoother approximations to true continuous Brownian motion. The Box-Muller transform generates these Normal increments from uniform random numbers.

Observations and Questions

Click on each question to reveal the answer and deepen your understanding.

Answer: The drift parameter \(\mu\) controls the expected direction of the process:

  • \(\mu > 0\): Trajectories trend upward on average. The expected value at time \(T\) is \(\mathbb{E}[Y(T)] = \mu T > 0\).
  • \(\mu = 0\): Pure diffusion with no systematic trend. Trajectories wander symmetrically around zero.
  • \(\mu < 0\): Trajectories trend downward on average. \(\mathbb{E}[Y(T)] = \mu T < 0\).

Try it: Set \(\mu = 0.5\), then \(\mu = 0\), then \(\mu = -0.5\). Observe how the "fan" of trajectories tilts.

Answer: The volatility \(\sigma\) controls the dispersion of trajectories:

  • Higher \(\sigma\) means larger variance: \(\text{Var}(Y(T)) = \sigma^2 T\)
  • Trajectories spread out more rapidly and the "cone" of paths is wider
  • At any time \(t\), approximately 68% of trajectories lie within \(\pm \sigma\sqrt{t}\) of the mean
  • Lower \(\sigma\) produces tighter, more predictable paths

Try it: Compare \(\sigma = 0.5\) vs \(\sigma = 2.0\). The distribution at time \(T\) is 4× wider in the high-volatility case.

Answer: The number of time steps \(n\) determines the resolution of the simulation:

  • Time step size: \(\Delta t = T/n\)
  • Higher \(n\) → smaller \(\Delta t\) → smoother, more accurate paths
  • The increment variance \(\sigma^2 \Delta t = \sigma^2 T/n\) decreases with \(n\)
  • Statistical properties (mean, variance of \(Y(T)\)) are preserved regardless of \(n\)
  • Visual appearance becomes more "continuous" and less jagged

Try it: Compare \(n = 100\) (coarse, visible steps) with \(n = 2000\) (smooth curves).

Answer: The final position \(Y(T)\) is the sum of \(n\) independent normal random variables:

\[Y(T) = \sum_{i=1}^{n} Z_i, \quad Z_i \sim \mathcal{N}(\mu \Delta t, \sigma^2 \Delta t)\]

Since the sum of independent normal random variables is also normal:

  • Mean: \(\mathbb{E}[Y(T)] = n \cdot \mu \Delta t = \mu T\)
  • Variance: \(\text{Var}(Y(T)) = n \cdot \sigma^2 \Delta t = \sigma^2 T\)
  • Therefore: \(Y(T) \sim \mathcal{N}(\mu T, \sigma^2 T)\)

This property holds exactly, not just approximately—unlike the discrete random walk which only approaches normality via the Central Limit Theorem.

Answer: These three processes form a hierarchy of increasing generality:

Process Time Space Increments
HW7: Random Walk Discrete Discrete \(\pm 1\) (Bernoulli)
HW10: Poisson Continuous Discrete \(+1\) at random times
HW11: Brownian Continuous Continuous Normal \(\mathcal{N}(\mu, \sigma^2)\)

The discrete random walk converges to Brownian motion under proper rescaling (Donsker's theorem). The Poisson process can be viewed as a "pure jump" counterpart to Brownian motion—both have independent, stationary increments.

Conclusion

Brownian motion represents the pinnacle of random walk theory: a continuous-time, continuous-space stochastic process that arises as the natural limit of discrete random walks. Its defining properties—independent Gaussian increments, continuous paths, and characteristic \(\sqrt{t}\) scaling—make it a fundamental model in probability theory, physics, and mathematical finance.

The simulation techniques developed here—particularly the Box-Muller transform for generating normal random variables—are essential tools in computational statistics and Monte Carlo methods. By implementing and visualizing Brownian motion, we gain intuition about stochastic processes that pervade models of uncertainty across engineering, science, and security applications.

Key takeaways:

References