Exponential martingale of a biased simple random walk (source code)

= Exponential martingale of a biased simple random walk

For a walk with increments $+1$ with probability $p$ and $-1$ with probability $1-p$, put
$$
\psi(\theta)=\log(pe^\theta+(1-p)e^{-\theta}).
$$
Then $\exp(\theta S_n-n\psi(\theta))$ is a martingale. Optional stopping at the first linear-boundary crossing and optimization over $\theta$ gives exponential maximal-deviation bounds governed by the <Legendre transform of a cumulant-generating function>.