5 Matrices

Syllabus
2016
Topic
5
Level

Learning objectives

Organise data in a matrix

A matrix is a rectangular array whose rows and columns give positions to data. Its order is rows by columns.

A=\begin{pmatrix}12&15&9\8&11&14\end{pmatrix}\quad\text{has order }2\times3

State what each row and column represents before interpreting an entry. Here, for example, rows might be two shops and columns three products.

The order 2imes32 imes3 means two rows and three columns, not the reverse. Entries in different positions need not represent the same quantity.

Add matrices and multiply row by column

Operation Condition Result order
A+BA+B same order same order
ABAB columns of AA = rows of BB rows of AA by columns of BB

\begin{pmatrix}1&-2\3&4\end{pmatrix}+\begin{pmatrix}5&1\-3&2\end{pmatrix}=\begin{pmatrix}6&-1\0&6\end{pmatrix}

\begin{pmatrix}1&2\3&4\end{pmatrix}\begin{pmatrix}5\-1\end{pmatrix}=\begin{pmatrix}1(5)+2(-1)\3(5)+4(-1)\end{pmatrix}=\begin{pmatrix}3\11\end{pmatrix}

Matrix multiplication is not entry-by-entry and is generally not commutative: ABAB and BABA may differ or one may be undefined.

Multiply every matrix entry by a scalar

A scalar is an ordinary number. Scalar multiplication multiplies every entry of the matrix and leaves its order unchanged.

-3\begin{pmatrix}2&-1\0&4\end{pmatrix}=\begin{pmatrix}-6&3\0&-12\end{pmatrix}

3A-2B\quad\text{means calculate }3A\text{ and }2B\text{ entry by entry, then subtract corresponding entries}

The scalar applies to every entry, including zeros and negative entries. Do not multiply only a row, column or diagonal unless explicitly stated.

Use identity and zero matrices

I_2=\begin{pmatrix}1&0\0&1\end{pmatrix},\quad O_{2\times2}=\begin{pmatrix}0&0\0&0\end{pmatrix}

Matrix Addition role Multiplication role
zero matrix A+O=AA+O=A compatible products give a zero matrix
identity matrix not an additive identity AI=IA=AAI=IA=A when orders fit

For order 3imes33 imes3, the identity has ones on the main diagonal and zeros elsewhere. A zero matrix may be rectangular.

The identity matrix is not a matrix filled with ones. Always use an identity matrix of compatible order.

Find a 2 by 2 determinant and inverse

A=\begin{pmatrix}a&b\c&d\end{pmatrix}\quad\Rightarrow\quad\det A=ad-bc

A^{-1}=\frac1{ad-bc}\begin{pmatrix}d&-b\-c&a\end{pmatrix}\qquad(ad-bc\ne0)

\begin{pmatrix}4&-2\8&6\end{pmatrix}^{-1}=\frac1{40}\begin{pmatrix}6&2\-8&4\end{pmatrix}

Swap the two main-diagonal entries and change the signs of the off-diagonal entries. The reciprocal belongs to the determinant, not to each original entry; singular-matrix theory is outside this syllabus.

Transform the plane with a 2 by 2 matrix

\begin{pmatrix}a&b\c&d\end{pmatrix}\begin{pmatrix}x\y\end{pmatrix}=\begin{pmatrix}ax+by\cx+dy\end{pmatrix}

Transformation Matrix
reflect in x=0x=0 (1001)\begin{pmatrix}-1&0\\0&1\end{pmatrix}
reflect in y=0y=0 (1001)\begin{pmatrix}1&0\\0&-1\end{pmatrix}
reflect in y=xy=x (0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}
rotate 9090^\circ anticlockwise (0110)\begin{pmatrix}0&-1\\1&0\end{pmatrix}
enlarge by factor kk (k00k)\begin{pmatrix}k&0\\0&k\end{pmatrix}

Transform every vertex as a column vector, plot the image coordinates and join them in the original order. These transformations keep the origin fixed.

Translations cannot be represented by a 2imes22 imes2 matrix. Keep the coordinate vector ordered as (x,y)T(x,y)^T.

Order matrices for combined transformations

If transformation BB happens first and transformation AA happens second, the combined matrix is ABAB. The matrix nearest the point vector acts first.

\mathbf x\xmapsto{B}B\mathbf x\xmapsto{A}A(B\mathbf x)=(AB)\mathbf x

A=\begin{pmatrix}0&-1\1&0\end{pmatrix},\ B=\begin{pmatrix}-1&0\0&1\end{pmatrix}\Rightarrow AB=\begin{pmatrix}0&-1\-1&0\end{pmatrix}

Do not multiply matrices in the chronological left-to-right order. Because ABBAAB\ne BA in general, reversing the product usually gives a different transformation.