1. Matrices#

A matrix is a rectangular array of elements which can be numbers, mathematical expressions, symbols, or even other matrices. Matrices are arranged in rows and columns and enclosed by parentheses, for example

\[\begin{split} \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}.\end{split}\]

This matrix contains 6 elements arranged in 2 (horizontal) rows and 3 (vertical) columns. Alternative representations of matrices include using square brackets or even no brackets at all (which isn’t recommended), i.e.,

\[\begin{split} \begin{align*} &\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}, & &\begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{matrix} \end{align*} \end{split}\]

Definition 1.1 (Dimension of a matrix)

The dimension or size of a matrix is expressed using \(m \times n\) where \(m\) and \(n\) are the number of rows and columns of the matrix respectively. If \(m = n\) columns we say that the matrix is a square matrix.

\[\begin{split} \begin{align*} &\,\,\,\begin{matrix} \leftarrow & \!\!\text{columns}\!\! & \rightarrow \end{matrix} \\ \begin{matrix} \uparrow \\ \text{rows} \\ \downarrow \end{matrix} &\begin{pmatrix} \square & \square & \cdots & \square \\ \square & \square & \cdots & \square \\ \vdots & \vdots & \ddots & \vdots \\ \square & \square & \cdots & \square \end{pmatrix} \end{align*} \end{split}\]

For example, given the following matrices

\[\begin{split} \begin{align*} A &= \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, & B &= \begin{pmatrix} a & b \\ c & d \\ e & f \end{pmatrix}, & C &= \begin{pmatrix} x & y & z & w \end{pmatrix}, & D &= \begin{pmatrix} \alpha & \beta & \gamma \\ \delta & \epsilon & \zeta \end{pmatrix}, \end{align*} \end{split}\]

we see that \(A\) is a \(2\times 2\) matrix, \(B\) is a \(3 \times 2\) matrix, \(C\) is a \(1 \times 4\) matrix and \(D\) is a \(2 \times 3\) matrix.


1.1. Indexing a matrix#

Matrices are typically labeled using uppercase characters, e.g., \(A\), and the elements of a matrix are labelled with the corresponding lowercase character, e.g. \(a\). Individual entries of a matrix are indexed using two subscript indices \(a_{ij}\) where \(i\) is the row number reading from top to bottom and \(j\) is the column number reading from left to right.

If \(A\) be an \(m \times n\) matrix then

\[\begin{split} 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}. \end{split}\]

Some alternative notation used for matrix indexing are given below

\[ a_{ij} = [A]_{ij} = A(i,j). \]

For example, given the matrix

\[\begin{split}A = \begin{pmatrix} 2 & 0 & -3 \\ 1 & 7 & 4 \end{pmatrix},\end{split}\]

then \(a_{12} = 0\), \(a_{21} = 1\), \([A]_{13} = -3\) and \(A(2,2) = 7\)