Matrix Operations

This post is a simple introduction into the concepts of matrix operations. This article should just serve as a refresher to most as the concepts here are quite elementary.

We previously discussed the concepts of matrices and how they are important in representing complex mathematical abstractions. There are many operations that can be applied to matrices. The first most basic is scalar matrix multiplication where a matrix is multiplied by a constant.

Consider the following matrix A.

     \[      A = \begin{bmatrix}  a_{11} & a_{12} & a_{1n} \\  a_{21} & a_{22} & a_{2n} \\  a_{m1} & a_{m2} & a_{mn}  \end{bmatrix}  \]

The matrix can be multiplied by a constant k in the following manner.

     \begin{align*}  k A &= k \begin{bmatrix}  a_{11} & a_{12} & a_{1n} \\  a_{21} & a_{22} & a_{2n} \\  a_{m1} & a_{m2} & a_{mn}  \end{bmatrix}  \\ &= \begin{bmatrix}  k a_{11} & k a_{12} &  k a_{1n} \\  k a_{21} & k a_{22} & k a_{2n} \\  k a_{m1} & k a_{m2} & k a_{mn}  \end{bmatrix}  \end{align*}

Furthermore, two matrices can be added or subtracted if they contain the same number of elements in each row and column. They can also be multiplied if the number of columns in the first matrix is equal to the number of rows in the second matrix.

Example of adding two matrices.

     \[ A = \begin{bmatrix}  3 & 9 & -3 \\ 5 & 3 & 8 \\ 5 & -4 & 6 \end{bmatrix} ,  B = \begin{bmatrix}  5 & -9 & -5 \\ 3 & 9 & 7 \\ 6 & 8 & -2 \end{bmatrix}  \\ \] \begin{align*}  A + B & =  \begin{bmatrix}  3 & 9 & -3 \\ 5 & 3 & 8 \\ 5 & -4 & 6 \end{bmatrix} +  \begin{bmatrix}  5 & -9 & -5 \\ 3 & 9 & 7 \\ 6 & 8 & -2 \end{bmatrix}  \\ &=  \begin{bmatrix}  8 & 0 & -8 \\ 8 & 12 & 15 \\ 11 & 4 & 4 \end{bmatrix}  \\ \end{align*}

For an example of multiplication consider the two matrices.

     \[ A =      \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{pmatrix}  , B =  \begin{pmatrix} a & d \\ b & e \\ c & f \\ \end{pmatrix}  \]

The two matrices can be multiplied two ways the first is the inner product.

     \[ AB = \begin{pmatrix} 1a + 2b + 3c & 1d + 2e + 3f \\ 4a + 5b + 6c & 4d + 5e + 6f \\ 7a + 8b + 9c & 7d + 8e + 9f \\ \end{pmatrix}  \]

The second method is by determining the outer product.

     \begin{align*}  AB &=  \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{pmatrix} \begin{pmatrix} a & d \\ b & e \\ c & f \\ \end{pmatrix} \\ &= \begin{pmatrix} 1a & 1d \\ 4a & 4d \\ 7a & 7d \\ \end{pmatrix}+ \begin{pmatrix} 2b & 2e \\ 5b & 5e \\ 8b & 8e \\ \end{pmatrix}+ \begin{pmatrix} 3c & 3f \\ 6c & 6f \\ 9c & 9f \\ \end{pmatrix}  \end{align*}

If we add these matrices its obvious that both methods produce the same answer in this example.

Another operation that can be performed is the transpose of a matrix. The transpose of a matrix can be found by swapping rows and columns in the following manner.

     \begin{align*}    A &=  \begin{pmatrix} a & d \\ b & e \\ c & f \\ \end{pmatrix} ,   A^T =  \begin{pmatrix} a & b & c \\ d & e & f \\ \end{pmatrix}  \end{align*}

Moreover, the inverse of a function is another important operation that can be performed on a matrix. The quotient of two matrices can be found my multiplying by the inverse of the second matrix.

     \begin{align*}  \[ \frac{A}{B} = A B^{-1} \] \end{align*}

If two matrices A and B are inverses of one another the product of the two is equal to the identity matrix.

     \begin{align*}  \[ AB =   \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix}  \] \end{align*}

I will now demonstrate how to find the inverse of a matrix.

Consider the following 3×3 matrix.

     \begin{align*}  \[ A =   \begin{bmatrix} 2 & 9 & 0 \\ 7 & -2 & -5 \\ 1 & -9 & 3   \end{bmatrix}  \] \end{align*}

Create an augmented matrix with the matrix A on the left and the identity matrix on the left.

     \begin{align*}  \[ M &=   \left| \begin{array}{ccc|ccc}  2 & 9 & 0 & 1 & 0 & 0 \\  7 & -2 & -5 & 0 & 1 & 0 \\  1 & -9 & 3 & 0 & 0 & 1   \end{array} \right| \] \end{align*}

Now we perform the necessary elementary row operations to rearrange the identity matrix onto the left similar to the Gauss-Jordan elimination method discussed in the previous post.

Add row 3 to row 1.

     \begin{align*}  \[ \Rightarrow &    \left| \begin{array}{ccc|ccc}  3 & 0 & 3              & 1 & 0 & 1 \\  7 & -2 & -5            & 0 & 1 & 0 \\  1 & -9 & 3             & 0 & 0 & 1   \end{array} \right| \] \end{align*}

Divide row 1 by 3.

     \begin{align*}  \[ \Rightarrow &    \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  7 & -2 & -5            & 0 & 1 & 0 \\  1 & -9 & 3             & 0 & 0 & 1   \end{array} \right| \] \end{align*}

Multiply row 1 by 7 and subtract it from row 2.

     \begin{align*}  \[ \Rightarrow &    \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & -2 & -12            & -\frac{7}{3} & 1 & -\frac{7}{3}\\  1 & -9 & 3             & 0 & 0 & 1   \end{array} \right| \] \end{align*}

Subtract row 1 from row 3.

     \begin{align*}  \[ \Rightarrow &   \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & -2 & -12            & -\frac{7}{3} & 1 & -\frac{7}{3}\\  0 & -9 & 2             & -\frac{1}{3} & 0 & \frac{2}{3}   \end{array} \right| \] \end{align*}

Divide row 2 by -2.

     \begin{align*}  \[ \Rightarrow &    \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & 1 & 6            & \frac{7}{6} & -\frac{1}{2} & \frac{7}{6}\\  0 & -9 & 2             & -\frac{1}{3} & 0 & \frac{2}{3}   \end{array} \right| \] \end{align*}

Multiply row 2 by 9 and add it to row 3.

     \begin{align*}  \[ \Rightarrow &   \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & 1 & 6            & \frac{7}{6} & -\frac{1}{2} & \frac{7}{6}\\  0 & 0 & 56             & \frac{61}{6} & -\frac{9}{2} & \frac{67}{6}   \end{array} \right| \] \end{align*}

Divide row 3 by 56.

     \begin{align*}  \[ \Rightarrow &    \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & 1 & 6            & \frac{7}{6} & -\frac{1}{2} & \frac{7}{6}\\  0 & 0 & 1             & \frac{61}{336} & -\frac{9}{112} & \frac{67}{336}   \end{array} \right| \] \end{align*}

Multiply row 3 by 6 and subtract it from row 2.

     \begin{align*}  \[ \Rightarrow &   \left| \begin{array}{ccc|ccc}  1 & 0 & 1              & \frac{1}{3} & 0 & \frac{1}{3} \\  0 & 1 & 0            & \frac{13}{168} & -\frac{1}{56} & -\frac{5}{168}\\ 0 & 0 & 1             & \frac{61}{336} & -\frac{9}{112} & \frac{67}{336}   \end{array} \right| \] \end{align*}

Finally we subtract row 3 from row 1 to achieve the reduced form.

     \begin{align*}  \[ \Rightarrow &   \left| \begin{array}{ccc|ccc}  1 & 0 & 0              & \frac{51}{336} & \frac{9}{112} & \frac{45}{336} \\  0 & 1 & 0            & \frac{13}{168} & -\frac{1}{56} & -\frac{5}{168}\\ 0 & 0 & 1             & \frac{61}{336} & -\frac{9}{112} & \frac{67}{336}   \end{array} \right| \] \end{align*}

Therefore the inverse of matrix A is as follows.

     \begin{align*}  \[ A^{-1} &=   \left| \begin{array}{ccc}  \frac{51}{336} & \frac{9}{112} & \frac{45}{336} \\   \frac{13}{168} & -\frac{1}{56} & -\frac{5}{168}\\   \frac{61}{336} & -\frac{9}{112} & \frac{67}{336}   \end{array} \right| \] \end{align*}

That concludes this post on matrix operations. I will introduce the concepts of vectors in the next post and then begin discussing eigenvalues and eigenvectors then move on to introduce the use of complex numbers.

Dan Roy, Founder and Creator of Universal Physics.

Category(s): Mathematics
Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *