Introduction to matrices

What are Matrices? #

A matrix is a set of numbers arranged in rows and columns forming a rectangular array. Matrices is the plural form of matrix.

Take a look at an example of matrix M: \[M = \begin{bmatrix} 1 & 5 \\ 3 & 4 \\ -3 & 2 \end{bmatrix}\]

Here \(\begin{bmatrix}1 & 5\end{bmatrix}\) , \(\begin{bmatrix}3 & 4\end{bmatrix}\) and \(\begin{bmatrix}-3 & 2\end{bmatrix}\) are three rows

and \(\begin{bmatrix}1 \\ 3 \\ -3\end{bmatrix}\) and \(\begin{bmatrix}5 \\ 4 \\ 2\end{bmatrix}\) are two columns.

Usually a capital letter donates a matrix. For example matrix M above.

A small letter with a double subscript denotes an element of the matrix. For example, \(m_{ij}\) , is the element in the \(i^\text{th}\) row and \(j^\text{th}\) column of the matrix M.

Please note that the row subscript will always come first then the column subscript.

Following our matix M from above, \[ \begin{aligned} m_{11} &= 1 \qquad \text{first row, first column} \\ m_{12} &= 5 \qquad \text{first row, second column} \\ m_{21} &= 3 \qquad \text{second row, first column} \\ m_{22} &= 4 \qquad \text{second row, second column} \\ m_{31} &= -3 \qquad \text{third row, first column} \\ m_{32} &= 2 \qquad \text{third row, second column} \end{aligned}\]

Order of a Matrix #

The order of a matrix is its number of rows and columns, written as \(r\;\textsf{x}\;c\) , where r is the number of rows and c is the number of columns.

Remember that in writing the order of a matrix, number of rows always come first then number of columns

flowchart TD A[Order of a Matrix] A-->B[Number of rows] A~~~C[x] A-->D[Number of columns]

So the order of the above matrix M is 3 x 2.

Square Matrix #

A square matrix has the same number of rows and columns. For example, consider the following matrix with 2 rows and 2 columns:

\[B = \begin{bmatrix} 4 & 12 \\ 2 & 7 \end{bmatrix}\]

It is called a square matrix of order 2 (two rows and 2 columns).

Following matrix is an example of a square matrix of order 3 (three rows and three columns):

\[D = \begin{bmatrix} -0.5 & 2 & 3 \\ 7 & 1.75 & 0 \\ 1 & 0 & -2 \\ \end{bmatrix}\]

An ordinary number can be regarded as a square matrix of order 1. For example, \(\begin{bmatrix}6\end{bmatrix}\) is a matrix of order 1.