7  Inverses, Elementary Matrices, and the Invertible Matrix Theorem

7.1 Opening question

A matrix can represent a process:

\[ x \longmapsto Ax. \]

Sometimes the process can be reversed. If we know the output \(b\), we can recover the input \(x\).

That means we can solve

\[ Ax=b \]

by undoing the action of \(A\).

This chapter studies when a matrix can be undone.

The key object is the inverse matrix.

The key computational method is Gauss–Jordan elimination on \([A\mid I]\).

The key conceptual result is the Invertible Matrix Theorem, which connects many different ways of saying that a square matrix has no information loss.

7.2 Learning goals

After studying this chapter, you should be able to:

  1. Define the inverse of a square matrix.
  2. Determine whether a \(2\times 2\) matrix is invertible.
  3. Compute the inverse of a \(2\times 2\) matrix using the formula.
  4. Compute inverses using Gauss–Jordan elimination.
  5. Understand why row operations can be represented by elementary matrices.
  6. Use an inverse to solve \(Ax=b\) when \(A\) is invertible.
  7. Recognize equivalent descriptions of invertibility.
  8. Interpret invertibility geometrically as no collapse of dimension.
  9. Understand why solving by inverse is usually not the best numerical method.
  10. Use Python to compute inverses, solve systems, and visualize invertible and noninvertible transformations.

7.3 5.1 What does it mean to undo a matrix?

For ordinary numbers, if \(a\ne 0\), then the inverse of \(a\) is \(\frac1a\), and

\[ \frac1a a = 1. \]

For matrices, the identity matrix \(I\) plays the role of the number \(1\).

NoteDefinition: inverse matrix

Let \(A\) be an \(n\times n\) matrix. An \(n\times n\) matrix \(A^{-1}\) is called the inverse of \(A\) if

\[ A^{-1}A=I_n \]

and

\[ AA^{-1}=I_n. \]

If such a matrix exists, then \(A\) is called invertible or nonsingular.

If no inverse exists, then \(A\) is called singular.

The inverse reverses the action of \(A\).

If

\[ Ax=b, \]

and \(A\) is invertible, then multiply both sides by \(A^{-1}\):

\[ A^{-1}Ax=A^{-1}b. \]

Since

\[ A^{-1}A=I, \]

we get

\[ x=A^{-1}b. \]

So when \(A\) is invertible, the system \(Ax=b\) has the unique solution

\[ x=A^{-1}b. \]

7.4 5.2 A first example

Let

\[ A= \begin{bmatrix} 2&0\\ 0&3 \end{bmatrix}. \]

This matrix scales the first coordinate by \(2\) and the second coordinate by \(3\):

\[ A \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 2x\\ 3y \end{bmatrix}. \]

To undo this transformation, divide the first coordinate by \(2\) and the second coordinate by \(3\).

Thus

\[ A^{-1}= \begin{bmatrix} \frac12&0\\ 0&\frac13 \end{bmatrix}. \]

Check:

\[ A^{-1}A= \begin{bmatrix} \frac12&0\\ 0&\frac13 \end{bmatrix} \begin{bmatrix} 2&0\\ 0&3 \end{bmatrix} = \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} =I_2. \]

Also,

\[ AA^{-1}=I_2. \]

7.5 5.3 The inverse of a \(2\times 2\) matrix

For a \(2\times 2\) matrix

\[ A= \begin{bmatrix} a&b\\ c&d \end{bmatrix}, \]

the determinant is

\[ \det(A)=ad-bc. \]

If

\[ ad-bc\ne 0, \]

then \(A\) is invertible and

\[ A^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d&-b\\ -c&a \end{bmatrix}. \]

If

\[ ad-bc=0, \]

then \(A\) is not invertible.

ImportantThe \(2\times 2\) inverse formula

\[ \begin{bmatrix} a&b\\ c&d \end{bmatrix}^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d&-b\\ -c&a \end{bmatrix}, \qquad ad-bc\ne 0. \]

7.6 5.4 Example using the \(2\times 2\) formula

Let

\[ A= \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix}. \]

Then

\[ \det(A)=1(4)-2(3)=4-6=-2. \]

Since \(\det(A)\ne 0\), the matrix is invertible.

Using the formula,

\[ A^{-1} = \frac{1}{-2} \begin{bmatrix} 4&-2\\ -3&1 \end{bmatrix} = \begin{bmatrix} -2&1\\ \frac32&-\frac12 \end{bmatrix}. \]

Check:

\[ AA^{-1} = \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix} \begin{bmatrix} -2&1\\ \frac32&-\frac12 \end{bmatrix} = \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix}. \]

7.7 5.5 Example of a noninvertible matrix

Let

\[ A= \begin{bmatrix} 1&2\\ 2&4 \end{bmatrix}. \]

Then

\[ \det(A)=1(4)-2(2)=0. \]

So \(A\) is not invertible.

Why geometrically?

The second column is twice the first column:

\[ \begin{bmatrix} 2\\ 4 \end{bmatrix} = 2 \begin{bmatrix} 1\\ 2 \end{bmatrix}. \]

Therefore the two columns point in the same direction. The matrix cannot produce all vectors in \(\mathbb{R}^2\). It collapses the plane onto a line.

Once a two-dimensional plane is collapsed onto a one-dimensional line, information is lost. We cannot reverse the process.

7.8 5.6 Geometry of invertibility in \(\mathbb{R}^2\)

A \(2\times 2\) matrix transforms the plane.

If the matrix is invertible, it sends the plane to the whole plane. It may rotate, reflect, shear, stretch, or shrink, but it does not collapse area to zero.

If the matrix is not invertible, it collapses the plane into a line or a point.

7.8.1 Python plot: invertible transformation

import numpy as np
import matplotlib.pyplot as plt

A = np.array([[1.0, 0.7],
              [0.3, 1.2]])

# grid points
xs = np.linspace(-2, 2, 9)
ys = np.linspace(-2, 2, 9)

plt.figure(figsize=(6, 6))

# original grid
for x in xs:
    pts = np.array([[x, y] for y in ys])
    trans = pts @ A.T
    plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

for y in ys:
    pts = np.array([[x, y] for x in xs])
    trans = pts @ A.T
    plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

# transformed basis vectors
e1 = A @ np.array([1, 0])
e2 = A @ np.array([0, 1])
plt.arrow(0, 0, e1[0], e1[1], head_width=0.08, length_includes_head=True)
plt.arrow(0, 0, e2[0], e2[1], head_width=0.08, length_includes_head=True)
plt.text(e1[0] + 0.05, e1[1], "$Ae_1$")
plt.text(e2[0] + 0.05, e2[1], "$Ae_2$")

plt.axhline(0, linewidth=0.8)
plt.axvline(0, linewidth=0.8)
plt.axis("equal")
plt.grid(True)
plt.title("An invertible matrix transforms the plane without collapse")
plt.show()

7.8.2 Python plot: noninvertible transformation

A = np.array([[1.0, 2.0],
              [2.0, 4.0]])

xs = np.linspace(-2, 2, 9)
ys = np.linspace(-2, 2, 9)

plt.figure(figsize=(6, 6))

for x in xs:
    pts = np.array([[x, y] for y in ys])
    trans = pts @ A.T
    plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

for y in ys:
    pts = np.array([[x, y] for x in xs])
    trans = pts @ A.T
    plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

plt.axhline(0, linewidth=0.8)
plt.axvline(0, linewidth=0.8)
plt.axis("equal")
plt.grid(True)
plt.title("A noninvertible matrix collapses the plane onto a line")
plt.show()

The second plot shows the key geometric idea: noninvertible matrices lose information.

7.9 5.7 Computing inverses by Gauss–Jordan elimination

The \(2\times 2\) formula is useful, but it does not scale well to large matrices.

For general \(n\times n\) matrices, we compute inverses using row reduction.

The idea is:

\[ [A\mid I] \longrightarrow [I\mid A^{-1}]. \]

If row reduction turns the left side into \(I\), then the right side becomes \(A^{-1}\).

If the left side cannot be turned into \(I\), then \(A\) is not invertible.

NoteAlgorithm: inverse by row reduction

To find \(A^{-1}\):

  1. Form the augmented matrix \([A\mid I_n]\).
  2. Use Gauss–Jordan elimination.
  3. If the left side becomes \(I_n\), then the right side is \(A^{-1}\).
  4. If the left side does not become \(I_n\), then \(A\) is not invertible.

7.10 5.8 Example: inverse by row reduction

Let

\[ A= \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix}. \]

Start with

\[ [A\mid I] = \left[ \begin{array}{ccc|ccc} 1&1&1&1&0&0\\ 1&2&3&0&1&0\\ 1&3&6&0&0&1 \end{array} \right]. \]

Apply row operations.

First eliminate below the first pivot:

\[ R_2\leftarrow R_2-R_1, \qquad R_3\leftarrow R_3-R_1. \]

Then

\[ \left[ \begin{array}{ccc|ccc} 1&1&1&1&0&0\\ 0&1&2&-1&1&0\\ 0&2&5&-1&0&1 \end{array} \right]. \]

Eliminate below the second pivot:

\[ R_3\leftarrow R_3-2R_2. \]

Then

\[ \left[ \begin{array}{ccc|ccc} 1&1&1&1&0&0\\ 0&1&2&-1&1&0\\ 0&0&1&1&-2&1 \end{array} \right]. \]

Eliminate above the third pivot:

\[ R_2\leftarrow R_2-2R_3, \qquad R_1\leftarrow R_1-R_3. \]

Then

\[ \left[ \begin{array}{ccc|ccc} 1&1&0&0&2&-1\\ 0&1&0&-3&5&-2\\ 0&0&1&1&-2&1 \end{array} \right]. \]

Eliminate above the second pivot:

\[ R_1\leftarrow R_1-R_2. \]

Then

\[ \left[ \begin{array}{ccc|ccc} 1&0&0&3&-3&1\\ 0&1&0&-3&5&-2\\ 0&0&1&1&-2&1 \end{array} \right]. \]

Therefore

\[ A^{-1} = \begin{bmatrix} 3&-3&1\\ -3&5&-2\\ 1&-2&1 \end{bmatrix}. \]

7.11 5.9 Checking an inverse

We should always check an inverse by multiplication.

For

\[ A= \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix} \]

and

\[ B= \begin{bmatrix} 3&-3&1\\ -3&5&-2\\ 1&-2&1 \end{bmatrix}, \]

we compute

\[ AB=I_3 \]

and

\[ BA=I_3. \]

In practice, for square matrices, if one of these identities holds exactly, then the other also holds. But when learning, it is useful to understand that the definition of inverse requires both.

7.12 5.10 Solving systems using an inverse

Suppose

\[ Ax=b, \]

where

\[ A= \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix} \]

and

\[ b= \begin{bmatrix} 3\\ 5\\ 8 \end{bmatrix}. \]

Since

\[ A^{-1} = \begin{bmatrix} 3&-3&1\\ -3&5&-2\\ 1&-2&1 \end{bmatrix}, \]

we get

\[ x=A^{-1}b. \]

Compute:

\[ x= \begin{bmatrix} 3&-3&1\\ -3&5&-2\\ 1&-2&1 \end{bmatrix} \begin{bmatrix} 3\\ 5\\ 8 \end{bmatrix} = \begin{bmatrix} 2\\ -2\\ 3 \end{bmatrix}. \]

Thus the solution is

\[ x_1=2,\qquad x_2=-2,\qquad x_3=3. \]

7.13 5.11 Elementary matrices

Every elementary row operation can be performed by multiplying on the left by a special matrix called an elementary matrix.

NoteDefinition: elementary matrix

An elementary matrix is obtained by applying one elementary row operation to an identity matrix.

For example, start with

\[ I_3= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix}. \]

If we swap rows \(1\) and \(2\), we get the elementary matrix

\[ E= \begin{bmatrix} 0&1&0\\ 1&0&0\\ 0&0&1 \end{bmatrix}. \]

Multiplying \(EA\) swaps rows \(1\) and \(2\) of \(A\).

If we multiply row \(2\) of \(I_3\) by \(5\), we get

\[ E= \begin{bmatrix} 1&0&0\\ 0&5&0\\ 0&0&1 \end{bmatrix}. \]

Multiplying \(EA\) multiplies row \(2\) of \(A\) by \(5\).

If we add \(3\) times row \(1\) to row \(3\) of \(I_3\), we get

\[ E= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 3&0&1 \end{bmatrix}. \]

Multiplying \(EA\) replaces row \(3\) of \(A\) by row \(3\) plus \(3\) times row \(1\).

7.14 5.12 Why elementary matrices matter

Suppose row reduction turns \(A\) into \(I\).

Each row operation is multiplication by an elementary matrix. So there are elementary matrices \(E_1,E_2,\ldots,E_k\) such that

\[ E_k\cdots E_2E_1A=I. \]

This means

\[ E_k\cdots E_2E_1=A^{-1}. \]

When we row reduce

\[ [A\mid I], \]

the same row operations are applied to both sides:

\[ [E_k\cdots E_1A\mid E_k\cdots E_1I]. \]

If the left side becomes \(I\), the right side becomes

\[ E_k\cdots E_1I=A^{-1}. \]

This explains why the algorithm works.

7.15 5.13 The Invertible Matrix Theorem

The following theorem is one of the central organizing results of first linear algebra.

ImportantInvertible Matrix Theorem

Let \(A\) be an \(n\times n\) matrix. The following statements are equivalent:

  1. \(A\) is invertible.
  2. \(Ax=b\) has a unique solution for every \(b\in\mathbb{R}^n\).
  3. \(Ax=0\) has only the trivial solution \(x=0\).
  4. The reduced row-echelon form of \(A\) is \(I_n\).
  5. \(A\) has a pivot in every column.
  6. \(A\) has a pivot in every row.
  7. The columns of \(A\) span \(\mathbb{R}^n\).
  8. The columns of \(A\) are linearly independent.
  9. The linear transformation \(x\mapsto Ax\) is one-to-one.
  10. The linear transformation \(x\mapsto Ax\) maps \(\mathbb{R}^n\) onto \(\mathbb{R}^n\).
  11. \(\det(A)\ne 0\).

Some of these ideas will be developed more deeply in later chapters. For now, the theorem gives a map of the subject.

Invertibility means all of these things at once:

  • no lost information,
  • no collapsed dimension,
  • unique solvability,
  • full set of pivots,
  • independent columns,
  • spanning columns,
  • nonzero determinant.

7.16 5.14 Invertibility and homogeneous systems

A square matrix \(A\) is invertible if and only if the homogeneous system

\[ Ax=0 \]

has only the zero solution.

Why?

If \(A\) is invertible and \(Ax=0\), then multiply by \(A^{-1}\):

\[ A^{-1}Ax=A^{-1}0. \]

So

\[ x=0. \]

Thus no nonzero vector can be sent to zero.

Geometrically, this means an invertible transformation does not collapse any nonzero direction to the origin.

If a nonzero vector \(v\) satisfies

\[ Av=0, \]

then information is lost. The transformation cannot be invertible.

7.17 5.15 Invertibility and columns

Let

\[ A= \begin{bmatrix} |&|&&|\\ a_1&a_2&\cdots&a_n\\ |&|&&| \end{bmatrix}. \]

The equation

\[ Ax=b \]

means

\[ x_1a_1+x_2a_2+\cdots+x_na_n=b. \]

If \(A\) is invertible, then every \(b\in\mathbb{R}^n\) can be written in exactly one way as a linear combination of the columns of \(A\).

So the columns of \(A\) must:

  1. span \(\mathbb{R}^n\),
  2. be linearly independent.

This means the columns form a basis of \(\mathbb{R}^n\).

This will become a central idea in the chapters on span, linear independence, basis, and dimension.

7.18 5.16 Invertibility as no information loss

Think of a matrix as a machine.

If two different inputs produce the same output, then the machine cannot be reversed.

That is, if

\[ Ax_1=Ax_2 \]

with

\[ x_1\ne x_2, \]

then we cannot know which input produced the output.

Subtract:

\[ Ax_1-Ax_2=0. \]

So

\[ A(x_1-x_2)=0. \]

Since \(x_1-x_2\ne 0\), a nonzero vector is sent to zero.

Therefore \(A\) is not invertible.

An invertible matrix is a matrix with no information loss.

7.19 5.17 Numerical warning: inverse versus solve

Although the formula

\[ x=A^{-1}b \]

is mathematically correct, it is usually not the best way to solve a system on a computer.

In numerical computation, it is better to use a direct solver such as

np.linalg.solve(A, b)

rather than explicitly computing

np.linalg.inv(A) @ b

The direct solver is usually faster and more accurate.

WarningComputational rule

Use inverses for theory.

Use solvers for computation.

7.20 5.18 Python: computing an inverse

import numpy as np

A = np.array([
    [1, 1, 1],
    [1, 2, 3],
    [1, 3, 6]
], dtype=float)

A_inv = np.linalg.inv(A)
A_inv
array([[ 3., -3.,  1.],
       [-3.,  5., -2.],
       [ 1., -2.,  1.]])

Check:

A @ A_inv
array([[1., 0., 0.],
       [0., 1., 0.],
       [0., 0., 1.]])

Because of floating-point arithmetic, the result may contain tiny roundoff errors such as \(10^{-16}\) instead of exact zeros.

7.21 5.19 Python: solving with inverse versus solve

b = np.array([3, 5, 8], dtype=float)

x_by_inverse = np.linalg.inv(A) @ b
x_by_solve = np.linalg.solve(A, b)

x_by_inverse, x_by_solve
(array([2., 0., 1.]), array([2., 0., 1.]))

Both should give approximately

\[ \begin{bmatrix} 2\\ -2\\ 3 \end{bmatrix}. \]

The second method is preferred computationally.

7.22 5.20 Python: a singular matrix

S = np.array([
    [1, 2],
    [2, 4]
], dtype=float)

np.linalg.det(S)
0.0

The determinant is zero, so the matrix is singular.

Trying to invert it gives an error:

# Uncomment to see the error:
# np.linalg.inv(S)

7.23 5.21 Condition number preview

Some matrices are invertible but nearly singular. This means they almost lose information.

For example,

\[ A_\varepsilon= \begin{bmatrix} 1&1\\ 1&1+\varepsilon \end{bmatrix}. \]

When \(\varepsilon\) is very small, the two columns are almost the same.

The determinant is

\[ \det(A_\varepsilon)=\varepsilon. \]

So the matrix is invertible when \(\varepsilon\ne 0\), but it becomes numerically unstable when \(\varepsilon\) is close to \(0\).

for eps in [1e-1, 1e-3, 1e-6, 1e-9]:
    Aeps = np.array([[1, 1], [1, 1 + eps]], dtype=float)
    print(eps, np.linalg.det(Aeps), np.linalg.cond(Aeps))
0.1 0.10000000000000006 42.076233614225764
0.001 0.00099999999999989 4002.000750125414
1e-06 9.999999999177338e-07 4000002.0005977233
1e-09 1.0000000827403716e-09 3999999887.515756

The condition number measures numerical sensitivity. A large condition number means small input errors can cause large output errors.

We will return to this idea when studying least squares and the SVD.

7.24 5.22 Python plot: nearly singular transformations

import matplotlib.pyplot as plt

def plot_transformed_grid(A, title):
    xs = np.linspace(-1, 1, 7)
    ys = np.linspace(-1, 1, 7)

    plt.figure(figsize=(6, 6))

    for x in xs:
        pts = np.array([[x, y] for y in ys])
        trans = pts @ A.T
        plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

    for y in ys:
        pts = np.array([[x, y] for x in xs])
        trans = pts @ A.T
        plt.plot(trans[:, 0], trans[:, 1], linewidth=0.8)

    e1 = A @ np.array([1, 0])
    e2 = A @ np.array([0, 1])
    plt.arrow(0, 0, e1[0], e1[1], head_width=0.03, length_includes_head=True)
    plt.arrow(0, 0, e2[0], e2[1], head_width=0.03, length_includes_head=True)
    plt.text(e1[0], e1[1], "$Ae_1$")
    plt.text(e2[0], e2[1], "$Ae_2$")

    plt.axhline(0, linewidth=0.8)
    plt.axvline(0, linewidth=0.8)
    plt.axis("equal")
    plt.grid(True)
    plt.title(title)
    plt.show()

A_good = np.array([[1.0, 0.2], [0.1, 1.0]])
A_near = np.array([[1.0, 1.0], [1.0, 1.05]])

plot_transformed_grid(A_good, "Well-conditioned invertible transformation")
plot_transformed_grid(A_near, "Nearly singular transformation")

The nearly singular matrix squeezes the plane strongly toward a line. It is technically invertible, but numerically unstable.

7.25 5.23 Common mistakes

7.25.1 Mistake 1: trying to invert a nonsquare matrix

Only square matrices can have inverses in the usual sense.

Rectangular matrices do not have two-sided inverses.

7.25.2 Mistake 2: thinking every square matrix is invertible

Some square matrices are singular. For example,

\[ \begin{bmatrix} 1&2\\ 2&4 \end{bmatrix} \]

does not have an inverse.

7.25.3 Mistake 3: forgetting both inverse equations

The definition requires

\[ A^{-1}A=I \]

and

\[ AA^{-1}=I. \]

For square matrices, one condition implies the other, but conceptually the inverse should undo \(A\) from both sides.

7.25.4 Mistake 4: dividing by determinant zero

The \(2\times 2\) inverse formula only works when

\[ ad-bc\ne 0. \]

7.25.5 Mistake 5: using inverse as the default computational method

In numerical computation, prefer

np.linalg.solve(A, b)

over

np.linalg.inv(A) @ b

7.25.6 Mistake 6: ignoring near singularity

A matrix can be invertible in exact mathematics but unstable in numerical computation.

7.26 5.24 Chapter summary

An \(n\times n\) matrix \(A\) is invertible if there is a matrix \(A^{-1}\) such that

\[ A^{-1}A=AA^{-1}=I_n. \]

If \(A\) is invertible, then the unique solution of

\[ Ax=b \]

is

\[ x=A^{-1}b. \]

For a \(2\times 2\) matrix,

\[ \begin{bmatrix} a&b\\ c&d \end{bmatrix}^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d&-b\\ -c&a \end{bmatrix}, \]

provided \(ad-bc\ne 0\).

For general square matrices, compute the inverse by row reducing

\[ [A\mid I]\to [I\mid A^{-1}]. \]

Elementary row operations correspond to multiplying by elementary matrices.

Invertibility is equivalent to:

  • unique solution for every \(b\),
  • only zero solution to \(Ax=0\),
  • rref\((A)=I\),
  • pivot in every row and column,
  • independent columns,
  • columns spanning \(\mathbb{R}^n\),
  • nonzero determinant,
  • no information loss.

7.27 Exercises

7.27.1 A. Inverse definition

  1. Let

\[ A= \begin{bmatrix} 2&0\\ 0&3 \end{bmatrix}. \]

Find \(A^{-1}\) and verify \(AA^{-1}=I\).

  1. Let

\[ A= \begin{bmatrix} 1&0\\ 0&-1 \end{bmatrix}. \]

Show that \(A^{-1}=A\).

  1. Give a geometric interpretation of the matrix in part 2.

7.27.2 B. The \(2\times 2\) inverse formula

For each matrix, determine whether it is invertible. If it is, find the inverse.

\[ \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix} \]

\[ \begin{bmatrix} 2&1\\ 4&2 \end{bmatrix} \]

\[ \begin{bmatrix} 0&1\\ 1&0 \end{bmatrix} \]

\[ \begin{bmatrix} 3&-1\\ 2&5 \end{bmatrix} \]

7.27.3 C. Inverses by row reduction

Use Gauss–Jordan elimination to find the inverse, or show that the matrix is not invertible.

\[ \begin{bmatrix} 1&1\\ 2&3 \end{bmatrix} \]

\[ \begin{bmatrix} 1&2\\ 2&4 \end{bmatrix} \]

\[ \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix} \]

\[ \begin{bmatrix} 1&0&1\\ 0&1&0\\ 2&-1&-1 \end{bmatrix} \]

7.27.4 D. Solving systems using inverses

For each system, use an inverse to solve.

\[ \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix} x = \begin{bmatrix} 5\\ 11 \end{bmatrix} \]

\[ \begin{bmatrix} 2&1\\ 1&1 \end{bmatrix} x = \begin{bmatrix} 7\\ 4 \end{bmatrix} \]

\[ \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix} x = \begin{bmatrix} 3\\ 5\\ 8 \end{bmatrix} \]

7.27.5 E. Elementary matrices

  1. Write the \(3\times 3\) elementary matrix that swaps rows \(1\) and \(3\).

  2. Write the \(3\times 3\) elementary matrix that multiplies row \(2\) by \(-4\).

  3. Write the \(3\times 3\) elementary matrix that replaces row \(3\) by row \(3+2\) row \(1\).

  4. Choose a \(3\times 3\) matrix \(A\) and verify that multiplying by your elementary matrices performs the corresponding row operations.

7.27.6 F. Invertible Matrix Theorem

For each matrix, determine which statements are true:

  • rref\((A)=I\),
  • \(A\) is invertible,
  • \(Ax=0\) has only the zero solution,
  • the columns of \(A\) span \(\mathbb{R}^n\),
  • the columns of \(A\) are linearly independent.

\[ A= \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix} \]

\[ A= \begin{bmatrix} 1&2\\ 2&4 \end{bmatrix} \]

\[ A= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix} \]

\[ A= \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix} \]

7.27.7 G. Geometry

  1. Explain why a matrix whose columns lie on the same line in \(\mathbb{R}^2\) cannot be invertible.

  2. Explain why a matrix that sends a nonzero vector to zero cannot be invertible.

  3. Draw or plot the image of the unit square under

\[ A= \begin{bmatrix} 1&2\\ 2&4 \end{bmatrix}. \]

What happens?

  1. Draw or plot the image of the unit square under

\[ A= \begin{bmatrix} 1&1\\ 0&1 \end{bmatrix}. \]

What happens?

7.27.8 H. Python exercises

  1. Use NumPy to compute the inverse of

\[ A= \begin{bmatrix} 1&1&1\\ 1&2&3\\ 1&3&6 \end{bmatrix}. \]

  1. Verify that \(AA^{-1}\) is approximately \(I\).

  2. Use np.linalg.solve(A,b) to solve

\[ Ax= \begin{bmatrix} 3\\ 5\\ 8 \end{bmatrix}. \]

  1. Compare the answer with np.linalg.inv(A) @ b.

  2. Compute the determinant and condition number of

\[ A_\varepsilon= \begin{bmatrix} 1&1\\ 1&1+\varepsilon \end{bmatrix} \]

for \(\varepsilon=10^{-1},10^{-3},10^{-6},10^{-9}\).

  1. Write a short explanation of what happens as \(\varepsilon\) approaches \(0\).

7.28 AI-age connection

Invertibility means that a linear process loses no information. This idea is important in data compression, numerical stability, optimization, machine learning, and neural networks. In practice, exact invertibility is often less important than approximate invertibility and numerical conditioning. A matrix may be invertible in theory but nearly singular in computation. The condition number, which will reappear later through the SVD, measures how safely a linear transformation can be reversed.