TactivergeLite

Lite / Independent Engineering Research / Week 2

Inverses: undoing a linear map

A sensor matrix turns true forces into readings. Can you always run it backwards to turn readings into forces?

About 40 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Inverting a calibration, a coordinate change or a mixing matrix is a daily engineering task. Knowing when it is impossible (and when it is merely dangerous) prevents confident nonsense.

Predict

A = [[2, 4], [1, 2]]. Does A⁻¹ exist?

  1. Yes
  2. No, because det A = 0
  3. Only if we allow complex numbers
Guess first, then reveal

det A = 2·2 − 4·1 = 0. Column 2 is twice column 1, so A squashes the plane onto a line and information is lost; no map can undo that.

Discover

Open the Code Lab. Write inv2(A) using the formula below and test it on five random matrices by checking A·inv2(A) ≈ I. Then try a matrix with determinant 10⁻⁹ and look at the entries.

What the interactive shows (text version)

This activity is code-based: implement the 2×2 inverse formula, verify A times its inverse equals the identity on random matrices, and observe the very large entries that appear when the determinant is tiny.

You can also open the interactive on the full site when you have a faster connection.

Understand

What an inverse is

A⁻¹ is the matrix with A⁻¹A = AA⁻¹ = I. It exists exactly when A is square with det A ≠ 0 (rank n). Then Ax = b has the unique solution x = A⁻¹b. Geometrically, the map must not squash any direction to zero, or it cannot be undone.

Gauss–Jordan for bigger matrices

Write [A | I] and row-reduce all the way to [I | X]: eliminate below and above each pivot and scale pivots to 1. Then X = A⁻¹. If a zero pivot cannot be fixed by swapping, A is singular.

Solve, don't invert

In computation, forming A⁻¹ costs about three times more than an LU solve and is typically less accurate. Libraries offer solve(A, b) for this reason. Inverses remain useful on paper, for small fixed matrices, and when you genuinely need the entries (for example a covariance matrix).

Explain it another way

Intuitive

If a map is a recipe for scrambling, the inverse is the unscrambling recipe. Scrambling that throws ingredients away (det 0) cannot be unscrambled.

Technical

Invertibility is equivalent to: det A ≠ 0, rank n, columns independent, Ax = 0 only for x = 0, and no zero eigenvalue.

Mathematical

Cofactor formula: (A⁻¹)ᵢⱼ = (−1)ⁱ⁺ʲ Mⱼᵢ / det A, where Mⱼᵢ is the minor deleting row j and column i. Note the transposed indices.

Applied

A six-axis force sensor uses a 6×6 calibration matrix to turn strain-gauge voltages into forces and torques; a poorly designed sensor gives a nearly singular matrix.

Derivation: The 2×2 inverse formula
  1. Let A = [[a, b], [c, d]]. We want X with AX = I.

  2. Try X = k·[[d, −b], [−c, a]] (swap the diagonal, negate the off-diagonal).

  3. Then AX = k·[[ad − bc, −ab + ba], [cd − dc, −cb + da]] = k·(ad − bc)·I.

  4. Choosing k = 1/(ad − bc) gives AX = I, so A⁻¹ = (1/det A)·[[d, −b], [−c, a]].

  5. This only works if det A = ad − bc ≠ 0; when it is zero there is no inverse.

Worked example 1

Invert A = [[3, 1], [2, 5]] and check.

det A = 15 − 2 = 13. A⁻¹ = (1/13)[[5, −1], [−2, 3]]. Check: A·A⁻¹ = (1/13)[[15 − 2, −3 + 3], [10 − 10, −2 + 15]] = I. ✓

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 2. Which matrix has no inverse?
Practice 3. What is (AB)⁻¹?

Practice 5. A colleague computes x = inv(A) * b for a 5000×5000 system. Best advice?

Apply it

Find the inverse of the sensor-mixing matrix [[1, 0.5], [0.25, 1]] and use it to recover the true quantities for three different readings. Then make the cross-talk 0.99 and 0.99: what happens to the inverse's entries?

Reflect

Why might an inverse that 'exists' still be useless in practice?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Matrix multiplication as compositionRotation, shear, stretch and projection →