Linear Algebra, Live
Recap · Reading

What you can now do

Lesson 3 in one page: what it means to undo a matrix, two ways to find the inverse, why a chain of steps is undone in reverse order, and two kinds of matrices you will meet everywhere, the transpose and the permutation matrices.

Lesson 3 · slide 7Recap
A⁻¹A = I    (AB)⁻¹ = B⁻¹A⁻¹    (AB)ᵀ = BᵀAᵀ    P⁻¹ = Pᵀ
Key ideas
  1. A⁻¹ undoes A. A square matrix has one exactly when all its pivots are nonzero; for 2 by 2, exactly when ad − bc ≠ 0.
  2. For 2 by 2: swap, flip signs, divide by ad − bc. In general: Gauss-Jordan on [A | I].
  3. (AB)⁻¹ = B⁻¹A⁻¹ and (AB)ᵀ = BᵀAᵀ: the order reverses.
  4. Symmetric means S = Sᵀ, and AᵀA always is.
  5. Permutations reorder rows, P⁻¹ = Pᵀ, and PA = LU.
  • §2.5 The inverse. Like changing money and changing it back: A⁻¹ turns every output Ax back into x, so A⁻¹A = I and Ax = b is solved by x = A⁻¹b. A matrix that sends two inputs to the same output has no inverse. That happens exactly when a pivot is zero, or one column is a combination of the others.
  • §2.5 The 2 by 2 formula. Swap a and d, flip the signs of b and c, divide by ad − bc. That number is the determinant, the yes-or-no number for a 2 by 2 inverse: ad − bc = 0 means the columns lie on one line and there is no inverse.
  • §2.5 Inverse of a product. Socks on, shoes on; shoes off, socks off. AB does B first, so (AB)⁻¹ = B⁻¹A⁻¹. Undoing lesson 2's elimination steps in reverse order gives L.
  • §2.5 Gauss-Jordan. Write down every move as you solve the puzzle: do row steps on [A | I] until the left half is I. The right half has recorded the steps, and it reads A⁻¹. A zero row on the left means no inverse. To solve Ax = b, elimination is still faster than computing A⁻¹.
  • §2.7 Transposes. Turn the spreadsheet: rows become columns, and an m by n matrix becomes n by m. The dot product is xᵀy, and (AB)ᵀ = BᵀAᵀ. A distance table is symmetric, S = Sᵀ, and AᵀA always is.
  • §2.7 Permutations. A new playlist order: P is I with its rows reordered, and PA reorders the rows of A. Sending every row back is the transpose, so P⁻¹ = Pᵀ. Doing the row exchanges first gives PA = LU.

Next lesson: the four subspaces (chapter 3)

What if A has no inverse, or isn't even square? The nullspace, pivot and free columns, the complete solution to Ax = b, and the big picture that ties them together.

Read along

Professor Gilbert Strang, Introduction to Linear Algebra, 5th edition (2016), sections 2.5 and 2.7. Lectures 3 and 5 of MIT 18.06 on MIT OpenCourseWare.

Examples

Example 1

Invert 2132.

Show solutionHide solution

det = 4 − 3 = 1, so the inverse is 2−1−32.

Example 2

A⁻¹ = 1101 and B⁻¹ = 2001. Find (AB)⁻¹.

Show solutionHide solution

(AB)⁻¹ = B⁻¹A⁻¹ = 2201.

Example 3

Compute AᵀA for A = 1234. Is it symmetric?

Show solutionHide solution

AᵀA = 10141420. Yes, symmetric.

Exercise Free play: try np.linalg.inv on any matrix, or build a symmetric matrix as A.T @ A. Edit the code and press Run.
slide_7.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.

Enjoying lesson 3? Get the full course: all 8 lessons through the SVD and PCA, your progress saved lesson by lesson, every solution and 5 extra problems per lesson. $20 once, yours for life.

Questions and comments

Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.

The full course

From Ax = b to PCA, by running it

Lessons 1 to 3 are free. Finish all eight and you will be able to:

You get: all 8 lessons with Python labs · every worked example and solution · 5 extra problems per lesson · your progress tracked · answers to your questions · every future update.

$20 once · lifetime access
Continue to checkout →

Already a member? Log in to the course