Simple symmetric random walk (source code)

= Simple symmetric random walk

A simple symmetric random walk starting from $S_0$ has
$$
S_n=S_0+\sum_{k=1}^n\xi_k,
$$
where the increments $\xi_k$ are independent and satisfy
$$
\mathbb P(\xi_k=1)=\mathbb P(\xi_k=-1)=\frac12.
$$