= Solution
The <random walk> $S_n$ is a <martingale>, since its integrable increments are independent of the past and have mean zero. For the <bounded stopping time> $n\wedge\eta$, the bounded <optional stopping theorem>, proved in the next question, gives $\mathbb ES_{n\wedge\eta}=x$.
If $0<x<r$, the value immediately before exit lies in $(0,r)$, so
$$
|S_\eta|\leq r+|X_\eta|.
$$
Before exit the stopped value has absolute value less than $r$, and after exit it equals $S_\eta$. Consequently $|S_{n\wedge\eta}|\leq r+|X_\eta|$ for every $n$. This is an integrable dominating <random variable> by the preceding part. Since $\eta<\infty$ with probability one, the <dominated convergence theorem> gives
$$
\boxed{\mathbb ES_\eta=\lim_{n\to\infty}\mathbb ES_{n\wedge\eta}=x.}
$$
For $r\leq x$, $S_\eta=S_0=x$ directly, without any convention about $X_0$. Thus the expected stopped position is well-defined and has the stated value for every $r>0$.
Back to article page