Apart from the Gaussian elimination, there is an alternative method to calculate the inverse matrix. It is much less intuitive, and may be much longer than the previous one, but we can always use it because it is more direct.

Let's remember that given a matrix $$A$$, its inverse $$A^{-1}$$ is the one that satisfies the following:

$$$A\cdot A^{-1}=I$$$

where $$I$$ is the identity matrix, with all its elements being zero except those in the main diagonal, which are ones.

The inverse matrix can be calculated as follows:

$$$A^{-1}=\dfrac{1}{|A|}\cdot(A^{adj})^t$$$

Where:

$$A^{-1} \rightarrow$$ Inverse matrix

$$|A| \rightarrow$$ Determinant

$$A^{adj} \rightarrow$$ Adjoint matrix

$$A^t \rightarrow$$ Transpose matrix

What is the inverse of the following matrix?

$$$A=\left( \begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{array} \right)$$$

1) Let's calculate the determinant:

$$$|A|=\left| \begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{array} \right|=-1$$$

2) Let's calculate the adjoint matrix:

$$$A^{adj}=\left(\begin{array}{ccc} +\left|\begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right| & -\left|\begin{array}{cc} 1 & 1 \\ 0 & 0 \end{array} \right| & +\ldots \\ -\ldots & +\ldots & -\ldots \\ +\ldots & -\ldots & +\left|\begin{array}{cc} 1 & 1 \\ 1 & 0 \end{array} \right| \end{array} \right)= \left( \begin{array}{ccc} -1 & 0 & 1 \\ 0 & 0 & -1 \\ 1 & -1 & -1 \end{array} \right)$$$

3) We transpose the adjoint matrix

$$$(A^{adj})^t=\left( \begin{array}{ccc} -1 & 0 & 1 \\ 0 & 0 & -1 \\ 1 & -1 & -1 \end{array} \right)$$$

which coincidentally doesn't change.

4) The inverse matrix is $$$A^{-1}=\dfrac{1}{-1}\cdot\left( \begin{array}{ccc} -1 & 0 & 1 \\ 0 & 0 & -1 \\ 1 & -1 & -1 \end{array} \right)=\left( \begin{array}{ccc} 1 & 0 & -1 \\ 0 & 0 & 1 \\ -1 & 1 & 1 \end{array} \right)$$$