Master Equation Framework

Discrete Generator on Interior States

$$(\mathcal{L}f)(i) = p(i)\big[f(i+\Delta_i)-f(i)\big] + q(i)\big[f(i-\Delta_i)-f(i)\big]$$
where $q(i) = 1-p(i)$ and $\Delta_i$ is the (possibly state-dependent) stake/jump size
Universal Framework: All variants are obtained by changing only the coefficients $p(i)$, the jump size $\Delta_i$, and/or the boundary conditions. The function $f$ represents any functional we want to solve for:
  • $f(i) = P(i)$ for probability of ruin (hit state 0 before $N$)
  • $f(i) = T(i)$ for expected time to absorption
  • Other functionals by adjusting the right-hand side and boundaries
Ruin Probability
$$\mathcal{L}P(i) = 0$$ $$P(0) = 1, \quad P(N) = 0$$
Expected Time
$$\mathcal{L}T(i) = -1$$ $$T(0) = T(N) = 0$$

🔧 Classical Case: Deriving from the Master Equation

Apply Master Equation to Classical Case

For the classical gambler's ruin: $p(i) \equiv p$, $\Delta_i = 1$, absorbing boundaries at 0 and $N$

$$(\mathcal{L}P)(i) = p[P(i+1)-P(i)] + q[P(i-1)-P(i)] = 0$$

This simplifies to the fundamental recursion:

$$pP_{i+1} - P_i + qP_{i-1} = 0$$

Characteristic Equation Method

Assume $P_i = \lambda^i$ and substitute:

$$p\lambda^2 - \lambda + q = 0$$

Solving: $\lambda = \frac{1 \pm \sqrt{1-4pq}}{2p} = \frac{1 \pm |p-q|}{2p}$

$$\lambda_1 = 1, \quad \lambda_2 = \frac{q}{p}$$

General Solution & Boundary Conditions

Case 1: $p \neq \frac{1}{2}$ (distinct roots)

$$P_i = A + B\left(\frac{q}{p}\right)^i$$

Applying $P_0 = 1$ and $P_N = 0$:

$$P_i = \frac{\left(\frac{q}{p}\right)^i - \left(\frac{q}{p}\right)^N}{1 - \left(\frac{q}{p}\right)^N}$$

Case 2: $p = \frac{1}{2}$ (repeated root)

$$P_i = A + Bi \quad \Rightarrow \quad P_i = 1 - \frac{i}{N}$$

Final Classical Solution

$P_i = \begin{cases} \dfrac{\left(\frac{q}{p}\right)^i - \left(\frac{q}{p}\right)^N}{1 - \left(\frac{q}{p}\right)^N} & \text{if } p \neq \frac{1}{2} \\[12pt] 1 - \dfrac{i}{N} & \text{if } p = \frac{1}{2} \end{cases}$

📊 Interactive Master Equation Explorer

0.50
20
10
Fair Game
Adjust parameters to see how the Master Equation generates different probability curves. Notice the transition from concave (p > 0.5) to linear (p = 0.5) to convex (p < 0.5) shapes.

Seven Essential Variants from the Master Equation

1
Classic Fair Game
p(i) ≡ 0.5 Δᵢ = 1 Absorbing 0,N
$$P_i = 1 - \frac{i}{N}$$ $$T_i = i(N-i)$$

Linear ruin probability, quadratic expected time.

2
Unfair (Casino Edge)
p(i) ≡ p < 0.5 Δᵢ = 1 Absorbing 0,N
$$P_i = \frac{r^i - r^N}{1 - r^N}, \quad r = \frac{q}{p}$$

Exponential growth in ruin probability as casino edge increases.

3
Martingale Strategy
p(i) ≡ p Δᵢ history-dependent Double after loss
$$P_{\text{ruin}} = \text{same as constant stake!}$$

Surprising result: ruin probability unchanged, but variance and time differ dramatically.

4
Bold Play Strategy
p(i) ≡ p Δᵢ = min(i, N-i) Maximum bet
$$\text{Optimal for } p > 0.5$$ $$\text{Catastrophic for } p < 0.5$$

Jump size modification completely changes the game dynamics.

5
Parrondo's Paradox
p(i) alternating Two losing games Combination wins
$$p_{\text{eff}} > 0.5 \text{ possible}$$

Counterintuitive: coefficient modification can turn losing games into winners!

6
Stock Price Model
Continuous limit Drift μ Volatility σ
$\mathcal{L}f = \mu f'(x) + \frac{1}{2}\sigma^2 f''(x)$ $\alpha = \frac{2\mu}{\sigma^2}$

Continuous limit of master equation yields barrier option pricing.

7
Population Genetics
p(i) = 0.5 + s·φ(i) Selection pressure Genetic drift
$\text{Neutral: } P_{\text{fix}} = \frac{i}{N}$ $\text{Selection: biased formula}$

Coefficient modification models evolutionary forces in finite populations.

⏱️ Expected Time Analysis via Master Equation

Master Equation for Expected Time

$\mathcal{L}T(i) = -1 \quad \text{on interior states}$ $T = \text{given on boundary}$

For the classical case with $p(i) \equiv p$ and $\Delta_i = 1$:

$pT(i+1) - T(i) + qT(i-1) = -1$
Case A: One-Sided Target

Problem: Start at 0, stop when hitting +k

Boundary: T(k) = 0, boundedness as i → -∞

Homogeneous solution: $T_h(i) = A + Br^i$ with $r = \frac{q}{p}$

Particular solution: Try $T_p(i) = \alpha i$

Substituting: $\alpha(p-q) = -1 \Rightarrow \alpha = -\frac{1}{p-q}$

General solution: $T(i) = A + Br^i - \frac{i}{p-q}$

If $p > q$: boundedness forces $B = 0$

From $T(k) = 0$: $A = \frac{k}{p-q}$

$\boxed{\mathbb{E}_0[\tau_{+k}] = \begin{cases} \frac{k}{p-q} & \text{if } p > q \\ \infty & \text{if } p \leq \frac{1}{2} \end{cases}}$
Case B: Two-Sided Target

Problem: Start at 0, stop when hitting ±k

Boundary: T(-k) = T(+k) = 0

Shift coordinates: $j = i + k$, so we have interval [0, 2k]

Start at $j = k$, boundaries at 0 and 2k

Solve on finite interval: Same method but with two boundary conditions

$\boxed{T(0) = \begin{cases} k^2 & \text{if } p = \frac{1}{2} \\[6pt] \frac{k}{q-p} \cdot \frac{r^k-1}{r^k+1} & \text{if } p \neq \frac{1}{2} \end{cases}}$
Key Distinction: The famous $k^2$ result applies to the two-sided case with fair games. For one-sided targets (most common interpretation), the answer is $\frac{k}{p-q}$ when $p > q$.

🔄 Continuity and Limit Analysis

L'Hôpital's Rule Verification

The transition from biased to fair game is smooth:

$\lim_{p \to 1/2} \frac{\left(\frac{q}{p}\right)^i - \left(\frac{q}{p}\right)^N}{1 - \left(\frac{q}{p}\right)^N} = 1 - \frac{i}{N}$

This can be verified using L'Hôpital's rule or by expanding around $p = 1/2$:

$\frac{q}{p} = \frac{1-p}{p} = \frac{1}{p} - 1 \approx 2(1-p) \text{ near } p = 1/2$

Taylor expansion approach

Let $\epsilon = p - 1/2$, so $p = 1/2 + \epsilon$ and $q = 1/2 - \epsilon$:

$\frac{q}{p} = \frac{1/2 - \epsilon}{1/2 + \epsilon} = \frac{1-2\epsilon}{1+2\epsilon} \approx (1-2\epsilon)(1-2\epsilon) = 1-4\epsilon$

Exponential limit

As $\epsilon \to 0$:

$(1-4\epsilon)^i \approx e^{-4\epsilon i} \approx 1 - 4\epsilon i$

Substituting back recovers the linear formula.