Reflected nearest-neighbour random walk (source code)

= Reflected nearest-neighbour random walk

On $\{0,1,2,\ldots\}$, let the chain jump from every $i\geq1$ to $i+1$ with <probability> $p\in(0,1)$ and to $i-1$ with <probability> $1-p$, and jump from zero to one. It is <recurrent Markov chain>[recurrent] exactly when $p\leq1/2$; at $p=1/2$ it is <null recurrent Markov chain>[null recurrent].