# Engaging students: Computing the determinant of a matrix

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission again comes from my former student Brendan Gunnoe. His topic: computing the determinant of a matrix.

How can this topic be used in your students’ future courses in mathematics or science?

When students learn about the determinant of a matrix, they only learn about computing it and don’t learn about the applications of the determinant or what they signify. One interesting use of the determinant is finding the eigenvectors of a matrix. A visual understanding of what an eigenvector is can be done by showing what a matrix does to the any generic vector, and what it does to the eigenvectors. For a generic vector that is different from an eigenvector, the matrix knocks the vector off the span of the original vector. What makes an eigenvector special is the fact that the matrix transformation keeps the eigenvector on its span but rescales said eigenvector by its eigenvalue. For example, take the matrix

$\left[ \begin{array}{cc} 5 & 3 \\ 3 & 5 \end{array} \right]$.

This matrix’s eigenvectors are $\left[ \begin{array}{c} 1 \\ 1 \end{array} \right]$ and $\left[ \begin{array}{c} 1 \\ -1 \end{array} \right]$ with eigenvalues 8 and 2 respectively. That is,

$\left[ \begin{array}{cc} 5 & 3 \\ 3 & 5 \end{array} \right] \left[ \begin{array}{c} 1 \\ 1 \end{array} \right] = \left[ \begin{array}{c} 8 \\ 8 \end{array} \right] = 8 \left[ \begin{array}{c} 1 \\ 1 \end{array} \right]$

and

$\left[ \begin{array}{cc} 5 & 3 \\ 3 & 5 \end{array} \right] \left[ \begin{array}{c} 1 \\ -1 \end{array} \right] = \left[ \begin{array}{c} 2 \\ -2 \end{array} \right] = 2 \left[ \begin{array}{c} 1 \\ -1 \end{array} \right]$.

Eigenvectors have many useful applications in future math and science classes including electronics, linear algebra, differential equations and mechanical engineering.

How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic? Note: It’s not enough to say “such-and-such is a great website”; you need to explain in some detail why it’s a great website.

The YouTube channel 3Blue1Brown has a fantastic video on determinates and linear transformations. Grant, the channel owner, uses animations to visualize what a matrix transformation does to the plane . He starts by showing what a transformation does to a single square then shows why the change of change of that one area shows what happens to the area of any region. He also gives multiple explanations for what a negative determinate means in terms of orientation of the axes. Then he explains what happens when the determinate is 0. All of this is already extremely useful for understanding what a 2×2 matrix does, but Grant continues and extends all the same things for 3×3 transformations. Lastly, Grant gives a few explanations on why the formula for the determinate is what it is and poses a small puzzle for the viewer to contemplate. This video explains what and why we use determinates and how they can be useful all while showing pleasing visual examples and other explanations.

What interesting word problems using this topic can your students do now?

Using determinates to see if a set of vectors is a basis.

The determinant can tell you when a matrix squishes space into a lower dimensional space like a line or a plane. Thus, taking the determinate of a matrix composed of a set of vectors tells you if those vectors are a basis for the matrix’s dimension.

Part 1. A 3D printer’s axes are set up in such a way that the print head can only travel in the direction $\left[ \begin{array}{c} 1 \\ 1 \end{array} \right]$ and $\left[ \begin{array}{c} -1 \\ 1 \end{array} \right]$. Assume that the place where the print head is right now is the origin $\left[ \begin{array}{c} 0 \\ 0 \end{array} \right]$. Can you move the print head to the location $\left[ \begin{array}{c} x \\ y \end{array} \right]$ and $\left[ \begin{array}{c} 1 \\ -1 \end{array} \right]$ by only moving in the directions of $\left[ \begin{array}{c} 1 \\ 1 \end{array} \right]$ and $\left[ \begin{array}{c} -1 \\ 1 \end{array} \right]$?

Hint: Try to solve $\left[ \begin{array}{cc} 1 & -1 \\ 1 & 1 \end{array} \right] \left[ \begin{array}{c} a \\ b \end{array} \right] = \left[ \begin{array}{c} x \\ y \end{array} \right]$ . Does this always have a solution $\left[ \begin{array}{c} a \\ b \end{array} \right]$?

Part 2. Next time you turn on your 3D printer, one of the motor’s broke and now the print head can only move in the direction of $\left[ \begin{array}{c} 1 \\ 0 \end{array} \right]$. Assume that the place where the print head is right now is the origin $\left[ \begin{array}{c} 0 \\ 0 \end{array} \right]$. Can you move the print head to the location  by only moving in the direction of $\left[ \begin{array}{c} 1 \\ 0 \end{array} \right]$?

Hint: Try to solve $\left[ \begin{array}{cc} 1 & 0 \\ 0 & 0 \end{array} \right] \left[ \begin{array}{c} a \\ b \end{array} \right] = \left[ \begin{array}{c} x \\ y \end{array} \right]$ . Does this always have a solution $\left[ \begin{array}{c} a \\ b \end{array} \right]$?

Part 3. You buy a new 3D printer that it can move in all three directions: up/down, left/right, forward/backwards. When you test out the movement of the print head, you see that each axis moves in the directions of $\left[ \begin{array}{c} 1 \\ 0 \\ 0 \end{array} \right]$, $\left[ \begin{array}{c} 0 \\ 1 \\ 0 \end{array} \right]$, and $\left[ \begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right]$. Can you use your new 3D printer to go to any location $\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]$, inside the printing space?

Hint: Think about solving $\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right] \left[ \begin{array}{c} a \\ b \\ c \end{array} \right] = \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]$ . Does this always have a solution $\left[ \begin{array}{c} a \\ b \\ c \end{array} \right]$? How do you know?

Part 4. Your little sibling messed around with your new 3D printer and now it moves in the directions $\left[ \begin{array}{c} 1 \\ 0 \\ 1 \end{array} \right]$, $\left[ \begin{array}{c} 1 \\ 1 \\ 0 \end{array} \right]$, and $\left[ \begin{array}{c} 2 \\ 1 \\ 1 \end{array} \right]$. Is your 3D printer able to get to some point $\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]$ inside the printing space as is, or do you need to fix your printer?

Hint: Think about solving $\left[ \begin{array}{ccc} 1 & 1 & 2 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{array} \right] \left[ \begin{array}{c} a \\ b \\ c \end{array} \right] = \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]$. Does this always have a solution $\left[ \begin{array}{c} a \\ b \\ c \end{array} \right]$? How do you know?

# Area of a triangle: Vertices (Part 7)

Suppose that the vertices of a triangle are $(1,2)$, $(2,5)$, and $(3,1)$. What is the area of the triangle?

At first blush, this doesn’t fall under any of the categories of SSS, SAS, or ASA. And we certainly aren’t given a base $b$ and a matching height $h$. The Pythagorean theorem could be used to determine the lengths of the three sides so that Heron’s formula could be used, but that would be extremely painful to do.

Fortunately, there’s another way to find the area of a triangle that directly uses the coordinates of the triangle. It turns out that the area of the triangle is equal to the absolute value of

$\displaystyle \frac{1}{2} \left| \begin{array}{ccc} 1 & 2 & 1 \\ 2 & 5 & 1 \\ 3 & 1 & 1 \end{array} \right|$

Notice that the first two columns contain the coordinates of the three vertices, while the third column is just padded with $1$s. Calculating, we find that the area is

$\left| \displaystyle \frac{1}{2} \left( 5 + 6 + 2 - 15 - 4 - 1 \right) \right| = \left| \displaystyle -\frac{7}{2} \right| = \displaystyle \frac{7}{2}$

In other words, direct use of the vertices is, in this case, a lot easier than the standard SSS, SAS, or ASA formulas.

A (perhaps) surprising consequence of this formula is that the area of any triangle with integer coordinates must either be an integer or else a half-integer. We’ll see this again when we consider Pick’s theorem in tomorrow’s post.

There is another way to solve this problem by considering the three vertices as points in $\mathbb{R}^3$. The vector from $(1,2,0)$ to $(2,5,0)$ is $\langle 1,3,0 \rangle$, while the vector from $(1,2,0)$ to $(3,1,0)$ is $\langle 2,-1,0 \rangle$. Therefore, the area of the triangle is one-half the length of the cross-product of these two vectors. Recall that the cross-product of the two vectors is

$\langle 1,3,0 \rangle \times \langle 2,-1,0 \rangle = \left| \begin{array}{ccc} {\bf i} & {\bf j} & {\bf k} \\ 1 & 3 & 0 \\ 2 & -1 & 0 \end{array} \right|$

$\langle 1,3,0 \rangle \times \langle 2,-1,0 \rangle = -7{\bf k}$

So the length of the cross-product is clearly $7$, so that the area of the triangle is (again) $\displaystyle \frac{7}{2}$.

The above technique works for any triangle in $\mathbb{R}^3$. For example, if we consider a triangle in three-dimensional space with corners at $(1,2,3)$, $(4,3,0)$, and $(6,1,9)$, the area of the triangle may be found by “subtracting” the coordinates to find two vectors along the sides of the triangle and then finding the cross-product of those two vectors.

Furthermore, determinants may be used to find the volume of a tetrahedron in $\mathbb{R}^3$. Suppose that we now consider the tetrahedron with corners at $(1,2,3)$, $(4,3,0)$, $(6,1,9)$, and $(2,5,2)$. Let’s consider $(1,2,3)$ as the “starting” point and subtract these coordinates from those of the other three points. We then get the three vectors

$\langle 3,2,-3 \rangle$, $\langle 5,-1,6 \rangle$, and $\langle 1,3,-1 \rangle$

One-third of the absolute value of the determinant of these three vectors will be the volume of the tetrahedron.

This post has revolved around one central idea: a determinant represents an area or a volume. While this particular post has primarily concerned triangles and tetrahedra, I should also mention that determinants are similarly used (without the factors of $1/2$ and $1/3$) for finding the areas of parallelograms and the volumes of parallelepipeds.

This central idea is also the basis behind an important technique taught in multivariable calculus: integration in polar coordinates and in spherical coordinates.
In two dimensions, the formulas for conversion from polar to rectangular coordinates are

$x = r \cos \theta$ and $y = r \sin \theta$

Therefore, using the Jacobian, the “infinitesimal area element” used for integrating is

$dx dy = \left| \begin{array}{cc} \partial x/\partial r & \partial y/\partial r \\ \partial x/\partial \theta & \partial y/\partial \theta \end{array} \right| dr d\theta$

$dx dy = \left| \begin{array}{cc} \cos \theta & \sin \theta \\ -r \sin \theta & r \cos \theta \end{array} \right| dr d\theta$

$dx dy = (r \cos^2 \theta + r \sin^2 \theta) dr d\theta$

$dx dy = r dr d\theta$

Similarly, using a $3 \times 3$ determinant, the conversion $dx dy dz = r^2 \sin \phi dr d\theta d\phi$ for spherical coordinates can be obtained.
References:

http://www.purplemath.com/modules/detprobs.htm

http://mathworld.wolfram.com/Parallelogram.html

http://en.wikipedia.org/wiki/Parallelogram#Area_formulas

http://mathworld.wolfram.com/Parallelepiped.html

http://en.wikipedia.org/wiki/Parallelopiped#Volume

# Engaging students: Computing the determinant of a matrix

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission again comes from my former student Caitlin Kirk. Her topic: computing the determinant of a matrix.

B. Curriculum: How does this topic extend what your students should have learned in previous courses?

Students learn early in their mathematical careers how to calculate the area of simple polygons such as triangles and parallelograms. They learn by memorizing formulas and plugging given values into the formulas. Matrices, and more specifically the determinant of a matrix, can be used to do the same thing.

For example, consider a triangle with vertices $(1,2)$, $(3, -4)$, and $(-2,3)$. The traditional method for finding the area of this circle would be to use the distance formula to find the length of each side and the height before plugging and chugging with the formula $A = \frac{1}{2} bh$. Matrices can be used to compute the same area in fewer steps using the fact that the area of a triangle the absolute value of one-half times the determinant of a matrix containing the vertices of the triangle as shown below.

First, put the vertices of the triangle into a matrix using the x-values as the first column and the corresponding y-values as the second column. Then fill the third column with 1’s as shown:

Next, compute the determinant of the matrix and multiply it by ½ (because the traditional area formula for a triangle calls for multiplying by ½ to account for the fact that a triangle is half of a rectangle, it is necessary to keep the ½ here also) as shown:

Obviously, the area of a triangle cannot be negative. Therefore it is necessary to take the absolute value of the final answer. In this case $|-8| = 8$, making the area positive eight instead of negative eight.

The same idea can be applied to extend students knowledge of the area of other polygons such as a parallelogram, rectangle, or square. Determinants of matrices are a great extension of the basic mathematical concept of area that students will have learned in previous courses.

D. History: What are the contributions of various cultures to this topic?

The history of matrices can be traced to four different cultures. First, Babylonians as early as 300 BC began attempting to solve simultaneous linear equations like the following:

There are two fields whose total area is eighteen hundred square yards. One produces grain at the rate of two-thirds of a bushel per square yard while the other produces grain at the rate of on-half a bushel per square yard. If the total yield is eleven hundred bushels, what is the size of each field?

While the Babylonians at this time did not actually set up matrices or calculate any determinants, they laid the framework for later cultures to do so by creating systems of linear equations.

The Chinese, between 200 BC and 100 BC, worked with similar systems and began to solve them using columns of numbers that resemble matrices. One such problem that they worked with is given below:

There are three types of corn, of which three bundles of the first, two of the second, and one of the third make 39 measures. Two of the first, three of the second and one of the third make 34 measures. And one of the first, two of the second and three of the third make 26 measures. How many measures of corn are contained of one bundle of each type?

Unlike the Babylonians, the Chinese answered this question using their version of matrices, called a counting board. The counting board functions the same way as modern matrices but is turned on its side. Modern matrices write a single equation in a row and the next equation in the next row and so forth. Chinese counting boards write the equations in columns. The counting board below corresponds to the question above:

1   2   3

2   3   2

3   1   1

26  34  39

They then used what we know as Gaussian elimination and back substitution to solve the system by performing operations on the columns until all but the bottom row contains only zeros and ones. Gaussian elimination with back substitution did not become a well known method until the early 19th century, however.

Next, in 1683, the Japanese and Europeans simultaneously saw the discovery and use of a determinant, though the Japanese published it first. Seki, in Japan, wrote Method of Solving the Dissimulated Problems which contains tables written in the same manner as the Chinese counting board. Without having a word to correspond to his calculations, Seki calculated the determinant and introduced a general method for calculating it based on examples. Using his methods, Seki was able to find the determinants of 2×2, 3×3, 4×4, and 5×5 matrices.

In the same year in Europe, Leibniz wrote that the system of equations below:

$10+11x+12y=0$

$20+21x+22y=0$

$30+31x+32y=0$

has a solution because

$(10 \times 21 \times 32)+(11 \times 22 \times 30)+(12 \times 20 \times 31)=(10 \times 22 \times 31)+(11 \times 20 \times 32)+(12 \times 21 \times 30)$.

This is the exact condition under which the matrix representing the system has a determinant of zero. Leibniz was the first to apply the determinant to finding a solution to a linear system. Later, other European mathematicians such as Cramer, Bezout, Vandermond, and Maclaurin, refined the use of determinants and published rules for how and when to use them.

B. Curriculum: How can this topic be used in you students’ future courses in mathematics or science?

Calculating the determinant is used in many lessons in future mathematics courses, mainly in algebra II and pre-calculus. The determinant is the basis for Cramer’s rule that allows a student to solve a system of linear equations. This leads to other methods of solving linear systems using matrices such as Gaussian elimination and back substitution.  It can also be used in determining the invertibility of matrices.  A matrix whose determinant is zero does not have an inverse. Invertibility of matrices determines what other properties of matrix theory a given matrix will follow. If students were to continue pursuing math after high school, understanding determinants is essential to linear algebra.

# That Makes It Invertible!

There are several ways of determining whether an $n \times n$ matrix ${\bf A}$ has an inverse:

1. $\det {\bf A} \ne 0$
2. The span of the row vectors is $\mathbb{R}^n$
3. Every matrix equation ${\bf Ax} = {\bf b}$ has a unique solution
4. The row vectors are linearly independent
5. When applying Gaussian elimination, ${\bf A}$ reduces to the identity matrix ${\bf I}$
6. The only solution of ${\bf Ax} = {\bf 0}$ is the trivial solution ${\bf x} = {\bf 0}$
7. ${\bf A}$ has only nonzero eigenvalues
8. The rank of ${\bf A}$ is equal to $n$

Of course, it’s far more fun to remember these facts in verse (pun intended). From the YouTube description, here’s a Linear Algebra parody of One Direction’s “What Makes You Beautiful”. Performed 3/8/13 in the final lecture of Math 40: Linear Algebra at Harvey Mudd College, by “The Three Directions.”

While I’m on the topic, here’s a brilliant One Direction mashup featuring the cast of Downton Abbey. Two giants of British entertainment have finally joined forces.