Matrices

A matrix is a rectangular array of numbers.

Matrices are usually denoted by uppercase letters.

A matrix, $A$, with $m$ rows and ${n}$ columns, is referred to as an ${m\times n}$ matrix.

If all the entries are real numbers, the matrix is a member of the set of all real matrices with $m$ rows and ${n}$ columns, i.e. $A \in\mathbb{R}^{m \times n}$.

The entry in the $i$th row and $j$th column of the matrix $A \in \mathrm{R}^{m \times n}$ is denoted by $a_{ij}$ or $a_{i,j}$. Hence, the matrix is written as

$$ \begin{align*} A = \left( \begin{array}{cccc} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{array} \right). \end{align*} $$

A matrix is said to be a square matrix if the number of rows is equal to the number of columns, i.e. $n=m$.

Matrix Operations

Definition: Matrix Matrix Multiplication
$$ c_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj} $$

for any $i=1, \ldots, m$ and $j =1, \ldots, l$.

If $A$ is an $m\times n$ matrix and $B$ is a $n\times l$ matrix, then $A$ has the same number of columns as $B$ has rows, i.e. $n$. Thus, each entry $c_{ij}$ is the dot product of the $i$th row of $A$ with the $j$th column of $B$, which both have length $n$.

Definition: Matrix Vector Multiplication
$$ y_{j} = \sum_{i=1}^{n} a_{ij} x_i . $$
Definition: Row and Column Vectors
When matrix $A \in \mathbb{R}^{m \times 1}$ is comprised of a single column of $m$ entries, it is called a column vector. Similarly, a $1 \times n$ matrix, i.e. a single row of $n$ entries is called a row vector.

Thus $\boldsymbol{v}^T \boldsymbol{v}$ is a $1 \times 1$ matrix, and $\boldsymbol{v} \boldsymbol{v}^T$ is a $n \times n$ matrix.

Definition: Transpose
For a matrix $A \in \mathbb{R}^{m \times n}$, the transpose of the matrix $A^T \in \mathbb{R}^{n \times m}$ where all elements are mapped to $a_{ij} = a_{ji}$.

Thus, if $\boldsymbol{x}$ is a column vector it is possible to perform $A\boldsymbol{x}=\boldsymbol{y}$, then the equivalent multiplication by a row vector is $\boldsymbol{x}^T A^T = \boldsymbol{y}^T$.

Definition: Trace
$$ \text{tr}\left(A \right) = \sum_{i=0}^{n} a_{ii}. $$

Properties of Matrix Operations

  1. $A+B = B+A$
  2. $c\left(A + B\right) = cA + cB$
  3. $C\left(A + B\right) = CA + CB$
  4. $\left(A + B\right)C = AC + BC$
  5. $AB \neq BA$
  6. $A + \left(B + C\right) = \left(A+ B\right) + C$
  7. $A\left( BC \right) = \left(AB\right)C$
Proposition:
$\left( A B \right)^T = B^T A^T$

Useful Types of Matrices

  • The identity matrix is the square matrix $I$ such that $AI=A$ and $IA=A$, all entries on the main diagonal are one, all others are zero.

  • A diagonal matrix is a matrix where all entries outside the main diagonal are all zero, i.e. $a_{ij} =0$ when $i \neq j$.

  • A banded matrix is a matrix whose non-zero entries are confined to a diagonal band, comprising the main diagonal and zero or more diagonals on either side.

  • The inverse matrix of a square matrix is the matrix $A^{-1}$ such that $AA^{-1}~=~A^{-1}A~=~I.$ A matrix is non-singular or invertible if there exists an inverse matrix exists.

A square matrix has an inverse if and only if the rank of the matrix is equal to the number of columns (or rows), equivalently, the columns are linearly independent. Such matrices are said to have full rank.

  • A square matrix $A$ is symmetric if ${A=A^T}$, that is, $a_{i,j}=a_{j,i}$ for all indices $i$ and $j$.

  • A square matrix, with complex elements, is said to be Hermitian if the matrix is equal to its conjugate transpose, i.e. $a_{i,j}=\overline{a_{j,i}}$ for all indices $i$ and $j$. A Hermitian matrix is written as $A=A^H$.

  • An orthogonal matrix $Q$ is a matrix whose columns $\vec{q}_i$ are orthogonal to one another, that is $\vec{q}_i \cdot \vec{q}_j = 0$ for $i \neq j$ and have unit length, i.e. $\left\| \vec{q}_i \right\| = 1$.

Proposition:
The inverse of an orthogonal matrix $Q$ is equal to its transpose, i.e. $Q^{-1} = Q^T$.
  • A Markov matrix has positive entries and every column sums to one.
Proposition:
The largest eigenvalue of a Markov matrix is one.
  • A permutation matrix is a square matrix that has exactly one entry of $1$ in each row and each column and all other entries $0$.

  • Rotation matrices describe rotations by an angle about the axes of a coordinate system. They can be denoted by $R_x ( \alpha )$, i.e. rotation by angle $\theta$ about the $x$ axis. The product of two rotation matrices is also a rotation matrix. Note that in general $R_x\left( \theta \right) R_y \left( \beta \right) \neq R_y \left( \beta \right) R_x\left( \theta \right)$.

  • Reflection matrices: $R = I - 2 \boldsymbol{u} \boldsymbol{u}^T$.

  • A square matrix is said to be lower triangular matrix if all the elements above the main diagonal are zero, i.e. $a_{ij}=0$ when $i < j$. Similarly, a matrix is said to be upper triangular if all the entries below the main diagonal are zero, that is $a_{ij}=0$ when $i~>~j$. A matrix is said to be strictly upper triangular (or strictly lower triangle) if the main diagonal is also zero.

Determinant of a Matrix

$$A= \left( \begin{array}{cc} a & b \\ c & d \end{array} \right)$$

, the determinant, denoted by $\left| A \right|$ or det$A$ is given by ${ad-bc}$.

There are many methods to compute the determinant. the

Leibniz Method: Consider all possible choices of $n$ elements from a matrix such that there is precisely one element chosen from each row and column. Let such a choice be denoted by $\sigma$ and let sgn$\sigma$ be $-1$ to the power of the number of row swaps required to turn the choice $\sigma$ into the diagonal. Then det$\sigma$ is the sum of the products of each $\sigma$ multiplied by its sign.

$$ C_{ij} = \left( -1 \right)^{i+j} \text{det} M_{ij} $$$$ \text{det}{A} = a_{i1}C_{i1} + a_{i2}C_{i2} + \ldots + a_{in}C_{in} $$$$ \text{det}{A} = a_{1j}C_{1j} + a_{2j}C_{2j} + \ldots + a_{nj}C_{nj}. $$$$ x_j = \dfrac{\text{det} B_j}{\text{det} A}. $$$$ \left( A^{-1} \right)_{ij} = \dfrac{ C_{ji} }{\text{det} A}. $$

Properties of Nonsingular Matrices

For a nonsingular matrix, the following all hold:

  • A nonsingular matrices has full rank, i.e. the rank is equal to the number of rows or columns

  • A square matrix is nonsingular if and only if the determinant of the matrix is non-zero.

  • If a matrix is singular, both versions of Gaussian elimination (with and without pivoting) will fail due to division by zero, yielding a floating exception error. Another way to understand this is that the number of pivots is equal to the rank, so if the matrix does not have full rank, so there will not be enough pivots in order to transform the matrix in to row-echelon form.