Markov Chain Calculator

Enter a stochastic transition matrix and an initial distribution to get the steady-state vector and the k-step distribution instantly.

Use the Markov Chain Calculator

Transition Matrix P

Row i = probabilities of moving FROM state i. Each row must sum to 1.

Initial Distribution v0

Probability of starting in each state. Must sum to 1.

Summary

This Markov Chain Calculator accepts an n×n row-stochastic transition matrix and computes two key results: the steady-state (stationary) probability vector that the chain converges to regardless of starting conditions, and the state distribution after exactly k steps from a user-supplied initial distribution. All computation runs locally in your browser using power-iteration and basic linear algebra — no data is sent to any server.

How it works

  1. Select the number of states n (2 to 6) to generate the n×n matrix grid.
  2. Fill in each cell with the transition probability from row-state i to column-state j.
  3. Each row must sum to 1; a live row-sum indicator confirms validity.
  4. Enter the initial probability distribution (must also sum to 1).
  5. Set the number of steps k and click Calculate.
  6. The tool runs power iteration to find the steady-state vector and matrix-multiplies the initial vector k times for the k-step distribution.

Use cases

  • Model customer retention and churn across subscription tiers.
  • Analyze page-rank style link graphs for small networks.
  • Simulate weather-pattern Markov models in statistics coursework.
  • Verify hand-calculated steady-state answers on homework problems.
  • Prototype board-game or inventory-level Markov models quickly.
  • Understand convergence behavior by comparing k-step vs. steady-state.

Frequently Asked Questions

Last updated: 2026-05-28 · Reviewed by Nham Vu