5 Matrices
- Syllabus
- 2016
- Topic
- 5
- Level
- —
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 2imes3 means two rows and three columns, not the reverse. Entries in different positions need not represent the same quantity.
| Operation | Condition | Result order |
|---|---|---|
| A+B | same order | same order |
| AB | columns of A = rows of B | rows of A by columns of B |
\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: AB and BA may differ or one may be undefined.
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.
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=A | compatible products give a zero matrix |
| identity matrix | not an additive identity | AI=IA=A when orders fit |
For order 3imes3, 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.
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.
\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=0 | (−1001) |
| reflect in y=0 | (100−1) |
| reflect in y=x | (0110) |
| rotate 90∘ anticlockwise | (01−10) |
| enlarge by factor k | (k00k) |
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 2imes2 matrix. Keep the coordinate vector ordered as (x,y)T.
If transformation B happens first and transformation A happens second, the combined matrix is AB. 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 AB=BA in general, reversing the product usually gives a different transformation.