# Thread: Inverting a 4x4 matrix using reduced row

1. ## Inverting a 4x4 matrix using reduced row

1 2 1 1
0 1 1 3
0 0 1 5
0 0 0 1

I know I need to make all the elements in the upper triangle equal zero, but I'm getting stuck on the first step.
I do -5*row4 + row3 --> row3

The steps after that seem to make the diagonals non-1 or the lower triangle nonzero.

Am i allowed to do this, and just go back randomly and change it?

2. ## Re: Inverting a 4x4 matrix using reduced row

I am puzzled as to what you are trying to do. Is the matrix you show the original matrix or what you have after row reduction? I ask because the matrix you give is row reduced but there are many matrices that row reduce to the same thing- you have to know the original matrix before row reduction to find its inverse matrix.

Assuming that the matrix you give is the original matrix, what I would do is write it right beside the identity matrix:
$\displaystyle \begin{bmatrix}1 & 2 & 1 & 1 \\ 0 & 1 & 1 & 3 \\ 0 & 0 & 1 & 5 \\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$

As I said, this is already in "row echelon form", you just need to "back substitute": subtract the fourth row from the first, 3 times the fourth row from the second and 5 times the fourth row from the third:
$\displaystyle \begin{bmatrix}1 & 2 & 1 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix}1 & 0 & 0 & -1 \\ 0 & 1 & 0 & -3 \\ 0 & 0 & 1 & -5 \\ 0 & 0 & 0 & 1 \end{bmatrix}$.

That has "cleared" the fourth column. Now subtract the third row from the first and second rows:
$\displaystyle \begin{bmatrix}1 & 2 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix}1 & 0 & -1 & 4 \\ 0 & 1 & -1 & 2 \\ 0 & 0 & 1 & -5 \\ 0 & 0 & 0 & 1 \end{bmatrix}$.

Finally, subtract two times the second row from the first:
$\displaystyle \begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix}1 & -2 & 1 & 0 \\ 0 & 1 & -1 & 2 \\ 0 & 0 & 1 & -5 \\ 0 & 0 & 0 & 1 \end{bmatrix}$.

We now have the identity matrix on the left and the inverse matrix,
$\displaystyle \begin{bmatrix}1 & -2 & 1 & 0 \\ 0 & 1 & -1 & 2 \\ 0 & 0 & 1 & -5 \\ 0 & 0 & 0 & 1 \end{bmatrix}$ on the right.

3. ## Re: Inverting a 4x4 matrix using reduced row

The matrix I supplied is the original.

I guess I'm confused as to what order I'm supposed to be making the nonzero elements equal 0

4. ## Re: Inverting a 4x4 matrix using reduced row

Originally Posted by MrJank
The matrix I supplied is the original.

I guess I'm confused as to what order I'm supposed to be making the nonzero elements equal 0
ignoring issues that come up with implementing algorithms on actual physical machines where round off error for example becomes a problem you don't have to worry about what order you perform the elementary operations that do Gauss elimination.

Just make sure that whatever operations you do on the original matrix to convert it to an identity matrix you also perform on an identity matrix to convert it into the inverse.

5. ## Re: Inverting a 4x4 matrix using reduced row

Start by making all elements in the final column equal to zero using the final row.
Then make all elements in the penultimate column equal to zero using the penultimate row.
Etc.