Linear Algebra

Matrices

3/13 in Linear Algebra. See all.

Matrices
Matrices are pretty simple. They're just arrays of column vectors. For example, the matrix [123456]\begin{bmatrix}1 & 2 & 3\\4 & 5 & 6\end{bmatrix} is a 2×32\times 3 matrix. The first row is [123]\begin{bmatrix}1 & 2 & 3\end{bmatrix}, and the second row is [456]\begin{bmatrix}4 & 5 & 6\end{bmatrix}. The first column is [14]\begin{bmatrix}1 \\ 4\end{bmatrix}, the second column is [25]\begin{bmatrix}2 \\ 5\end{bmatrix}, and the third column is [36]\begin{bmatrix}3 \\ 6\end{bmatrix}.

Matrix Equivalency
Two matrices AA and BB are equivalent if there exist two real numbers nn and pp such that the following conditions hold:

  1. (Number of rows of A)=n=(Number of rows of B)\text{(Number of rows of }A\text{)}=n=\text{(Number of rows of }B\text{)}
  2. (Number of columns of A)=p=(Number of columns of B)\text{(Number of columns of }A\text{)}=p=\text{(Number of columns of }B\text{)}
  3. Corresponding indices of AA and BB are equivalent.

Matrix Addition
Matrix addition is defined elementwise — add corresponding elements. Matrix addition is commutative (A+B=B+AA+B=B+A) and associative ((A+B)+C=A+(B+C)(A+B)+C=A+(B+C)). Undefined if the orders of AA and BB are not the same.

Scalar Multiplication
For a matrix AA and real number λ\lambda, λA\lambda A is defined by (λA)i,j=λAi,j(\lambda A)_{i, j}=\lambda A_{i,j}.

  1. λ(A+B)=λA+λB\lambda(A+B)=\lambda A+\lambda B.
  2. (λ1+λ2)A=λ1A+λ2A(\lambda_1 + \lambda_2)A=\lambda_1A + \lambda_2 A.
  3. (λ1λ2)A=λ1(λ2A)(\lambda_1\lambda_2)A=\lambda_1(\lambda_2A).

Matrix Multiplication
Let p,rp, r and nn be positive integers, AA be a matrix with order p×rp\times r, and BB be a matrix with order r×nr\times n. The product matrix, ABAB, is the p×np\times n matrix C[ci,j]C[c_{i,j}] defined by cij=k=1raikbkj,c_{ij}=\sum_{k=1}^ra_{ik}b_{kj}, For i=1,2,,pi=1,2,\dots,p and j=1,2,nj=1,2,\dots n. This means that ci,Ic_{i,I} is obtained by multiplying the iith row of AA with the jjth row of BB and summing. The multiplicative identity matrix is the diagonal matrix with only 11 as its diagonal elements (and is denoted by InI_n).

If BB and CC are matrices such that BCBC is defined, then λ(BC)=B(λC)\lambda(BC)=B(\lambda C). Here's a gif:

Special Types of Matrices

There are some special types of matrices that we'll need to know about.

Identity Matrix
The identity matrix is a square matrix with 11's on the main diagonal and 00's elsewhere. It is denoted by InI_n (where nn is the order of the matrix). The identity matrix is the multiplicative identity for matrices: AIn=InA=AAI_n=I_nA=A.

Zero Matrix
The unique zero matrix of order p×np\times n is a matrix (of order p×np\times n) whose entries are all zero. It is denoted with 0p×n\textbf{0}_{p\times n}. If AA and 0p×n\textbf{0}_{p\times n} have the same order, then A+0p×n=AA+\textbf{0}_{p\times n}=A.

Triangular Matrices

  1. Upper Triangular: A square matrix is upper triangular if ai,j=0a_{i,j}=0 whenever i>ji > j.
  2. Lower Triangular: A square matrix is lower triangular if ai,j=0a_{i,j}=0 whenever i<ji < j.
    An upper triangular matrix has elements that are all 00 below the main diagonal, and a lower triangular matrix has zero elements above the main diagonal. The product of a UT or LT matrix with another UT or LT (must be the same) matrix is also UT or LT (must be the same). Here's an example of an upper triangular matrix: [123045006].\begin{bmatrix}1 & 2 & 3\\0 & 4 & 5\\0 & 0 & 6\end{bmatrix}.

Diagonal Matrix
A diagonal matrix is a matrix where all the elements are zero except for the diagonal elements. The product of two diagonal matrices is also a diagonal matrix. So, a diagonal matrix is both UT and LT.

Sub-matrix
A sub-matrix of a matrix AA is any matrix obtained by removing a number of rows or columns from AA. We'll need this when we talk about the determinant.

Partitioned Matrix
A matrix is partitioned if it is divided into submatrices by horizontal and vertical lines between rows and columns. The resulting submatrices are often called blocks. Matrices are compatibly partitioned if the number of horizontal blocks in A=A= the number of vertical blocks in BB (i.e., the block dimensions are multiplicable) AND each block ×\times block operation "makes sense" — i.e., the submatrices can be multiplied. Note that partitioning a matrix doesn't change anything about the matrix — it's just a way to organize the matrix.

Symmetric Partition
A symmetrically partitioned matrix is one where the horizontal and vertical partition lines occur in the same places relative to the sequence of rows and columns.

Diagonal Block
A diagonal block (in a symmetrically partitioned matrix) can be defined in two ways:

  1. A block bounded by the ii-th and i+1i+1st horizontal AND vertical partition lines.
  2. A block whose diagonal elements are all diagonal elements of AA.
    Each diagonal block must be square. A block diagonal matrix is one whose nondiagonal blocks are all zero submatrices.

Special Matrix Definitions

Row Equivalence
Two matrices are row equivalent if one can be changed to the other by a sequence of elementary row operations.

Positive Integral Power
AnA^n (for any positive integer nn) is called a "positive integral power of AA."

Transpose
The transpose of a p×np\times n matrix AA is the n×pn\times p matrix ATA^T such that (AT)i,j=Aj,i.(A^T)_{i,j}=A_{j,i}. Essentially, each row of AA becomes a column of ATA^T. Transposes have the following properties: (AT)T=A(λA)T=λ(AT)(A+B)T=AT+BT(AB)T=BTAT(An)T=(AT)n\begin{align}(A^T)^T&=A\\(\lambda A)^T&=\lambda(A^T)\\(A+B)^T&=A^T+B^T\\(AB)^T&=B^TA^T\\{\left(A^n\right)}^T&={\left(A^T\right)}^n\end{align}

Symmetry
A matrix is symmetric if AT=AA^T=A. This can be possible if and only if AA is square and Aij=AjiA_{ij}=A_{ji}. So, the main diagonal can be anything, but the other elements must be symmetric.

Skew Symmetry
A matrix AA is skew symmetric if AT=AA^T=-A. This is true if and only if AA is square and Aij=AjiA_{ij}=-A_{ji}. A skew symmetric matrix must have all diagonal elements equal to 00. It is a good exercise to prove that a skew symmetric matrix AA squared is symmetric, and A3A^3 is skew symmetric.