A matrix moves every point of the plane. Can another matrix move them all back? Watch the grid warp, then play back home.
Undoing a matrix
The grid goes where the matrix sends it, then the inverse brings it back.
The square grid and the unit arrows, before the matrix acts.
Describe this picture
One panel with a faint square grid, the two unit arrows and the unit square shaded. First the grid glides to the place the matrix sends it, with the unit arrows riding out to the columns and . Then it plays back, under the inverse, until it is the square grid again, and dashed arrows show where the two unit arrows went, with a ring on each tip. When the clip has finished, either tip can be dragged, or moved with the arrow keys in steps of half a unit, and the panel shows the grid under the matrix as it is changed. As one column is pulled towards the line of the other, the grid squeezes towards a single line, and a readout of the number falls towards 0. On the line itself the grid is flat; press Play, and the playback has nothing to restore.
Undo
In A matrix moves the plane, the matrix above sent the point to . The undo must send back to , and do the same for every other point. A matrix that does this is the inverse of , written :
Here is the identity matrix of Matrix multiplication, the map that leaves every point where it is. Doing and then leaves every point where it started. So does doing them in the other order.
For this matrix,
Check it on the point: . That is also the answer to the system , of Two pictures of a linear system. Once you know , the solution of is .
Notice what the inverse is not. It is not the matrix of reciprocals, , , and . The undo has to reverse the whole map, not each number on its own.
Finding it by elimination
Where does come from? Its first column is where lands under the undo. That is the that sends to , so it solves . The second column solves .
So solve both systems at once. Write with beside it, and run the elimination of Elimination on the whole wide table. This time keep going: clear above each pivot as well as below, then divide each row by its pivot. When the left half has become , the right half is . This is called Gauss–Jordan elimination.
The steps are: take of row 1 from row 2; add of row 2 to row 1; divide row 1 by 2 and row 2 by 1.5.
The 2 × 2 formula
For a matrix there is a short cut. Swap the two numbers on the diagonal, change the sign of the other two, and divide everything by one number:
For our , the number is , and the formula gives the above. Check one entry of : row 1 of times column 1 of is . Row 1 times column 2 is .
The number is the determinant of the matrix, written . Here it is 3, which is the area of the parallelogram the unit square became in the first picture. The page The determinant as area explains why.
When there is no undo
Now drag a column, after the clip, towards the line of the other column. The grid squeezes, and when the two columns line up it is flat: the whole plane has landed on one line.
Take , whose columns and lie on one line. It sends to . It sends to as well. Two different points land on the same spot, and no undo can send that spot back to both of them. So this matrix has no inverse. The formula agrees: its determinant is , and the formula would divide by zero.
The same reasoning works for any square matrix. If for some that is not , then and land together, and has no inverse. So not every square matrix has one. Those that do are called invertible.
Undo in reverse order
In the morning you put on socks, then shoes. To undo it, you take off the shoes first, then the socks. Matrices work the same way.
Socks and shoes
Two moves, then their undoing, last move first.
Two moves, then their undoing. Watch the order of the undoing.
Describe this picture
The square grid with a small letter F drawn on it. It turns a quarter turn under , then shears under . Then it comes back: first the shear is undone, then the turn, and the grid and the letter are home again. A caption names each step as it plays. The picture has no control.
Take the turn and the shear of Matrix multiplication: turns by 90°, which is radians, and shears. Turning first and then shearing is , since the first map is written on the right. To undo it, undo the shear first, then the turn:
Here turns back by 90° and shears back. The other order, , is a different matrix, and it does not undo . In general,
One more rule. The transpose of a matrix swaps its rows and columns, as Transposes and permutations explains. The inverse of the transpose is the transpose of the inverse: . For the turn, the inverse happens to be the transpose itself: .
Solve, don’t invert
The formula is good for thinking, but computer programs rarely use it. Finding for an matrix takes about multiply-and-subtract steps. Solving by elimination takes about . Elimination is also less disturbed by rounding errors. So a program that needs solves the system instead, and keeps the steps of elimination for the next , as LU factorisation shows.
Worked example
- The inverse. has and .
- Solving with it. .
- Another one. has determinant , so its inverse is .
- No inverse. has determinant 0 and sends to .
- The quarter turn. Its inverse is the quarter turn the other way, 90° clockwise, which is its transpose.
- A test. If has a solution , can be invertible? No: would send to both and .
- Predict. As one column nears the line of the other, what happens to the playback? The grid squeezes, and the undo has to stretch it back more and more, without limit.
Where you’ll meet this
The stereo crossfeed of A matrix moves the plane mixed the channels with . Its determinant is , and its inverse is , which unmixes them. Notice the cost: a difference between the channels, , comes out as . Any noise in the mixed sound that differs between the channels is made 2.5 times larger. The page Conditioning measures this effect.
A game finds the object under the mouse pointer by running the camera’s matrix backwards, from the screen into the scene. That is an inverse.
In signal processing · inverses in filters
Filters often rest on a small system or an inverse. In Resampling by any factor, the cubic through four samples comes from solving one system once. In RLS and the Kalman filter, an inverse is never recomputed from scratch: when one small piece is added to a matrix, its inverse changes by one small piece too. That rule is called the matrix inversion lemma.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Inverse | the undo | |
| Solution | compute by elimination instead | |
| Gauss–Jordan | clear above and below each pivot | |
| 2 × 2 | swap, change signs, divide | |
| Determinant | 0 means no inverse | |
| No inverse | with | the map flattens |
| Product | reverse order | |
| Transpose | ||
| Cost | inverse , solve | solve, don’t invert |