Gambler's Ruin, the CTMC Way

Same positive edge. Same starting bankroll. Two models. The deterministic model says you win forever — smooth, calm, inevitable. The exact stochastic model (a real Gillespie-simulated continuous-time Markov chain) says a chunk of your trajectories go bust at zero, purely from the randomness of small numbers — even though the expected path says you shouldn't. The smaller your bankroll, the worse your odds of ruin, even at a fixed positive edge.

Reframed from: Evaluating the effectiveness of Stochastic CTMC and deterministic models in correlating rabies persistence in human and dog populations — arXiv:2510.25777. There, N = reservoir population size and "ruin" = disease extinction. Here, N = bankroll units and "ruin" = busting to zero. Same linear birth–death CTMC, same math.

Deterministic model (ODE)

"Business as usual" — mean-field prediction, no randomness. Edge > 0 ⇒ grows forever, by assumption.

Stochastic CTMC (exact Gillespie SSA)

Real event-driven simulation: exponential waiting times, birth/death rates proportional to current bankroll. Same edge, same N, same horizon.
Busted: 0
Survived: 0
Empirical ruin rate: 0%

Extinction probability vs. bankroll size N

exact finite-horizon theory    sweep empirical fractions    current N / current roll

What's actually being computed

Both panels use the same linear birth–death process: at bankroll x, birth rate = p·x, death rate = (1-p)·x.

Deterministic: x(t) = N·e^((2p-1)t) — the mean-field ODE limit.

Stochastic: exact Gillespie SSA — draw waiting time Δt ~ Exp(x), then step x±1 with probability p / 1-p. Absorbing at x=0.

Exact ruin probability (Kendall, 1948 linear birth–death closed form) at horizon T:
P₁(T) = d(e^{(p-d)T}-1) / (p·e^{(p-d)T}-d),  P_N(T) = P₁(T)^N
As T → ∞, this floors at ((1-p)/p)^N — the classical gambler's ruin formula, and the paper's reservoir-extinction result, in one line.