[example: Doubling Strategy Failure]
**SETUP.** Let $X_1, X_2, \dots$ be i.i.d. with $\mathbb P(X_i = 1) = \mathbb P(X_i = -1) = 1/2$. Define
\begin{align*}
S_n &= \sum_{i=1}^n X_i, \qquad S_0 = 0, \qquad \mathcal F_n = \sigma(X_1, \dots, X_n),
\end{align*}
and the stopping time
\begin{align*}
\tau &= \inf\{n \ge 0 : S_n = 1\}.
\end{align*}
The capital $S_n$ represents the gambler's fortune after $n$ plays of a fair $\pm 1$ game. The rule $\tau$ says: quit the first time fortune reaches 1.
**CLAIM.** The process $(S_n)_{n \ge 0}$ is a martingale with $\mathbb E[S_0] = 0$, yet $\mathbb E[S_\tau] = 1$. The apparent contradiction does not arise from any bias in the game. It arises because $\tau$ is unbounded, so the [Optional Stopping Theorem](/theorems/1153) does not apply.
**DERIVATION.**
**Step 1: $(S_n)_{n \ge 0}$ is a martingale.** For $m \ge n \ge 0$, write $S_m = S_n + \sum_{i=n+1}^m X_i$ and condition on $\mathcal F_n$:
\begin{align*}
\mathbb E[S_m \mid \mathcal F_n]
&= \mathbb E\!\left[S_n + \sum_{i=n+1}^m X_i \,\middle|\, \mathcal F_n\right] \\
&= S_n + \sum_{i=n+1}^m \mathbb E[X_i \mid \mathcal F_n] \\
&= S_n + \sum_{i=n+1}^m \mathbb E[X_i] \\
&= S_n + \sum_{i=n+1}^m 0 \;=\; S_n.
\end{align*}
The second equality uses linearity and the fact that $S_n$ is $\mathcal F_n$-measurable. The third uses that $X_i$ is independent of $\mathcal F_n = \sigma(X_1,\dots,X_n)$ for every $i > n$, so $\mathbb E[X_i \mid \mathcal F_n] = \mathbb E[X_i]$. The fourth uses $\mathbb E[X_i] = \tfrac{1}{2}(1) + \tfrac{1}{2}(-1) = 0$.
**Step 2: $\tau$ is a stopping time.** For every $n \ge 0$,
\begin{align*}
\{\tau \le n\} &= \{S_0 = 1\} \cup \{S_1 = 1\} \cup \cdots \cup \{S_n = 1\}.
\end{align*}
Each $\{S_k = 1\}$ is $\mathcal F_k$-measurable, and $\mathcal F_k \subseteq \mathcal F_n$ for $k \le n$, so the union belongs to $\mathcal F_n$.
**Step 3: $\mathbb P(\tau < \infty) = 1$.** Fix an integer $N \ge 1$ and define the auxiliary stopping time $\tau_N = \inf\{n \ge 0 : S_n = 1 \text{ or } S_n = -N\}$. Until $\tau_N$ the walk is confined to $\{-N, -N{+}1, \dots, 1\}$, a finite set, so $\tau_N < \infty$ a.s. Set $Y_n = S_n + N$; then $Y_0 = N$, $Y$ moves $\pm 1$ at each step, and $\tau_N$ is the first time $Y$ hits $N{+}1$ (corresponding to $S = 1$) or $0$ (corresponding to $S = -N$). Applying [Gambler's Ruin Probability](/theorems/1125) with starting position $N$ and absorbing barriers at $0$ and $N{+}1$:
\begin{align*}
\mathbb P(S_{\tau_N} = 1) &= \frac{N}{N+1}.
\end{align*}
Since $\{S_{\tau_N} = 1\} \subseteq \{\tau \le \tau_N\} \subseteq \{\tau < \infty\}$, we have $\mathbb P(\tau < \infty) \ge N/(N+1)$ for every $N \ge 1$. Letting $N \to \infty$:
\begin{align*}
\mathbb P(\tau < \infty) &= 1.
\end{align*}
**Step 4: $S_\tau = 1$ almost surely.** By definition of $\tau$ as the first time the walk visits 1, $S_\tau = 1$ on $\{\tau < \infty\}$. Since $\mathbb P(\tau < \infty) = 1$, we conclude $S_\tau = 1$ a.s.
**Step 5: $\mathbb E[S_\tau] = 1 \ne 0 = \mathbb E[S_0]$.** From Step 4:
\begin{align*}
\mathbb E[S_\tau] &= 1 \cdot \mathbb P(\tau < \infty) = 1.
\end{align*}
Since $S_0 = 0$ deterministically, $\mathbb E[S_0] = 0$.
**Step 6: The [Optional Stopping Theorem](/theorems/1153) does not apply because $\tau$ is not bounded.** The [Optional Stopping Theorem](/theorems/1153) requires that the stopping times be bounded above by a deterministic constant. For every $n \ge 1$, the event $\{X_1 = -1, X_2 = -1, \dots, X_n = -1\}$ has probability $2^{-n} > 0$. On this event $S_k = -k \le 0 < 1$ for $k = 1, \dots, n$, and $S_0 = 0 \ne 1$, so $\tau > n$. Since $\mathbb P(\tau > n) \ge 2^{-n} > 0$ for every $n$, the stopping time $\tau$ is not bounded by any deterministic constant.
**Step 7: The stopped family is not uniformly integrable, and the escaping mass is explicit.** For each fixed $n \ge 0$, the time $n \wedge \tau$ is bounded by $n$, so by the [Optional Stopping Theorem](/theorems/1153):
\begin{align*}
\mathbb E[S_{n \wedge \tau}] &= \mathbb E[S_0] = 0.
\end{align*}
Decompose according to whether $\tau \le n$ or not, using $S_{n \wedge \tau} = S_\tau \mathbf 1_{\{\tau \le n\}} + S_n \mathbf 1_{\{\tau > n\}}$:
\begin{align*}
0 &= \mathbb E[S_\tau \mathbf 1_{\{\tau \le n\}}] + \mathbb E[S_n \mathbf 1_{\{\tau > n\}}] \\
&= \mathbb P(\tau \le n) + \mathbb E[S_n \mathbf 1_{\{\tau > n\}}],
\end{align*}
where the second line uses $S_\tau = 1$ a.s. Rearranging:
\begin{align*}
\mathbb E[S_n \mathbf 1_{\{\tau > n\}}] &= -\mathbb P(\tau \le n).
\end{align*}
As $n \to \infty$, $\mathbb P(\tau \le n) \to 1$, so $\mathbb E[S_n \mathbf 1_{\{\tau > n\}}] \to -1$. On the event $\{\tau > n\}$ the walk has never reached 1; since $S_n$ is integer-valued and $S_n \ne 1$ at every step up to $n$, the walk satisfies $S_n \le 0$ on $\{\tau > n\}$. Thus the expected value of $S_n$ on this event is at most $0$, yet its magnitude grows: the paths that have not yet hit 1 by time $n$ are rare (probability $\mathbb P(\tau > n) \to 0$) but carry $S_n$ to deeply negative values. Meanwhile, $S_{n \wedge \tau} \to S_\tau = 1$ almost surely. A family converging a.s. to an integrable limit and also converging in $L^1$ must be uniformly integrable by [Uniform Integrability and $L^1$ Convergence](/theorems/1162); since $\mathbb E[S_{n \wedge \tau}] = 0 \not\to 1 = \mathbb E[S_\tau]$, the convergence fails in $L^1$, confirming that $\{S_{n \wedge \tau}\}_{n \ge 0}$ is not uniformly integrable.
**CONCLUSION.** The game is fair at every step: $\mathbb E[X_i] = 0$ and $(S_n)$ is a martingale. The strategy stop-at-first-profit guarantees $S_\tau = 1$ almost surely. The apparent paradox $\mathbb E[S_\tau] \ne \mathbb E[S_0]$ is not a failure of fairness but a failure of the hypothesis of the [Optional Stopping Theorem](/theorems/1153): $\tau$ has no deterministic upper bound, and the stopped family $\{S_{n \wedge \tau}\}$ is not uniformly integrable. The "missing" unit of expected wealth sits in the large negative values of $S_n$ on the rare paths that have wandered deeply into deficit and not yet recovered. Their expected contribution $\mathbb E[S_n \mathbf 1_{\{\tau > n\}}] = -\mathbb P(\tau \le n) \to -1$ exactly offsets the expected gain on paths that have already stopped. Optional stopping requires hypotheses that prevent this mass from escaping through the tails of $\tau$.
[/example]