Skip to content
IB Diploma ProgrammeSL & HL

Markov chains

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Markov chains notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Markov chains notes as text: skim, search, and jump between subtopics.

~20 min read

1. Transition matrices

A system moves between a fixed number of states, one transition at a time. The probabilities of each move are stored in a transition matrix T. Each state has one row and one column.

The entry T_ij is the probability of moving from state j to state i. Column j therefore lists every place state j can go next, so each column sums to 1. The rows need not sum to 1.

A transition diagram holds the same information: a circle for each state, and an arrow from state j to state i labelled T_ij. A state that stays where it is has an arrow back to itself.

T_ij = P(moving from state j to state i)

each column of T sums to 1

Worked example 13 marks

In a town, there are three stores: Aroma, Bodega and Clover. Ashley is the manager of Aroma. She found that:

  • 91% of Aroma customers stayed with Aroma, 5% moved to Bodega, and 4% moved to Clover.
  • 95% of Bodega customers stayed with Bodega, 4% moved to Aroma, and 1% moved to Clover.
  • 92% of Clover customers stayed with Clover, 6% moved to Aroma, and 2% moved to Bodega.

This information is used to form a transition matrix, T.

(a) Write down the transition matrix T.

  1. 1

    A1: Aroma is the first state, so column 1 holds where Aroma customers go: beginpmatrix 0.91 0.05 0.04 endpmatrix [1]

  2. 2

    A1: Bodega, column 2: beginpmatrix 0.04 0.95 0.01 endpmatrix [1]

  3. 3

    A1: Clover, column 3: beginpmatrix 0.06 0.02 0.92 endpmatrix [1]

  4. 4

    So T = beginpmatrix 0.91 & 0.04 & 0.06 0.05 & 0.95 & 0.02 0.04 & 0.01 & 0.92 endpmatrix. Each column sums to 1, which checks it. The markscheme awards one A1 for each correct column.

2. The state after n transitions

The initial state matrix s₀ is a column of the probabilities of being in each state before any transition. Its entries add to 1. One transition gives s₁ = Ts₀. In general the column state matrix after n transitions is sn = Tⁿ s₀.

Write T on the left of the column s₀. Each column of T is then matched with the entries of the column s₀.

The matrix Tⁿ has a meaning of its own: entry (i,j) of Tⁿ is the probability of moving from state j to state i in n transitions. Find Tⁿ on the GDC by entering T as a matrix and raising it to the power n. Then select the relevant cell.

sn = Tⁿ s₀

(Tⁿ)_ij = P(state j to state i in n transitions)

Worked example 14 marks

In a town, there are three stores: Aroma, Bodega and Clover. The movement of customers between the three stores over the course of one year is used to form a transition matrix,

T = beginpmatrix 0.91 & 0.04 & 0.06 0.05 & 0.95 & 0.02 0.04 & 0.01 & 0.92 endpmatrix.

It is assumed that the movement of customers between stores remains constant from year to year.

(b) Determine the percentage of Clover customers expected to move to Aroma over a 5-year period.

  1. 1

    M1: recognise the need to calculate T⁵, because five transitions are made [1]

  2. 2

    A1: on the GDC, T⁵ = beginpmatrix 0.659 & 0.156 & 0.219 0.196 & 0.792 & 0.101 0.146 & 0.0514 & 0.680 endpmatrix to three significant figures [1]

  3. 3

    M1: select the relevant cell. Clover is state 3 (column 3) and Aroma is state 1 (row 1), so (T⁵)₁₃ = 0.219 [1]

  4. 4

    A1: 21.9%. The final answer must be a percentage [1]

3. Working backwards

If s₁ = Ts₀, then s₀ = T⁻¹s₁ whenever the inverse exists. The same step gives an earlier state from a later one. Find T⁻¹ on the GDC.

A second method is to write the unknown earlier state as beginpmatrix r d endpmatrix and solve the simultaneous equations that Tbeginpmatrix r d endpmatrix must equal the current state.

Check by multiplying forward. T times your earlier state must give the state you started with.

s₀ = T⁻¹s₁

Worked example 13 marks

Krauss works at a coffee shop and finds that this month, 65% of customers ordered regular coffee and 35% of customers ordered decaf coffee. This information can be displayed as the following column vector.

C = beginpmatrix 0.65 0.35 endpmatrix

Krauss believes that customers change their choices each month according to the following transition matrix.

T = beginpmatrix 0.8 & 0.3 0.2 & 0.7 endpmatrix

(a) Use Krauss' transition matrix to predict the proportion of customers who ordered regular coffee and decaf coffee in the previous month.

  1. 1

    M1: evidence of using the inverse of matrix T, so C_last month = T⁻¹C [1]

  2. 2

    A1: T⁻¹ = beginpmatrix 1.4 & -0.6 -0.4 & 1.6 endpmatrix [1]

  3. 3

    A1: C_last month = beginpmatrix 0.7 0.3 endpmatrix, so 70% ordered regular coffee and 30% ordered decaf [1]

  4. 4

    Check forward: 0.8 × 0.7 + 0.3 × 0.3 = 0.65 and 0.2 × 0.7 + 0.7 × 0.3 = 0.35. The markscheme's second method solves these two equations for r and d instead.

4. Regular Markov chains

A Markov chain is regular when some power of its transition matrix has every entry non-zero. A zero in T itself does not stop the chain being regular, because a higher power can fill it.

To test a chain, raise T to successive powers on the GDC. If a zero remains in every power, the chain is not regular.

For a regular chain the long-term behaviour does not depend on the initial state. That is why a single steady state vector can be found in the next blocks.

regular: some Tⁿ has all entries > 0

Worked example 13 marks

A Markov chain has transition matrix T = beginpmatrix 0.5 & 1 0.5 & 0 endpmatrix. Show that the chain is regular.

  1. 1

    M1: attempt T², because T itself contains a zero [1]

  2. 2

    A1: T² = beginpmatrix 0.75 & 0.5 0.25 & 0.5 endpmatrix [1]

  3. 3

    R1: every entry of T² is greater than 0, so a power of T has no zero entries and the chain is regular [1]

5. Steady state by repeated multiplication

The steady state vector gives the long-term probabilities. It is the state after so many transitions that one more transition changes nothing.

Raise T to a high power, such as T⁵⁰, on the GDC. When the columns stop changing, every column of Tⁿ is the same. Any one column is the steady state vector.

Write the answer as a single column vector. A matrix with repeated columns is not a state vector, and the markscheme awards M1A0 for it.

Tⁿ s₀ → s for large n

Worked example 13 marks

In a town, there are three stores: Aroma, Bodega and Clover. The movement of customers between the three stores over the course of one year is used to form a transition matrix,

T = beginpmatrix 0.91 & 0.04 & 0.06 0.05 & 0.95 & 0.02 0.04 & 0.01 & 0.92 endpmatrix.

(c) Find the steady state vector for T.

(d) Hence, state the percentage of Clover customers expected to move to Aroma in the long term.

  1. 1

    (c) M1: attempt to find the steady state vector, for example by raising T to a high power [1]

  2. 2

    A1: every column of Tⁿ tends to beginpmatrix 0.342 0.432 0.225 endpmatrix, which is the steady state vector [1]

  3. 3

    (d) A1: the first entry is the long-term proportion in Aroma, 34.2%. It does not depend on which store a customer starts in [1]

6. Steady state by solving equations

Let x be the steady state vector. Then Tx = x and the entries of x add to 1. Writing Tx = x out gives a system of linear equations.

Those equations alone fix only a ratio between the entries, because they are not independent. Add the condition that the entries sum to 1, or scale the solution by 1/(x₁ + x₂).

This is the eigenvector of T for the eigenvalue 1, scaled so its entries sum to 1 (links to AHL 1.15). Exam questions state when an exact solution from solving equations is required.

Tx = x

x₁ + x₂ + … = 1

Worked example 14 marks

Krauss' customers change their choices each month according to the transition matrix

T = beginpmatrix 0.8 & 0.3 0.2 & 0.7 endpmatrix.

(b) Show that the only steady state vector is beginpmatrix 0.6 0.4 endpmatrix.

  1. 1

    M1: attempt to use Tx = x with x = beginpmatrix x₁ x₂ endpmatrix [1]

  2. 2

    A1: 0.8x₁ + 0.3x₂ = x₁ and 0.2x₁ + 0.7x₂ = x₂ [1]

  3. 3

    A1: both equations give 0.2x₁ = 0.3x₂, so x₁ = 3/2x₂ (or x₂ = 2/3x₁) [1]

  4. 4

    A1: the entries sum to 1, x₁ + x₂ = 1 (or scaling by 1/(x₁ + x₂)), so 5/2x₂ = 1 [1]

  5. 5

    AG: x₁ = 0.6 and x₂ = 0.4

7. Changing T to reach a target

Some questions ask how one probability in T must change for a long-term share to reach a target. Begin by stating the condition on the steady state vector, for example a ≥ 0.40.

Change two entries in the same column, so that the column still sums to 1. Find the new steady state vector on the GDC. Test whole-number percentages, because the answer must be an integer percentage.

Justify the answer by showing that the value just below it fails.

condition on s ⇒ test values of the changed entry

Worked example 13 marks

In a town, there are three stores: Aroma, Bodega and Clover. The movement of customers between the three stores over the course of one year is used to form a transition matrix,

T = beginpmatrix 0.91 & 0.04 & 0.06 0.05 & 0.95 & 0.02 0.04 & 0.01 & 0.92 endpmatrix.

Ashley's initial findings suggested that 6% of Clover's customers moved to Aroma over the course of one year. Ashley is instructed to increase this figure so that at least 40% of Clover's customers move to Aroma in the long term.

It may be assumed that all other annual percentage changes remain the same, other than the percentage that stay with Clover.

(e) Determine the minimum integer percentage to which the 6% figure will need to be raised to achieve this objective, justifying your answer.

  1. 1

    R1: require a new steady state vector beginpmatrix a b c endpmatrix such that a ≥ 0.40 [1]

  2. 2

    A1: any correct manipulation of Clover's entries: raise T_1,3 and lower T_3,3 by the same amount, so column 3 still sums to 1 [1]

  3. 3

    A1: with T_1,3 = 0.13 and T_3,3 = 0.85 the steady state vector is beginpmatrix 0.403 0.459 0.138 endpmatrix, so a ≥ 0.40 when the figure for Clover customers moving to Aroma is 13% [1]

  4. 4

    Check on the GDC: at 12% the steady state gives a = 0.398, which is below 0.40, so 13% is the minimum integer.

Recap

  • T_ij is the probability of moving from state j to state i, so each column of T sums to 1.
  • sn = Tⁿ s₀, with T on the left. Entry (i,j) of Tⁿ is the probability of moving from state j to state i in n transitions.
  • To go back one step use s₀ = T⁻¹s₁, then check forward.
  • A regular chain has some power of T with every entry non-zero.
  • Steady state by repeated multiplication: raise T to a high power and take one column, written as a column vector.
  • Steady state by equations: solve Tx = x with the entries summing to 1. It is the eigenvector for eigenvalue 1, scaled.
  • To meet a target, state the condition first, change two entries in one column, and test whole-number percentages.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State the value of the sum of the entries in each column of a transition matrix T, where T_ij is the probability of moving from state j to state i.1 mark
    Answer
    1. 1. Column j lists the probabilities of every move from state j, so they add to 1. (A1)

    Trap: Checking the rows. With T_ij defined as moving from state j to state i, it is the columns that sum to 1.

  2. A taxi is parked at either the airport (A) or the station (B) each night. If it is at A one night, then it is at A the next night with probability 0.8 and at B with probability 0.2. If it is at B, then it is at A the next night with probability 0.1 and at B with probability 0.9. Which matrix is the transition matrix T, where T_ij is the probability of moving from state j to state i? A. beginpmatrix 0.8 & 0.2 0.1 & 0.9 endpmatrix B. beginpmatrix 0.8 & 0.1 0.2 & 0.9 endpmatrix C. beginpmatrix 0.2 & 0.1 0.8 & 0.9 endpmatrix D. beginpmatrix 0.8 & 0.9 0.2 & 0.1 endpmatrix1 mark
    Answer
    1. The answer is B. Column 1 is where A goes: (0.8, 0.2). Column 2 is where B goes: (0.1, 0.9). (A1)
    2. A has the rows as the 'from' states, so it is the transpose. C swaps the entries of column 1. D swaps the entries of column 2.

    Trap: Writing the probabilities as rows. Each 'from' state must be a column.

  3. A town has two bus routes, X and Y. Each month, 15% of X passengers switch to Y and 25% of Y passengers switch to X. The rest stay. This month 60% of passengers use X and 40% use Y. Calculate the proportion of passengers using each route two months from now.3 marks
    Answer
    1. Take the states in the order X, Y. Column X is (0.85, 0.15) and column Y is (0.25, 0.75). (A1)
    2. T = beginpmatrix 0.85 & 0.25 0.15 & 0.75 endpmatrix and s₀ = beginpmatrix 0.6 0.4 endpmatrix, so s₂ = T² s₀. (M1)
    3. s₁ = beginpmatrix 0.85 × 0.6 + 0.25 × 0.4 0.15 × 0.6 + 0.75 × 0.4 endpmatrix = beginpmatrix 0.61 0.39 endpmatrix.
    4. s₂ = beginpmatrix 0.85 × 0.61 + 0.25 × 0.39 0.15 × 0.61 + 0.75 × 0.39 endpmatrix = beginpmatrix 0.616 0.384 endpmatrix.
    5. 61.6% use X and 38.4% use Y. (A1)

    Trap: Building T with the rows as the 'from' states. That gives s₁ = (0.57, 0.45), whose entries add to 1.02, a sign that T is wrong.

  4. A machine is either working or under repair at the start of each day. If it is working, then the next day it is working with probability 0.6 and under repair with probability 0.4. If it is under repair, then the next day it is working with probability 0.5 and under repair with probability 0.5. Determine the long-term probability that the machine is working at the start of a day.2 marks
    Answer
    1. T = beginpmatrix 0.6 & 0.5 0.4 & 0.5 endpmatrix. Raise T to a high power on the GDC, for example T⁵⁰. (M1)
    2. Both columns tend to beginpmatrix 0.556 0.444 endpmatrix, so the probability is 5/9 = 0.556. (A1)

    Trap: Writing the answer as the matrix T⁵⁰ with two identical columns. The markscheme gives M1A0 for that. Give one column, or the probability asked for.

  5. A Markov chain has transition matrix T = beginpmatrix 1 & 0.4 0 & 0.6 endpmatrix. Determine whether the chain is regular, justifying your answer.2 marks
    Answer
    1. T² = beginpmatrix 1 & 0.64 0 & 0.36 endpmatrix. The entry in row 2, column 1 is 0 in T and in T². (M1)
    2. Column 1 of T is (1, 0) and T(1,0) = (1,0), so column 1 of every power is (1, 0). A zero stays in every power, so the chain is not regular. (R1)

    Trap: Seeing that most entries of T² are non-zero and concluding that the chain is regular. Every entry of one power must be non-zero.

  6. A rental firm has two depots, A and B. Each month 10% of the cars at A move to B and 20% of the cars at B move to A. This month 60% of the cars are at A and 40% are at B. Determine the proportion of cars at each depot last month.3 marks
    Answer
    1. T = beginpmatrix 0.9 & 0.2 0.1 & 0.8 endpmatrix, with determinant 0.9 × 0.8 - 0.2 × 0.1 = 0.7. (A1)
    2. Last month's state is T⁻¹ times this month's state. (M1)
    3. T⁻¹s = 1/0.7beginpmatrix 0.8 & -0.2 -0.1 & 0.9 endpmatrixbeginpmatrix 0.6 0.4 endpmatrix = 1/0.7beginpmatrix 0.40 0.30 endpmatrix.
    4. Last month 57.1% of the cars were at A and 42.9% at B, which are 4/7 and 3/7. (A1)
    5. Check forward: 0.9 × 4/7 + 0.2 × 3/7 = 0.6.

    Trap: Multiplying T by this month's state. That gives (0.62, 0.38), which is next month's state.

  7. A user of a mobile network is on network P or network Q each year. Each year 30% of the users on P move to Q and 40% of the users on Q move to P. Determine, as exact fractions, the long-term proportion of users on each network.4 marks
    Answer
    1. T = beginpmatrix 0.7 & 0.4 0.3 & 0.6 endpmatrix and Tx = x with x = beginpmatrix x₁ x₂ endpmatrix. (M1)
    2. 0.7x₁ + 0.4x₂ = x₁, so 0.3x₁ = 0.4x₂ and x₁ = 4/3x₂. (A1)
    3. The entries sum to 1: x₁ + x₂ = 1, so 7/3x₂ = 1. (M1)
    4. x₂ = 3/7 and x₁ = 4/7. So 4/7 of users are on P and 3/7 on Q. (A1)

    Trap: Stopping at the ratio x₁ = 4/3x₂. The equations from Tx = x give only a ratio, so the condition that the entries sum to 1 is needed.

  8. A delivery van is parked each night at one of three depots, P, Q or R. From P it goes next night to P with probability 0.7, to Q with probability 0.2 and to R with probability 0.1. From Q it goes to P with probability 0.3, to Q with probability 0.5 and to R with probability 0.2. From R it goes to P with probability 0.2, to Q with probability 0.3 and to R with probability 0.5. The van is at P on Monday night. Determine the probability that the van is at Q on Thursday night.4 marks
    Answer
    1. Each 'from' state is a column: T = beginpmatrix 0.7 & 0.3 & 0.2 0.2 & 0.5 & 0.3 0.1 & 0.2 & 0.5 endpmatrix. (A1)
    2. Monday to Thursday is 3 transitions, so find T³. (M1)
    3. T³ = beginpmatrix 0.512 & 0.437 & 0.399 0.297 & 0.334 & 0.335 0.191 & 0.229 & 0.266 endpmatrix.
    4. The van starts at P, so use column 1. It ends at Q, so use row 2. (M1)
    5. The probability is 0.297. (A1)

    Trap: Reading row 1, column 2 of T³. That is 0.437, the probability of moving from Q to P.

  9. A city bike scheme has 240 bikes and three stations, A, B and C. Of the bikes that start a day at A, 60% end it at A, 30% at B and 10% at C. Of the bikes that start a day at B, 20% end it at A, 70% at B and 10% at C. Of the bikes that start a day at C, 30% end it at A, 20% at B and 50% at C. (a) Write down the transition matrix T. On Monday morning there are 100 bikes at A, 60 at B and 80 at C. (b) Calculate the expected number of bikes at station C on Tuesday evening. (c) By solving a system of linear equations, show that in the long term exactly 1/6 of the bikes are at station C.10 marks
    Answer
    1. (a)
    2. T = beginpmatrix 0.6 & 0.2 & 0.3 0.3 & 0.7 & 0.2 0.1 & 0.1 & 0.5 endpmatrix, one correct column for each A1. (A1)(A1)(A1)
    3. (b)
    4. Monday morning to Tuesday evening is two days, so two transitions: s₂ = T² s₀ with s₀ = beginpmatrix 100 60 80 endpmatrix. (M1)
    5. s₁ = Ts₀ = beginpmatrix 96 88 56 endpmatrix. (A1)
    6. s₂ = Ts₁, whose third entry is 0.1 × 96 + 0.1 × 88 + 0.5 × 56 = 46.4. About 46.4 bikes are expected at C. (A1)
    7. (c)
    8. Attempt to use Tx = x with x = beginpmatrix a b c endpmatrix. (M1)
    9. The third row gives 0.1a + 0.1b + 0.5c = c. (A1)
    10. So 0.1a + 0.1b = 0.5c, which is a + b = 5c. (A1)
    11. The entries sum to 1: a + b + c = 1, so 5c + c = 1 and 6c = 1. (A1)
    12. c = 1/6 (AG)

    Trap: Counting the transitions wrongly: Monday morning to Tuesday evening is two transitions, and using one gives 56 while using three gives 42.56.

  10. Two phone companies, A and B, share a market. Each year 8% of the customers of A switch to B and q% of the customers of B switch to A. Everyone else stays. At present q = 20. (a) Determine the long-term proportion of customers with company B. (b) Company B wants its long-term proportion to be at least 45%. Determine the largest integer value of q for which this is achieved, justifying your answer.6 marks
    Answer
    1. (a)
    2. T = beginpmatrix 0.92 & 0.2 0.08 & 0.8 endpmatrix. Solve Tx = x with x₁ + x₂ = 1, or use a high power of T. (M1)
    3. The long-term proportion for B is 0.08/0.28 = 0.286, or 28.6%. (A1)
    4. (b)
    5. Require b ≥ 0.45. (R1)
    6. Write p = q/100, so T = beginpmatrix 0.92 & p 0.08 & 1 - p endpmatrix. From Tx = x, 0.08a = pb, and with a + b = 1 this gives b = 0.08/(0.08 + p). (M1)
    7. 0.08/(0.08 + p) ≥ 0.45 gives 0.08 ≥ 0.036 + 0.45p, so p ≤ 0.0978 and q ≤ 9.78. (A1)
    8. The largest integer is 9. At q = 9, b = 0.471, which meets the target. At q = 10, b = 0.444, which does not. (A1)

    Trap: Rounding 9.78 up to 10, or giving the change 20 - 9 = 11 instead of the new value 9: at q = 10 the long-term proportion is 0.444, below 0.45.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
0.219, or 21.9, as the final answer.21.9%. The question asks for a percentage, and the markscheme says the final answer must be a percentage.
The steady state written as the matrix with three identical columns.A single column vector beginpmatrix 0.342 0.432 0.225 endpmatrix. The markscheme awards M1A0 for the repeated-column matrix.
7%, the increase from 6% to 13%.13%, the new figure for Clover customers moving to Aroma. An answer of just 7% earns A0.
'Customers may change their minds.'A reason tied to the scenario, such as 'a fourth store could open, impacting the model'. The markscheme gives A0 for 'customers may change their minds'.

Frequently asked questions

What does each entry of a transition matrix mean, and why do its columns add to 1?
The entry T_ij is the probability of moving from state j to state i. Column j lists every place state j can go next, so each column sums to 1. The rows need not sum to 1. For example, the Aroma column beginpmatrix 0.91 0.05 0.04 endpmatrix holds where Aroma customers go next.
How do you find the state after n transitions of a Markov chain?
Write the initial state as a column s₀, with entries that add to 1. The state after n transitions is sn = Tⁿ s₀, with T on the left. Entry (i, j) of Tⁿ is the probability of moving from state j to state i in n transitions. Find Tⁿ on the GDC and select the relevant cell.
How do you work backwards to find the earlier state from the current state?
If s₁ = Ts₀, then s₀ = T⁻¹s₁ whenever the inverse exists. Find T⁻¹ on the GDC and multiply by the current state. Check your answer by multiplying forward, so that T times the earlier state gives the state you started with. In one coffee example, C_last month = beginpmatrix 0.7 0.3 endpmatrix, so 70% ordered regular coffee.
How do you show that a Markov chain is regular?
A chain is regular when some power of its transition matrix has every entry non-zero. A zero in T itself does not stop the chain being regular, because a higher power can fill it. For T = beginpmatrix 0.5 & 1 0.5 & 0 endpmatrix, T² = beginpmatrix 0.75 & 0.5 0.25 & 0.5 endpmatrix has no zero, so the chain is regular.
How do you find the steady state vector of a transition matrix?
The steady state vector gives the long-term probabilities. Either raise T to a high power, such as T⁵⁰, and write one column as a single column vector, or solve Tx = x with the entries summing to 1. For T = beginpmatrix 0.8 & 0.3 0.2 & 0.7 endpmatrix, the only steady state vector is beginpmatrix 0.6 0.4 endpmatrix.
Why is my transition matrix giving states that add to more than 1?
You have probably written the probabilities as rows, so each 'from' state is a row instead of a column. Each column must hold the probabilities of every move from one state. With the rows swapped, s₁ gave (0.57, 0.45), whose entries add to 1.02, which is a sign that T is wrong. Check that each column sums to 1.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters