Transition matrix (source code)

= Transition matrix
{wiki=Stochastic_matrix}

The transition matrix of a finite <Markov chain> has entries
$$
P_{ij}=\mathbb P(X_{n+1}=j\mid X_n=i).
$$