University

Mathematical Methods for Economics · Linear Algebra

Linear algebra
worked examples

Lecture notes from EC3304 Mathematical Methods for Economics, University of St Andrews (undergraduate).

Three practice problems worked in full, each drawing on the methods from the topic pages: a parametric linear system solved by determinant and inverse, a matrix inversion carried out by elementary row operations, and the computation of eigenvalues and eigenvectors of a \(3\times3\) matrix. Attempt each before reading the solution.

These practice problems accompany the linear algebra study notes for a mathematical economics course. Each solution states the method, shows every step, and points back to the relevant topic page.

Problem 1, a linear system with a parameter

Problem

The three equations below, in the unknowns \(x_1,x_2,x_3\), involve a real parameter \(\delta\):

$$\begin{cases}x_1 - x_2 + 2x_3 = 3\\ 2x_1 + x_2 + \delta x_3 = 6\\ x_1 + x_2 + x_3 = 4.\end{cases}$$

(a) Use the determinant of the coefficient matrix to find the value of \(\delta\) that rules out a unique solution.  (b) Take \(\delta = 3\) and solve the system by computing the inverse of the coefficient matrix.  (c) Keeping \(\delta = 3\), a fourth equation \(x_1 + \delta x_2 + x_3 = 4\) joins the system. Is there still a single solution, and if not, why not?

(a) When is the solution unique?

In matrix form the system is \(A\mathbf{x}=\mathbf{b}\), where

$$A=\begin{pmatrix}1&-1&2\\2&1&\delta\\1&1&1\end{pmatrix}, \qquad \mathbf{b}=\begin{pmatrix}3\\6\\4\end{pmatrix}.$$

There is a unique solution if and only if \(\lvert A\rvert\neq 0\). Expanding along the first row, where the middle cofactor carries a minus sign and the entry there is itself \(-1\),

$$\begin{aligned}\lvert A\rvert &= 1\begin{vmatrix}1&\delta\\1&1\end{vmatrix} - (-1)\begin{vmatrix}2&\delta\\1&1\end{vmatrix}\\ &\quad + 2\begin{vmatrix}2&1\\1&1\end{vmatrix}\\ &= (1-\delta) + (2-\delta) + 2\\ &= 5 - 2\delta.\end{aligned}$$

So \(\lvert A\rvert = 0\) only at \(\delta = \tfrac52\). The system fails to have a unique solution when \(\delta = \tfrac52\), and has one for every other \(\delta\). (At \(\delta=\tfrac52\) there is in fact no solution at all: the first equation minus twice the second plus three times the third reads \(0 = 3\).)

(b) The inverse at \(\delta = 3\).

At \(\delta=3\), \(\lvert A\rvert = 5-6 = -1\neq 0\), so \(A\) is invertible and \(\mathbf{x}=A^{-1}\mathbf{b}\). The cofactors of \(A=\begin{pmatrix}1&-1&2\\2&1&3\\1&1&1\end{pmatrix}\), row by row, are \((-2,1,1)\), \((3,-1,-2)\) and \((-5,1,3)\). Transposing gives the adjugate, and dividing by \(\lvert A\rvert=-1\) changes every sign:

$$A^{-1} = \begin{pmatrix}2&-3&5\\-1&1&-1\\-1&2&-3\end{pmatrix}.$$

(You can verify \(AA^{-1}=I\) directly.) Then

$$\begin{aligned}\mathbf{x} = A^{-1}\begin{pmatrix}3\\6\\4\end{pmatrix} &= \begin{pmatrix}6-18+20\\ -3+6-4\\ -3+12-12\end{pmatrix}\\ &= \begin{pmatrix}8\\-1\\-3\end{pmatrix}.\end{aligned}$$

Check: \(8+1-6=3\) ✓, \(16-1-9=6\) ✓, \(8-1-3=4\) ✓. So the unique solution is \(\mathbf{x} = (8, -1, -3)\).

(c) The extra equation.

At \(\delta=3\) the added equation is \(x_1 + 3x_2 + x_3 = 4\). The first three equations already have a single solution, \((8,-1,-3)\), so any solution of the enlarged system would have to be that point. Substituting it into the new equation gives \(8 + 3(-1) + (-3) = 2\neq 4\). The point fails the new equation, so the enlarged four-equation system has no solution at all at \(\delta = 3\): it is inconsistent. Adding an equation can keep a unique solution (when the point satisfies it) or remove it, but it cannot create a new one; here the right-hand side would have to be 2 for the solution to survive.

Methods used: determinants, the matrix inverse and solving \(A\mathbf{x}=\mathbf{b}\).

What students say

“Nicky is an excellent econometrics tutor. He explains complex concepts clearly and makes them much easier to understand.”
Charles GardnerGoogle review
“I was completely lost in my economics class, and then I started working Nicky and he totally saved me. He was excellent at explaining the material and extremely accommodating to meet with me many times despite us being in different time zones! Highly recommend working with Nicky!”
Claire ChouGoogle review
“Nicky is a very good and thorough teacher. He has excellent knowledge of econometrics and takes the time to work through your questions. Highly recommended!”
ChrisEconometrics · 22/08
“Really great tutor! Encouraging, knowledgeable, friendly”
JedEconometrics · 09/02
“Very good lesson, Nicky is very helpful.”
ChrisEconometrics · 19/08
“Very helpful and clear.”
ClaireEconometrics · 22/01
“I gather it was very useful, thank you!”
ClaireEconometrics · 12/01
“Fantastic!”
JedEconometrics · 11/02

Problem 2, inversion by elementary transformations

Problem

Find the inverse of \(A=\begin{pmatrix}1&-3\\2&0\end{pmatrix}\) using elementary row operations (the Gauss-Jordan method).

Augment \(A\) with the identity and reduce the left block to \(I\); the right block becomes \(A^{-1}\). Begin with \(\left(\begin{array}{cc|cc}1&-3&1&0\\2&0&0&1\end{array}\right)\).

Step 1, clear the entry below the pivot.

Add \((-2)\times\)row 1 to row 2:

$$\left(\begin{array}{cc|cc}1&-3&1&0\\0&6&-2&1\end{array}\right).$$

Step 2, clear the entry above the second pivot.

Add \(\tfrac12\times\)row 2 to row 1:

$$\left(\begin{array}{cc|cc}1&0&0&\tfrac12\\0&6&-2&1\end{array}\right).$$

Step 3, normalise the second pivot.

Multiply row 2 by \(\tfrac16\):

$$\left(\begin{array}{cc|cc}1&0&0&\tfrac12\\0&1&-\tfrac13&\tfrac16\end{array}\right).$$

The left block is now the identity, so

$$A^{-1} = \begin{pmatrix}0&\tfrac12\\-\tfrac13&\tfrac16\end{pmatrix}.$$

Cross-check with the \(2\times2\) formula: \(\lvert A\rvert = 1(0)-2(-3) = 6\), and \(\tfrac{1}{6}\begin{pmatrix}0&3\\-2&1\end{pmatrix} = \begin{pmatrix}0&\tfrac12\\-\tfrac13&\tfrac16\end{pmatrix}\). ✓

Method used: the inverse by elementary transformations.

Problem 3, eigenvalues and eigenvectors of a 3×3 matrix

Problem

The matrix below is the coefficient matrix of the system of differential equations in problem 2 of the practice problems page. Find its eigenvalues, and an eigenvector for each.

$$A=\begin{pmatrix}1&0&0\\1&2&3\\1&2&1\end{pmatrix}.$$

Step 1, the characteristic equation.

Only the first entry of the first row of \(A-\lambda I\) is nonzero, so a cofactor expansion along that row leaves one \(2\times2\) minor:

$$\begin{aligned}&\lvert A-\lambda I\rvert\\ &\quad= (1-\lambda)\begin{vmatrix}2-\lambda&3\\2&1-\lambda\end{vmatrix}\\ &\quad= (1-\lambda)\big[(2-\lambda)(1-\lambda) - 6\big].\end{aligned}$$

Now

$$\begin{aligned}&(2-\lambda)(1-\lambda) - 6\\ &\quad= \lambda^2 - 3\lambda + 2 - 6\\ &\quad= \lambda^2 - 3\lambda - 4\\ &\quad= (\lambda-4)(\lambda+1).\end{aligned}$$

Hence the characteristic equation is

$$(1-\lambda)(\lambda-4)(\lambda+1) = 0,$$

so the eigenvalues are \(\lambda = -1,\ 1,\ 4\). (Check against the trace: \(1+2+1 = 4 = -1+1+4\) ✓; and against the determinant: \(\lvert A\rvert = 1\cdot(2\cdot1-3\cdot2) = -4\), which is the product \((-1)(1)(4)\) ✓.)

Step 2, eigenvector for \(\lambda = 4\).

Solve \((A-4I)\mathbf{x}=\mathbf{0}\): \(\begin{pmatrix}-3&0&0\\1&-2&3\\1&2&-3\end{pmatrix}\mathbf{x}=\mathbf{0}\). The first row gives \(x_1=0\); the second then gives \(-2x_2+3x_3=0\), and the third is the same condition. With \(x_3=2\) this gives the eigenvector \(\mathbf{x}=(0,3,2)^{\top}\).

Step 3, eigenvector for \(\lambda = -1\).

Solve \((A+I)\mathbf{x}=\mathbf{0}\): \(\begin{pmatrix}2&0&0\\1&3&3\\1&2&2\end{pmatrix}\mathbf{x}=\mathbf{0}\). The first row gives \(x_1=0\), and both other rows then give \(x_2=-x_3\). With \(x_3=-1\) this gives the eigenvector \(\mathbf{x}=(0,1,-1)^{\top}\).

Step 4, eigenvector for \(\lambda = 1\).

Solve \((A-I)\mathbf{x}=\mathbf{0}\): \(\begin{pmatrix}0&0&0\\1&1&3\\1&2&0\end{pmatrix}\mathbf{x}=\mathbf{0}\). The first row is zero, so \(x_1\) is no longer forced to vanish. The third row gives \(x_1 = -2x_2\); the second then gives \(-x_2+3x_3=0\), so \(x_2=3x_3\). With \(x_3=1\) this gives the eigenvector \(\mathbf{x}=(-6,3,1)^{\top}\).

The three eigenpairs are \(\big(-1,(0,1,-1)\big)\), \(\big(1,(-6,3,1)\big)\) and \(\big(4,(0,3,2)\big)\); any nonzero multiple of an eigenvector is an eigenvector for the same eigenvalue.

Where this arises in economics

This is the coefficient matrix of the linear system of differential equations in practice problem 2, a model of three variables that evolve together over time. Its eigenvalues govern the dynamics: along each eigenvector the system moves in a straight line, growing like \(e^{\lambda t}\) when \(\lambda>0\) and shrinking when \(\lambda<0\). Here two eigenvalues are positive (1 and 4) and one is negative (\(-1\)), so the steady state at the origin is a saddle: paths that start on the line through \((0,1,-1)\) converge to it, and every other path moves away. Saddle-path dynamics of this kind are what the Ramsey growth model and models of exchange-rate overshooting produce. The linear-algebra step shown above, extracting eigenvalues and eigenvectors, is the part every such analysis relies on; the dynamics themselves belong to the calculus and dynamic-optimisation notes.

Methods used: the characteristic equation and finding eigenvectors.

Quick self-check

Two shorter problems to test the same techniques.

1. For which value(s) of \(k\) does \(kx_1 + x_2 = 3\), \(4x_1 + x_2 = 1\) fail to have a unique solution?

The coefficient matrix is \(A=\begin{pmatrix}k&1\\4&1\end{pmatrix}\) with \(\lvert A\rvert = k - 4\). A unique solution requires \(\lvert A\rvert\neq 0\), so the system fails to have a unique solution when \(k = 4\). (At \(k=4\) the two left-hand sides are identical while the right-hand sides differ, so the system is inconsistent, no solution.)

2. Find the eigenvalues of the upper-triangular matrix \(A=\begin{pmatrix}3&7\\0&-2\end{pmatrix}\).

For a triangular matrix the determinant is the product of the diagonal, so \(\lvert A-\lambda I\rvert = (3-\lambda)(-2-\lambda) = 0\). The eigenvalues are the diagonal entries themselves, \(\lambda = 3\) and \(\lambda = -2\). This is a general fact: the eigenvalues of any triangular (or diagonal) matrix are its diagonal entries.

Want more
worked practice?

I tutor economics, econometrics and mathematics at university and postgraduate level. Send a topic list and I will build a set of worked problems around exactly what you need. Free 30 minute initial consultation.

Pricing Book a consultation
Free 30-min consultationNo obligation · reply within one business day
Book now