# How to write the algorithm? I have figured out a method to find the inverse.

How to write the algorithm? I figured out a method to find the inverse.

The assignment is making use of the property of triangular matrices to find the inverse of a matrix $\displaystyle A$.

The inverse of a triangular matrix(Upper/ Lower) is also triangular(Upper/ Lower) and is easy to find.

$\displaystyle \begin{bmatrix} a & b & c\\ 0 & d & e\\ 0 & 0& f \end{bmatrix} \begin{bmatrix}\frac{1}{a} & x & z\\ 0 & \frac{1}{d} & y \\ 0 & 0 &\frac{1}{f} \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}$

By equating the Upper 0s, $\displaystyle x, y, z$ are readily to be found.

$\displaystyle x = -a^{-1} b d^{-1}$, $\displaystyle y = -d^{-1} e f^{-1}$, $\displaystyle z = a^{-1} b d^{-1} c f^{-1} - a^{-1} c f^{-1}$

In higher order matrices:

$\displaystyle a d x= - \begin{vmatrix} b \end{vmatrix}$

$\displaystyle d f y = - \begin{vmatrix} e \end{vmatrix}$

$\displaystyle a d f z= + \begin{vmatrix} b & c \\ d & e \end{vmatrix}$

$\displaystyle \pm$ signs follow the plan:

$\displaystyle \begin{bmatrix} + & - & + \\ - & + & -\\ + & -& + \end{bmatrix} \sim \begin{bmatrix} + & x & z \\ - & + & y\\ + & - & + \end{bmatrix}$

If $\displaystyle A$ is invertible, find $\displaystyle A^{-1}$ by changing $\displaystyle A$ triangular...

$\displaystyle AX=I$

$\displaystyle E_3E_2E_1AX=E_3E_2E_1I$

$\displaystyle E_jAX=E_jI$

Take Row operation and Column operation on $\displaystyle E_jA$ to become a triangular matrix

$\displaystyle R_jE_jAC_j = U$ is triangular.

$\displaystyle (R_jE_jAC_j)^{-1} = U^{-1}$ can be found by the method above.

$\displaystyle (R_jE_jAC_j)^{-1}=C_j^{-1}A^{-1}E_j^{-1}R_j^{-1} = U^{-1}$

$\displaystyle A^{-1}=C_j(C_j^{-1}A^{-1}E_j^{-1}R_j^{-1})R_jE_j = C_j(U^{-1})R_jE_j$

$\displaystyle E_j = E_jAX = E_jI$ is computed in the beginning.

Last edited: