1.2. Arithmetic operations on matrices#

So far, we have given a fancy name to a rectangular array of objects and showed how we can index its elements. Now we are going to fully develop an algebra for matrices. A system, where there are operations of addition and multiplication and necessarily rules that accompany them. This system resembles that of real numbers but we will see some differences and new concepts. For simplicity, we are going to assume that the entries of our matrices are numbers, however the developed theory applies to a broader range of objects.

1.2.1. Matrix equality#

Definition 1.2 (Matrix equality)

We say that an \(m \times n\) matrix \(A\) and an \(p \times q\) matrix \(B\) are equal and write \(A = B\) if and only if both of the following conditions are satisfied:

  • they have the same dimensions, i.e., \(m = p\) and \(n = q\)

  • for all \(1 \leq i \leq m\) and \(1 \leq j \leq n\), \(a_{ij} = b_{ij}\)

For example, consider the following matrices

\[\begin{split} \begin{align*} A &= \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, & B &= \begin{pmatrix} 1 & 2 & 5 \\ 3 & 4 & 6 \end{pmatrix}, & C &= \begin{pmatrix} 3^0 & \sqrt{4} \\ 1 + 2 & 2^2 \end{pmatrix}. \end{align*} \end{split}\]

Here \(A \neq B\) since \(A\) has 2 columns and \(B\) has 3 columns. However, \(A=C\) because both \(A\) and \(C\) have the same number of rows and columns and all of the corresponding elements are equal.

1.2.2. Matrix addition#

Definition 1.3 (Matrix addition and subtraction)

Let \(A\) and \(B\) be two \(m \times n\) matrices. The addition or subtraction of two \(m \times n\) matrices \(A\) and \(B\) is an \(m \times n\) matrix \(A \pm B\) defined by:

(1.1)#\[ [A \pm B]_{ij} = a_{ij} \pm b_{ij}, \]

where \(1 \leq i \leq m\) and \(1 \leq j \leq n\). For example, the addition or subtraction of two \(2 \times 2\) matrices is

\[\begin{split} \begin{align*} \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix} \pm \begin{pmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{pmatrix} = \begin{pmatrix} a_{11} \pm b_{11} & a_{12} \pm b_{12} \\ a_{21} \pm b_{21} & a_{22} \pm b_{22} \end{pmatrix}. \end{align*} \end{split}\]

The addition and subtraction of two matrices of different sizes is not defined.

Theorem 1.1 (Properties of matrix addition)

For all \(m \times n\) matrices \(A,B\) and \(C\), the following conditions are satisfied:

  • matrix addition is commutative, i.e., \(A + B = B + A\);

  • matrix addition is associative, i.e., \(A + (B + C) = (A + B) + C\).

Example 1.3

Evaluate the following:

(i)   \(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}\);

Solution
\[\begin{split} \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{pmatrix}= \begin{pmatrix}6 & 8 \\ 10 & 12 \end{pmatrix} \end{split}\]

(ii)   \(\begin{pmatrix} 2 \\ 3 \\ 5 \end{pmatrix} - \begin{pmatrix} 7 \\ -11 \\ -13 \end{pmatrix}\);

Solution
\[\begin{split} \begin{pmatrix} 2 \\ 3 \\ 5 \end{pmatrix} - \begin{pmatrix} 7 \\ -11 \\ -13 \end{pmatrix} = \begin{pmatrix}2 - 7 \\ 3 + 11 \\ 5 + 13 \end{pmatrix} = \begin{pmatrix} -5 \\ 14 \\ 18\end{pmatrix} \end{split}\]

(iii)   \(\begin{pmatrix} 1 & 3 & 5 \\ 7 & 9 & 11 \end{pmatrix} + \begin{pmatrix}2 & 3 \\ 5 & 7 \end{pmatrix}\).

Solution

Undefined since the left matrix is \(2\times 3\) and the right matrix is \(2\times 2\)

1.2.3. Scalar multiplication#

Definition 1.4 (Scalar multiplication)

Let \(A\) be a matrix and \(k \in \mathbb{R}\) be a scalar. The scalar multiplication \(kA\) is defined by

(1.2)#\[ [kA]_{ij} = ka_{ij}, \]

i.e.,

\[\begin{split} \begin{align*} k \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} = \begin{pmatrix} ka_{11} & ka_{12} & \cdots & ka_{1n} \\ ka_{21} & ka_{22} & \cdots & ka_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ ka_{m1} & ka_{m2} & \cdots & ka_{mn} \end{pmatrix}. \end{align*} \end{split}\]

Theorem 1.2 (Properties of scalar multiplication)

Let \(A\) and \(B\) be two \(m \times n\) matrices and \(k\) and \(\ell\) are scalars then

  • scalar multiplication is commutative: \(kA = Ak\)

  • scalar multiplication is distributive over matrix addition: \(k (A + B) = kA + kB\)

  • scalar multiplication is distributive over scalar addition: \((k + \ell)A = kA +\ell A\)

  • scalar multiplication is associative: \(k(\ell A) = (k \ell) A = \ell(kA)\)

  • multiplication by \(-1\) gives the additive inverse: \(-1 \times A = -A\)

Example 1.4

Evaluate the following:

(i)   \(2 \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\)

Solution
\[\begin{split} 2 \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} 2 & 4 \\ 6 & 8 \end{pmatrix} \end{split}\]

(ii)   \(\dfrac{1}{2} \begin{pmatrix} 0 & -1 \\ 3 & 2 \\ 4 &-2 \end{pmatrix}\)

Solution
\[\begin{split} \dfrac{1}{2} \begin{pmatrix} 0 & -1 \\ 3 & 2 \\ 4 &-2 \end{pmatrix} = \begin{pmatrix} 0 & -1/2 \\ 3/2 & 1 \\ 2 & -1 \end{pmatrix} \end{split}\]

(iii)   \(a \begin{pmatrix} 1 & 6 & 4 \\ 0 & 3 & -1 \end{pmatrix}\)

Solution
\[\begin{split} a \begin{pmatrix} 1 & 6 & 4 \\ 0 & 3 & -1 \end{pmatrix} = \begin{pmatrix} a & 6a & 4a \\ 0 & 3a & -a \end{pmatrix} \end{split}\]

(iv)   \(101 \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} - 99 \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}\)

Solution
\[\begin{split} 101 \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} - 99 \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} = (101 - 99) \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 4 \\ 0 & 2 \end{pmatrix}\end{split}\]

1.2.4. Matrix transpose#

Definition 1.5 (Matrix transpose)

The transpose of an \(m \times n\) matrix \(A\) is a \(n \times m\) matrix denoted by \(A^\mathsf{T}\) formed by switching the rows and columns of \(A\), i.e.,

(1.3)#\[ [A^\mathsf{T}]_{ij}=a_{ji}. \]

Transposing a matrix switches the rows and columns around so that row \(i\) becomes column \(i\) and column \(j\) becomes row \(j\), i.e.,

\[\begin{split} \begin{align*} \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}^\mathsf{T} = \begin{pmatrix} a_{11} & a_{21} & \cdots & a_{m1} \\ a_{12} & a_{22} & \cdots & a_{m2} \\ \vdots & \vdots & \ddots & \vdots \\ a_{1n} & a_{2n} & \cdots & a_{mn} \end{pmatrix}. \end{align*} \end{split}\]

Theorem 1.3 (Properties of matrix transpose)

Let \(A\) and \(B\) be two square \(n \times n\) matrices and \(k\) a scalar, then

  • \((A^\mathsf{T})^\mathsf{T} = A\)

  • \((A + B)^\mathsf{T} = A^\mathsf{T} + B^\mathsf{T}\)

  • \((k A)^\mathsf{T} = k (A^\mathsf{T})\)

  • \((AB)^\mathsf{T} = B^\mathsf{T}A^\mathsf{T}\) (the product of two matrices is defined in the following section)

Example 1.5

Evaluate the following:

(i)   \(\begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}^\mathsf{T}\)

Solution
\[\begin{split} \begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}^\mathsf{T} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \end{split}\]

(ii)   \(\begin{pmatrix} 1 & 0 & -2 \\ 3 & -4 & 1 \end{pmatrix}^\mathsf{T}\)

Solution
\[\begin{split} \begin{pmatrix} 1 & 0 & -2 \\ 3 & -4 & 1 \end{pmatrix}^\mathsf{T} = \begin{pmatrix} 1 & 3 \\ 0 & -4 \\ -2 & 1 \end{pmatrix} \end{split}\]

(iii)   \(\begin{pmatrix}2 & 3 & 5 \end{pmatrix}^\mathsf{T}\)

Solution
\[\begin{split} \begin{pmatrix}2 & 3 & 5 \end{pmatrix}^\mathsf{T} = \begin{pmatrix} 2 \\ 3 \\ 5 \end{pmatrix} \end{split}\]