DP Math AI · HL · Statistics and Probability

AHL 4.19—Transition matrices – Markov chains

Get started
Notes

What is a Transition Matrix?

A Transition Matrix: A square matrix P in which each entry pij​ gives the probability of moving from state i to state j in one step of a stochastic process. This follows the row-stochastic convention: row i lists all probabilities of leaving state i, so each row sums to 1.

If a system has n states, the transition matrix is n×n:

P=​p11​p21​⋮pn1​​p12​p22​⋮pn2​​⋯⋯⋱⋯​p1n​p2n​⋮pnn​​​

Each row corresponds to a current ("from") state, and each column corresponds to the next ("to") state.

Note

Because every row lists all possible outcomes from a given state, the entries in each row must sum to 1. This is the defining constraint of a valid (row-stochastic) transition matrix.

Warning

Be careful about convention: in some textbooks columns sum to 1 (column-stochastic), and in that convention pij​ means the probability of moving from state j to state i. In the IB DP course, rows sum to 1, and state vectors are row vectors multiplied on the left of the matrix: sn​=s0​Pn.

Building a Transition Matrix , Worked Example

Example

Weather forecasting model

Suppose a weather system has two states: Sunny (S) and Rainy (R).

  • If today is Sunny: 70% chance of Sunny tomorrow, 30% chance of Rainy tomorrow.
  • If today is Rainy: 40% chance of Sunny tomorrow, 60% chance of Rainy tomorrow.

Step 1 , Label rows and columns by state (S, R).

Step 2 , Fill in probabilities row by row:

P=SR​S0.70.4​R0.30.6​​

In matrix form:
P=(0.70.4​0.30.6​)

Check: Row 1: 0.7+0.3=1 ✓ Row 2: 0.4+0.6=1 ✓

This same information can be represented as a transition diagram , a directed graph where each node is a state and each arrow is labelled with the transition probability. For the weather model, there are arrows from S to S (0.7), S to R (0.3), R to S (0.4), and R to R (0.6). Reading arrows out of each node gives the corresponding row of the transition matrix.

Exam Tip

Always verify rows sum to 1 immediately after writing down any transition matrix , catching errors early saves marks in exams. When working from a transition diagram, trace all arrows leaving each state to fill in that row.

Free preview

10 more sections in this topic

← Previous topicAHL 4.18—T and Z test, type I and II errors
Koncepts

Learn it properly. Then practise like it's the real paper.

Start free

Features

  • Lessons
  • Past papers
  • Library
  • Homework Help
  • Duels

More

  • For parents
  • Compare
  • Plans & pricing
  • DP for students

Legal

  • Privacy
  • Terms
  • Account deletion

© 2026 Koncepts (product of PrepAiro, Inc). All rights reserved.
DP, IB, EE and TOK are terms of the International Baccalaureate Organization.

Made for IB DP students.