All revision notes topics

4.19 Transition matrices and Markov chainsIB Maths: Applications and Interpretation HL: Revision notes

Section 1

Transition matrices and diagrams

A system that moves between a fixed set of states, where the next state depends only on the current one, is described by a transition matrix TT. In this course TijT_{ij} is the probability of moving from state jj to state ii, so each column sums to 1. A transition diagram shows the same information: one node per state and an arrow for each move, labelled with its probability (a loop for staying put). Example: rain (R) or dry (D). After a rainy day, rain again with probability 0.80.8; after a dry day, rain with probability 0.30.3. T=(0.80.30.20.7)T=\begin{pmatrix} 0.8 & 0.3 \\ 0.2 & 0.7 \end{pmatrix} Column 1 is 'from R', column 2 is 'from D'. This has the same layout as an adjacency matrix for the diagram, except that the entries are probabilities rather than counts of edges.

Key termsstatetransition matrixtransition diagram
Common mistake

Writing the matrix with rows summing to 1. Here the columns sum to 1, so check this every time.

Exam tip

Always write the order of the states next to the matrix, for example 'states ordered R, D'.

Section 2

State matrices and powers of TT

The initial state matrix s0\mathbf{s}_0 is a column giving the probability (or number) in each state at the start. After one transition s1=Ts0\mathbf{s}_1=T\mathbf{s}_0, and in general sn=Tns0.\mathbf{s}_n=T^n\mathbf{s}_0. The entry (Tn)ij(T^n)_{ij} is the probability of moving from state jj to state ii in exactly nn steps. Use your GDC for powers. Example: it is dry today, so s0=(01)\mathbf{s}_0=\begin{pmatrix} 0 \\ 1 \end{pmatrix}. Then s1=(0.30.7)\mathbf{s}_1=\begin{pmatrix} 0.3 \\ 0.7 \end{pmatrix} and s2=Ts1=(0.450.55)\mathbf{s}_2=T\mathbf{s}_1=\begin{pmatrix} 0.45 \\ 0.55 \end{pmatrix}: a probability 0.450.45 of rain in two days.

Key termsinitial state matrix$T^n$
Common mistake

Multiplying in the wrong order. With columns as 'from' states, the state matrix goes on the right: Ts0T\mathbf{s}_0, not s0T\mathbf{s}_0T.

Exam tip

Check each state matrix still sums to 1 (or to the total population).

Section 3

Regular Markov chains and the steady state

A Markov chain is regular if some power of TT has all entries positive. Then sn\mathbf{s}_n approaches the same steady state whatever s0\mathbf{s}_0 is, and TnT^n settles to a matrix with identical columns. There are two methods.

  • Repeated multiplication: calculate Tns0T^n\mathbf{s}_0 for a large nn on your GDC until the values stop changing.
  • Solve Ts=sT\mathbf{s}=\mathbf{s} together with the entries summing to 1 (use this when an exact answer is demanded). Example with the rain matrix: Ts=sT\mathbf{s}=\mathbf{s} gives 0.8r+0.3d=r0.8r+0.3d=r, so 0.2r=0.3d0.2r=0.3d and r=1.5dr=1.5d. With r+d=1r+d=1: d=0.4d=0.4 and r=0.6r=0.6. So in the long term it rains on 60%60\% of days.
Key termsregularsteady statelong-term probability
Common mistake

Using only Ts=sT\mathbf{s}=\mathbf{s}. The equations are dependent, so you must also use that the entries sum to 1.

Section 4

Steady state as an eigenvector

The equation Ts=sT\mathbf{s}=\mathbf{s} says that s\mathbf{s} is an eigenvector of TT with eigenvalue 1. A transition matrix always has the eigenvalue 1. To use this, solve (T−I)v=0(T-I)\mathbf{v}=\mathbf{0}, then scale v\mathbf{v} so its entries sum to 1. For the rain matrix, det⁡(T−λI)=(0.8−λ)(0.7−λ)−0.06=0\det(T-\lambda I)=(0.8-\lambda)(0.7-\lambda)-0.06=0 gives λ=1\lambda=1 or λ=0.5\lambda=0.5. For λ=1\lambda=1: −0.2r+0.3d=0-0.2r+0.3d=0, so v=(32)\mathbf{v}=\begin{pmatrix} 3 \\ 2 \end{pmatrix}, and scaling gives (0.60.4)\begin{pmatrix} 0.6 \\ 0.4 \end{pmatrix}. The other eigenvalue has size less than 1, which is why its contribution fades as nn grows and sn\mathbf{s}_n tends to the steady state.

Key termseigenvectoreigenvalue
Exam tip

If a question asks for 'exact' steady-state values, solve the equations; otherwise a high power on the GDC is quicker.

Section 5

Modelling and exam technique

Markov chains model discrete dynamical systems: weather, customer loyalty, population movement, machine states. Read the question for the ordering of states and whether the state matrix is a count or a probability.

  • Write TT with columns summing to 1 and check.
  • Use sn=Tns0\mathbf{s}_n=T^n\mathbf{s}_0 for a specific time.
  • For the long term, use a high power or solve Ts=sT\mathbf{s}=\mathbf{s} with sum 1.
  • Give answers in context, as probabilities or numbers of people, to 3 s.f.
  • If TT contains an unknown pp, use the steady-state equations to find it.
Common mistake

Thinking the long-term answer depends on the starting state. In a regular chain the steady state is the same for every starting state.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on 4.19 Transition matrices and Markov chains

  1. Each day a commuter either cycles (C) or takes the bus (B). If she cycles today, the probability that she cycles tomorrow is 0.70.7. If she takes the bus today, the probability that she cycles tomorrow is 0.40.4. On Monday she cycles. Order the states C, B.
    Find the long-term probability that she cycles on a given day.2 marks
  2. A machine is either working (W) or faulty (F) at the start of each day. A working machine is faulty the next day with probability 0.10.1. A faulty machine is working the next day with probability 0.60.6. The machine is working on day 0. Order the states W, F.
    Use your GDC to find the probability that the machine is faulty on day 3.2 marks
  3. A website has 10001000 subscribers, each on one plan at the start of each month: Free (F), Standard (S) or Premium (P). Each month: a Free subscriber stays Free with probability 0.80.8 and otherwise moves to Standard; a Standard subscriber moves to Free with probability 0.10.1, stays with probability 0.70.7 and otherwise moves to Premium; a Premium subscriber stays with probability 0.70.7 and otherwise moves to Standard. Initially 600600 are Free, 300300 are Standard and 100100 are Premium. Order the states F, S, P.
    Write down the transition matrix TT, and find the number of Premium subscribers after one month.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).