Loading…

Markov Chain Matrix Analyzer

Math Linear Algebra • Applications and Advanced Linear Algebra (capstone)

View all topics

Analyze a transition matrix \(P\) (row-stochastic). Compute a steady state \(\pi\) by solving \(\pi P=\pi\) with \(\sum_i \pi_i=1\), detect absorbing states, compute \(n\)-step transitions \(P^n\), and visualize state probabilities over time.

Transition matrix \(P\)
Row \(i\) should sum to 1. Entry \(p_{ij}\) is the probability to move from state \(i\) to state \(j\).
Inputs accept 0.3, 2e-4, fractions 7/10, and constants pi, e.
Initial distribution \(v_0\)
Used for the graph \(v_{t+1}=v_tP\) and for \(v_k=v_0P^k\).
Tip: a valid distribution has nonnegative entries and sums to 1 (within tolerance).
Ready
Results
Row-stochastic check
Absorbing states
Steady state \(\pi\)
Steady-state residual \(\|\pi P-\pi\|\)
\(P^n\) (selected \(n\))
Distribution after \(n\) steps: \(v_n = v_0P^n\)
Long-term note
Graph
Plots \(v_t\) versus time step \(t\). Includes axis tick values. Zoom with wheel/trackpad, drag to pan, double-click to reset. Play animates drawing the trajectories.
Step-by-step
Enter \(P\) and click “Calculate”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does it mean for P to be row-stochastic?

Every entry is nonnegative and each row sums to 1. Row i represents a probability distribution over the next state given the current state i.

How is the steady state computed?

The calculator solves πP=π with sum(π)=1 by converting it to (P^T - I)π^T=0 and replacing one equation with the normalization constraint; if the system is ill-conditioned, it falls back to an iterative approximation.

What is an absorbing state?

A state i is absorbing if p_ii=1 and p_ij=0 for all j≠i. Once entered, the chain stays there forever.

Why might the chain not converge to a single steady state?

If the chain is reducible, periodic, or has multiple closed classes, it may have multiple stationary distributions or oscillate. Regular/ergodic chains converge to a unique π.