# Optional Stopping Theorem and Uniform Integrability

Here's a problem related to the Optional Stopping Theorem:

Let $$S_n$$ be a symmetric simple random walk on $$\mathbb{Z}$$ (as in, at each step, the random walk moves a distance of 1 in a uniformly random direction) starting at 0, and let $$T=\min \{n:S_n = M$$ or $$S_n = -M\}$$ where $$M$$ is an integer.

Find constants $$b$$ and $$c$$ so that $$Y_n = S_n^4 - 6nS_n^2 +bn^2 +cn$$ is a martingale, and compute $$\mathbb{E}[T^2]$$.

I understand how to get that $$b=3$$, $$c=2$$. The problem intends for one to then apply the Optional Stopping Theorem to $$Y_{n\wedge T}$$ (along with the fact that $$E[T] = M^2$$ as follows:

$$0=\mathbb{E}[M^4-(6T)M^2+3T^2+2T] = M^4+(2-6M^2)\mathbb{E}[T]+3\mathbb{E}[T^2]=M^4+(2-6M^2)M^2+3\mathbb{E}[T^2] \Rightarrow \mathbb{E}[T^2] = \frac{5M^4-2M^2}{3}$$.

Per multiple online sources, the following three conditions are sufficient for the OST to apply to a martingale:

1. The stopping time has to be bounded a.s.
2. The value of the martingale is bounded a.s.
3. The expectation of the stopping time is finite, and the difference of the martingale's increments are bounded a.s.

As far as I can tell, $$Y_{n\wedge T}$$ does not meet any of these conditions: the stopping time is not bounded a.s., and, if $$n$$ becomes arbitrarily large, so do $$Y_{n}$$ and the martingale's increments.

However, my professor said that the optional stopping theorem still applies here because $$Y_{n\wedge T}$$ is uniformly integrable.

So, in general, for a discrete-time martingale, is uniform integrability a sufficient condition for the Optional Stopping Theorem? If so, I understand that the three conditions above would be useful as sufficient (but not necessary) conditions for uniform integrability.

If not, why would the Optional Stopping Theorem apply here?

Yes, uniform integrability of the martingale is sufficient to apply the Optional Stopping Theorem to any stopping time. In fact, your condition 2. is a special case since bounded $$\Rightarrow$$ uniformly integrable.
Fix $$k \geqslant 0$$ and apply the OST to the martingale $$(Y_n)_{n \geqslant 0}$$ and the stopping time $$k \wedge T$$ which is bounded a.s. by $$k$$. We get $$0 = \mathbb{E}\left[S_{k \wedge T}^4 - 6(k \wedge T)S_{k \wedge T}^2+ 3 (k\wedge T)^2 +2 k\wedge T \right].$$ Then, by the dominated convergence theorem, letting $$k \to \infty$$ yields the result.