<s>[INST] LU decomposition- Suppose we have to find LU decomposition of 
$A = \begin{bmatrix}
    3 & 1 & -1  \\
    1 & 0 & 1  \\
    4 & 2 & 2 
\end{bmatrix}$
I correctly found $M_{1}=\begin{bmatrix}
    1 & 0 & 0  \\
    -4/3 & 1 & 0  \\
    -1/3 & 0 & 1 
\end{bmatrix} $ and $M_{2}=\begin{bmatrix}
     1 & 0 & 0  \\
     0 & 1 & 0  \\
    0 & 1/2 & 1 
\end{bmatrix} $
The problem happens when I try to find $L=(M_{2}M_{1})^{-1}$
In my notes, its done as $\Bigg(\begin{bmatrix}
     1 & 0 & 0  \\
     0 & 1 & 0  \\
    0 & 1/2 & 1 
\end{bmatrix}\begin{bmatrix}
    1 & 0 & 0  \\
    -4/3 & 1 & 0  \\
    -1/3 & 0 & 1 
\end{bmatrix}\Bigg)^{-1}$
Which equals $\begin{bmatrix}
    1 & 0 & 0  \\
    -4/3 & 1 & 0  \\
    -1 & 1/2 & 1 
\end{bmatrix}^{-1}$ which is $\begin{bmatrix}
    1 & 0 & 0  \\
    4/3 & 1 & 0  \\
    1 & -1/2 & 1 
\end{bmatrix}$
I used the fact that $(AB)^{-1}=B^{-1}A^{-1}$ which then works to the following:
$\begin{bmatrix}
    1 & 0 & 0  \\
    4/3 & 1 & 0  \\
    1/3 & 0 & 1 
\end{bmatrix}$ $\begin{bmatrix}
    1 & 0 & 0  \\
    0 & 1 & 0  \\
    0 & -1/2 & 1 
\end{bmatrix}$ which equals $\begin{bmatrix}
    1 & 0 & 0  \\
    4/3 & 1 & 0  \\
    1/3 & -1/2 & 1 
\end{bmatrix}$
Its almost the same answer as my notes, but the value at $a_{31}$ is different. For me I am getting $a_{31}=\frac{1}{3}$, but in my notes $a_{31}=1$. Every other value matches.
I am really not sure where I am going wrong, can someone please help?
 [/INST] $\begin{bmatrix}
    1 & 0 & 0  \\
    -4/3 & 1 & 0  \\
    -1 & 1/2 & 1 
\end{bmatrix}
\begin{bmatrix}
    1 & 0 & 0  \\
    4/3 & 1 & 0  \\
    1 & -1/2 & 1 
\end{bmatrix}=
\begin{bmatrix}
    1 & 0 & 0  \\
    0 & 1 & 0  \\
    2/3 & 0 & 1 
\end{bmatrix}.$ 
Thereore 
$\begin{bmatrix}
    1 & 0 & 0  \\
    -4/3 & 1 & 0  \\
    -1 & 1/2 & 1 
\end{bmatrix}^{-1}\ne 
\begin{bmatrix}
    1 & 0 & 0  \\
    4/3 & 1 & 0  \\
    1 & -1/2 & 1 
\end{bmatrix}
$ 
</s>