Introduction to Matrices
A matrix (pronounced MAY-trix) is a rectangular arrangement of numbers, like:
$$ \cssId{s2}{\begin{bmatrix} 7 & 3 & 2\\ 6 & 5 & 8 \end{bmatrix}} $$A number in a matrix is often called an element, a member, or an entry of the matrix. The members of a matrix are often enclosed in (square) brackets.
Rows have a horizontal orientation, and are numbered from top to bottom:
$7$ | $3$ | $2$ |
$6$ | $5$ | $8$ |
Thus, $ \cssId{s7}{\begin{bmatrix} 7 & 3 & 2\\ \end{bmatrix}} $ is the first row, and $ \cssId{s9}{\begin{bmatrix} 6 & 5 & 8\\ \end{bmatrix}} $ is the second row.
Columns have a vertical orientation, and are numbered from left to right:
$7$ | $3$ | $2$ | ||
$6$ | $5$ | $8$ |
Thus, $ \cssId{s13}{\begin{bmatrix} 7\\ 6 \end{bmatrix}} $ is the first column, $ \cssId{s15}{\begin{bmatrix} 3\\ 5 \end{bmatrix}} $ is the second column, and $ \cssId{s17}{\begin{bmatrix} 2\\ 8 \end{bmatrix}} $ is the third column.
The plural of matrix is matrices (pronounced MAY-tri-sees).
Matrices offer a way to represent large amounts of data in an organized way. Matrices are particularly well-suited to computer analysis. There are a multitude of applications of matrices, including:
- encrypting numerical data (think national security)
- computer graphics (think video games)
- solving systems of equations
The size of a matrix is reported by stating the number of rows, followed by the ‘$\,\times\,$’ symbol, followed by the number of columns.
For example, the size of $$ \cssId{s30}{\begin{bmatrix} 7 & 3 & 2\\ 6 & 5 & 8 \end{bmatrix}} $$ is $\,2\times 3\,,$ which is read aloud as ‘$\,2\,$ by $\,3\,$’.
Observe that an $\,m \times n\,$ matrix has $\,mn\,$ elements, since there are $\,m\,$ rows, with $\,n\,$ entries in each row.
Matrices are usually named with capital letters. Members of a matrix are usually named with lowercase letters. In particular, the elements of a matrix $\,M\,$ are conventionally named $\,m_{ij}\,$:
- $\,m_{ij}\,$ is read aloud as ‘$\,m\,$ sub $\,i\,$ $\,j\,$’
- the $\,i\,$ and $\,j\,$ are called subscripts; they are written a little bit below the line
- the first subscript ($\,i\,$) gives the row number of the element
- the second subscript ($\,j\,$) gives the column number of the element
- a capital letter is used to denote the matrix, and the corresponding lowercase letter is used to denote the elements
For example, if $$ \cssId{s46}{M = \begin{bmatrix} 7 & 3 & 2\\ 6 & 5 & 8\end{bmatrix}} $$ then:
- $\,m_{11} = 7\,$ (first row, first column; read as em sub one one, NOT (say) em sub eleven)
- $\,m_{12} = 3\,$ (first row, second column)
- $\,m_{13} = 2\,$ (first row, third column)
- $\,m_{21} = 6\,$ (second row, first column)
- $\,m_{22} = 5\,$ (second row, second column)
- $\,m_{23} = 8\,$ (second row, third column)
Two matrices are equal when they have the same size, and corresponding elements are equal. Precisely, we have:
Let $\,A\,$ and $\,B\,$ be matrices.
Then:
$A=B$ | if and only if | $A\,$ and $\,B\,$ have the same size and $\,a_{ij} = b_{ij}\,$ for all $\,i\,$ and $\,j$ |
Here, $\,i\,$ takes on all possible row numbers, and $\,j\,$ takes on all possible column numbers.
A matrix with the same number of rows and columns is called a square matrix. For example, $$ \cssId{s76}{\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}} $$ is a square matrix.
A matrix where all the entries are zero is called a zero matrix. For example, $$ \cssId{s80}{\begin{bmatrix} 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \end{bmatrix}} $$ is a $\,2\times 4\,$ zero matrix.