Markov Chain Calculator

Stationary distribution, n-step probabilities and classification, as exact fractions.

Transition matrix P (row = from, column = to)

Classification

Stationary distribution π

After n steps

Frequently asked questions

How is the stationary distribution found?

By solving πP = π with π₁ + … + πₙ = 1 in exact fractions. For an irreducible chain it is unique, and πⱼ is the long-run share of time in state j.

How are irreducible and aperiodic decided?

Irreducible means every state can reach every other; the tool shows a route through all states, or a state that cannot be reached. The period is the gcd of the possible return times; Pᵢᵢ > 0 gives period 1.

What about absorbing states?

A state with Pᵢᵢ = 1 is absorbing. The tool then gives the probability of ending in each absorbing state and the expected number of steps.