🧮
🧮 Math & statistics

Markov Chain Steady-State Calculator

Results update as you type.

Your numbers

Understanding the Markov chain steady-state calculator — concept and principle

A Markov chain moves between states with fixed probabilities that depend only on the current state. The transition matrix P holds them: row i lists the probabilities of going from state i to each state, so every row sums to 1. The steady state (stationary distribution) π is the long-run share of time spent in each state. It is used for customer retention and brand switching, weather models, machine up/down cycles, queueing and web page ranking. The calculator also shows the distribution after n steps starting from state 1.

Two-state Markov chain and its steady stateState 1 stays with 0.9 and moves with 0.1; state 2 returns with 0.5. Balancing 0.1·π₁ = 0.5·π₂ gives π = (5/6, 1/6).In the long run, flows balanceState 1State 20.90.50.10.5flow out of 1 = flow into 10.1 · π₁ = 0.5 · π₂ → π₁ = 5 π₂π₁ = 5/6 ≈ 0.83331/6After 10 steps from state 1: 0.833351
The chain spends 5/6 of its time in state 1 once the flows balance.

How it is calculated

The principle

If today's distribution is a row vector x, tomorrow's is xP. A distribution that reproduces itself, πP = π, is a fixed point: once reached, nothing changes. In matrix language π is a left eigenvector of P for eigenvalue 1. For a finite chain that is irreducible (every state can reach every other) and aperiodic, that fixed point is unique and every starting distribution converges to it. The other eigenvalues set the speed: the gap from the steady state shrinks like |λ₂|ⁿ.

Worked example

  1. Defaults: P = [0.9 0.1; 0.5 0.5], n = 10.
  2. Balance for state 2: flow in = flow out, 0.1·π₁ = 0.5·π₂, so π₁ = 5π₂.
  3. With π₁ + π₂ = 1: 6π₂ = 1, giving π = (5/6, 1/6) = (0.833333, 0.166667).
  4. For a 2-state chain λ₂ = 1 − 0.1 − 0.5 = 0.4, so starting in state 1 the probability of being in state 1 after n steps is 5/6 + (1/6)·0.4ⁿ. Check: n = 1 gives 0.9, n = 2 gives 0.86.
  5. For n = 10: 0.4¹⁰ ≈ 0.000105, so the result is (0.833351, 0.166649), already very close to π.

How to read the result

πᵢ is the long-run fraction of steps in state i, and 1/πᵢ is the mean number of steps between returns to state i (here 1.2 steps for state 1, 6 for state 2). Compare the n-step distribution with π to see how quickly the chain forgets its starting point.

Common mistakes

Keep in mind: A Markov model assumes the future depends only on the present state and that the probabilities stay constant over time. Real systems with memory, seasonality or changing behaviour may violate this.

Frequently asked questions

What if a row does not sum to 1?

Then P is not a valid transition matrix and the result has no probability meaning. Fix the data first.

When is there no unique steady state?

When the chain splits into separate closed groups, for example the identity matrix, where each state stays put forever.

Sources: John G. Kemeny and J. Laurie Snell, Finite Markov Chains, Springer · Sheldon M. Ross, Introduction to Probability Models, Academic Press — Markov chains

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →