Skip to main content

Section 8.3 Determinants

Preview Activity 8.3.1.

The code in 8.3.1 demonstrates how a given matrix transforms the shape of the standard unit square with corners at \((0,0),(1,0),(1,1),(0,1)\text{.}\)

A = matrix([[1,2],[3,4]])

print("The transformation caused by:")
show(A)
plot(vector([1,0]), color="#f88") + \
plot(vector([0,1]), color="#88f") + \
plot(A*vector([1,0]), color="#f00") + \
plot(A*vector([0,1]), color="#00f") + \
polygon([
    vector([0,0]),
    vector([1,0]),
    vector([1,1]),
    vector([0,1]),
    ], color="#fbf"
)+ \
polygon([
    A*vector([0,0]),
    A*vector([1,0]),
    A*vector([1,1]),
    A*vector([0,1]),
    ], color="#f0f"
)
Listing 8.3.1. Transforming a square

(a)

Create several Code cells that modify 8.3.1 in order to show how each of the following matrices transforms the standard unit square.

  • \(\displaystyle \left(\begin{array}{rr} 3 & 1 \\ 2 & 2 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} 0 & -1 \\ 1 & 0 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} -1 & -2 \\ -2 & 1 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} \frac{1}{10} & \frac{3}{10} \\ -\frac{3}{10} & -\frac{1}{2} \end{array}\right)\)

(b)

Write a sentence pointing out a difference or two among these transformations.

(c)

Write a sentence pointing out a similarity or two among these transformations.

Activity 8.3.2.

The determinant of a matrix measures the factor by which it transforms areas.

(a)

One of the following matrices has a determinant equal to \(2\text{,}\) that is, it doubles areas. The other matrix has a determinant equal to \(1/2\text{,}\) that is, it halves areas. Modify the visualization code in 8.3.1 to figure out which is which.

  • \(\displaystyle \left(\begin{array}{rr} \frac{1}{2} & 1 \\ -1 & 2 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} 0 & -\frac{1}{2} \\ 1 & -3 \end{array}\right)\)

(b)

Use visualizations to determine which of the following matrices you think has the biggest determinant, thie middle determinant, and the smallest determinant.

  • \(\displaystyle \left(\begin{array}{rr} 3 & 2 \\ -3 & 4 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} -1 & -2 \\ 3 & 5 \end{array}\right)\)

  • \(\displaystyle \left(\begin{array}{rr} 3 & 1 \\ 3 & 2 \end{array}\right)\)

(c)

Visualize the transformation given by \(\left(\begin{array}{rr} 2 & 5 \\ 2 & 5 \end{array}\right)\text{.}\) What would you expect the value of its determinant to be?

Activity 8.3.3.

It turns out that the determinant of a \(2\times 2\) matrix can be computed by multiplying its diagonals and subtracting:

\begin{equation*} \operatorname{det}\left(\begin{array}{rr} 2 & 3 \\ 1 & 5 \end{array}\right) = (2)(5)-(3)(1) = 10-3=7 \end{equation*}

(a)

Use this technique to confirm your work from the previous activity.

(b)

SageMath can also compute the determinant of a matrix A directly: det(A). Use this to check your work from the previous task.

Activity 8.3.4.

Consider the transformations caused by the matrices \(\left(\begin{array}{rr} 1 & 2 \\ 3 & 4 \end{array}\right)\) and \(\left(\begin{array}{rr} 2 & 1 \\ 4 & 3 \end{array}\right)\text{.}\)

(a)

Write Code cells that visualize how these matrices transform areas and compute their determinants.

(b)

Write a sentence explaining why you think one determinant was positive and one was negative.

(c)

Confirm your guess by making up two new matrices, visualizing them, and then computing their determinants.

Activity 8.3.5.

The code in 8.3.2 visualizes the transformation of the standard unit cube by a \(3\times 3\) matrix, as well as computing its determinant.

A = matrix([
    [3,0,-2],
    [1,-1,3],
    [0,-1,1],
])
print("The determinant of")
show(A)
print("is")
show(det(A))
corners = [
    vector([0,0,0]),
    vector([0,0,1]),
    vector([0,1,0]),
    vector([0,1,1]),
    vector([1,0,0]),
    vector([1,0,1]),
    vector([1,1,0]),
    vector([1,1,1]),
]
plot(Polyhedron(vertices=corners)) + \
plot(Polyhedron(vertices=[A*c for c in corners]))
Listing 8.3.2. Transforming a cube

Create a few Code cells with modified values for the matrix. Then write a sentence explaining what you think the determinant measures for three-dimensional data.

Exercises Exercises

1.

Use Code cells to create visualizations of how the following matrices transform areas.

  • \(\displaystyle A=\left(\begin{array}{rr} -5 & 4 \\ 3 & -3 \end{array}\right)\)

  • \(\displaystyle B=\left(\begin{array}{rr} 3 & 5 \\ -1 & 5 \end{array}\right)\)

  • \(\displaystyle C=\left(\begin{array}{rr} -2 & 4 \\ 4 & -8 \end{array}\right)\)

  • \(\displaystyle D=\left(\begin{array}{rr} -3 & -1 \\ 4 & 3 \end{array}\right)\)

2.

Use these visualizations to explain which matrices have positive determinants, which ones have negative determinants, and which ones have a determinant of zero.

3.

Use these visualizations to explain which matrix has the smallest nonzero determinant and which has the largest determinant. (When comparing the size of determinants, ignore \(\pm\) signs, so a determinant of \(-10\) is considered larger than a determinant of \(+3\text{.}\))

4.

Show how to use the diagonal formula to compute each determinant by hand.

5.

Show how to use SageMath to compute each determinant.

6.

Use SageMath to compute the determinant of \(\left(\begin{array}{rrr} 1 & 3 & -2 \\ -1 & -5 & -1 \\ -2 & 1 & 0 \end{array}\right)\text{.}\) Then write a sentence explaining what this value represents.