Gillespie Algorithm: Exact Stochastic Chemical Kinetics

Molecule-by-molecule simulation — discrete stochastic events vs. deterministic ODE, with finite-size fluctuations

A + B →k₁ C   |   C →k₂ A + B   |   A₀ = B₀ = Ω·c₀, C₀ = 0

Parameters

50
0.020
0.50
4
Gillespie Algorithm (1977)

The exact stochastic simulation algorithm (SSA) treats reactions as discrete events. At each step:
1. Compute propensities: a₁ = k₁·A·B, a₂ = k₂·C
2. Sample time to next event: τ ~ Exp(a₀ = a₁+a₂)
3. Select reaction μ with probability aμ/a₀
4. Update molecule counts and advance time by τ

Deterministic ODE (dashed white): d[C]/dt = k₁[A][B] − k₂[C], valid for Ω→∞.
Stochastic trajectories (colored): fluctuate around ODE with amplitude ∝ 1/√Ω.
Equilibrium: K_eq = k₁/k₂. For small Ω, discrete fluctuations and rare events dominate.