Skip to content

Matrices and Transformations

Matrices and Transformations

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices provide a powerful Framework for solving systems of linear equations, representing geometric transformations, modelling Markov processes, and much more. This topic is central to the IB Mathematics AA course at both SL And HL, with eigenvalues and diagonalisation appearing exclusively at HL.


1. Matrix Fundamentals

Definition and Notation

An m×nm \times n matrix AA is a rectangular array of real numbers with mm rows and nn columns:

A = \begin`\{pmatrix}` a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_`\{mn}` \end`\{pmatrix}`

The entry in row ii and column jj is denoted aija_{ij}. The set of all m×nm \times n real matrices Is written Mm×n(R)\mathcal{M}_{m \times n}(\mathbb{R}).

A column vector in Rn\mathbb{R}^n is an n×1n \times 1 matrix, and a row vector is a 1×n1 \times n Matrix. When the dimensions are equal (m=nm = n), the matrix is called square.

Matrix Addition and Scalar Multiplication

Addition. If A,BMm×n(R)A, B \in \mathcal{M}_{m \times n}(\mathbb{R})Then A+BA + B is defined Entry-wise:

(A + B)_`\{ij}` = a_`\{ij}` + b_`\{ij}`

Scalar multiplication. For kRk \in \mathbb{R} and AMm×n(R)A \in \mathcal{M}_{m \times n}(\mathbb{R}):

(kA)_`\{ij}` = k \cdot a_`\{ij}`

These operations satisfy the following axioms (making Mm×n(R)\mathcal{M}_{m \times n}(\mathbb{R}) a Vector space over R\mathbb{R}):

  • A+B=B+AA + B = B + A (commutativity)
  • (A+B)+C=A+(B+C)(A + B) + C = A + (B + C) (associativity)
  • A+O=AA + O = AWhere OO is the m×nm \times n zero matrix
  • k(A+B)=kA+kBk(A + B) = kA + kB (distributivity over matrix addition)
  • (k+l)A=kA+lA(k + l)A = kA + lA (distributivity over scalar addition)
  • k(lA)=(kl)Ak(lA) = (kl)A (associativity of scalar multiplication)

Matrix Multiplication

If AA is m×pm \times p and BB is p×np \times nThen the product C=ABC = AB is an m×nm \times n matrix Whose entries are:

C_`\{ij}` = \sum_{k=1}^{p} a_`\{ik}` b_`\{kj}`

This is the dot product of the ii-th row of AA with the jj-th column of BB. The inner Dimensions must agree: an m×pm \times p matrix can multiply a p×np \times n matrix, producing an m×nm \times n matrix.

Critical properties:

  • Matrix multiplication is associative: (AB)C=A(BC)(AB)C = A(BC) when the products are defined.
  • Matrix multiplication is distributive over addition: A(B+C)=AB+ACA(B + C) = AB + AC.
  • Matrix multiplication is NOT commutative : ABBAAB \neq BA.
  • The existence of ABAB does not imply the existence of BABA.
  • AB=OAB = O does NOT imply A=OA = O or B=OB = O (there are non-trivial zero divisors).

Examples

Expand

Solve the system:

2x+3y=82x + 3y = 8 and xy=1x - y = 1

In matrix form: (2311)(xy)=(81)\begin{pmatrix} 2 & 3 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 8 \\ 1 \end{pmatrix}

det(A)=(2)(1)(3)(1)=5\det(A) = (2)(-1) - (3)(1) = -5

A1=15(1312)=(0.20.60.20.4)A^{-1} = \dfrac{1}{-5}\begin{pmatrix} -1 & -3 \\ -1 & 2 \end{pmatrix} = \begin{pmatrix} 0.2 & 0.6 \\ 0.2 & -0.4 \end{pmatrix}

(xy)=(0.20.60.20.4)(81)=(2.21.2)\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0.2 & 0.6 \\ 0.2 & -0.4 \end{pmatrix} \begin{pmatrix} 8 \\ 1 \end{pmatrix} = \begin{pmatrix} 2.2 \\ 1.2 \end{pmatrix}

So x=115x = \frac{11}{5} and y=65y = \frac{6}{5}.


4. 2D Geometric Transformations

Every linear transformation T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 can be represented by a 2×22 \times 2 Matrix MM such that T(v)=MvT(\mathbf{v}) = M\mathbf{v}. The images of the standard basis vectors (10)\begin{pmatrix} 1 \\ 0 \end{pmatrix} and (01)\begin{pmatrix} 0 \\ 1 \end{pmatrix} form the columns Of MM.

Reflections

A reflection maps every point to its mirror image across a specified line. The determinant of any Reflection matrix is 1-1 (orientation is reversed).

Reflection in the xx-axis:

R_x = \begin`\{pmatrix}` 1 & 0 \\ 0 & -1 \end`\{pmatrix}`

Reflection in the yy-axis:

R_y = \begin`\{pmatrix}` -1 & 0 \\ 0 & 1 \end`\{pmatrix}`

Reflection in the line y=xy = x:

R_{y=x} = \begin`\{pmatrix}` 0 & 1 \\ 1 & 0 \end`\{pmatrix}`

Reflection in the line y=xy = -x:

R_{y=-x} = \begin`\{pmatrix}` 0 & -1 \\ -1 & 0 \end`\{pmatrix}`

Reflection in the line y=(tanθ)xy = (\tan\theta)\,x (a line through the origin making angle θ\theta With the positive xx-axis):

R_\theta = \begin`\{pmatrix}` \cos 2\theta & \sin 2\theta \\ \sin 2\theta & -\cos 2\theta \end`\{pmatrix}`

Rotations

An anticlockwise rotation about the origin through an angle θ\theta is represented by:

R_\theta = \begin`\{pmatrix}` \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end`\{pmatrix}`

Key properties of rotation matrices:

  • det(Rθ)=cos2θ+sin2θ=1\det(R_\theta) = \cos^2\theta + \sin^2\theta = 1 (area-preserving, orientation-preserving)
  • Rθ1=Rθ=RθTR_\theta^{-1} = R_{-\theta} = R_\theta^T (rotation matrices are orthogonal)
  • RαRβ=Rα+βR_\alpha R_\beta = R_{\alpha + \beta} (composition of rotations adds angles)

Common rotations:

AngleMatrix
9090^\circ(0110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}
180180^\circ(1001)\begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}
270270^\circ(0110)\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}
6060^\circ(12323212)\begin{pmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}
4545^\circ(22222222)\begin{pmatrix} \frac{\sqrt{2}}{2} & -\frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{pmatrix}

Enlargements (Dilations)

An enlargement with scale factor kk about the origin scales all distances by k|k| and, if k<0k \lt 0Also rotates by 180180^\circ.

E_k = \begin`\{pmatrix}` k & 0 \\ 0 & k \end`\{pmatrix}`
  • det(Ek)=k2\det(E_k) = k^2So the area scale factor is k2k^2.
  • For k=1k = 1This is the identity transformation.
  • For k=1k = -1This is equivalent to a rotation of 180180^\circ about the origin.

Stretches. A stretch parallel to the xx-axis with scale factor kk:

S_x = \begin`\{pmatrix}` k & 0 \\ 0 & 1 \end`\{pmatrix}`

A stretch parallel to the yy-axis with scale factor kk:

S_y = \begin`\{pmatrix}` 1 & 0 \\ 0 & k \end`\{pmatrix}`

For a stretch parallel to the xx-axis, det(Sx)=k\det(S_x) = kSo the area scale factor is k|k|. If 0<k<10 \lt k \lt 1The figure is compressed; if k>1k \gt 1It is expanded.

Shears. A horizontal shear with shear factor kk fixes every point on the xx-axis and shifts Other points horizontally in proportion to their yy-coordinate:

H_x = \begin`\{pmatrix}` 1 & k \\ 0 & 1 \end`\{pmatrix}`

A vertical shear with shear factor kk:

H_y = \begin`\{pmatrix}` 1 & 0 \\ k & 1 \end`\{pmatrix}`

For any shear matrix, det=1\det = 1So area is preserved. The xx-axis (for HxH_x) or yy-axis (for HyH_y) is point-wise invariant.

Composite Transformations

If transformation AA is applied first, followed by transformation BBThe composite transformation Is represented by the product BABA (note the order: right to left).

v=B(Av)=(BA)v\mathbf{v}' = B(A\mathbf{v}) = (BA)\mathbf{v}

Example. A rotation of 9090^\circ anticlockwise followed by a reflection in the xx-axis:

\begin`\{pmatrix}` 1 & 0 \\ 0 & -1 \end`\{pmatrix}` \begin`\{pmatrix}` 0 & -1 \\ 1 & 0 \end`\{pmatrix}` = \begin`\{pmatrix}` 0 & -1 \\ -1 & 0 \end`\{pmatrix}`

This is equivalent to a single reflection in the line y=xy = -x.

Worked Example: Composite Transformation

Find the image of the point (2,3)(2, 3) under a rotation of 9090^\circ anticlockwise about the origin Followed by a reflection in the line y=xy = x.

Rotation matrix:

R90=(0110)R_{90} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}

Reflection in y=xy = x:

Ry=x=(0110)R_{y=x} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}

Composite (reflection applied after rotation):

M=Ry=xR90=(0110)(0110)=(1001)M = R_{y=x} \cdot R_{90} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}

This is a reflection in the xx-axis! Apply to (2,3)(2, 3):

(1001)(23)=(23)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} 2 \\ 3 \end{pmatrix} = \begin{pmatrix} 2 \\ -3 \end{pmatrix}

The image is (2,3)(2, -3).

Inverse of a composite. Since (BA)1=A1B1(BA)^{-1} = A^{-1}B^{-1}To undo a composite transformation, The individual inverses are applied in reverse order.

Invariant Points and Invariant Lines

An invariant point under transformation MM is a point v\mathbf{v} such that Mv=vM\mathbf{v} = \mathbf{v}I.e. (MI)v=0(M - I)\mathbf{v} = \mathbf{0}. The set of invariant points forms The null space of MIM - I.

For any 2×22 \times 2 transformation matrix, the origin is always invariant.

An invariant line is a line that is mapped onto itself (though individual points on the line may Move along it). A line through the origin with direction vector d\mathbf{d} is invariant if Md=λdM\mathbf{d} = \lambda \mathbf{d} for some scalar λ\lambdaWhich means d\mathbf{d} is an Eigenvector of MM.

A line is point-wise invariant (every point is fixed) if and only if every point on it is an Invariant point, meaning the line lies entirely in the null space of MIM - I.

Not all invariant lines are point-wise invariant. For example, a stretch parallel to the xx-axis (k001)\begin{pmatrix} k & 0 \\ 0 & 1 \end{pmatrix} leaves the xx-axis point-wise invariant and Also leaves the yy-axis invariant as a line (each point (0,y)(0, y) maps to itself), but it leaves Every line parallel to the xx-axis invariant as a line (points slide along it), not point-wise.

For a reflection, the mirror line is point-wise invariant and the line perpendicular to it through The origin is invariant as a set (points are reflected across the mirror line but remain on the Perpendicular line).

Area Scale Factor

For any 2×22 \times 2 matrix MM representing a linear transformation of the plane, the area scale Factor is det(M)|\det(M)|. This means:

  • If det(M)=1|\det(M)| = 1The transformation preserves area (e.g. Rotations, reflections).
  • If det(M)=k2|\det(M)| = k^2The area of any region is multiplied by k2k^2 (e.g. Enlargement by scale factor kk).
  • If det(M)=0\det(M) = 0The transformation is singular and collapses the plane to a line or point.

This extends to 3×33 \times 3 matrices where det(M)|\det(M)| is the volume scale factor.


5. Eigenvalues and Eigenvectors (AHL)

Motivation

When a linear transformation acts on a vector, the vector is generally rotated and scaled. Certain Special vectors, called eigenvectors, are only scaled (stretched or compressed) by the Transformation, not rotated. The factor by which an eigenvector is scaled is the corresponding eigenvalue.

Formal Definition

Let AA be an n×nn \times n matrix. A scalar λ\lambda is an eigenvalue of AA if there exists a Non-zero vector v\mathbf{v} (the corresponding eigenvector) such that:

Av=λvA\mathbf{v} = \lambda \mathbf{v}

Equivalently: (AλI)v=0(A - \lambda I)\mathbf{v} = \mathbf{0}.

For a non-trivial solution v0\mathbf{v} \neq \mathbf{0} to exist, we require:

det(AλI)=0\det(A - \lambda I) = 0

Characteristic Equation

The equation det(AλI)=0\det(A - \lambda I) = 0 is the characteristic equation of AA. For a 2×22 \times 2 Matrix A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}:

\det\begin`\{pmatrix}` a - \lambda & b \\ c & d - \lambda \end`\{pmatrix}` = (a - \lambda)(d - \lambda) - bc = 0

Expanding:

λ2(a+d)λ+(adbc)=0\lambda^2 - (a + d)\lambda + (ad - bc) = 0

Notice that a+d=tr(A)a + d = \mathrm{tr}(A) (the trace of AA) and adbc=det(A)ad - bc = \det(A). Therefore:

λ2tr(A)λ+det(A)=0\lambda^2 - \mathrm{tr}(A)\lambda + \det(A) = 0

For a 3×33 \times 3 matrix, the characteristic equation is a cubic:

det(AλI)=λ3+tr(A)λ2Sλ+det(A)=0\det(A - \lambda I) = -\lambda^3 + \mathrm{tr}(A)\lambda^2 - S\lambda + \det(A) = 0

Where SS is the sum of the principal 2×22 \times 2 minors (the sum of the determinants of the Matrices obtained by deleting each row and the corresponding column).

Fundamental properties of eigenvalues:

  • The sum of the eigenvalues equals the trace: λ1+λ2++λn=tr(A)\lambda_1 + \lambda_2 + \cdots + \lambda_n = \mathrm{tr}(A).
  • The product of the eigenvalues equals the determinant: λ1λ2λn=det(A)\lambda_1 \lambda_2 \cdots \lambda_n = \det(A).
  • A matrix is invertible if and only if none of its eigenvalues is zero.
  • The eigenvalues of AkA^k are λ1k,λ2k,,λnk\lambda_1^k, \lambda_2^k, \ldots, \lambda_n^k.

Finding Eigenvectors

Once an eigenvalue λ\lambda is known, the corresponding eigenvectors are found by solving:

(AλI)v=0(A - \lambda I)\mathbf{v} = \mathbf{0}

This is a homogeneous system. Since det(AλI)=0\det(A - \lambda I) = 0The rows of AλIA - \lambda I are Linearly dependent, and the system has infinitely many solutions forming a one-dimensional subspace (a line through the origin) for each distinct eigenvalue.

Important: Eigenvectors are determined only up to a non-zero scalar multiple. Any non-zero Multiple of an eigenvector is also an eigenvector for the same eigenvalue.

Repeated Eigenvalues

When the characteristic equation has a repeated root (a repeated eigenvalue), the matrix may or may Not be diagonalisable.

  • Geometric multiplicity \leq algebraic multiplicity. The algebraic multiplicity of an eigenvalue is its multiplicity as a root of the characteristic equation. The geometric multiplicity is the dimension of the corresponding eigenspace (the number of linearly independent eigenvectors for that eigenvalue).
  • A matrix is diagonalisable if and only if the geometric multiplicity of each eigenvalue equals its algebraic multiplicity.
  • If the geometric multiplicity is strictly less than the algebraic multiplicity, the matrix is defective and cannot be diagonalised.

For a 2×22 \times 2 matrix with a repeated eigenvalue λ\lambda:

  • If A=λIA = \lambda IThen every non-zero vector is an eigenvector (geometric multiplicity =2= 2), and AA is diagonalisable (it is already diagonal).
  • If AλIA \neq \lambda I but has a repeated eigenvalue, the geometric multiplicity is 11 and AA is not diagonalisable.

3x3 Eigenvalue Problems

For a 3×33 \times 3 matrix, the characteristic equation is a cubic polynomial in λ\lambda. The cubic Can have three distinct real roots, one repeated and one distinct real root, or one real root and Two complex conjugate roots. Since the IB course works over R\mathbb{R}Only real eigenvalues and Eigenvectors are considered.

Examples

Expand

Find the eigenvalues and eigenvectors of

A=(200031002)A = \begin{pmatrix} 2 & 0 & 0 \\ 0 & 3 & 1 \\ 0 & 0 & 2 \end{pmatrix}

Characteristic equation:

det(AλI)=2λ0003λ1002λ\det(A - \lambda I) = \begin{vmatrix} 2 - \lambda & 0 & 0 \\ 0 & 3 - \lambda & 1 \\ 0 & 0 & 2 - \lambda \end{vmatrix}

Expanding along the first column:

(2λ)3λ102λ=(2λ)(3λ)(2λ)=0(2 - \lambda)\begin{vmatrix} 3 - \lambda & 1 \\ 0 & 2 - \lambda \end{vmatrix} = (2 - \lambda)(3 - \lambda)(2 - \lambda) = 0

(2λ)2(3λ)=0(2 - \lambda)^2(3 - \lambda) = 0

λ1=3\lambda_1 = 3 (algebraic multiplicity 1), λ2=2\lambda_2 = 2 (algebraic multiplicity 2)

Eigenvector for λ1=3\lambda_1 = 3:

(100001001)(v1v2v3)=(000)\begin{pmatrix} -1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & -1 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \\ v_3 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}

-v_1 = 0$$v_3 = 0$$v_2 is free. Eigenvector: (010)\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}.

Eigenvector for λ2=2\lambda_2 = 2:

(000011000)(v1v2v3)=(000)\begin{pmatrix} 0 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \\ v_3 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}

v_2 + v_3 = 0$$v_3 = -v_2And v1v_1 is free. Two linearly independent eigenvectors: (100)\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} and (011)\begin{pmatrix} 0 \\ 1 \\ -1 \end{pmatrix}.

Since the geometric multiplicity of λ2=2\lambda_2 = 2 equals its algebraic multiplicity (both =2= 2), The matrix is diagonalisable. The total number of linearly independent eigenvectors is 33.

P=(010101001),D=(300020002)P = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 0 & -1 \end{pmatrix}, \quad D = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{pmatrix}

Characteristic equation:

det(AλI)=4λ123λ=(4λ)(3λ)2=0\det(A - \lambda I) = \begin{vmatrix} 4 - \lambda & 1 \\ 2 & 3 - \lambda \end{vmatrix} = (4 - \lambda)(3 - \lambda) - 2 = 0

λ27λ+10=0\lambda^2 - 7\lambda + 10 = 0

(λ5)(λ2)=0(\lambda - 5)(\lambda - 2) = 0

λ1=5,λ2=2\lambda_1 = 5, \quad \lambda_2 = 2

Eigenvector for λ1=5\lambda_1 = 5:

(451235)(v1v2)=(00)\begin{pmatrix} 4 - 5 & 1 \\ 2 & 3 - 5 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

(1122)(v1v2)=(00)\begin{pmatrix} -1 & 1 \\ 2 & -2 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

From the first row: v1+v2=0-v_1 + v_2 = 0So v1=v2v_1 = v_2. The eigenvector is (11)\begin{pmatrix} 1 \\ 1 \end{pmatrix} (up to scalar multiples).

Eigenvector for λ2=2\lambda_2 = 2:

(421232)(v1v2)=(00)\begin{pmatrix} 4 - 2 & 1 \\ 2 & 3 - 2 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

(2121)(v1v2)=(00)\begin{pmatrix} 2 & 1 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

From the first row: 2v1+v2=02v_1 + v_2 = 0So v2=2v1v_2 = -2v_1. The eigenvector is (12)\begin{pmatrix} 1 \\ -2 \end{pmatrix}.

Diagonalisation

An n×nn \times n matrix AA is diagonalisable if there exists an invertible matrix PP and a Diagonal matrix DD such that:

A=PDP1A = PDP^{-1}

The columns of PP are the eigenvectors of AAAnd the diagonal entries of DD are the Corresponding eigenvalues.

Theorem. An n×nn \times n matrix is diagonalisable if and only if it has nn linearly independent Eigenvectors. This is guaranteed when AA has nn distinct eigenvalues.

Procedure for diagonalising a 2×22 \times 2 matrix:

  1. Find the eigenvalues by solving det(AλI)=0\det(A - \lambda I) = 0.
  2. Find a corresponding eigenvector for each eigenvalue.
  3. Form P=(v1v2)P = \begin{pmatrix} \mathbf{v}_1 & \mathbf{v}_2 \end{pmatrix} (eigenvectors as columns).
  4. Form D=(λ100λ2)D = \begin{pmatrix} \lambda_1 & 0 \\ 0 & \lambda_2 \end{pmatrix}.
  5. Verify: A=PDP1A = PDP^{-1}Or equivalently, P1AP=DP^{-1}AP = D.

Matrix Powers via Diagonalisation

One of the most powerful applications of diagonalisation is computing large matrix powers. If A=PDP1A = PDP^{-1}Then:

Ak=PDkP1A^k = PD^k P^{-1}

Where Dk=(λ1k00λ2k)D^k = \begin{pmatrix} \lambda_1^k & 0 \\ 0 & \lambda_2^k \end{pmatrix} for a 2×22 \times 2 Case.

This transforms the problem of computing AkA^k (which would require k1k-1 matrix multiplications) Into computing three matrix products, which is dramatically more efficient.

Examples

Expand

Find A5A^5 where A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}

From the previous example: \lambda_1 = 5$$\lambda_2 = 2 v1=(11)\mathbf{v}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix} v2=(12)\mathbf{v}_2 = \begin{pmatrix} 1 \\ -2 \end{pmatrix}.

P=(1112),D=(5002)P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}, \quad D = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}

det(P)=21=3\det(P) = -2 - 1 = -3

P1=13(2111)=(23131313)P^{-1} = \frac{1}{-3}\begin{pmatrix} -2 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} \frac{2}{3} & \frac{1}{3} \\ \frac{1}{3} & -\frac{1}{3} \end{pmatrix}

D5=(31250032)D^5 = \begin{pmatrix} 3125 & 0 \\ 0 & 32 \end{pmatrix}

A5=PD5P1=(1112)(31250032)(23131313)A^5 = PD^5 P^{-1} = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix} \begin{pmatrix} 3125 & 0 \\ 0 & 32 \end{pmatrix} \begin{pmatrix} \frac{2}{3} & \frac{1}{3} \\ \frac{1}{3} & -\frac{1}{3} \end{pmatrix}

=(312532312564)(23131313)= \begin{pmatrix} 3125 & 32 \\ 3125 & -64 \end{pmatrix} \begin{pmatrix} \frac{2}{3} & \frac{1}{3} \\ \frac{1}{3} & -\frac{1}{3} \end{pmatrix}

=(62823309336186331893)=(2094103120621063)= \begin{pmatrix} \frac{6282}{3} & \frac{3093}{3} \\ \frac{6186}{3} & \frac{3189}{3} \end{pmatrix} = \begin{pmatrix} 2094 & 1031 \\ 2062 & 1063 \end{pmatrix}


6. Applications

Gaussian Elimination

Gaussian elimination is a systematic method for solving systems of linear equations by reducing the Augmented matrix to row echelon form (REF) or reduced row echelon form (RREF).

Elementary row operations:

  1. Swap two rows (RiRjR_i \leftrightarrow R_j).
  2. Multiply a row by a non-zero scalar (RikRiR_i \to kR_i).
  3. Add a multiple of one row to another (RiRi+kRjR_i \to R_i + kR_j).

Algorithm (for an n×nn \times n system):

  1. Form the augmented matrix [Ab][A \mid \mathbf{b}].
  2. Use row operations to create zeros below each pivot (forward elimination).
  3. Back-substitute to find the solution.

Existence and uniqueness:

  • If rank(A)=rank([Ab])=n\mathrm{rank}(A) = \mathrm{rank}([A \mid \mathbf{b}]) = n: unique solution.
  • If rank(A)=rank([Ab])<n\mathrm{rank}(A) = \mathrm{rank}([A \mid \mathbf{b}]) \lt n: infinitely many solutions.
  • If rank(A)<rank([Ab])\mathrm{rank}(A) \lt \mathrm{rank}([A \mid \mathbf{b}]): no solution (inconsistent system).

Examples

Expand

Solve the system:

x + 2y + z = 5$$2x + 5y + 3z = 13$$x + 3y + 3z = 10

Augmented matrix:

(12152531313310)\begin{pmatrix} 1 & 2 & 1 & \mid & 5 \\ 2 & 5 & 3 & \mid & 13 \\ 1 & 3 & 3 & \mid & 10 \end{pmatrix}

R_2 \to R_2 - 2R_1$$R_3 \to R_3 - R_1:

(121501130125)\begin{pmatrix} 1 & 2 & 1 & \mid & 5 \\ 0 & 1 & 1 & \mid & 3 \\ 0 & 1 & 2 & \mid & 5 \end{pmatrix}

R3R3R2R_3 \to R_3 - R_2:

(121501130012)\begin{pmatrix} 1 & 2 & 1 & \mid & 5 \\ 0 & 1 & 1 & \mid & 3 \\ 0 & 0 & 1 & \mid & 2 \end{pmatrix}

Back-substitution: z = 2$$y + z = 3 \Rightarrow y = 1$$x + 2(1) + 2 = 5 \Rightarrow x = 1.

Solution: (x,y,z)=(1,1,2)(x, y, z) = (1, 1, 2).

Cramer’s Rule

Cramer’s rule provides an explicit formula for the solution of a system Ax=bA\mathbf{x} = \mathbf{b} When AA is an n×nn \times n invertible matrix.

For a 2×22 \times 2 system:

X = \frac{\begin`\{vmatrix}` e & b \\ f & d \end`\{vmatrix}`}{\det(A)}, \qquad y = \frac{\begin`\{vmatrix}` a & e \\ c & f \end`\{vmatrix}`}{\det(A)}

Where the numerator for xx replaces the first column of AA with b\mathbf{b}And the numerator For yy replaces the second column.

General formula (Cramer’s Rule): For each variable xix_i:

Xi=det(Ai)det(A)X_i = \frac{\det(A_i)}{\det(A)}

Where AiA_i is the matrix AA with column ii replaced by the vector b\mathbf{b}.

Examples

Expand

Encrypt “HELP” using the key matrix

K=(3512)K = \begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix}

Convert to numbers: H = 7$$E = 4$$L = 11$$P = 15.

Block 1: (74)\begin{pmatrix} 7 \\ 4 \end{pmatrix}Block 2: (1115)\begin{pmatrix} 11 \\ 15 \end{pmatrix}

Block 1: (3512)(74)=(21+207+8)=(4115)\begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} 7 \\ 4 \end{pmatrix} = \begin{pmatrix} 21 + 20 \\ 7 + 8 \end{pmatrix} = \begin{pmatrix} 41 \\ 15 \end{pmatrix}

Modulo 26: (1515)\begin{pmatrix} 15 \\ 15 \end{pmatrix}Which gives “PP”.

Block 2: (3512)(1115)=(33+7511+30)=(10841)\begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} 11 \\ 15 \end{pmatrix} = \begin{pmatrix} 33 + 75 \\ 11 + 30 \end{pmatrix} = \begin{pmatrix} 108 \\ 41 \end{pmatrix}

Modulo 26: 108 \bmod 26 = 4$$41 \bmod 26 = 15Giving (415)\begin{pmatrix} 4 \\ 15 \end{pmatrix} Which is “EP”.

Ciphertext: “PPEP”

Computer Graphics

Matrices are fundamental to 2D and 3D computer graphics. Every transformation of a geometric object (viewing, rotation, scaling, projection) is represented by matrix multiplication.

Homogeneous coordinates. To represent translations (which are not linear transformations) as Matrix multiplications, 2D points (x,y)(x, y) are extended to homogeneous coordinates (x,y,1)(x, y, 1). A Translation by (tx,ty)(t_x, t_y) is then:

T = \begin`\{pmatrix}` 1 & 0 & t_x \\ 0 & 1 & t_y \\ 0 & 0 & 1 \end`\{pmatrix}`

Rotation and scaling in homogeneous coordinates use 3×33 \times 3 matrices with the bottom row (0,0,1)(0, 0, 1).

Transformation pipeline. A typical graphics pipeline applies a sequence of transformations: Model transform (place object in world space), view transform (position camera), projection Transform (3D to 2D), and viewport transform (map to screen coordinates). Each stage is a matrix Multiplication.

Composition advantage. Instead of applying nn separate transformations to each of mm vertices, The transformations are composed into a single matrix M=TnT2T1M = T_n \cdots T_2 T_1And each vertex is Transformed with a single multiplication MvM\mathbf{v}. This reduces the cost from O(nm)O(nm) to O(n3+m)O(n^3 + m) matrix operations.

Markov Chains

A Markov chain is a stochastic process where the probability of transitioning to any future State depends only on the current state, not on the sequence of events that preceded it (the Markov Property).

Transition matrix. A transition matrix PP is a square matrix where:

  • pij0p_{ij} \geq 0 for all i,ji, j (entries are probabilities)
  • Each row sums to 11: jpij=1\sum_j p_{ij} = 1 for all ii

The entry pijp_{ij} represents the probability of moving from state ii to state jj in one step.

State evolution. If s(k)\mathbf{s}^{(k)} is the state probability vector at step kkThen:

s(k)=s(0)Pk\mathbf{s}^{(k)} = \mathbf{s}^{(0)} P^k

Steady state. A steady-state (stationary) vector s\mathbf{s} satisfies sP=s\mathbf{s}P = \mathbf{s}Or equivalently, s(PI)=0\mathbf{s}(P - I) = \mathbf{0}. This means s\mathbf{s} is a left eigenvector of PP with eigenvalue 11.

For a regular Markov chain (one where some power of PP has all positive entries), the steady-state Distribution exists, is unique, and is independent of the initial state. The eigenvalue 11 is Always the largest eigenvalue of a stochastic matrix (by the Perron-Frobenius theorem).

Examples

Expand

A weather model has two states: Sunny (S) and Rainy (R). If it is sunny today, the probability of Sun tomorrow is 0.70.7 and rain is 0.30.3. If it is rainy today, the probability of sun tomorrow is 0.40.4 and rain is 0.60.6.

Transition matrix:

P=(0.70.30.40.6)P = \begin{pmatrix} 0.7 & 0.3 \\ 0.4 & 0.6 \end{pmatrix}

Find the steady-state vector s=(sr)\mathbf{s} = \begin{pmatrix} s & r \end{pmatrix}:

sP=s\mathbf{s}P = \mathbf{s} gives 0.7s+0.4r=s0.7s + 0.4r = s and 0.3s+0.6r=r0.3s + 0.6r = r.

From the first equation: 0.3s+0.4r=0-0.3s + 0.4r = 0So 3s=4r3s = 4r.

Since s+r=1s + r = 1: s+34s=1s + \frac{3}{4}s = 1Giving s=47s = \frac{4}{7} and r=37r = \frac{3}{7}.

Steady state: s=(4737)\mathbf{s} = \begin{pmatrix} \frac{4}{7} & \frac{3}{7} \end{pmatrix}.

In the long run, the weather is sunny 4757.1%\frac{4}{7} \approx 57.1\% of the time.

Eigenvalue verification. The eigenvalues of PP are found from:

det(PλI)=(0.7λ)(0.6λ)0.12=λ21.3λ+0.3=0\det(P - \lambda I) = (0.7 - \lambda)(0.6 - \lambda) - 0.12 = \lambda^2 - 1.3\lambda + 0.3 = 0

(λ1)(λ0.3)=0(\lambda - 1)(\lambda - 0.3) = 0

\lambda_1 = 1$$\lambda_2 = 0.3. Since λ2<1|\lambda_2| \lt 1As kk \to \infty the term λ2k0\lambda_2^k \to 0 and the system converges to the eigenvector for λ1=1\lambda_1 = 1.

:::danger Common Pitfalls

  • Confusing matrix multiplication order: Matrix multiplication is NOT commutative: AB is generally not equal to BA. When applying a transformation matrix to a point, the ORDER matters. For combined transformations, the matrix closest to the point is applied FIRST: if transformation B follows transformation A, the combined matrix is BA (not AB).

  • Forgetting that the determinant of a singular matrix is zero: A singular matrix has determinant zero and NO inverse. If asked to find the inverse of a 2x2 matrix, always check that the determinant is non-zero first. A zero determinant means the transformation collapses space (maps the plane onto a line), which is why no inverse exists.

  • Misidentifying the type of transformation from its matrix: A reflection in the y-axis has matrix [[-1, 0], [0, 1]] (negative in top-left). A reflection in the x-axis has matrix [[1, 0], [0, -1]] (negative in bottom-right). Students frequently confuse these two. Also, a rotation of 90 degrees anticlockwise gives [[0, -1], [1, 0]], which students often mix up with the clockwise rotation.

  • Arithmetic errors when calculating determinants and inverses: For a 2x2 matrix [[a, b], [c, d]], the determinant is ad - bc (not ad + bc). The inverse is (1/det) * [[d, -b], [-c, a]] (note the swap of a and d and the negative signs). A single sign error invalidates the entire calculation. Always double-check by multiplying the matrix by its inverse to get the identity.

Orthogonal Matrices

A square matrix QQ is orthogonal if QTQ=QQT=IQ^T Q = Q Q^T = IWhich means Q1=QTQ^{-1} = Q^T.

Equivalent characterisations:

  • The columns of QQ form an orthonormal set (each column has unit length, and distinct columns are perpendicular).
  • The rows of QQ form an orthonormal set.
  • det(Q)=±1\det(Q) = \pm 1 (since det(QT)det(Q)=det(I)=1\det(Q^T)\det(Q) = \det(I) = 1 and det(QT)=det(Q)\det(Q^T) = \det(Q)).

Rotation matrices and reflection matrices in R2\mathbb{R}^2 are orthogonal:

  • Rotations have det=+1\det = +1 and are called proper orthogonal (special orthogonal).
  • Reflections have det=1\det = -1.

Preservation of the inner product. If QQ is orthogonal, then for any vectors u,v\mathbf{u}, \mathbf{v}:

(Qu)(Qv)=uv(Q\mathbf{u}) \cdot (Q\mathbf{v}) = \mathbf{u} \cdot \mathbf{v}

In particular, Qv=v|Q\mathbf{v}| = |\mathbf{v}| and the angle between vectors is preserved.

Orthogonal diagonalisation (spectral theorem). A real symmetric matrix AA can always be Orthogonally diagonalised: A=QDQTA = QDQ^T where QQ is orthogonal and DD is diagonal. This is a Stronger form of diagonalisation that is guaranteed for all symmetric matrices (even those with Repeated eigenvalues), since symmetric matrices always have nn linearly independent eigenvectors That can be chosen orthonormal.


Summary of Key Results

| Concept | Formula / Result | | :------------------------------ | :------------------------------------------------------------------------------------------ | ------- | --- | | 2×22 \times 2 determinant | det(abcd)=adbc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc | | | | 2×22 \times 2 inverse | A1=1det(A)(dbca)A^{-1} = \dfrac{1}{\det(A)}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix} | | | | 3×33 \times 3 inverse | A1=1det(A)adj(A)A^{-1} = \dfrac{1}{\det(A)}\mathrm{adj}(A) | | | | Characteristic equation (2x2) | λ2tr(A)λ+det(A)=0\lambda^2 - \mathrm{tr}(A)\lambda + \det(A) = 0 | | | | Diagonalisation | A=PDP1A = PDP^{-1}Where D=diag(λ1,,λn)D = \mathrm{diag}(\lambda_1, \ldots, \lambda_n) | | | | Matrix powers | Ak=PDkP1A^k = PD^kP^{-1} | | | | Area scale factor | det(M)| \det(M) | | | Rotation by θ\theta | (cosθsinθsinθcosθ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} | | | | Reflection in y=xtanθy = x\tan\theta | (cos2θsin2θsin2θcos2θ)\begin{pmatrix} \cos 2\theta & \sin 2\theta \\ \sin 2\theta & -\cos 2\theta \end{pmatrix} | | | | Cramer’s rule | xi=det(Ai)/det(A)x_i = \det(A_i)/\det(A) | | | | Steady state of Markov chain | \mathbf{s}P = \mathbf{s}$$\sum s_i = 1 | | |

Worked Example: Finding Eigenvalues and Eigenvectors

Find the eigenvalues and eigenvectors of A=(5335)A = \begin{pmatrix} 5 & 3 \\ 3 & 5 \end{pmatrix}.

Characteristic equation:

det(AλI)=(5λ)29=λ210λ+16=0\det(A - \lambda I) = (5 - \lambda)^2 - 9 = \lambda^2 - 10\lambda + 16 = 0

(λ2)(λ8)=0(\lambda - 2)(\lambda - 8) = 0

λ1=2\lambda_1 = 2, λ2=8\lambda_2 = 8.

Eigenvector for λ1=2\lambda_1 = 2:

(3333)(v1v2)=(00)    v1=v2\begin{pmatrix} 3 & 3 \\ 3 & 3 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix} \implies v_1 = -v_2

Eigenvector: (11)\begin{pmatrix} 1 \\ -1 \end{pmatrix} (or any scalar multiple).

Eigenvector for λ2=8\lambda_2 = 8:

(3333)(v1v2)=(00)    v1=v2\begin{pmatrix} -3 & 3 \\ 3 & -3 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix} \implies v_1 = v_2

Eigenvector: (11)\begin{pmatrix} 1 \\ 1 \end{pmatrix}.

The eigenvectors are perpendicular (as expected for a symmetric matrix).


Problem Set

Problem 1

Given A=(2143)A = \begin{pmatrix} 2 & -1 \\ 4 & 3 \end{pmatrix} and B=(1520)B = \begin{pmatrix} 1 & 5 \\ -2 & 0 \end{pmatrix}Find ABAB and BABA. Comment on whether AB=BAAB = BA.

Solution

AB=(2(1)+(1)(2)2(5)+(1)(0)4(1)+3(2)4(5)+3(0))=(410220)AB = \begin{pmatrix} 2(1) + (-1)(-2) & 2(5) + (-1)(0) \\ 4(1) + 3(-2) & 4(5) + 3(0) \end{pmatrix} = \begin{pmatrix} 4 & 10 \\ -2 & 20 \end{pmatrix}

BA=(1(2)+5(4)1(1)+5(3)2(2)+0(4)2(1)+0(3))=(221442)BA = \begin{pmatrix} 1(2) + 5(4) & 1(-1) + 5(3) \\ -2(2) + 0(4) & -2(-1) + 0(3) \end{pmatrix} = \begin{pmatrix} 22 & 14 \\ -4 & 2 \end{pmatrix}

ABBAAB \neq BAConfirming that matrix multiplication is not commutative.

If you get this wrong, revise: Matrix Multiplication properties.

Problem 2

Find the determinant and inverse of A=(5321)A = \begin{pmatrix} 5 & 3 \\ 2 & 1 \end{pmatrix}.

Solution

det(A)=5(1)3(2)=56=1\det(A) = 5(1) - 3(2) = 5 - 6 = -1

Since det(A)0\det(A) \neq 0The inverse exists:

A1=11(1325)=(1325)A^{-1} = \frac{1}{-1}\begin{pmatrix} 1 & -3 \\ -2 & 5 \end{pmatrix} = \begin{pmatrix} -1 & 3 \\ 2 & -5 \end{pmatrix}

Verification: AA1=(5321)(1325)=(5+615152+265)=(1001)AA^{-1} = \begin{pmatrix} 5 & 3 \\ 2 & 1 \end{pmatrix}\begin{pmatrix} -1 & 3 \\ 2 & -5 \end{pmatrix} = \begin{pmatrix} -5+6 & 15-15 \\ -2+2 & 6-5 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

If you get this wrong, revise: 2x2 Determinant and Inverse sections.

Problem 3

Find the determinant of A=(231012141)A = \begin{pmatrix} 2 & 3 & 1 \\ 0 & -1 & 2 \\ 1 & 4 & -1 \end{pmatrix}.

Solution

Expanding along row 2 (which contains a zero):

det(A)=0C21+(1)C22+2C23\det(A) = 0 \cdot C_{21} + (-1) \cdot C_{22} + 2 \cdot C_{23}

C22=(1)2+22111=21=3C_{22} = (-1)^{2+2}\begin{vmatrix} 2 & 1 \\ 1 & -1 \end{vmatrix} = -2 - 1 = -3

C23=(1)2+32314=(83)=5C_{23} = (-1)^{2+3}\begin{vmatrix} 2 & 3 \\ 1 & 4 \end{vmatrix} = -(8 - 3) = -5

det(A)=0+(1)(3)+2(5)=310=7\det(A) = 0 + (-1)(-3) + 2(-5) = 3 - 10 = -7

If you get this wrong, revise: 3x3 Determinant — Cofactor Expansion.

Problem 4

Find the matrix representing an anticlockwise rotation by 6060^\circ about the origin, and use it to Find the image of the point (1,3)(1, \sqrt{3}).

Solution

R60=(cos60sin60sin60cos60)=(12323212)R_{60} = \begin{pmatrix} \cos 60^\circ & -\sin 60^\circ \\ \sin 60^\circ & \cos 60^\circ \end{pmatrix} = \begin{pmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}

(12323212)(13)=(123232+32)=(13)\begin{pmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}\begin{pmatrix} 1 \\ \sqrt{3} \end{pmatrix} = \begin{pmatrix} \frac{1}{2} - \frac{3}{2} \\ \frac{\sqrt{3}}{2} + \frac{\sqrt{3}}{2} \end{pmatrix} = \begin{pmatrix} -1 \\ \sqrt{3} \end{pmatrix}

The image is (1,3)(-1, \sqrt{3}).

If you get this wrong, revise: Rotations section.

Problem 5

A reflection in the yy-axis is followed by an enlargement with scale factor 33 about the origin. Find the single matrix that represents this composite transformation. What is the area scale factor?

Solution

Reflection in the yy-axis: Ry=(1001)R_y = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}

Enlargement with scale factor 33: E3=(3003)E_3 = \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}

Composite (enlargement applied after reflection):

M=E3Ry=(3003)(1001)=(3003)M = E_3 \cdot R_y = \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} -3 & 0 \\ 0 & 3 \end{pmatrix}

Area scale factor: det(M)=3×30=9|\det(M)| = |-3 \times 3 - 0| = 9.

If you get this wrong, revise: Composite Transformations and Area Scale Factor.

Problem 6

Solve the system of equations using matrices:

3x+2yz=53x + 2y - z = 5 xy+2z=1x - y + 2z = 1 2x+y+z=42x + y + z = 4

Solution

Coefficient matrix: A=(321112211)A = \begin{pmatrix} 3 & 2 & -1 \\ 1 & -1 & 2 \\ 2 & 1 & 1 \end{pmatrix}

Constants: b=(514)\mathbf{b} = \begin{pmatrix} 5 \\ 1 \\ 4 \end{pmatrix}

det(A)=3(12)2(14)+(1)(1+2)=9+63=6\det(A) = 3(-1 - 2) - 2(1 - 4) + (-1)(1 + 2) = -9 + 6 - 3 = -6

By Cramer’s rule:

x=det(521112411)6=5(12)2(18)+(1)(1+4)6=15+1456=66=1x = \frac{\det\begin{pmatrix} 5 & 2 & -1 \\ 1 & -1 & 2 \\ 4 & 1 & 1 \end{pmatrix}}{-6} = \frac{5(-1-2) - 2(1-8) + (-1)(1+4)}{-6} = \frac{-15+14-5}{-6} = \frac{-6}{-6} = 1

y=det(351112241)6=3(18)5(14)+(1)(42)6=21+1526=86=43y = \frac{\det\begin{pmatrix} 3 & 5 & -1 \\ 1 & 1 & 2 \\ 2 & 4 & 1 \end{pmatrix}}{-6} = \frac{3(1-8) - 5(1-4) + (-1)(4-2)}{-6} = \frac{-21+15-2}{-6} = \frac{-8}{-6} = \frac{4}{3}

z=det(325111214)6=3(41)2(42)+5(1+2)6=154+156=46=23z = \frac{\det\begin{pmatrix} 3 & 2 & 5 \\ 1 & -1 & 1 \\ 2 & 1 & 4 \end{pmatrix}}{-6} = \frac{3(-4-1) - 2(4-2) + 5(1+2)}{-6} = \frac{-15-4+15}{-6} = \frac{-4}{-6} = \frac{2}{3}

Solution: x = 1$$y = \frac{4}{3}$$z = \frac{2}{3}.

If you get this wrong, revise: Cramer’s Rule section.

Problem 7

Find the eigenvalues and eigenvectors of A=(3210)A = \begin{pmatrix} 3 & -2 \\ 1 & 0 \end{pmatrix}.

Solution

Characteristic equation:

det(AλI)=(3λ)(λ)(2)(1)=λ23λ+2=0\det(A - \lambda I) = (3 - \lambda)(-\lambda) - (-2)(1) = \lambda^2 - 3\lambda + 2 = 0

(λ1)(λ2)=0(\lambda - 1)(\lambda - 2) = 0

λ1=1\lambda_1 = 1, λ2=2\lambda_2 = 2.

Eigenvector for λ1=1\lambda_1 = 1:

(2211)(v1v2)=(00)    v1=v2\begin{pmatrix} 2 & -2 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix} \implies v_1 = v_2

Eigenvector: (11)\begin{pmatrix} 1 \\ 1 \end{pmatrix}.

Eigenvector for λ2=2\lambda_2 = 2:

(1212)(v1v2)=(00)    v1=2v2\begin{pmatrix} 1 & -2 \\ 1 & -2 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix} \implies v_1 = 2v_2

Eigenvector: (21)\begin{pmatrix} 2 \\ 1 \end{pmatrix}.

If you get this wrong, revise: Eigenvalues and Eigenvectors section.

Problem 8

A stretch parallel to the xx-axis with scale factor 22 is followed by a stretch parallel to the yy-axis with scale factor 33. Find the single matrix and describe its effect on the unit square.

Solution

M=(1003)(2001)=(2003)M = \begin{pmatrix} 1 & 0 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}

The unit square (area = 1) is mapped to a rectangle with vertices (0,0)(0,0), (2,0)(2,0), (2,3)(2,3), (0,3)(0,3). The new area is 66.

Area scale factor: det(M)=6|\det(M)| = 6.

If you get this wrong, revise: Enlargements and Stretches section.

Problem 9

Find the invariant points and invariant lines of the transformation represented by M=(2102)M = \begin{pmatrix} 2 & 1 \\ 0 & 2 \end{pmatrix}.

Solution

Invariant points: Solve (MI)x=0(M - I)\mathbf{x} = \mathbf{0}:

(1101)(xy)=(00)\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

From row 2: y=0y = 0. From row 1: x+0=0x + 0 = 0So x=0x = 0.

The only invariant point is the origin (0,0)(0, 0).

Invariant lines: For an invariant line through the origin, the direction vector must be an Eigenvector. Eigenvalues satisfy (2λ)2=0(2-\lambda)^2 = 0So λ=2\lambda = 2 (repeated).

For λ=2\lambda = 2: (0100)(v1v2)=(00)\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}Giving v2=0v_2 = 0. The only eigenvector direction is (10)\begin{pmatrix} 1 \\ 0 \end{pmatrix}.

The xx-axis (y=0y = 0) is the only invariant line through the origin.

If you get this wrong, revise: Invariant Points and Lines section.

Problem 10

The transition matrix for a two-state Markov chain is P=(0.60.30.40.7)P = \begin{pmatrix} 0.6 & 0.3 \\ 0.4 & 0.7 \end{pmatrix}. Find the steady-state distribution.

Solution

Solve sP=s\mathbf{s}P = \mathbf{s} where s=(s1s2)\mathbf{s} = \begin{pmatrix} s_1 & s_2 \end{pmatrix} with s1+s2=1s_1 + s_2 = 1.

From sP=s\mathbf{s}P = \mathbf{s}:

0.6s1+0.4s2=s1    0.4s1+0.4s2=0    s1=s20.6s_1 + 0.4s_2 = s_1 \implies -0.4s_1 + 0.4s_2 = 0 \implies s_1 = s_2

With s1+s2=1s_1 + s_2 = 1: s1=0.5s_1 = 0.5, s2=0.5s_2 = 0.5.

Steady state: (0.50.5)\begin{pmatrix} 0.5 & 0.5 \end{pmatrix}.

If you get this wrong, revise: Markov Chains section.

Problem 11

Encrypt the word “CAT” using the Hill cipher with key matrix K=(2111)K = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}Padding with “X” if needed.

Solution

C = 2, A = 0, T = 19. Pad to make even length: “CATX” where X = 23.

Block 1: (20)\begin{pmatrix} 2 \\ 0 \end{pmatrix}Block 2: (1923)\begin{pmatrix} 19 \\ 23 \end{pmatrix}

Block 1:

(2111)(20)=(42)(42)(mod26)\begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} 2 \\ 0 \end{pmatrix} = \begin{pmatrix} 4 \\ 2 \end{pmatrix} \equiv \begin{pmatrix} 4 \\ 2 \end{pmatrix} \pmod{26}

Giving “EC”.

Block 2:

(2111)(1923)=(6142)(916)(mod26)\begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} 19 \\ 23 \end{pmatrix} = \begin{pmatrix} 61 \\ 42 \end{pmatrix} \equiv \begin{pmatrix} 9 \\ 16 \end{pmatrix} \pmod{26}

61mod26=961 \bmod 26 = 9 (J), 42mod26=1642 \bmod 26 = 16 (Q). Giving “JQ”.

Ciphertext: “ECJQ”.

If you get this wrong, revise: Hill Cipher section.

Problem 12

Diagonalise the matrix A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} and use the diagonalisation To find A4A^4.

Solution

Eigenvalues:

det(AλI)=(2λ)21=λ24λ+3=0\det(A - \lambda I) = (2-\lambda)^2 - 1 = \lambda^2 - 4\lambda + 3 = 0

(λ1)(λ3)=0    λ1=1,λ2=3(\lambda - 1)(\lambda - 3) = 0 \implies \lambda_1 = 1, \lambda_2 = 3

Eigenvectors:

λ1=1\lambda_1 = 1: (1111)(v1v2)=0    v1=v2\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \mathbf{0} \implies v_1 = -v_2So v1=(11)\mathbf{v}_1 = \begin{pmatrix} 1 \\ -1 \end{pmatrix}.

λ2=3\lambda_2 = 3: (1111)(v1v2)=0    v1=v2\begin{pmatrix} -1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \mathbf{0} \implies v_1 = v_2So v2=(11)\mathbf{v}_2 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}.

Diagonalisation:

P=(1111),D=(1003)P = \begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}, \quad D = \begin{pmatrix} 1 & 0 \\ 0 & 3 \end{pmatrix}

det(P)=2,P1=12(1111)\det(P) = 2, \quad P^{-1} = \frac{1}{2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}

Compute A4A^4:

D4=(10081)D^4 = \begin{pmatrix} 1 & 0 \\ 0 & 81 \end{pmatrix}

A4=PD4P1=(1111)(10081)12(1111)A^4 = PD^4 P^{-1} = \begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & 81 \end{pmatrix}\frac{1}{2}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}

=12(181181)(1111)=12(82808082)=(41404041)= \frac{1}{2}\begin{pmatrix} 1 & 81 \\ -1 & 81 \end{pmatrix}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix} = \frac{1}{2}\begin{pmatrix} 82 & 80 \\ 80 & 82 \end{pmatrix} = \begin{pmatrix} 41 & 40 \\ 40 & 41 \end{pmatrix}

If you get this wrong, revise: Diagonalisation and Matrix Powers sections.

Common Pitfalls

  1. Misreading the question, particularly with ‘hence’ vs ‘hence or otherwise’ — the former requires using previous work.

  2. Confusing sin(2x)\sin(2x) with 2sin(x)2\sin(x) — double-angle formulas are not the same as scalar multiplication.

Summary

  • Matrix multiplication is not commutative (ABBAAB \neq BA)
  • detA=0\det A = 0 means AA is singular (no inverse)
  • 2×22 \times 2 inverse: 1adbc(dbca)\frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
  • Transformations represented by matrices: rotation, reflection, enlargement

Cross-References

TopicSiteLink
[Matrices]A-LevelView
[Matrices]IBView

Worked Examples

Worked examples demonstrating the application of key concepts are covered in the detailed sub-pages linked above.