topic badge
AustraliaVIC
VCE 12 General 2023

7.08 Applications of transition matrices

Lesson

Introduction

In this lesson we will look at applications of Transition matrices to solve various problems.

Customer rates in transition matrices

This image shows a state diagram. Ask your teacher for more information.

Three grocery stores A,B, and C each have an initial customer base of 400 people. Every week however, each store finds that they lose a certain percentage of their base to other stores. The percentage of people moving from one store to another (or staying loyal to a store) are summarised in the state diagram.

So for example, 60\% of people who use store A in any one week stay with store A the following week. However 10\% shift to store B and 30\% shift to store C. The same idea applies to the other stores.

We can write the transition matrix down as T= \begin{bmatrix} 0.60 & 0.20 & 0.15 \\ 0.10 & 0.50 & 0.15 \\ 0.30 & 0.30 & 0.70 \end{bmatrix} and the initial state matrix as S_0 = \begin{pmatrix} 400\\ 400\\ 400 \end{pmatrix} .

We can determine a future state, say week 3 as S_3=T^3\times S_0, given by:

\begin{bmatrix} 0.60 & 0.20 & 0.15 \\ 0.10 & 0.50 & 0.15 \\ 0.30 & 0.30 & 0.70 \end{bmatrix}^3 \begin{pmatrix} 400\\ 400\\ 400 \end{pmatrix} = \begin{bmatrix} 0.349 & 0.285 & 0.261 \\ 0.183 & 0.247 & 0.207 \\ 0.468 & 0.468 & 0.532 \end{bmatrix} \begin{pmatrix} 400\\ 400\\ 400 \end{pmatrix} = \begin{pmatrix} 358\\ 254.8\\ 587.2 \end{pmatrix}

The calculations were made using technology.

Here is the state matrix determined for week 6:

S_6 = T_6 S_0 = \begin{bmatrix} 0.60 & 0.20 & 0.15 \\ 0.10 & 0.50 & 0.15 \\ 0.30 & 0.30 & 0.70 \end{bmatrix}^6 \begin{pmatrix} 400\\ 400\\ 400 \end{pmatrix} = \begin{pmatrix} 350.819\\ 250\\ 599.181 \end{pmatrix}

There is some evidence of convergence here between week 3 and week 6.

We might think about trying a much larger power in an attempt to find the steady state matrix a little quicker. Technology or CAS are indispensable in this regard.

If we arbitrarily try week 20 we see that:

S_{20} = T^{20} S_0 = \begin{bmatrix} 0.60 & 0.20 & 0.15 \\ 0.10 & 0.50 & 0.15 \\ 0.30 & 0.30 & 0.70 \end{bmatrix}^{20} \begin{pmatrix} 400\\ 400\\ 400 \end{pmatrix} = \begin{pmatrix} 350\\ 250\\ 600 \end{pmatrix}

Week 21 shows the same state matrix as week 20, so the numbers 350,250, and 600 represent the long term customer base for each of stores A,B, and C respectively.

Examples

Example 1

In a town with three supermarkets, the information below was gathered from a survey. The survey was conducted in October 2013.

Assume that those customers that did not shop at a different store the following month, continued to shop at the same store.

  • 42\% of Store 1 customers will shop at Store 2 the following month.

  • 45\% of Store 1 customers will shop at Store 3 the following month.

  • 39\% of Store 2 customers will shop at Store 1 the following month.

  • 45\% of Store 2 customers will shop at Store 3 the following month.

  • 39\% of Store 3 customers will shop at Store 1 the following month.

  • 6\% of Store 3 customers will shop at Store 2 the following month.

a

Construct a transition matrix below which stores the given information.

Worked Solution
Create a strategy

Use the following pattern of the transition matrix.

\qquad \quad 1 \qquad \quad2 \qquad \quad 3 \\ T= \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 1\to1 & 2\to1 & 3\to1 \\ 1\to2 & 2\to2 & 3\to2 \\ 1\to3 & 2\to3 & 3\to3 \end{bmatrix}

Apply the idea
\displaystyle T\displaystyle =\displaystyle \qquad \,\, 1 \qquad \quad 2 \qquad \quad 3 \\ \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 1\to1 & 2\to1 & 3\to1 \\ 1\to2 & 2\to2 & 3\to2 \\ 1\to3 & 2\to3 & 3\to3 \end{bmatrix}Write the pattern
\displaystyle =\displaystyle \quad \quad \,\,1 \qquad \quad2 \qquad \quad 3 \\ \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 1\to1 & 39\% & 39\% \\ 42\% & 2\to2 & 6\% \\ 45\% & 45\% & 3\to3 \end{bmatrix}Fill the elements with the information
\displaystyle =\displaystyle \qquad \qquad 1 \qquad \qquad \qquad \qquad 2 \qquad \qquad \qquad \quad 3 \\ \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 100-(42+45) & 39\% & 39\% \\ 42\% & 100-(39+45) & 6\% \\ 45\% & 45\% & 100-(39+6) \end{bmatrix}Subtract the sum of filled column from 100
\displaystyle =\displaystyle \qquad 1 \qquad \,\,2 \qquad \,\, 3 \\ \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 13\% & 39\% & 39\% \\ 42\% & 16\% & 6\% \\ 45\% & 45\% & 55\% \end{bmatrix}Evaluate
\displaystyle =\displaystyle \qquad 1 \qquad \,2 \qquad \,\, 3 \\ \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 0.13 & 0.39 & 0.39 \\ 0.42 & 0.16 & 0.06 \\ 0.45 & 0.45 & 0.55 \end{bmatrix}Change percents to decimals
b

The market share at the time of the survey showed that 1200 customers shopped at Store 1, 800 customers shopped at Store 2, and 1000 customers shopped at Store 3. Write the matrix which represents this information.

Worked Solution
Create a strategy

Use the following pattern of the matrix.

S_{\text{October}}= \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} ⬚ \\ ⬚ \\ ⬚ \end{bmatrix}

Apply the idea
\displaystyle S_{\text{October}}\displaystyle =\displaystyle \begin{matrix} 1\\ 2\\ 3 \end{matrix} \begin{bmatrix} 1200 \\ 1800 \\ 1000 \end{bmatrix}Write the corresponding values
c

Find the number of customers expected to be shopping at each store in March 2014. Round your answers to the nearest two decimal places.

Worked Solution
Create a strategy

Compute the power transition matrix from part (a) and multiply it by the matrix from part (b) using technology.

Apply the idea

The power of the transition matrix is the number of months between October 2013 and March 2014, that is 5.

\displaystyle T^5\displaystyle =\displaystyle \begin{bmatrix} 0.13 & 0.39 & 0.39 \\ 0.42 & 0.16 & 0.06 \\ 0.45 & 0.45 & 0.55 \end{bmatrix}^5Write the power transition matrix
\displaystyle S_{\text{March}}\displaystyle =\displaystyle \begin{bmatrix} 0.13 & 0.39 & 0.39 \\ 0.42 & 0.16 & 0.06 \\ 0.45 & 0.45 & 0.55 \end{bmatrix}^5 \begin{bmatrix} 1200 \\ 1800 \\ 1000 \end{bmatrix} Multiply T^5 by S_{\text{October}}
\displaystyle S_{\text{March}}\displaystyle =\displaystyle \begin{bmatrix} 928.25 \\ 571.76 \\ 1500.00 \end{bmatrix} Multiply T^5 by S_{\text{October}}
d

Calculate the long-term expected share of the customers shopping at each store as a percentage (correct to one decimal place).

Worked Solution
Create a strategy

Use the formula S_\infty=\dfrac{1}{\text{sum of initial matrix}}T^nS_0 using technology where n is the number of months when the probabilities are steady and S_0 is the initial matrix.

Apply the idea

We can use n=60 by evaluating first T^{60} and T^{61} to verify if it can be a steady number of months.

\displaystyle T^{60}\displaystyle =\displaystyle \begin{bmatrix} 0.13 & 0.39 & 0.39 \\ 0.42 & 0.16 & 0.06 \\ 0.45 & 0.45 & 0.55 \end{bmatrix}^{60} Evaluate T^{60}
\displaystyle =\displaystyle \begin{bmatrix} 0.309524 & 0.309524 & 0.309524 \\ 0.190476 & 0.190476 & 0.190476 \\ 0.5 & 0.5 & 0.5 \end{bmatrix} Evaluate
\displaystyle T^{61}\displaystyle =\displaystyle \begin{bmatrix} 0.13 & 0.39 & 0.39 \\ 0.42 & 0.16 & 0.06 \\ 0.45 & 0.45 & 0.55 \end{bmatrix}^{61} Evaluate T^{61}
\displaystyle =\displaystyle \begin{bmatrix} 0.309524 & 0.309524 & 0.309524 \\ 0.190476 & 0.190476 & 0.190476 \\ 0.5 & 0.5 & 0.5 \end{bmatrix} Evaluate

Since there are no changes between T^{60} and T^{61}, we can use n=60 as well as S_0=S_{\text{October}} in S_\infty=\dfrac1{\text{sum of initial matrix}}T^nS_0.

For the sum of initial matrix, we need to add the entries at S_{\text{October}}, that is 1200+1800+1000=3000.

\displaystyle S_\infty\displaystyle =\displaystyle \dfrac1{\text{sum of initial matrix}}T^nS_0Write the formula
\displaystyle =\displaystyle \dfrac1{3000} \begin{bmatrix} 0.309524 & 0.309524 & 0.309524 \\ 0.190476 & 0.190476 & 0.190476 \\ 0.5 & 0.5 & 0.5 \end{bmatrix}^{60} \begin{bmatrix} 1200 \\ 1800 \\ 1000 \end{bmatrix} Substitute the values obtained
\displaystyle =\displaystyle \begin{bmatrix} 0.31 \\ 0.19 \\ 0.50 \end{bmatrix} Evaluate
\displaystyle =\displaystyle \begin{bmatrix} 31\% \\ 19\% \\ 50\% \end{bmatrix} Change decimals to percents
Idea summary

The following are the steps of calculating the long-term expected shares or the steady state.

  1. Construct the transition matrix and initial matrix using the given information.

  2. Raise the transition matrix to the number of months when the prediction started and will end. Then, multiply the result by the initial matrix.

  3. Use the formula S_\infty=\dfrac{1}{\text{sum of initial matrix}}T^nS_0 to calculate the long-term expected shares.

Culling and restocking

Restocking means to add items as we go. Culling means we take away items as we go.

The following recurrence relation can be used to extend modelling to populations that include culling and restocking:

\displaystyle S_{n+1}=TS_n+B
\bm{T}
is the transition matrix
\bm{S_0}
is the initial state matrix
\bm{B}
is the amount we are restocking or culling

If we are restocking, B will be positive, and if we are culling, B will be negative.

Examples

Example 2

In a physical rehabilitation clinic, certain residents can choose out of 2 weekend activities each week, bowls (B) and golf (G). On the first weekend 70 people played bowls and 40 people played golf.

a

It has been found that 70\% of residents who select bowls on one weekend will select bowls again the following weekend. It has also been found that 60\% of residents who select golf will select it again the following weekend.

Set up a transition matrix to represent this situation.

Worked Solution
Create a strategy

Use the following pattern of the transition matrix.

\qquad \quad B \qquad \quad \,\, G\\ T= \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} B\to B & G\to B\\ B\to G & G\to G \end{bmatrix}

Apply the idea
\displaystyle T\displaystyle =\displaystyle \qquad \,\,\,\, B \qquad \quad \,\, G\\ \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} B\to B & G\to B\\ B\to G & G\to G \end{bmatrix}Write the pattern
\displaystyle =\displaystyle \qquad \,\,\,\, B \qquad \quad \,\, G\\ \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 70\% & G\to B\\ B\to G & 60\% \end{bmatrix}Fill the elements with the information
\displaystyle =\displaystyle \qquad \qquad B \qquad \qquad \quad G\\ \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 70\% & 100\%-60\%\\ 100\%-70\% & 60\% \end{bmatrix}Subtract each entered data from 100
\displaystyle =\displaystyle \qquad B \qquad G\\ \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 70\% & 40\%\\ 30\% & 60\% \end{bmatrix}Evaluate
\displaystyle =\displaystyle \qquad B \qquad G\\ \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 0.70 & 0.40\\ 0.30 & 0.60 \end{bmatrix}Change percents to decimals
b

Write down the initial state matrix for the first weekend, S_1.

Worked Solution
Create a strategy

Use the following pattern of the matrix.

S_{1}= \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} ⬚ \\ ⬚ \end{bmatrix}

Apply the idea
\displaystyle S_1\displaystyle =\displaystyle \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 70 \\ 40 \end{bmatrix}Write the corresponding values
c

The participant numbers are also affected by residents who recover enough to move onto more physically demanding activities. 3 more people attend bowls each week and 5 more people attend golf each week. Set up a matrix B to represent the number of people being added to the activities each week.

Worked Solution
Create a strategy

Use the following pattern of the matrix.

B= \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} ⬚ \\ ⬚ \end{bmatrix}

Apply the idea
\displaystyle B\displaystyle =\displaystyle \begin{matrix} B\\ G \end{matrix} \begin{bmatrix} 3 \\ 5 \end{bmatrix}Write the corresponding values
d

Construct the matrix recurrence relation which represents the expected number of residents selecting each activity on the second weekend, S_2=TS_1+B.

Worked Solution
Create a strategy

Substitute the values of T from part (a), S_1 from part (b), and B from part (c).

Apply the idea
\displaystyle S_2\displaystyle =\displaystyle TS_1+BWrite the recurrence relation
\displaystyle =\displaystyle \begin{bmatrix} 0.70 & 0.40\\ 0.30 & 0.60 \end{bmatrix} \begin{bmatrix} 70 \\ 40 \end{bmatrix} + \begin{bmatrix} 3 \\ 5 \end{bmatrix}Substitute the values of T,S_1, and B
e

Find S_2.

Worked Solution
Create a strategy

Evaluate the recurrence relation from part (d).

Apply the idea
\displaystyle S_2\displaystyle =\displaystyle \begin{bmatrix} 0.70 & 0.40\\ 0.30 & 0.60 \end{bmatrix} \begin{bmatrix} 70 \\ 40 \end{bmatrix} + \begin{bmatrix} 3 \\ 5 \end{bmatrix} Write the recurrence relation
\displaystyle =\displaystyle \begin{bmatrix} 0.70\times70 + 0.40\times40 \\ 0.30\times70 + 0.60\times40 \end{bmatrix} + \begin{bmatrix} 3 \\ 5 \end{bmatrix} Evaluate the matrix multiplication
\displaystyle =\displaystyle \begin{bmatrix} 65 \\ 45 \end{bmatrix} + \begin{bmatrix} 3 \\ 5 \end{bmatrix} Evaluate the multiplication
\displaystyle =\displaystyle \begin{bmatrix} 68 \\ 50 \end{bmatrix} Evaluate
f

Construct the matrix recurrence relation which represents the expected number of residents selecting each activity on the third weekend, S_3=TS_2+B.

Worked Solution
Create a strategy

Substitute the values of T from part (a), S_2 from part (e), and B from part (c).

Apply the idea
\displaystyle S_3\displaystyle =\displaystyle TS_2+BWrite the recurrence relation
\displaystyle =\displaystyle \begin{bmatrix} 0.70 & 0.40\\ 0.30 & 0.60 \end{bmatrix} \begin{bmatrix} 68 \\ 50 \end{bmatrix} + \begin{bmatrix} 3 \\ 5 \end{bmatrix}Substitute the values of T,S_2, and B
g

Use the recurrence relation to determine the expected number of people playing golf on the third weekend. Round your answer to the nearest person.

Worked Solution
Create a strategy

Use the recurrence relation constructed from part (f) computing only the bottom entries that corresponds to golfers.

Apply the idea
\displaystyle \text{Third Weekend}\displaystyle =\displaystyle \begin{bmatrix} 0.30 & 0.60 \end{bmatrix} \begin{bmatrix} 50 \end{bmatrix} + \begin{bmatrix} 5 \end{bmatrix} Write the bottom rows of matrices
\displaystyle =\displaystyle \begin{bmatrix} 0.30\times 68 + 0.60\times 50 \end{bmatrix} + \begin{bmatrix} 5 \end{bmatrix} Evaluate the matrix multiplication
\displaystyle =\displaystyle \begin{bmatrix} 50.4 \end{bmatrix} + \begin{bmatrix} 5 \end{bmatrix} Evaluate the multiplication
\displaystyle =\displaystyle \begin{bmatrix} 55.4 \end{bmatrix} Evaluate
\displaystyle =\displaystyle 55 \text{ golfers} Round off to the nearest person
Idea summary

The following recurrence relation can be used to extend modelling to populations that include culling and restocking:

\displaystyle S_{n+1}=TS_n+B
\bm{T}
is the transition matrix
\bm{S_0}
is the initial state matrix
\bm{B}
is the amount we are restocking or culling

If we are restocking, B will be positive, and if we are culling, B will be negative.

Leslie matrices

Leslie matrices are used to calculate populations over time, particularly animal populations. There are two events that affect animal populations:

  • An animal dies, which decreases the population.

  • An animal has offspring, which increases the population.

We will use these events to calculate populations over time.

Leslie matrices have the form: L=\begin{bmatrix} f_1 & f_2 & f_3 & f_4 & ... &f_{n-1} &f_n \\ s_1 & 0 & 0 & 0 &... & 0 &0 \\ 0 & s_2 & 0 & 0 &... & 0& 0\\ 0 & 0 &s_3 & 0 & ... & 0& 0 \\ ... & & & & && \\ ... & & & & && \\ 0 & 0 & 0 & 0 & ... & s_{n-1} &0 \end{bmatrix} where f_n is the fecundity rate (birth rate) of the animals in the nth age group, and s_n is the survival rate of the animals in the nth age group.

You might notice that s_n is not in the matrix. The last age group in questions involving Leslie matrices, will usually have a 0\% survival rate, so it will not need to be included.

To predict the population we use the recurrence formula: S_{n+1}=LS_n, where S_n is the column state matrix, and S_0 is the initial state column matrix.

Examples

Example 3

A farmer has a number of cows on his farm. The age, initial population and average yearly birth rate and survival rate of the cows is shown in the table below:

AgeInitial populationBirth rateSurvival rate
260.50.8
380.70.9
4100.90
a

Write the Leslie matrix, L, for this scenario.

Worked Solution
Create a strategy

Use the form L=\begin{bmatrix} f_1 & f_2 & f_3 \\ s_1 & 0 & 0 \\ 0 & s_2 & 0 \end{bmatrix}.

Apply the idea

The first age group is the 2 year olds, the second age group is the 3 year olds, and the third age group is the 4 year olds. So we get the following values: f_1=0.5, \, f_2=0.7, \, f_3=0.9 using the birth rates, and s_1=0.8, s_2=0.9 using the survival rates.

So the Leslie matrix is: L=\begin{bmatrix} 0.5 & 0.7 & 0.9 \\ 0.8 & 0 & 0 \\ 0 & 0.9 & 0 \end{bmatrix}

b

Write the matrix for the initial population, S_0.

Worked Solution
Create a strategy

Use the initial number in each age group to write the column matrix.

Apply the idea

There were 6 two year old cows, 8 three year old cows and 10 four year old cows. So the column matrix is: S_0 = \begin{bmatrix} 6 \\ 8 \\ 10 \end{bmatrix}

c

Write the recurrence formula that can be used to predict the number of cows in the form S_{n+1}=LS_n .

Worked Solution
Create a strategy

Use the Leslie matrix from part (a).

Apply the idea

S_{n+1}= \begin{bmatrix} 0.5 & 0.7 & 0.9 \\ 0.8 & 0 & 0 \\ 0 & 0.9 & 0 \end{bmatrix} S_n

d

Find S_1.

Worked Solution
Create a strategy

Use the recurrence formula from part (c) and the initial state matrix.

Apply the idea

We have found that S_0 = \begin{bmatrix} 6 \\ 8 \\ 10 \end{bmatrix} and S_{n+1}= \begin{bmatrix} 0.5 & 0.7 & 0.9 \\ 0.8 & 0 & 0 \\ 0 & 0.9 & 0 \end{bmatrix} S_n.

\displaystyle S_1\displaystyle =\displaystyle LS_0Use the formula
\displaystyle =\displaystyle \begin{bmatrix} 0.5 & 0.7 & 0.9 \\ 0.8 & 0 & 0 \\ 0 & 0.9 & 0 \end{bmatrix} \begin{bmatrix} 6 \\ 8 \\ 10 \end{bmatrix}Substitute L and S_0
\displaystyle =\displaystyle \begin{bmatrix} 17.6 \\ 4.8 \\ 7.2 \end{bmatrix}Evaluate
Reflect and check

The first value in S_1 which is 17.6 was found by multiplying the birth rates by the initial number of cows. So it is equal to the number of cows that have been born during the first year.

The second value in S_1 which is 4.8 was found by multiplying the survival rate for 2 year-old cows by the number of 2 year-old cows. So it is equal to the number of 2 year-old cows that survived the first year.

The third value in S_1 which is 7.2 was found by multiplying the survival rate for 3 year-old cows by the number of 3 year-old cows. So it is equal to the number of 3 year-old cows that survived the first year.

So by adding these values we are counting the number of cows who have survived, and the number of cows who have been born over the time period.

e

Find the total number of cows the farmer will have in 1 year time.

Worked Solution
Create a strategy

Add up the values in S_1.

Apply the idea
\displaystyle \text{No. cows}\displaystyle =\displaystyle 17.6 + 4.8 +7.2Add the values
\displaystyle =\displaystyle 29.6Evaluate

So there will be approximately 30 cows in 1 year time.

Idea summary

Leslie matrices have the form: L=\begin{bmatrix} f_1 & f_2 & f_3 & f_4 & ... &f_{n-1} &f_n \\ s_1 & 0 & 0 & 0 &... & 0 &0 \\ 0 & s_2 & 0 & 0 &... & 0& 0\\ 0 & 0 &s_3 & 0 & ... & 0& 0 \\ ... & & & & && \\ ... & & & & && \\ 0 & 0 & 0 & 0 & ... & s_{n-1} &0 \end{bmatrix} where f_n is the fecundity rate (birth rate) of the animals in the nth age group, and s_n is the survival rate of the animals in the nth age group.

To predict the population we use the recurrence formula:

\displaystyle S_{n+1}=LS_n
\bm{S_n}
is the column state matrix for time period n
\bm{L}
is the Leslie matrix

Outcomes

U4.AoS2.7

construct a transition matrix to model the transitions in a population with an equilibrium state

U4.AoS2.8

use matrix recurrence relations to model populations with culling and restocking

What is Mathspace

About Mathspace