Mathwords logoMathwords

Transition Matrix — Definition, Formula & Examples

A transition matrix is a square matrix whose entries represent the probabilities of moving from one state to another in a system that changes over discrete time steps. Each column (or row, depending on convention) sums to 1, since the system must go somewhere at each step.

A transition matrix (or stochastic matrix) PP is an n×nn \times n matrix where each entry pij0p_{ij} \geq 0 represents the probability of transitioning from state jj to state ii, and each column sums to 1: i=1npij=1\sum_{i=1}^{n} p_{ij} = 1 for all jj. (In some conventions, rows sum to 1 instead, with pijp_{ij} denoting the probability of going from state ii to state jj.)

Key Formula

xk=Pkx0\mathbf{x}_{k} = P^{k}\,\mathbf{x}_0
Where:
  • PP = The transition matrix
  • x0\mathbf{x}_0 = The initial state vector (probability distribution at step 0)
  • xk\mathbf{x}_k = The state vector after k transitions
  • kk = Number of time steps

How It Works

To find the state of a system after one step, multiply the transition matrix PP by the current state vector x\mathbf{x}. The result PxP\mathbf{x} gives the new probability distribution across all states. To find the state after kk steps, compute PkxP^k \mathbf{x}. A steady-state vector q\mathbf{q} satisfies Pq=qP\mathbf{q} = \mathbf{q}, meaning the system's distribution no longer changes — this is an eigenvector of PP with eigenvalue 1.

Worked Example

Problem: A city has two weather states: Sunny (S) and Rainy (R). If today is sunny, there is a 0.7 chance tomorrow is sunny and 0.3 chance it is rainy. If today is rainy, there is a 0.4 chance tomorrow is sunny and 0.6 chance it is rainy. If today is sunny (100% chance), find the weather probabilities after 2 days.
Set up P and x₀: Write the transition matrix (columns sum to 1) and the initial state vector.
P=(0.70.40.30.6),x0=(10)P = \begin{pmatrix} 0.7 & 0.4 \\ 0.3 & 0.6 \end{pmatrix}, \quad \mathbf{x}_0 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}
Compute after 1 day: Multiply P by x₀.
x1=Px0=(0.70.3)\mathbf{x}_1 = P\mathbf{x}_0 = \begin{pmatrix} 0.7 \\ 0.3 \end{pmatrix}
Compute after 2 days: Multiply P by x₁.
x2=Px1=(0.7(0.7)+0.4(0.3)0.3(0.7)+0.6(0.3))=(0.610.39)\mathbf{x}_2 = P\mathbf{x}_1 = \begin{pmatrix} 0.7(0.7)+0.4(0.3) \\ 0.3(0.7)+0.6(0.3) \end{pmatrix} = \begin{pmatrix} 0.61 \\ 0.39 \end{pmatrix}
Answer: After 2 days, there is a 61% chance of sun and a 39% chance of rain.

Why It Matters

Transition matrices are central to Markov chains, which model real systems in genetics (allele frequencies), finance (credit ratings), search engines (Google's PageRank algorithm), and queueing theory. Understanding them is essential in any probability or linear algebra course that covers stochastic processes.

Common Mistakes

Mistake: Confusing whether rows or columns should sum to 1.
Correction: The convention varies by textbook. In linear algebra courses, columns typically sum to 1 so that you multiply P on the left of a column state vector. In many probability texts, rows sum to 1 and the state vector is a row vector multiplied on the left of P. Always check which convention your course uses.