Matrices Part 2: What Can I Do With a Matrix?

Hallway full of arcade cabinets with string lights hanging from ceiling

Photo by Kyle Nieber on Unsplash

Did you know you can use matrices to transform and rotate shapes? Video game designers use these transformation matrices to move and manipulate the models in their games. Here’s a link if you want to interact with a 2D transformation matrix.

Addition and Subtraction

Matrices of equal dimension can be added and subtracted. Each element in one matrix is added or subtracted to its corresponding element in the other matrix.

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

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

Scalar Multiplication

A matrix can be scaled up or down by multiplying it with a number called a scalar. A scalar is usually a unitless and dimensionless number. The scalar multiplies each element individually. 

\(4 \left[
\begin{array}{cc}
1 & 2 \\
3 & 4 \\
\end{array}
\right]=\left[
\begin{array}{cc}
4\ * 1 & 4\ * 2 \\
4\ * 3 & 4\ * 4 \\
\end{array}
\right]=\left[
\begin{array}{cc}
4 & 8 \\
12 & 16 \\
\end{array}
\right] \)

Multiplication (Dot Product)

Under certain conditions, two matrices can be multiplied together. This is called taking the dot product. Two matrices can only be multiplied together if the number of columns of the first matrix matches the number of rows in the second matrix. An easy way to check this is to write the dimensions of both matrices in the order you want to multiply them. The dot product will have a solution if, and only if, the two inner numbers match.

TRUE or FALSE: The dot, or matrix, product AB, where A= \( \left[
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right] \)  and B= \( \left[
\begin{array}{c}
1 \\
1 \\
\end{array}
\right] \) has a solution.

Ans: TRUE. The dimensions of A and B are 2×2 and 2×1. The two inner dimensions are both 2, therefore this dot product has a solution. Note: the result of the dot product will be a matrix with the dimensions of the two outer numbers. In this case, the answer would be a 2×1 matrix.

TRUE or FALSE: The dot, or matrix, product BA, where A=  \(\left[
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right] \) and B= \( \left[
\begin{array}{c}
1 \\
1 \\
\end{array}
\right] \) has a solution.

Ans: FALSE. The dimensions of B and A are 2×1 and 2×2. The two inner dimensions are 1 and 2. Therefore this dot product has no solution.

Now, here’s how to calculate a dot product. In short, the column elements of the second matrix multiply the corresponding row elements of the first matrix. The resulting numbers are then added together.

If you have a graphing calculator, it can probably do this operation for you. It is worth taking the time to learn how to do it on your calculator.

Below, we will walk you through an example by hand. We highly recommend that you visit this website to see an animated version of the process. (Trust us, it’s easier when you see the process in action!)

Let’s take matrices A and B where A= \(\left[
\begin{array}{cc}
1 & 2 \\
3 & 4 \\
\end{array}
\right] \) and B= \( \left[
\begin{array}{c}
5 \\
6 \\
\end{array}
\right] \) 

Since the dimensions of A and B are 2×2 and 2×1, AB has a solution. Here’s how to find it.

The column elements of B will multiply the corresponding row elements of A, then the resulting rows are summed:

\(x_{p,q}\) represents the element located in the \( p^{\text{th}} \) row and \( q^{\text{th}} \) column of matrix X

Using this notation we can fill in the solution:

\(\left[
\begin{array}{cc}
1 & 2 \\
3 & 4 \\
\end{array}
\right] \left[
\begin{array}{c}
5 \\
6 \\
\end{array}
\right]=\left[
\begin{array}{c}
1\ * 5+2\ * 6 \\
3\ * 5+4\ * 6 \\
\end{array}
\right]=\left[
\begin{array}{c}
17 \\
39 \\
\end{array}
\right] \)

If we look back at the matrices in the true or false questions, we can learn about a special kind of matrix called the Identity matrix. The Identity matrix is an nxn matrix, symbolized by \( I_n \), where all the diagonal elements are 1, and all other elements are zero. Let’s see what it does.

Say \(I_2=\left[
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right] \), and \( B=\left[
\begin{array}{c}
1 \\
1 \\
\end{array}
\right] \). Find \(I_2B\).

\(I_2 B=\left[
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right] \left[
\begin{array}{c}
1 \\
1 \\
\end{array}
\right]=\left[
\begin{array}{c}
1\ * 1+1\ * 0 \\
0\ * 1+1\ * 1 \\
\end{array}
\right]=\left[
\begin{array}{c}
1 \\
1 \\
\end{array}
\right]=B \)

We got B back! The Identity matrix has the unique property of keeping the matrices it multiplies unchanged. It is the matrix equivalent of multiplying by 1!

The Determinant:

At first glance, the determinant of a matrix seems arbitrary. For a 2×2 matrix \(A=\left[
\begin{array}{cc}
a & b \\
c & d \\
\end{array}
\right] \) its determinant is: det(A)= ad-bc.

(So far, the ACT has never asked for a determinant of a higher dimensional matrix than a 2×2, but you can learn more about finding the determinants of larger matrices here if you’re curious.)

Example: Find the determinant of the matrix \( \left[
\begin{array}{cc}
1 & 5 \\
2 & 4 \\
\end{array}
\right] \).

det \(\left[
\begin{array}{cc}
1 & 5 \\
2 & 4 \\
\end{array}
\right]=1\ * 4-5\ * 2=-6\)

Ultimately, if you think of a matrix as a system of linear equations, the determinant of that matrix tells you whether or not that system has a single solution.

If the determinant of a matrix is zero, there won’t be exactly 1 solution to that system. (There could be more than one or there could be none!)

Let’s work through some examples together.