Matrices
A matrix is a rectangular array of elements (real or complex numbers)
arranged in rows and columns. The array is enclosed within brackets.
\[
\left[
\begin{matrix}
2 & 1 \\
4 & 5 \\
8 & 9 \\
1 & 2
\end{matrix}
\right]
\]
\[
\text{box brackets}
\]
\[
\left(
\begin{matrix}
2 & 1 \\
4 & 5 \\
8 & 9 \\
1 & 2
\end{matrix}
\right)
\]
\[
\text{parentheses}
\]
A matrix with m rows and n columns is called an
m × n matrix.
This is also called its order.
If \(m = n\), the matrix is square.
If \(m = 1\), it is a row matrix (row vector).
If \(n = 1\), it is a column matrix (column vector).
Examples
\[
\left(
\begin{matrix}
1 & 5 & 8
\end{matrix}
\right)
\]
\[
\text{1 × 3 row matrix}
\]
\[
\text{or row vector}
\]
\[
\left(
\begin{matrix}
1 \\
2 \\
4
\end{matrix}
\right)
\]
\[
\text{3 × 1 column matrix}
\]
\[
\text{or column vector}
\]
\[
\left(
\begin{matrix}
2 & 3 \\
2 & 31 \\
15 & 8 \\
1 & \sqrt{48}
\end{matrix}
\right)
\]
\[
\text{4 × 2 matrix}
\]
\[
\left(
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right)
\]
\[
\text{3 × 3 square matrix}
\]
Each element in a matrix is addressed by its row and column as
double suffixes.
\(a_{ij}\) denotes the element in the \(i\)-th row and \(j\)-th column.
\[
\left(
\begin{matrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\
a_{31} & a_{32} & a_{33} & \cdots & a_{3n} \\
\vdots & \vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & a_{m3} & \cdots & a_{mn}
\end{matrix}
\right)
\]
\[
a_{23} = \text{ the element in the second row and third column}
\]
\[
a_{mn}
= \text{ the element in the } m^{\text{th}} \text{ row and } n^{\text{th}} \text{ column}
\]
Example
\[
\left(
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right)
\]
\(a_{13} = 3\),
\(a_{21} = 4\),
\(a_{34}\) does not exist.
An \(m \times n\) matrix is often denoted by a bold capital letter.
It may also be written using its general element.
\[
\left(
\begin{matrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{matrix}
\right)
\]
Can be denoted as A,
\(
\underset{\tilde{}}{A}
\),
\((a_{ij})\) or simply \((a)\).
A row or column matrix is often denoted by a bold lowercase letter.
\[
\left(
\begin{matrix}
y_{1} & y_{2} & y_{3}
\end{matrix}
\right)
\]
Can be written as y,
\(
\underset{\tilde{}}{y}
\) ,
\((y_j)\) or \((y)\).
Two matrices are equal only if they are of the same order
and contain corresponding elements.
Examples
\[
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right]
=
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right]
\]
\[
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right]
\;\neq\;
\left[
\begin{matrix}
1 & 4 & 0.8 \\
2 & 5 & 12 \\
3 & 6 & 3i
\end{matrix}
\right]
\]
Matrix Addition & Subtraction
Only matrices of the same order can be added or subtracted.
Each element is combined with its corresponding element.
Matrix addition is commutative.
\[
\mathbf{A} + \mathbf{B} = \mathbf{B} + \mathbf{A}
\]
Example
\[
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3
\end{matrix}
\right]
+
\left[
\begin{matrix}
7 & 21 & 3 \\
5 & 2 & 1 \\
0 & 1 & 4
\end{matrix}
\right]
=
\left[
\begin{matrix}
1+7 & 2+21 & 3+3 \\
4+5 & 5+2 & 6+1 \\
0.8+0 & 12+1 & 3+4
\end{matrix}
\right]
\]
\[
\qquad\qquad\qquad\qquad\qquad
=
\left[
\begin{matrix}
8 & 23 & 6 \\
9 & 7 & 7 \\
0.8 & 13 & 7
\end{matrix}
\right]
\]
Example
\[
\left[
\begin{matrix}
7 & 1 \\
2 & 3
\end{matrix}
\right]
-
\left[
\begin{matrix}
4 & 2 \\
3 & 1
\end{matrix}
\right]
=
\left[
\begin{matrix}
7-4 & 1-2 \\
2-3 & 3-1
\end{matrix}
\right]
\]
\[
\qquad\qquad\qquad
=
\left[
\begin{matrix}
3 & -1 \\
-1 & 2
\end{matrix}
\right]
\]
Example
\[
\left[
\begin{matrix}
5 & 6 \\
4 & 5 \\
7 & 8
\end{matrix}
\right]
-
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{matrix}
\right]
=
\text{Meaningless}
\]
Scalar Matrix Multiplication
To multiply a matrix by a scalar, multiply each element by the scalar.
Example
\[
7 \times
\left[
\begin{matrix}
7 & 1 \\
2 & 3
\end{matrix}
\right]
=
\left[
\begin{matrix}
7\times 7 & 1\times 7 \\
2\times 7 & 3\times 7
\end{matrix}
\right]
\]
\[
\qquad\qquad
=
\left[
\begin{matrix}
49 & 7 \\
14 & 21
\end{matrix}
\right]
\]
Matrix multiplication is only possible if the number of columns
in the first matrix equals the number of rows in the second.
If A is an \(m \times n\) matrix and B is an \(n \times p\) matrix,
then the product A·B is defined.
If A is an m x n matrix and B is a n x p matrix
then
the product A.B is possible since m x n n x p
but B.A is not possible, since n x p m x n
Let B be an m x n matrix and A be an n x p matrix.
\[
\mathbf{A} =
\left[
\begin{matrix}
a_{11} & \cdots & a_{1p} \\
\vdots & & \vdots \\
a_{n1} & \cdots & a_{np}
\end{matrix}
\right]
\]
\[
\mathbf{B} =
\left[
\begin{matrix}
b_{11} & \cdots & b_{1n} \\
\vdots & & \vdots \\
b_{m1} & \cdots & b_{mn}
\end{matrix}
\right]
\]
B·A is possible,
A·B is not possible.
Let the product \(BA = C\).
\[
\mathbf{B}\mathbf{A} = \mathbf{C} =
\left[
\begin{matrix}
c_{11} & \cdots & c_{1p} \\
\vdots & & \vdots \\
c_{m1} & \cdots & c_{mp}
\end{matrix}
\right]
\]
C is defined as:
\[
c_{ij}
=
\sum_{k=1}^{n}
b_{ik}\, a_{kj}
\qquad
i = 1,2,\ldots,m
\qquad
j = 1,2,\ldots,p
\]
\[
c_{ij}
=
b_{i1}a_{1j}
\;+\;
b_{i2}a_{2j}
\;+\;
b_{i3}a_{3j}
\;+\;\ldots+\;
b_{in}a_{nj}
\]
Matrix multiplication can be described as taking the
scalar product of each row of the first matrix with each column of the second.
Example
Let:
\[
\mathbf{B} =
\left[
\begin{matrix}
3 & 2 & 4 \\
5 & 6 & 2 \\
7 & 2 & 7
\end{matrix}
\right]
\]
\[
\mathbf{A} =
\left[
\begin{matrix}
5 & 1 \\
2 & 6 \\
3 & 4
\end{matrix}
\right]
\]
B is \(3 \times 3\), A is \(3 \times 2\).
So B·A is possible.
A·B is not possible, so multiplication here is not commutative.
\[
\mathbf{A}\mathbf{B} \;\neq\; \mathbf{B}\mathbf{A}
\]
\[
\mathbf{B}\mathbf{A} = \mathbf{C} =
\left[
\begin{matrix}
3\times5 + 2\times2 + 4\times3
&
3\times1 + 2\times6 + 4\times4
\\[6pt]
5\times5 + 6\times2 + 2\times3
&
5\times1 + 6\times6 + 2\times4
\\[6pt]
7\times5 + 2\times2 + 7\times3
&
7\times1 + 2\times6 + 7\times4
\end{matrix}
\right]
\]
\[
\qquad\qquad
=
\left[
\begin{matrix}
31 & 31 \\
43 & 49 \\
60 & 47
\end{matrix}
\right]
\]
The product of an \(m \times n\) matrix with an \(n \times p\) matrix
is an \(m \times p\) matrix.
In the product B.A
A is pre-multiplied by B
B is post-multiplied by A
Matrix multiplication is associative:
\[
(\mathbf{A}\mathbf{B})\,\mathbf{C}
\;=\;
\mathbf{A}(\mathbf{B}\mathbf{C})
\]
and distributive:
\[
\mathbf{A}(\mathbf{B} + \mathbf{C})
\;=\;
\mathbf{A}\mathbf{B} + \mathbf{A}\mathbf{C}
\]
The transpose of a matrix A is written \(A'\) or \(A^T\).
It is found by interchanging rows and columns:
\(a'_{ij} = a_{ji}\).
Examples
\[
\mathbf{D} =
\left[
\begin{matrix}
1 & 2 \\
3 & 4
\end{matrix}
\right]
\qquad
\mathbf{D}^{T} =
\left[
\begin{matrix}
1 & 3 \\
2 & 4
\end{matrix}
\right]
\]
\[
\mathbf{A} =
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
0.8 & 12 & 3i
\end{matrix}
\right]
\qquad
\mathbf{A}^{T} =
\left[
\begin{matrix}
1 & 4 & 0.8 \\
2 & 5 & 12 \\
3 & 6 & 3i
\end{matrix}
\right]
\]
Notice that the leading diagonal remains the same:
and that the other entries have been flipped.
Note:
\[
\bigl(\mathbf{A}^{T}\bigr)^{T} = \mathbf{A}
\]
\[
(\mathbf{A} + \mathbf{B})^{T}
=
\mathbf{A}^{T} + \mathbf{B}^{T}
\]
\[
(\mathbf{A}\mathbf{B})^{T}
=
\mathbf{B}^{T}\mathbf{A}^{T}
\]
A square matrix is symmetric if
\(a_{ij} = a_{ji}\).
Example
\[
\mathbf{A} =
\left[
\begin{matrix}
1 & 2 & 3 \\
2 & 5 & 6 \\
3 & 6 & 3i
\end{matrix}
\right]
\qquad
\mathbf{A}^{T} =
\left[
\begin{matrix}
1 & 2 & 3 \\
2 & 5 & 6 \\
3 & 6 & 3i
\end{matrix}
\right]
\]
A symmetric matrix satisfies \(A^T = A\).
A square matrix is skew‑symmetric if
\(A^T = -A\).
\[
\mathbf{A} =
\left[
\begin{matrix}
0 & -2 & 3 \\
2 & 0 & 6 \\
-3 & -6 & 0
\end{matrix}
\right]
\qquad
\mathbf{A}^{T} =
\left[
\begin{matrix}
0 & 2 & -3 \\
-2 & 0 & -6 \\
3 & 6 & 0
\end{matrix}
\right]
\]
Notice that the leading diagonal is zero.
A Diagonal matrix has all non‑leading diagonal
elements equal to zero.
\[
\mathbf{A} =
\left[
\begin{matrix}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 0 & 3
\end{matrix}
\right]
\]
The Identity matrix has ones on the leading diagonal
and is denoted by I.
\[
\mathbf{I} =
\left[
\begin{matrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{matrix}
\right]
\]
\[
\mathbf{A}\mathbf{I} = \mathbf{A}
\]
The Null matrix contains only zeroes
and is denoted by 0.
\[
\mathbf{0} =
\left[
\begin{matrix}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0
\end{matrix}
\right]
\]
Important:
\(A·B = 0\) does not imply that A or B is zero.
Example
Example:
\[
\left[
\begin{matrix}
1 & 1 & 2 \\
2 & 2 & 4 \\
4 & 4 & 8
\end{matrix}
\right]
\;
\left[
\begin{matrix}
1 & 2 & 4 \\
3 & 6 & 12 \\
-2 & -4 & -8
\end{matrix}
\right]
\;=\;
\left[
\begin{matrix}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0
\end{matrix}
\right]
\;=\;
\mathbf{0}
\]
Linear transformations map \((x, y)\) to \((x', y')\).
\[
\mathbf{T} :
\begin{bmatrix}
x \\[4pt]
y
\end{bmatrix}
\;\longrightarrow\;
\begin{bmatrix}
x' \\[4pt]
y'
\end{bmatrix}
\]
\[
\begin{bmatrix}
x' \\[4pt]
y'
\end{bmatrix}
=
\mathbf{A}
\begin{bmatrix}
x \\[4pt]
y
\end{bmatrix}
\]
The matrix A is called the transformation matrix of T.
The transformation
\(x' = ax + by,\; y' = cx + dy\)
can be written:
\[
\begin{bmatrix}
x' \\[4pt]
y'
\end{bmatrix}
=
\begin{bmatrix}
ax + by \\[4pt]
cx + dy
\end{bmatrix}
\]
\[
=\;
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\begin{bmatrix}
x \\[4pt]
y
\end{bmatrix}
\]
\[
=\;
\mathbf{A}
\begin{bmatrix}
x \\[4pt]
y
\end{bmatrix}
\]
\[
\text{where}\quad
\mathbf{A} =
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\]
Example
Find the images of A(1,2), B(3,4), C(5,6)
under the transformation:
\[
\left[
\begin{matrix}
1 & 2 \\
3 & 4
\end{matrix}
\right]
\]
\[
\begin{bmatrix}
x' \\[4pt]
y'
\end{bmatrix}
=
\begin{bmatrix}
1 & 2 \\
3 & 4
\end{bmatrix}
\begin{bmatrix}
1 & 3 & 5 \\
2 & 4 & 6
\end{bmatrix}
\]
\[
=\;
\begin{bmatrix}
5 & 11 & 17 \\
11 & 25 & 39
\end{bmatrix}
\]
\[
A'(5,11)\qquad
B'(11,25)\qquad
C'(17,39)
\]
Reflection in the x‑axis:
\[
\mathbf{A} =
\begin{bmatrix}
1 & 0 \\
0 & -1
\end{bmatrix}
\]
Reflection in the y‑axis:
\[
\mathbf{A} =
\begin{bmatrix}
-1 & 0 \\
0 & 1
\end{bmatrix}
\]
Reflection in the line \(y = x\):
\[
\mathbf{A} =
\begin{bmatrix}
0 & 1 \\
1 & 0
\end{bmatrix}
\]
Reflection in the line \(y = -x\):
\[
\mathbf{A} =
\begin{bmatrix}
0 & -1 \\
-1 & 0
\end{bmatrix}
\]
Rotation \(90^\circ\) anticlockwise about the origin:
\[
\mathbf{A} =
\begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}
\]
Rotation \(180^\circ\) about the origin:
\[
\mathbf{A} =
\begin{bmatrix}
-1 & 0 \\
0 & -1
\end{bmatrix}
\]
Rotation \(90^\circ\) clockwise about the origin:
\[
\mathbf{A} =
\begin{bmatrix}
0 & 1 \\
-1 & 0
\end{bmatrix}
\]
Rotation \(\theta\) anticlockwise about the origin:
\[
\mathbf{A} =
\begin{bmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{bmatrix}
\]
\(x' = x\cos\theta - y\sin\theta,\quad
y' = x\sin\theta + y\cos\theta\)
Enlargement with Scale Factor
\[
\mathbf{A} =
\begin{bmatrix}
\lambda & 0 \\
0 & \mu
\end{bmatrix}
\]
\[
\lambda = \text{ scaling in the } x \text{ direction}
\]
\[
\mu = \text{ scaling in the } y \text{ direction}
\]
Example: scale factor 2
\[
\mathbf{A} =
\begin{bmatrix}
2 & 0 \\
0 & 2
\end{bmatrix}
\]
Example: scale factor 1/2
\[
\mathbf{A} =
\begin{bmatrix}
\frac{1}{2} & 0 \\
0 & \frac{1}{2}
\end{bmatrix}
\]
To undo the effects of a transformation,
premultiply the image vector by the inverse of the
transformation matrix.
If the inverse of the transformation matrix equals its transpose,
then the transformation matrix is orthogonal.
If a point is transformed to its own image,
it is called invariant.