Text tool

Markov Chain Calculator

Enter a transition matrix and initial probabilities. All calculations run locally in your browser.

In-browser processingNo account requiredPrivacy details ↗

Use 2–12 rows, one per line, with comma or whitespace separated probabilities. Each row must have the same number of entries as rows.

All entries must be finite numbers from 0 to 1. Every row and the initial distribution must sum to 1 within 1e-9; accepted values are normalized.

Use an integer step count from 0 to 10,000.

Enter a valid matrix and initial distribution.

Power iteration starts from your initial distribution, stops at a maximum coordinate change ≤ 1e-10, or after 10,000 iterations. The estimate depends on the input and start; convergence and uniqueness are not guaranteed.

pₖ₊₁ = pₖP

A QUICK WALKTHROUGH

How to use this tool

  1. Set a 2–12 state row-stochastic matrix and an initial distribution.
  2. Choose 0–10,000 steps and calculate.
  3. Review the finite-step result, stationary estimate and convergence status.

Row-vector convention

The calculation uses pₖ₊₁ = pₖP. Rows describe transitions from the corresponding state. Accepted sums within 1e-9 of 1 are normalized before calculation.

Bounded numerical estimate

Power iteration uses the supplied start, at most 10,000 iterations and a 1e-10 coordinate-change threshold. The displayed residual is max |pP − p|; no convergence or uniqueness guarantee is made.

GOOD TO KNOW

Common questions

What if the iteration does not settle?

The last iterate is shown with a limit-reached status, rather than presented as a converged stationary distribution.

Is my matrix uploaded?

No. The matrix and probabilities stay in the current browser page.