Exercise: Computing the Inverse of a Matrix (1)
We want to find the inverse of the following matrix:
$$ A = \begin{pmatrix} 4 & 0 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 1 & 2 & 0 \\ 1 & 1 & 0 & 1 \end{pmatrix} $$
To do this, we apply the Gauss - Jordan elimination method.
We start by writing the identity matrix I alongside A:
$$ A | I = \begin{pmatrix} 4 & 0 & 0 & 0 & | & 1 & 0 & 0 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0\\ 0 & 1 & 2 & 0 & | & 0 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 &| & 0 & 0 & 0 & 1 \end{pmatrix} $$
We now perform elementary row operations to transform the left block into the identity matrix.
First, divide the first row by 4 (R1 → R1·1/4):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0\\ 0 & 1 & 2 & 0 & | & 0 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 &| & 0 & 0 & 0 & 1 \end{pmatrix} $$
Next, swap the second and third rows (R2 ↔ R3):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 1 & 2 & 0 & | & 0 & 0 & 1 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 1 &| & 0 & 0 & 0 & 1 \end{pmatrix} $$
Subtract the third row from the second (R2 → R2 − R3):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & | & 0 & -1 & 1 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 1 &| & 0 & 0 & 0 & 1 \end{pmatrix} $$
Subtract the first row from the fourth (R4 → R4 − R1):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & | & 0 & -1 & 1 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 &| & -\tfrac{1}{4} & 0 & 0 & 1 \end{pmatrix} $$
Subtract the second row from the fourth (R4 → R4 − R2):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & | & 0 & -1 & 1 & 0 \\ 0 & 0 & 2 & 0 & | & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 &| & -\tfrac{1}{4} & 1 & -1 & 1 \end{pmatrix} $$
Finally, divide the third row by 2 (R3 → R3·1/2):
$$ A | I = \begin{pmatrix} 1 & 0 & 0 & 0 & | & \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & | & 0 & -1 & 1 & 0 \\ 0 & 0 & 1 & 0 & | & 0 & \tfrac{1}{2} & 0 & 0 \\ 0 & 0 & 0 & 1 &| & -\tfrac{1}{4} & 1 & -1 & 1 \end{pmatrix} $$
At this point, the left block has been reduced to the identity matrix I.
The block on the right is therefore the inverse of A:
$$ A^{-1} = \begin{pmatrix} \tfrac{1}{4} & 0 & 0 & 0 \\ 0 & -1 & 1 & 0 \\ 0 & \tfrac{1}{2} & 0 & 0 \\ -\tfrac{1}{4} & 1 & -1 & 1 \end{pmatrix} $$
This completes the computation.
