Linear Algebra and Vector Geometry 201-SN4-RE • CEGEP, Montreal

Revision sheet: matrix models, Markov, Leontief and Leslie (201-SN4-RE)

This sheet covers the three matrix models that the CEGEP linear algebra course, 201-SN4-RE (formerly 201-NYC), uses to show what matrices are for: Markov chains, the Leontief input-output model and Leslie matrices. It does not repeat matrix arithmetic; it gives the eight places where a correct product answers the wrong question.

It is written for CEGEP students taking 201-SN4-RE in the Science program, and for those taking linear algebra in the Social Science program, 201-105. The corrected exercise set of the same chapter works through each model, from the transition graph to the reading of an input-output table.

Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.

The thread of the chapter

A model matrix is not a table of numbers: it is a machine that carries a state vector from one step to the next. Almost every mistake in the chapter comes from ignoring IN WHICH DIRECTION it carries it.

This chapter is part of 201-SN4-RE, Linear Algebra and Vector Geometry

The essentials

The convention, to state before any calculation

  • • COLUMN convention: pijp_{ij} reads “from state jj TO state ii”, and every COLUMN sums to 11.
  • • In the row convention everything is transposed: pijp_{ij} goes from ii to jj and it is the ROWS that sum to 11.
  • • One step: xn+1=Pxnx_{n+1}=Px_{n}. After nn steps: xn=Pnx0x_{n}=P^{n}x_{0}.
  • • Entry (i,j)(i,j) of P2P^{2} AUTOMATICALLY adds up every path from jj to ii in two steps: this is what makes the matrix useful.
COLUMN convention: from j to iAB0.300.10stays: 0.70stays: 0.90
The top arrow carries pBA=0.30p_{BA}=0.30: it leaves column AA and arrives at row BB, and the complement 0.700.70 stays in place.

Instant check of the convention: add up a column. If it gives 11, you are in the column convention and the product is written PxPx.

The steady state, and when it exists

  • • We look for xx such that Px=xPx=x, so we solve (P−I)x=0\left(P-I\right)x=0 and NEVER Px=0Px=0.
  • • The system is rank deficient: it has infinitely many solutions, all proportional. They must then be NORMALIZED by the required sum.
  • • A REGULAR chain, that is, one with a power whose entries are all strictly positive, converges to a unique steady state, whatever the initial distribution.
  • • The powers of a stochastic matrix remain stochastic: the columns of PnP^{n} still sum to 11.
the three programs converge to a steady staten = 0n = 1n = 2limit
The three bars get closer from step to step and end at the limiting distribution: it is the fixed point of the matrix, reached whatever the start.

Every stochastic matrix has 11 as an eigenvalue, and the steady state is precisely the associated eigenvector.

Leontief and Leslie, two matrices read differently

  • • LEONTIEF: x=Ax+dx=Ax+d, so (I−A)x=d\left(I-A\right)x=d and x=(I−A)−1dx=\left(I-A\right)^{-1}d. COLUMN jj of AA says what ONE UNIT produced by sector jj consumes.
  • • Each entry of (I−A)−1\left(I-A\right)^{-1} is the total output of one sector required by one unit of final demand for another; the sum of a COLUMN is the MULTIPLIER of that sector.
  • • (I−A)−1=I+A+A2+⋯\left(I-A\right)^{-1}=I+A+A^{2}+\cdots: direct effect, then the indirect effects of every round.
  • • LESLIE: first ROW of fertility rates, SUBDIAGONAL of survival rates, everything else zero. The first periods oscillate: this is the population wave.
1class 12class 23class 3s₁s₂f₂f₃
The Leslie matrix can be read on this diagram: its first row carries the fertility rates f2f_{2}, f3f_{3} (in orange, towards class 1), its subdiagonal the survival rates s1s_{1}, s2s_{2} (in blue).

Inverse of a 2×22\times 2 matrix: swap the diagonal entries, change the sign of the other two, divide by the determinant.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Confusing the row convention with the column convention

the whole question, every result being transposed

What not to write

“Row AA sums to 11, so I write xn+1=Pxnx_{n+1}=Px_{n}.”

What to write

“The ROWS sum to 11: I am in the row convention, so either I write xn+1=xnPx_{n+1}=x_{n}P with a row vector, or I TRANSPOSE the matrix and keep PxPx.”

0.70.20.10.20.60.30.10.20.6sum 1sum 1.1sum 0.9
Matrix of the worked example: each COLUMN sums to 11 (in green), hence the column convention and xn+1=Pxnx_{n+1}=Px_{n}. The rows sum to 1.11.1 or 0.90.9 (in red): they are not probabilities.

Why: The two conventions look exactly the same on paper. The only thing that tells them apart is the direction in which the entries add up to 1, and that is why it is checked BEFORE any calculation.

2. Writing the product in the wrong order

the whole question, and often a visible dimension error

What not to write

“x1=x0Px_{1}=x_{0}P, with x0x_{0} as a column.”

What to write

“A COLUMN vector is multiplied on the RIGHT of the matrix: x1=Px0x_{1}=Px_{0}. The other order is not even defined for these dimensions.”

Why: The matrix product is not commutative, and the dimensions act as a safeguard: a 3×33\times 3 matrix followed by a 3×13\times 1 vector gives a 3×13\times 1 vector; the reverse cannot be computed.

3. Raising each entry to the power n

2 marks, and a result that is not even stochastic any more

What not to write

“P2P^{2}: I square each probability.”

What to write

“P2=P×PP^{2}=P\times P, a matrix product: its entry (i,j)(i,j) adds up every path from jj to ii in TWO steps.”

AAA0.49BBA0.03B0.700.700.300.300.100.90
In two steps, you come back to AA along two paths: A→A→AA\to A\to A (0.490.49) and A→B→AA\to B\to A (0.030.03). Hence P2P^{2} at (A,A)(A, A): 0.520.52, and not 0.702=0.490.70^{2}=0.49, which forgets the second path.

Why: Squaring the entries destroys the column sums: 0.72+0.22+0.12=0.540.7^{2}+0.2^{2}+0.1^{2}=0.54, which is no longer a probability distribution.

4. Looking for the steady state by solving the wrong system

the whole question

What not to write

“The steady state satisfies Px=0Px=0.”

What to write

“It satisfies Px=xPx=x, so (P−I)x=0\left(P-I\right)x=0. Solving Px=0Px=0 would give the null space of PP, which almost always contains only the zero vector.”

Why: A steady state is a FIXED point, not a vector sent to zero. Subtracting the identity is precisely what turns “PP changes nothing” into a homogeneous system.

5. Forgetting to normalize the steady state

1.5 marks, and an answer with no unit

What not to write

“The system gives x=(10,11,8)x=(10, 11, 8): that is the final distribution.”

What to write

“The system is rank deficient, so all its solutions are proportional. With 1,0001{,}000 students, I normalize: 100029(10,11,8)≈(345,379,276)\dfrac{1000}{29}(10, 11, 8)\approx(345, 379, 276).”

Why: The direction of the eigenvector is unique, its length is not. The sum constraint, given in the problem, is what fixes it.

6. Multiplying by I−AI-A instead of inverting

the whole question, and an output that is badly underestimated

What not to write

“(I−A)x=d\left(I-A\right)x=d, so x=(I−A)dx=\left(I-A\right)d.”

What to write

“We INVERT: x=(I−A)−1dx=\left(I-A\right)^{-1}d. With A=(0.20.30.40.1)A=\begin{pmatrix}0.2&0.3\\0.4&0.1\end{pmatrix} and d=(100,200)d=(100, 200), we get x=(250,333.33)x=(250, 333.33).”

agricultureindustryagriculture0.200.30industry0.400.10the COLUMN says what one unit consumes
The “industry” column reads: producing one unit of industry consumes 0.300.30 of agriculture and 0.100.10 of industry.

Why: (I−A)−1=I+A+A2+⋯\left(I-A\right)^{-1}=I+A+A^{2}+\cdots contains every round of intermediate consumption. Multiplying by (I−A)\left(I-A\right) keeps only the direct effect, and backwards.

7. Reading the Leontief matrix by rows

1.5 marks, and an economic interpretation turned upside down

What not to write

“The first row gives what agriculture consumes: 0.200.20 of itself and 0.300.30 of industry.”

What to write

“The first row says what agriculture SUPPLIES to the others. What a sector CONSUMES is read in its COLUMN.”

Why: The convention is the same as for Markov: the column index is the origin, the row index the destination. The matrix always reads “from the column to the row”.

8. Taking the first Leslie periods for the stable structure

2 marks, and the demographic conclusion

What not to write

“After one period, the class of the young explodes: that is the equilibrium structure of the population.”

What to write

“These are the oscillations of the POPULATION WAVE. The stable structure is the eigenvector of the DOMINANT eigenvalue, reached only after several periods.”

Why: The second eigenvalue governs the speed of convergence: the gap to the limit is multiplied by ∣λ2∣\left|\lambda_{2}\right| at every step, which takes all the longer as this modulus is close to 11.

Which method to choose

Which model does the problem describe?

Look at what the matrix contains and what the vector represents.

  • If the columns sum to 11 and the entries are transition probabilities → MARKOV CHAIN: xn+1=Pxnx_{n+1}=Px_{n}, steady state through (P−I)x=0\left(P-I\right)x=0

    Example: mobility between three programs

  • If the entries say what a sector consumes to produce one unit, and a final demand is given → LEONTIEF: x=(I−A)−1dx=\left(I-A\right)^{-1}d

    Example: a two-sector input-output table

  • If the first row carries fertility rates and the subdiagonal survival rates → LESLIE: growth given by the dominant eigenvalue

    Example: a population by age classes

  • If the matrix has none of these structures → it is an ordinary linear transformation: go back to the general tools of the course

    Example: a rotation matrix

The first move is always the same: add up a column. A sum of 11 signals Markov, a sum less than 11 signals Leontief.

What does the question ask for, one step or the limit?

Find the TIME HORIZON of the question in the problem.

  • If “after one year”, “at the next step” → a single product Px0Px_{0}

    Example: from (600,300,100)(600, 300, 100) to (490,330,180)(490, 330, 180)

  • If “after nn steps”, with nn small → iterate the product, or compute PnP^{n} then multiply

    Example: two or three iterations by hand

  • If “in the long run”, “at equilibrium”, “the final distribution” → STEADY state: solve (P−I)x=0\left(P-I\right)x=0 then normalize

    Example: (345,379,276)(345, 379, 276) out of a thousand students

  • If “what long-term growth rate” → dominant EIGENVALUE, and its eigenvector gives the stable structure

    Example: a Leslie matrix

If the problem asks for the limit, iterating the product earns almost nothing: the marker expects the system, not ten multiplications.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

Finding and writing up a steady state

When to use it: As soon as the problem asks for the long-term distribution of a Markov chain.

  1. 1 Check and STATE the convention: the columns sum to 11, so xn+1=Pxnx_{n+1}=Px_{n}.
  2. 2 Write the system (P−I)x=0\left(P-I\right)x=0 in full, row by row.
  3. 3 Solve, pointing out that the system is rank deficient and therefore has infinitely many proportional solutions.
  4. 4 NORMALIZE according to the constraint of the problem, total size or a sum equal to 11.
  5. 5 Check by computing PxPx: you must get xx back.

Concluding sentence

“The system (P−I)x=0\left(P-I\right)x=0 gives the solutions proportional to (10,11,8)(10, 11, 8); normalized to 1,0001{,}000 students, they are (345,379,276)(345, 379, 276), and we check that Px=xPx=x.”

The trap: Stopping at the proportional vector: without normalization, the answer is not expressed in any unit of the problem.

Marking: 1 mark for the convention, 2 marks for the system, 1 mark for the normalization, 1 mark for the check.

Solving a Leontief problem

When to use it: When the problem gives a technology matrix and a final demand.

  1. 1 Write AA and recall that its COLUMN jj describes what one unit of sector jj consumes.
  2. 2 Form I−AI-A and compute its determinant, checking that it is not zero.
  3. 3 Invert, with the 2×22\times 2 formula or by the Gauss-Jordan method.
  4. 4 Compute x=(I−A)−1dx=\left(I-A\right)^{-1}d and check that Ax+d=xAx+d=x.
  5. 5 Interpret the MULTIPLIERS, that is, the column sums of the inverse.

Concluding sentence

“The required output is x=(250,333.33)x=(250, 333.33), and we check that Ax+d=xAx+d=x. The sum of the first column of (I−A)−1\left(I-A\right)^{-1}, 2.172.17, is the multiplier of agriculture: each dollar of final demand for agriculture mobilizes 2.172.17 dollars of total output.”

The trap: Forgetting the check Ax+d=xAx+d=x: it is what catches a faulty inversion, and it takes thirty seconds.

Marking: 1 mark for I−AI-A, 2 marks for the inversion, 1 mark for the product, 1 mark for the check, 1 mark for the interpretation.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

The typical problem, taken apart

Mobility between three programs, from the first year to the limit

Every year, students change program according to the transition matrix, in the column convention: P=(0.70.20.10.20.60.30.10.20.6)P=\begin{pmatrix}0.7&0.2&0.1\\0.2&0.6&0.3\\0.1&0.2&0.6\end{pmatrix}.

At the start, the enrolments are x0=(600,300,100)x_{0}=(600, 300, 100), that is 1,0001{,}000 students.

We want the distribution after one year, after two years, and the long-term distribution.

123stays 0.7stays 0.6stays 0.60.20.10.20.20.10.3
The graph of PP: the arrow from program jj to program ii carries pijp_{ij}, and what stays in place is the diagonal. What leaves a program, “stays” included, sums to 11.

Step 1

Convention check: 0.7+0.2+0.1=10.7+0.2+0.1=1, 0.2+0.6+0.2=10.2+0.6+0.2=1, 0.1+0.3+0.6=10.1+0.3+0.6=1. The COLUMNS sum to 11, so xn+1=Pxnx_{n+1}=Px_{n}.

Why

This check takes one line and decides everything else: in the row convention, every product in the problem would be transposed.

Step 2

x1=Px0=(0.7(600)+0.2(300)+0.1(100),…)=(490,330,180)x_{1}=Px_{0}=(0.7(600)+0.2(300)+0.1(100), \ldots)=(490, 330, 180), with sum 1,0001{,}000.

Why

Each component mixes the three origins: 490490 students are in program 1 because 420420 stayed there, 6060 came from 2 and 1010 from 3.

Step 3

x2=Px1=(427,350,223)x_{2}=Px_{1}=(427, 350, 223), with sum 1,0001{,}000.

Why

The first program keeps losing and the third keeps gaining, but more and more slowly: the chain is approaching its fixed point.

Step 4

Steady state: (P−I)x=0\left(P-I\right)x=0 gives −0.3x1+0.2x2+0.1x3=0-0.3x_{1}+0.2x_{2}+0.1x_{3}=0 and 0.1x1+0.2x2−0.4x3=00.1x_{1}+0.2x_{2}-0.4x_{3}=0, hence x∝(10,11,8)x\propto(10, 11, 8).

Why

The system has rank 22 for three unknowns: it can only give a DIRECTION, never enrolments. This is normal and must be written.

Step 5

Normalization to 1,0001{,}000 students: 100029(10,11,8)≈(344.8,379.3,275.9)\dfrac{1000}{29}(10, 11, 8)\approx(344.8, 379.3, 275.9).

Why

The sum constraint comes from the problem, not from the matrix. Without it, the answer would remain a ratio between three numbers.

Step 6

Check: 0.7(344.8)+0.2(379.3)+0.1(275.9)≈344.80.7(344.8)+0.2(379.3)+0.1(275.9)\approx 344.8.

Why

Getting the first component back confirms at once the solution of the system and the normalization, without redoing any calculation.

The conclusion, written out

“After one year the distribution is (490,330,180)(490, 330, 180), after two years (427,350,223)(427, 350, 223), and since the chain is regular it converges to (345,379,276)(345, 379, 276), whatever the initial distribution.”

The classic mistake on this problem: Iterating the product ten times to approach the limit: the marker expects the system (P−I)x=0\left(P-I\right)x=0, and iterating earns almost no marks.

Learn by heart

  • • COLUMN convention: pijp_{ij} goes from jj TO ii, and every column sums to 11. State it before any calculation.
  • • One step, xn+1=Pxnx_{n+1}=Px_{n}; nn steps, xn=Pnx0x_{n}=P^{n}x_{0}, and PnP^{n} is a matrix PRODUCT, not powers of the entries.
  • • Steady state: solve (P−I)x=0\left(P-I\right)x=0, never Px=0Px=0, then NORMALIZE.
  • • LEONTIEF: x=(I−A)−1dx=\left(I-A\right)^{-1}d, and the sum of a column of the inverse is the MULTIPLIER of the sector.
  • • The column of a technology matrix says what a sector CONSUMES; its row says what it SUPPLIES.
  • • LESLIE: first row of fertility rates, subdiagonal of survival rates, and the first periods OSCILLATE.
  • • The DOMINANT eigenvalue gives the long-term growth rate, its eigenvector the stable structure.

Frequently asked questions

How do I know whether a transition matrix uses the column convention?

Add up one column: if the total is one, the matrix uses the column convention and the state vector is multiplied on the right of the matrix. If it is the rows that add up to one, the matrix is transposed with respect to that convention, and you must either transpose it or work with a row vector multiplied on the left.

How do I find the steady state of a Markov chain?

Solve the system obtained by subtracting the identity from the transition matrix and setting the result equal to zero. This system is rank deficient, so it gives a family of proportional solutions: you then normalize according to the constraint of the problem, a total size or a sum equal to one. Finally, check that the matrix leaves this vector unchanged.

What does the inverse of the Leontief matrix represent?

Each of its entries gives the total output that one sector must supply to meet one unit of final demand for another sector, indirect effects included. The sum of a column is the multiplier of that sector: it tells you how much total output is mobilized by each dollar of final demand addressed to it.

Why does a Leslie population oscillate at first?

Because the initial structure is not the equilibrium one. An age class that is too large produces a large generation one period later, which produces another in turn, and this movement takes several periods to die down. This is the population wave, and how fast it dies out depends on the second eigenvalue.

Can a matrix be raised to a power entry by entry?

No. The power of a matrix is a repeated matrix product, and that is exactly what gives it its meaning: an entry of the square automatically adds up every path in two steps. Raising the entries separately also destroys the column sums, which no longer equal one.

Practise it

Corrected exercises: Matrix models, 201-SN4-RE

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 15 corrected exercises
  • 150 points
  • 225 minutes
Do the exercises
Something missing from this sheet? A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous sheet Eigenvalues and diagonalization Next sheet Complex numbers

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-sn4-matrix-models. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a 201-SN4-RE tutor in Montreal?

Get in touch for a first session. Matrix models are the part of the course where linear algebra stops being abstract, and that is often where it finally clicks.

Site by Studio Squalli