อภิธานศัพท์

เลือกหนึ่งในคำหลักทางด้านซ้าย ...

Linear AlgebraDeterminants

เวลาอ่านหนังสือ: ~25 min

The determinant of a square matrix A is a single number which captures some important information about how the transformation \mathbf{x}\mapsto A\mathbf{x} behaves. In this section, we will develop a geometrically-motivated definition of the determinant.

Exercise
Suppose that R is a region in \mathbb{R}^n and that A is an n \times n matrix. Consider the singular value decomposition A = U \Sigma V'.

  • Let L_1(\mathbf{x}) = V'\mathbf{x}. By what factor does L_1 transform volumes?
  • Let L_2(\mathbf{x}) = \Sigma\mathbf{x}. In terms of the entries of \Sigma, by what factor does L_1 transform volumes?
  • Let L_3(\mathbf{x}) = U\mathbf{x}. By what factor does L_3 transform volumes?

Solution. Since U and V are orthogonal, L_1 and L_3 both preserve volumes. So they multiply volumes by a factor of 1. Since L_2 scales volumes by a factor of \sigma_1 along the first axis, \sigma_2 along the second, and so on, it scales volumes by a factor of \sigma_1 \sigma_2 \ldots \sigma_n.

Volume scale factor

We see from this exercise that a linear transformation T from \mathbb{R}^n to \mathbb{R}^n scales the volume of any n-dimensional region by the same factor: the volume scale factor of T.

Exercise
Find the volume scale factor of the matrix A = \begin{bmatrix} 1 & 0 & 0 \\\ 0 & 0 & 1 \\\ 0 & k & 0 \end{bmatrix} by describing how the matrix transforms a region in \mathbb{R}^3.

Solution. Since A[x,y,z] = [x,z,ky], we see that A stretches (or compresses) regions in \mathbb{R}^3 by a factor k along the y-axis and then reflects across the plane y = z. For example, the unit cube is mapped to a 1 \times 1 \times k box Since such a box has volume k, the volume scale factor of S is k.

Orientation factor

Another geometrically relevant piece of information about T is whether it preserves or reverses orientations. For example, rotations in \mathbb{R}^2 are orientation preserving, while reflections are orientation reversing. Let's define the orientation factor of T to be +1 if T is orientation preserving and -1 if T is orientation reversing.

Definition
We define the determinant of a transformation T to be the product of its orientation factor and its volume scale factor.

We define the determinant of a matrix A to be the determinant of the corresponding linear transformation \mathbf{x}\mapsto A\mathbf{x}.

Exercise
Interpret A = \begin{bmatrix} 0 & -1 \\\ -1 & 0 \end{bmatrix} geometrically and use this interpretation to find \det A, the determinant of A.

Solution. Since A\begin{bmatrix} x \\\ y \end{bmatrix} = \begin{bmatrix} -y \\\ -x \end{bmatrix}, A reflects points in \mathbb{R}^2 across the line y = -x. Therefore, it preserves areas and reverses orientations. So its determinant is -1.

There is relatively simple formula for \det A in terms of the entries of A. For example,

\begin{align*}\left|\begin{array}{cc} a & b \\\ c & d \end{array}\right| = ad - bc\end{align*}

is the determinant of a 2 \times 2 matrix. However this formula is terribly inefficient if A has many entries (it has n! terms for an n\times n matrix), and all scientific computing environments have a det function which uses much faster methods.

Exercise
For various values of n, use the expression np.linalg.det(np.random.randint(-9,10,(n,n))) det(rand(-9:9, n, n)) to find the determinant of an n\times n matrix filled with random single-digit numbers. How large does n have to be for the determinant to be large enough to consistently overflow?

import numpy as np
np.linalg.det(np.random.randint(-9,10,(n,n)))
using LinearAlgebra
det(rand(-9:9, n, n))

Solution. Trial and error reveals that this determinant starts to consistently return inf Inf at n = 187.

Exercise
Suppose that A and B are 3 \times 3 matrices, with determinant 5 and \frac{1}{2} respectively. Suppose that R \subset \mathbb{R}^3 is a 3D region modeling a fish whose volume is 14. What is the volume of the transformed fish BA(R)?

19.5
35
12
16.5

Solution. The volume of A(R) is 5 \cdot 14 = 70. The volume of BA(R) = B(A(R)) is \tfrac{1}{2} \cdot 70 = 35.

Exercise
Let R \subset \mathbb{R}^3 be 3D region modeling a fish, and suppose A an invertible 3 \times 3 matrix. If R has volume 15 and A^{-1}(R) has volume 5, then the determinant of A is equal to ?

Solution. We can see that the matrix A^{-1} scales volumes by \frac{1}{3}, and hence \det A^{-1} = \frac{1}{3}. This implies that \det A = 3.

Determinants can be used to check whether a matrix is invertible, since A is noninvertible if and only if it maps \mathbb{R}^n to a lower-dimensional subspace of \mathbb{R}^n, and in that case A squishes positive-volume regions down to zero-volume regions.

Exercise
Let A = \begin{bmatrix} 2 & -2 \\\ -4 & 0 \end{bmatrix}. Find the values of \lambda \in \mathbb{R} for which the equation A \mathbf{v} = \lambda \mathbf{v} has nonzero solutions for \mathbf{v}.

Solution. We can rewrite A\mathbf{v} = \lambda \mathbf{v} as A\mathbf{v} = (\lambda I) \mathbf{v}, where I is the identity matrix. We can rearrange this to give the equation (A - \lambda I)\mathbf{v} = 0. This has a nontrivial solution if (A - \lambda I) has a nonzero nullspace. Since A - \lambda I is a square matrix, this is equivalent to it having determinant zero.

\begin{align*}\det \left(A - \lambda I \right) = \det \left(\begin{bmatrix} 2-\lambda & -2\\ -4 &- \lambda \end{bmatrix} \right) = -\lambda (2-\lambda) - 8\end{align*}

Setting this equal to zero gives

\begin{align*}\lambda^2 - 2\lambda - 8 = 0\end{align*}

The left-hand side can be factored

\begin{align*}(\lambda - 4)(\lambda + 2) = 0\end{align*}

Thus our two solutions are \lambda = 4,-2.

Exercise
For an n \times n square matrix, which of the following is the relationship between \det A and \det (3A)?

XEQUATIONX3239XEQUATIONX.
XEQUATIONX3240XEQUATIONX.
XEQUATIONX3241XEQUATIONX.
\det(3A) = 3^{n} \det (A).

Solution. The answer is (4) \det(3A) = 3^{n} \det (A). There are two ways to see this, algebraically and geometrically.

To check that this is the right answer using algebra, let A = I_{n} be the n \times n identity matrix, with determinant 1. The matrix 3A is diagonal, with threes on the diagonal. Its determinant is the product of the entries on its diagonal, 3 \times 3 \times \cdots \times 3 = 3^{n}.

Geometrically, we know that the determinant of A measures how much A scales volume. The matrix 3A scales by a factor of three more in each dimension. Since there are n dimensions, the total scaling of volume is multiplied by a factor 3^n.

Exercise
Is every matrix with positive determinant positive definite?

Solution. No. Consider the negation of the 2 \times 2 identity matrix. It has determinant 1, yet its eigenvalues are both negative.

Congratulations! You have completed the Data Gymnasia Linear Algebra course.

Bruno
Bruno Bruno