Matrices

This section of Algebra 2 is about matrices and the various things they can do, how to work with them, and what they are.

# The Matrix

A matrix is a rectangular arrangement of information. In math, this is an array of numbers or variables arranged in an organized fashion. Matrices are used for organizing a bunch of numbers into something easy to work with. Primarily, they are used for solving complex systems of equations, but they are also used for storing information and defining output. Here is an example of a matrix:

(1)
\begin{align} \left[ \begin{array}{cccc} 1 & 3 & 7 & 4 \\ -4 & 9 & 0 & -2 \\ 12 & 6 & -7 & 8\end{array} \right] \end{align}

Matrices can be altered and manipulated using your familiar operations. We will discuss the different types of matrices, operations of matrices, and application.

# Types

There are three main types of matrices each with their own special attributes. These matrices are unique to themselves, and they are used for various things.

## Square

A square matrix is a matrix with its row dimension equal to its column dimension. Really, they look like squares. A 2 x 2 matrix is a square matrix, for example. These matrices are special because a determinant can be measured.

# Operations

Just like when using real numbers and variables, you can manipulate matrices with operations. The rules for these are slightly different, but similar.

In adding of matrices, the dimensions of the matrices must be equal. For example, let's take [A]2x3 and [B]2x3 and [C]3x2. You can add [A]+[B] because both have dimensions of 2 x 3. However, [A]+[C] yields no resultant matrix because the dimensions are not exactly the same. When you add matrices, you just add the corresponding elements and create a matrix with congruent dimensions. So, if element (1,1) in matrix A (written [A](1,1)) is 3, and element [B](1,1) is 4, then the resultant matrix would have a sum of 7 in element (1,1). Here is an example.

(2)
\begin{align} \left[ \begin{array}{ccc} 3 & 2 & 1 \\ 4 & -5 & 0 \end{array} \right] + \left[ \begin{array}{ccc} 4 & -2 & 3 \\ 0 & 7 & 2 \end{array} \right] = \left[ \begin{array}{ccc} 3+4 & 2+-2 & 1+3 \\ 4+0 & -5+7 & 0+2 \end{array} \right] = \left[ \begin{array}{ccc} 7 & 0 & 4 \\ 4 & 2 & 2 \end{array} \right] \end{align}

As shown above, all we did is add the numbers that had the same place in both matrices. Of course, this means that if the dimensions don't match, a problem occurs, and it is impossible.

Sometimes, certain elements are variables, and you have to solve for them. Consider the following matrix addition problem.

(3)
\begin{align} \left[ \begin{array}{cc} 1 & a \\ b-2 & 3 \end{array} \right] + \left[ \begin{array}{cc} c & 4 \\ 1 & -2 \end{array} \right] = \left[ \begin{array}{cc} 3 & -1 \\ 2 & d \end{array} \right] \end{align}

There are four variables we need to solve for: a, b, c, and d. With the way matrix addition works, this is actually possible. For as long as there are not more than one variable within an element in all three matrices, solving is possible. Here is what we must do. First, combine the two addends together into one matrix. This will make solving easier, and it gives you a feel for how to solve it. When we combine the two matrices using what we know about addition, we get the following.

(4)
\begin{align} \left[ \begin{array}{cc} 1+c & a+4 \\ b-1 & 1 \end{array} \right] = \left[ \begin{array}{cc} 3 & -1 \\ 2 & d \end{array} \right] \end{align}

Now, we can separate the matrices into four different equations. Why? Since addition is done according to element, we can pretend that each corresponding element is a separate equation. So, we can get 1+c=3, a+4=-1, b-1=2, and 1=d. When we solve for each variable, we get a=-5, b=3, c=2, and d=1.

## Subtraction

Subtraction of matrices is very much done in the same way as addition. First, the dimensions must be the same. When we subtract matrices, we are simply performing the opposite of addition for the corresponding elements. In other words, we are simply performing the subtraction operation on each corresponding slot. Pretty much, subtraction is the same as addition, except you are subtracting (or adding a negative).

(5)
\begin{align} \left[ \begin{array}{cc} 5 & 3 \\ 10 & 5 \\ 1 & -2 \end{array} \right] - \left[ \begin{array}{cc} 2 & 0 \\ 4 & 5 \\ -3 & 2 \end{array} \right] = \left[ \begin{array}{cc} 5-2 & 3-0 \\ 10-4 & 5-5 \\ 1-(-3) & -2-2 \end{array} \right] = \left[ \begin{array}{cc} 3 & 3 \\ 6 & 0 \\ 4 & -4 \end{array} \right] \end{align}

## Multiplication

There are two types of multiplication when it comes to matrices. The first is scalar multiplication. This occurs when you see a coefficient in front of a matrix, such as 2[A]. In scalar multiplication, all you do is multiply the coefficient by every element in the matrix. It is sort of like distributing, only it's more involved. For example:

(6)
\begin{align} 4 \left[ \begin{array}{ccc} 2 & 4 & 10 \\ 0 & -2 & 1 \\ 9 & -4 & 2 \end{array} \right] = \left[ \begin{array}{ccc} 2*4 & 4*4 & 10*4 \\ 0*4 & -2*4 & 1*4 \\ 9*4 & -4*4 & 2*4 \end{array} \right] = \left[ \begin{array}{ccc} 8 & 16 & 40 \\ 0 & -8 & 4 \\ 36 & -16 & 8 \end{array} \right] \end{align}

In this example, we distributed the 4 among every single element we were multiplying it by. It's simple, but larger matrices can be quite tedious.

The second type of multiplication is matrix multiplication. This is where you are multiplying a matrix by another matrix. Warning! This can get confusing real fast, so pay close attention. First, you want to make sure the dimensions for each matrix is correct. In order for matrices to be multiplied, the number of columns in the first matrix must equal the number of rows in the second matrix. In other words, for [A]axb and [B]cxd, the matrices, [A][B] can only be multiplied if b=c. So, if matrix A has dimensions of 2 x 3, and matrix B has dimensions of 3 x 4, the matrices A*B can be multiplied, but B*A cannot. Note: In multiplication of matrices, the communicative property is negated! In other words, the order of multiplication matters. Next, identify the dimensions of the product matrix. The new dimensions are defined as a x d in our previous matrices.

Matrix multiplication works by row by column operations. Take the first row of the first matrix and the first column of the second matrix. Now, multiply the first number in the row by the first number in the column. Do the same for the other elements (second by second, third by third…) and add the products together. That is element (1,1) in the product matrix. Now take row one of matrix one and column two of matrix two. Do the same thing, and that becomes element (1,2). Notice, the element number is the row you multiply in matrix one comma column you multiply in matrix two. When row one of matrix one has been multiplied by all the columns in matrix two, begin again except with row two. Your job is done once you've multiplied every row in matrix one by every column in matrix two. Consider this:

(7)
\begin{align} \left[ \begin{array}{cccc} 2 & 1 & 0 & 4 \\ -2 & 3 & -4 & 2 \end{array} \right] \left[ \begin{array}{ccc} 2 & 0 & -2 \\ 1 & -4 & 5 \\ 3 & 7 & -2 \\ -3 & -2 & 1 \end{array} \right] \end{align}

First, insure that the dimensions are compatible. The dimensions of the first matrix is 2 x 4, and the second matrix is a 4 x 3. Look at the dimensions side by side. (2 x 4)(4 x 3) Since 4=4, the matrices can be multiplied. Your resultant matrix will be 2 x 3. Now let us begin our row by column operations. Take the first row of the first matrix and first column in the second matrix. Multiply your corresponding elements and add the products for your element. Here is what that may look like:

(8)
\begin{align} \left[ \begin{array}{cccc} 2 & 1 & 0 & 4 \end{array} \right] \left[ \begin{array}{c} 2 \\ 1 \\ 3 \\ -3 \end{array} \right] = \left[ \begin{array}{c} (2*2)+(1*1)+(0*3)+(4*-3) \end{array} \right] = \left[ -7 \right] \end{align}

So, element (1,1) in your product matrix is -7. Continue this pattern with the rest of the rows and columns. Perform R1C2, R1C3, R2C1, R2C2, and R2C3. The process gets very long with large matrices. When you are done, you should get the following 2 x 3 matrix:

(9)
\begin{align} \left[ \begin{array}{ccc} -7 & -12 & 5 \\ -19 & -44 & 29 \end{array} \right] \end{align}

This math get's very tedious, and it leaves a lot of room for errors. Be careful!

## Determinant

The determinant of a matrix is a figure that tells something about it that helps you solve linear systems. It is highly used in Cramer's method and also used to find the inverse of a matrix. Determinants can only be found with square matrices. The determinant is a single number found by using the elements in a matrix. It is shown by either det in front or vertical lines in place of the brackets.

(10)
\begin{align} \det \left[ \begin{array}{ccc} 2 & 3 & 1 \\ 6 & 0 & 3 \\ 4 & 9 & 5 \end{array} \right] or \left| \begin{array}{ccc} 2 & 3 & 1 \\ 6 & 0 & 3 \\ 4 & 9 & 5 \end{array} \right| \end{align}

Those vertical lines are not absolute value lines.

To find the determinant of a matrix, some very special element manipulation is needed. First, we'll look at finding the determinant of a 1 x 1 matrix and 2 x 2 matrix. Then, we will investigate the determinate of matrices of greater dimensions.

The determinant of a 1 x 1 matrix is simply whatever the element is. The determinant of a 2 x 2 matrix with the form $\left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]$ is ad-bc. So, the determinant of a matrix, say $\left[ \begin{array}{cc} 2 & 4 \\ 1 & 3 \end{array} \right]$ is 2*3-4*1, which is 6-4, which is 2. Finding the determinant though this process is good with 2 x 2 matrices and prove faster than calculators, usually.

Finding the determinant of matrices of higher dimensions is more complicated. Usually, a calculator can be used. Here, we will discuss the handwritten way. This method can take a while, but hopefully, it's easy to understand. First, write down your matrix. Then, write the same matrix on its right side without the rightmost row. Like so…

(11)
\begin{align} \left[ \begin{array}{ccc} 2 & 0 & 1 \\ -3 & 4 & 2 \\ 5 & -2 & -1 \end{array} \right] \begin{array}{cc} 2 & 0 \\ -3 & 4 \\ 5 & -2 \end{array} \end{align}

## Inversion

With matrices, there is no such thing as division. Instead, we use inversion. Consider this: Say that we have 4/5. This can also be 4*1/5. Well, this form looks really weird. So, suppose we did not want a fraction, or a decimal. What can we do? Remember what reciprocals are? The reciprocal of 1/5 is 5. When we take any number to the -1 power, it represents the reciprocal. For example, n-1 is 1/n. So, we can also represent 4/5 as 4*5-1. So, instead of dividing 4 by 5, we are multiplying by 5's inverse. This is what we do in matrix inversion.