Introduction To Matrices & Vectors
I. Matrices
A matrix $(pl.\ matrices)$ is an arrangement of numbers or variables consisting of rows and columns. A matrix can have $1$ or more rows and $1$ or more columns. A matrix is denoted by enclosing this row and column arrangement of numbers within an opening and a closing square brace $\left[\ \right]$.
We can define a matrix $A$ as:
$A = \begin{bmatrix}13 & 5 & 8\\21 & 3 & 34\end{bmatrix}$
The above matrix has $2$ rows, and $3$ columns. The first row contains numbers $13$, $5$ and $8$ and the the second row consists of numbers $21$, $3$ and $34$. The first column contains $13$ and $21$, the second column contains $5$ and $3$, and the third column contains $8$ and $34$. This is a $2 \times 3$ matrix (read as: $\unicode{0x201C}two\ by\ three\ matrix\unicode{0x201D}$). We also say that the order of this matrix is $2 \times 3$
Likewise, we can define another matrix $B$ as:
$B = \begin{bmatrix}5 & 6\\7 & 8 \\ 9 & 10\end{bmatrix}$ This one is a $3 \times 2$ matrix, that is, the order of this matrix is $3 \times 2$
-----------book page break-----------
Similarly, we can define matrix $A$ as an $m \times n$ matrix in the following way:
$A = \begin{bmatrix}a_{11} & a_{12} & a_{13} & ... & a_{1n}\\ a_{21} & a_{22} & a_{23} & ... & a_{2n} \\ ... \\ ... & & & a_{ij} \\ a_{m1} & a_{m2} & a_{m3} & ... & a_{mn} \end{bmatrix}$
The above is an $m \times n$ matrix with $m$ rows and $n$ columns. Each element $a_{ij}$ denotes the elements in the $i\xasuper{th}$ row and $j\xasuper{th}$ column.
Let's define the following matrix $C$ as:
$C = \begin{bmatrix}5 & \sqrt{2}\\6 & 7 \end{bmatrix}$
Here $C$ is a $2 \times 2$ matrix, in mathematical notation, $C = \begin{bmatrix}c_{ij}\end{bmatrix}_{2\times2}$ with the following elements:
$c_{11} = 5$
$c_{12} = \sqrt{2}$
$c_{21} = 6$
$c_{22} = 7$
II. Vectors
Vectors are special types of matrices where either the number or rows or the number of columns is $1$. In other words a vector is a $1 \times n$ matrix, which is a matrix with $1$ row and $n$ columns or an $m \times 1$ matrix which is a matrix with $m$ rows and $1$ column.
-----------book page break-----------
The first type of vector with a single row and any number of columns is called a $\underline{row\ vector}$ or a $\underline{row\ matrix}$, and the second type of vector with $1$ column and any number of rows is called a $\underline{column\ vector}$ or a $\underline{column\ matrix}$.
The following is an example of a $1 \times n$ row vector:
$R = \begin{bmatrix}r_{11} & r_{12} & r_{13} & ... & r_{1n}\end{bmatrix}$
The following is an example of $m \times 1$ column vector:
$C = \begin{bmatrix}c_{11} \\ c_{21} \\ c_{31} \\ . \\ . \\ . \\ c_{m1}\end{bmatrix}$
III. Properties Of Matrices
A matrix with an equal number of rows and columns is called a $\underline{square\ matrix}$
Following is an example of a $3 \times 3$ square matrix:
$\begin{bmatrix}1 & 4 & 9 \\ 16 & 25 & 36 \\ 49 & 64 & 81\end{bmatrix}$
An $n \times n$ square matrix is commonly denoted using $A_n$
If you take the elements starting with the top-left corner and move diagonally to the bottom-right corner, the elements you will get will form the $\underline{principal\ diagonal}$ of the matrix.
-----------book page break-----------
Following is the same square matrix with the elements of the principal diagonal shown in blue:
$\begin{bmatrix}\color{blue}{1} & 4 & 9 \\ 16 & \color{blue}{25} & 36 \\ 49 & 64 & \color{blue}{81}\end{bmatrix}$
Similarly, if you start with the element at the top-right corner and move diagonally to the bottom-left corner, the elements you will get will form the $\underline{antidiagonal}$ of the matrix.
The following shows the antidiagonal elements of our $3 \times 3$ matrix, shown in red:
$\begin{bmatrix}1 & 4 & \color{red}{9} \\ 16 & \color{red}{25} & 36 \\ \color{red}{49} & 64 & 81\end{bmatrix}$
Note, that the terms $\unicode{0x201C}principal\ diagonal\unicode{0x201D}$ and $\unicode{0x201C}diagonal\unicode{0x201D}$ are used interchangeably in common math text, so, when you come across the term diagonal of a matrix it would mean the principal diagonal.
A matrix, which has all its elements as zero, is called a $\underline{null\ matrix}$ or a $\underline{zero\ matrix}$
For example, the following is a $2 \times 3$ null matrix:
$\begin{bmatrix}0 & 0 & 0\\0 & 0 & 0\end{bmatrix}$
A square matrix with all its non-diagonal elements as zero and at least one of its diagonal elements is non-zero is called a $\underline{diagonal\ matrix}$.
The following is an example of a diagonal matrix:
$\begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 11\end{bmatrix}$
-----------book page break-----------
A square matrix with all its diagonal elements as equal, non-zero values, and all other elements as zero, is called a $\underline{scalar\ matrix}$.
Following is an example of a $3 \times 3$ scalar matrix:
$\begin{bmatrix}17 & 0 & 0 \\ 0 & 17 & 0 \\ 0 & 0 & 17\end{bmatrix}$
A square matrix with all its diagonal elements as $1$, and all other elements as zero, is called an $\underline{identity\ matrix}$ or, less commonly, a $\underline{unit\ matrix}$.
Following is an example of a $3 \times 3$ unit matrix:
$\begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}$
A square matrix, with all its elements below and to the left of the diagonal elements as $0$ is called an upper triangular matrix or right triangular matrix. The following is an example of a upper triangular matrix:
$\begin{bmatrix}\color{blue}{1} & 4 & 9 \\ 0 & \color{blue}{25} & 36 \\ 0 & 0 & \color{blue}{81}\end{bmatrix}$
A square matrix, with all its elements above and to the right of the diagonal elements as $0$ is called a lower triangular matrix or left triangular matrix. The following is an example of a lower triangular matrix. The following is an example of a lower triangular matrix:
$\begin{bmatrix}\color{blue}{1} & 0 & 0 \\ 16 & \color{blue}{25} & 0 \\ 49 & 64 & \color{blue}{81}\end{bmatrix}$