Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test

4 · IB Maths

Markov chains

A system hops between two states with fixed transition probabilities. Change where it starts and how many steps it takes, and watch the distribution settle to the same steady state. A random walker hops alongside as a check.

Predict first

Start from the defaults (p = 0.30, q = 0.20), where P(A) settles at 0.40. You raise q to 0.30. What is the new steady-state P(A)?

state A state B random walker (share of hops spent in A)

T = [ 1−p q ; p 1−q ], xₙ = Tⁿx₀
steady state: Tx = x, so x = (q, p) ÷ (p + q)
second eigenvalue: λ = 1 − p − q

Try this

  1. Use the defaults (p = 0.30, q = 0.20) and drag n from 0 to 30. How many steps until P(A) is within 0.01 of 0.4?
  2. Change 'Start in A' from 100% to 0%. Does the steady state change, and does the time to reach it?
  3. Set p = q = 1.00 with a 100% start. Why does the distribution never settle, and what does λ = −1 tell you?

Common error: each column of the transition matrix must sum to 1 when the state vector is a column; writing the probabilities in the wrong orientation gives the wrong steady state.