Skip to main content

Section 2.4 Determinants

In this section we will learn how to

Subsection What is the determinant?

Recall that the action of a linear transformation from \(\mathbb{R}^n \rightarrow \mathbb{R}^n\) can be completely determined by a set of \(n\) basis vectors. These basis vectors create a coordinate grid. For example, in \(\mathbb{R}^2\) any set of two non-parallel vectors form a basis and a corresponding coordinate grid of parallelograms. The coordinate grid determines a basic area, the area of the parallelogram between the two basis vectors. Since the transformation is linear, the transformed basis vectors either create a transformed parallelogram, or they collapse to a line or the origin. In particular, the areas of the parallelograms are scaled by the transformation and, since we started with a basis, all areas in the plane are scaled by that same amount. How the area is scaled by a transformation on \(\mathbb{R}^2\) is the value of the determinant.
In \(\mathbb{R}^3\) the coordinate grid determines a basic volume. Here how the volume is scaled by a transformation on \(\mathbb{R}^3\) is the value of the determinant. Finally in \(\mathbb{R}^n\) the coordinate grid determines a basic hypervolume and the value by which the volume is scaled by a transformation on \(\mathbb{R}^n\) is the value of the determinant.
The determinant can be positive or negative depending on whether or not the orientation of the basis vectors changes or not. For example, a reflection in \(\mathbb{R}^2\) will switch the orientation and change the sign of the determinant.

Subsection Computing the Determinant

We can compute the determinant of square matrices both in NumPy and in SymPy as follows.

You Try 2.41.

Find the determinants of the matrices in the code above. What can you conclude about the transformations of \(\mathbb{R}^2\text{?}\)

You Try 2.42.

Find a matrix with determinant 0. Check your determinant in the above code. What can you conclude about the transformation?

You Try 2.43.

Play with finding the determinant of higher dimensional matrices. What can you conclude about the transformations?

Subsection Determinants and Systems of Linear Equations

The determinant gives us a quick way to tell whether or not a system of linear equations has a unique solution or not. Recall that every system of linear equations corresponds to a matrix-vector equation.

Example 2.44.

For example, the systems
\begin{align*} 2x -3y \amp= 1 \amp\text{ and } \amp\amp x+2y \amp = 1 \\ x +4y \amp =2 \amp \amp \amp 3x+6y \amp = 2 \end{align*}
correspond to matrix equations
\begin{equation*} \left[ \begin{matrix} 2 \amp -3 \\ 1 \amp 4 \end{matrix} \right] \left[ \begin{matrix} x\\ y \end{matrix} \right]= \left[ \begin{matrix} 1\\ 2 \end{matrix} \right] \end{equation*}
and
\begin{equation*} \left[ \begin{matrix} 1 \amp 2 \\ 3 \amp 6 \end{matrix} \right] \left[ \begin{matrix} x\\ y \end{matrix} \right]= \left[ \begin{matrix} 1\\ 2 \end{matrix} \right] \end{equation*}
If the corresponding matrix transformation collapses down a dimension, more than one vector gets mapped to the same place, preventing an inverse transformation (since one output would have to map back to several inputs). In this case, the determinant of the transformation is 0. This corresponds exactly to linear systems of equations with either infinitely many solutions or no solution.
When the determinant is non-zero, however, the matrix transformation is invertible. This corresponds exactly to when a system of linear equations has a unique solution, since you can solve for it using \(A^{-1}.\)

You Try 2.45.

Consider the linear systems in Example 2.44.
  • Compute the determinant.
  • What can you conclude about solutions to each system?

Subsection Numerically Solving System of Equations

In Section 2.1, we learned how to solve systems of linear equations using rref() in SymPy. More efficient algorithms
 7 
e.g. using \(LU\)-decomposition of our matrix
can be implemented when we know we have a unique solution. NumPy’s linalg.solve(A,b) and SymPy’s A.solve(b) uses such algorithms to solve \(A\vec{x}=\vec{b}\text{.}\)

You Try 2.46.

Use NumPy’s linalg.solve(A,b) to solve the systems of linear equations in Example 2.44. Next try SymPy’s A.solve(b). What happens? Why?
In practice, we often check the determinant to determine whether or not an algorithm such as linalg.solve() will work before solving the system numerically.
 8 
Many stackoverflow questions have been written asking about the “singular” error when attempting to solve a large system numerically. The response always involves someone in the know checking the determinant.

Subsection Ill-conditioned Matrices

Recall in Example 2.18 we explored solutions to a system of equations where the corresponding matrix was ill-conditioned. How does ill-conditioning relate to the determinant and the matrix transformation?

You Try 2.47.

Compute the determinant of the matrix in Example 2.18. Hypothesize a property of ill-conditioned matrices and explain how this property is related to the rounding issues we experienced.
If we visualize the linear system of equations as a matrix transformation of \(\mathbb{R}^2\) we can graphically see the problem.

You Try 2.48.

Using what we learned in Section 2.3, plot the matrix transformation corresponding to You Try 2.19 on a point grid.
Use your visual to clearly show what is happening with the solutions in You Try 2.19. Note: Solving a matrix equation \(\vec{x}=A^{-1}\vec{b}\) corresponds to then reversing the transformation.

Summary.

  • TBD
  • TBD

Exercises Exercises

1.

Compute the determinant of the matrix in Example 2.18. Hypothesize a property of ill-conditioned matrices and explain how this property is related to the rounding issues we experienced.

2.

Using what we learned in Section 2.3, plot the matrix transformation corresponding to You Try 2.19 on a point grid. Use your visual to clearly show what is happening with the solutions in You Try 2.19. Note: animating can make this even clearer.