What does Martingales, Stopping Times and Stop-Loss Bounds conclude, in numbers, about “A Conservation Law for Fair Games: Martingales, Bounded Stopping Times and the Optional Stopping Theorem”?

Answer: A martingale is a cumulative process that neither gains nor loses; a stopping time is a rule that looks only at the past; the optional stopping theorem says that under a bounded stopping time the expectation of a martingale is conserved. Program p11 displays this conservation exactly on six rules, whose win rates range from 0.300 to 0.824 while every expectation is zero. Program p12 shows that the theorem fails only when the stopping time is unbounded, and that the price of the failure is a loss on a vanishing set of paths and an average wait that both grow without limit, which cannot be collected within finite capital and finite time. What, then, are the accounts of the most common and most tempting rule of all, doubling after a loss, when capital is finite? That is the question of the next chapter.

Scope of the numbers: Its parameters are illustrative; all calculations are generated by its programs. It is not individual financial advice, does not encourage gambling of any kind, and analyses doubling only as a counter-example.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.300, 0.824

fair walk, deadline N = 20 periods, exact enumeration
ruleE[S_T]P(+)P(-)E[T]sdworst P(worst)
hold00.4120.41220.004.47-200.0000
first+100.8240.1606.222.49-200.0000
+3/-300.4810.4818.472.91-30.4625
+2/-800.6640.28110.443.23-80.0712
+5/-200.3000.6578.772.96-20.6566
trail300.3220.57210.473.24-30.2495
every row: E[S_T] is exactly 0 (a Fraction, not a rounded float)

Key formula

\[E[S_{t+1}\mid S_0,S_1,\ldots,S_t]=S_t.\]
Show the full program
# Chapter 1. p11: Six stopping rules on a fair walk all keep mean zero.
# Model: a fair business trial. Each period the running result moves
# +1 or -1 unit with probability 1/2 each (a martingale). A stopping
# rule may look at the whole past but not the future; every rule here
# is also cut at the deadline N = 20, so the stopping time is bounded
# and Doob's optional stopping theorem says E[S_T] = S_0 = 0. Exact
# enumeration with fractions; the rules and N are illustrative.
from fractions import Fraction
import math

N = 20
HALF = Fraction(1, 2)


def rule_hold(s, m):
    return False


def rule_first_up(s, m):
    return s >= 1


def rule_3_3(s, m):
    return s >= 3 or s <= -3


def rule_2_8(s, m):
    return s >= 2 or s <= -8


def rule_5_2(s, m):
    return s >= 5 or s <= -2


def rule_trail3(s, m):
    return m - s >= 3


RULES = [("hold", rule_hold), ("first+1", rule_first_up),
         ("+3/-3", rule_3_3), ("+2/-8", rule_2_8),
         ("+5/-2", rule_5_2), ("trail3", rule_trail3)]


def run(rule):
    live = {(0, 0): Fraction(1)}
    ends = []                      # (final value, time, probability)
    for t in range(1, N + 1):
        new = {}
        for (s, m), pr in live.items():
            for d in (1, -1):
                ns = s + d
                key = (ns, max(m, ns))
                new[key] = new.get(key, Fraction(0)) + pr * HALF
        live = {}
        for key in sorted(new):
            s, m = key
            if rule(s, m) or t == N:
                ends.append((s, t, new[key]))
            else:
                live[key] = new[key]
    return ends


print("fair walk, deadline N = %d periods, exact enumeration" % N)
print("%-9s %6s %6s %6s %6s %6s %6s %8s" % (
    "rule", "E[S_T]", "P(+)", "P(-)", "E[T]", "sd", "worst", "P(worst)"))
for name, rule in RULES:
    ends = run(rule)
    mean = Fraction(0)
    for s, t, pr in ends:
        mean += s * pr
    pw = math.fsum(float(pr) for s, t, pr in ends if s > 0)
    pl = math.fsum(float(pr) for s, t, pr in ends if s < 0)
    et = math.fsum(t * float(pr) for s, t, pr in ends)
    var = math.fsum(s * s * float(pr) for s, t, pr in ends)
    worst = min(s for s, t, pr in ends)
    pwo = math.fsum(float(pr) for s, t, pr in ends if s == worst)
    print("%-9s %6s %6.3f %6.3f %6.2f %6.2f %6d %8.4f" % (
        name, str(mean), pw, pl, et, math.sqrt(var), worst, pwo))
print("every row: E[S_T] is exactly 0 (a Fraction, not a rounded float)")

Single source and citation

Fan, Y. (2026). Doob's Martingales and the Optional Stopping Theorem: the Doubling Fallacy and Rigorous Stop-Loss Bounds for Business Trials (Version 1.0.0), Chapter 1: A Conservation Law for Fair Games: Martingales, Bounded Stopping Times and the Optional Stopping Theorem. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-249 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026249,
  author    = {Fan, Yafu},
  title     = {Doob's Martingales and the Optional Stopping Theorem: the Doubling Fallacy and Rigorous Stop-Loss Bounds for Business Trials},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book