Matrice inversa, con l’eliminazione di Gauss-Jordan

Con l’eliminazione di Gauss-Jordan si può calcolare la matrice inversa.

Considera la matrice che si ottiene affiancando alle colonne di A le colonne della matrice Identità (dello stesso ordine)

A\, |\, I

\displaystyle \begin{bmatrix}a_{11} & a_{12} & a_{13} & | & 1 & 0 & 0\\a_{21} & a_{22} & a_{23} & | & 0 & 1 & 0\\a_{31} & a_{32} & a_{33} & | & 0 & 0 & 1\end{bmatrix}

Applica l’eliminazione di Gauss-Jordan alla prima metà.
Le stesse operazioni agiscono anche sulla seconda metà

G_1\cdot A\, |\, G_1\cdot I

\displaystyle \begin{bmatrix}d_{11} & 0 & 0 & | & b_{11} & b_{12} & b_{13}\\0 & d_{22} & 0 & | & b_{21} & b_{22} & b_{23}\\0 & 0 & d_{33} & | & b_{31} & b_{32} & b_{33}\end{bmatrix}

Ottieni una matrice diagonale, adesso dividi gli elementi di ogni riga per l’elemento della diagonale principale.
Le stesse operazioni agiscono anche sulla seconda metà

G_2\cdot G_1\cdot A\, |\, G_2\cdot G_1\cdot I
G\cdot A\, |\, G\cdot I
I\, |\, G

Ottieni la matrice identità affiancata dalla matrice G.

La matrice G ha trasformato la matrice A nella matrice identità, quindi è la sua inversa!

I\, |\, A^{-1}

\displaystyle \begin{bmatrix}1 & 0 & 0 & | & g_{11} & g_{12} & g_{13}\\0 & 1 & 0 & | & g_{21} & g_{22} & g_{23}\\0 & 0 & 1 & | & g_{31} & g_{32} & g_{33}\end{bmatrix}


Esempio 2×2

\displaystyle A = \begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}

\displaystyle \begin{bmatrix}1 & 2 & | & 1 & 0\\3 & 4 & | & 0 & 1\end{bmatrix}

m_1 = \displaystyle\frac{a_{21}}{a_{11}} = \displaystyle\frac{3}{1} = 3

R_2 = R_2 -m_1 \cdot R_1 = R_2 -3\cdot R_1

\displaystyle \begin{bmatrix}1 & 2 & | & 1 & 0\\0 & -2 & | & -3 & 1\end{bmatrix}

m_2 = \displaystyle\frac{a_{12}}{a_{22}} = \displaystyle\frac{2}{-2} = -1

R_1 = R_1 -m_2 \cdot R_2 = R_1 -(-1) R_2

\displaystyle \begin{bmatrix}1 & 0 & | & -2 & 1\\0 & -2 & | & -3 & 1\end{bmatrix}

R_2 = \displaystyle \frac{R_2}{a_{22}} =\frac{R_2}{-2}

\displaystyle \begin{bmatrix}1 & 0 & | & -2 & 1\\0 & 1 & | & \displaystyle\frac{3}{2} & \displaystyle -\frac{1}{2}\end{bmatrix}

\displaystyle A^{-1} = \begin{bmatrix}-2 & 1\\\displaystyle\frac{3}{2} & \displaystyle -\frac{1}{2}\end{bmatrix}

Controlla…

\displaystyle A\cdot A^{-1}

= \displaystyle \begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}\cdot \begin{bmatrix}-2 & 1\\\displaystyle\frac{3}{2} & \displaystyle -\frac{1}{2}\end{bmatrix}

= \displaystyle \begin{bmatrix}1\cdot  (-2)+ 2\cdot \displaystyle\frac{3}{2} & 1\cdot 1 + 2\cdot \displaystyle \left(-\frac{1}{2}\right) \\3\cdot (-2) + 4 \cdot \displaystyle\frac{3}{2} & 3\cdot 1 + 4\cdot \displaystyle \left(-\frac{1}{2} \right) \end{bmatrix}

= \displaystyle \begin{bmatrix}-2+ 3 & 1 -1 \\-6 + 6 & 3-2 \end{bmatrix}

= \displaystyle \begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}

Controlla…

\displaystyle A^{-1}\cdot A

= \displaystyle \begin{bmatrix}-2 & 1\\\displaystyle\frac{3}{2} & \displaystyle -\frac{1}{2}\end{bmatrix}\cdot \begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}

= \displaystyle \begin{bmatrix}(-2)\cdot 1+ 1\cdot 3 & (-2)\cdot 2 + 1\cdot 4 \\\displaystyle\frac{3}{2}\cdot 1 +\left(-  \displaystyle \frac{1}{2}\right) \cdot 3 & \displaystyle\frac{3}{2}\cdot 2 +\left(-  \displaystyle \frac{1}{2}\right) \cdot 4\end{bmatrix}

= \displaystyle \begin{bmatrix}-2+ 3 & -4 + 4 \\\displaystyle\frac{3}{2} -  \displaystyle \frac{3}{2} & 3-2\end{bmatrix}

= \displaystyle \begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}


Esempio 3×3

\displaystyle A = \begin{bmatrix}1 & 2 & 3\\0 & 2 & 3\\0 & 0 & 3\end{bmatrix}

\displaystyle \begin{bmatrix}1 & 2 & 3 & | & 1 & 0 & 0\\0 & 2 & 3 & | & 0 & 1 & 0\\0 & 0 & 3 & | & 0 & 0 & 1\end{bmatrix}

m_3 = \displaystyle\frac{a_{23}}{a_{33}} = \displaystyle\frac{3}{3} = 1

R_2 = R_2 -m_3 \cdot R_3 = R_2 -R_3

\displaystyle \begin{bmatrix}1 & 2 & 3 & | & 1 & 0 & 0\\0 & 2 & 0 & | & 0 & 1 & -1\\0 & 0 & 3 & | & 0 & 0 & 1\end{bmatrix}

m_3 = \displaystyle\frac{a_{13}}{a_{33}} = \displaystyle\frac{3}{3} = 1

R_1 = R_1 -m_3 \cdot R_3 = R_1 - R_3

\displaystyle \begin{bmatrix}1 & 2 & 0 & | & 1 & 0 & -1\\0 & 2 & 0 & | & 0 & 1 & -1\\0 & 0 & 3 & | & 0 & 0 & 1\end{bmatrix}

m_2 = \displaystyle\frac{a_{12}}{a_{22}} = \displaystyle\frac{2}{2} = 1

R_1 = R_1 -m_2 \cdot R_2 = R_1 - R_2

\displaystyle \begin{bmatrix}1 & 0 & 0 & | & 1 & -1 & 0\\0 & 2 & 0 & | & 0 & 1 & -1\\0 & 0 & 3 & | & 0 & 0 & 1\end{bmatrix}

R_2 = \displaystyle \frac{R_2}{a_{22}} =\frac{R_2}{2}

R_3 = \displaystyle \frac{R_3}{a_{33}} =\frac{R_3}{3}

\displaystyle \begin{bmatrix}1 & 0 & 0 & | & 1 & -1 & 0\\0 & 1 & 0 & | & 0 & \displaystyle\frac{1}{2} & \displaystyle-\frac{1}{2}\\0 & 0 & 1 & | & 0 & 0 & \displaystyle\frac{1}{3}\end{bmatrix}

\displaystyle A^{-1} = \begin{bmatrix}1 & -1 & 0\\0 & \displaystyle\frac{1}{2} & \displaystyle-\frac{1}{2}\\0 & 0 & \displaystyle\frac{1}{3}\end{bmatrix}

Controlla…

\displaystyle A\cdot A^{-1}

= \displaystyle \begin{bmatrix}1 & 2 & 3\\0 & 2 & 3\\0 & 0 & 3\end{bmatrix}\cdot \begin{bmatrix}1 & -1 & 0\\0 & \displaystyle\frac{1}{2} & \displaystyle-\frac{1}{2}\\0 & 0 & \displaystyle\frac{1}{3}\end{bmatrix}

= \displaystyle \begin{bmatrix}1\cdot (1) + 2\cdot (0) + 3\cdot (0) & 1\cdot (-1) + 2\cdot \displaystyle\left(\frac{1}{2}\right) + 3\cdot (0) & 1\cdot (0) + 2\cdot \displaystyle\left(-\frac{1}{2}\right) + 3\cdot \displaystyle\left(\frac{1}{3}\right)\\0\cdot (1) + 2\cdot (0) + 3\cdot (0) & 0\cdot (-1) + 2\cdot \displaystyle\left(\frac{1}{2}\right) + 3\cdot (0) & 0\cdot (0) + 2\cdot \displaystyle\left(-\frac{1}{2}\right) + 3\cdot \displaystyle\left(\frac{1}{3}\right)\\0\cdot (1) + 0\cdot (0) + 3\cdot (0) & 0\cdot (-1) + 0\cdot \displaystyle\left(\frac{1}{2}\right) + 3\cdot (0) & 0\cdot (0) + 0\cdot \displaystyle\left(-\frac{1}{2}\right) + 3\cdot \displaystyle\left(\frac{1}{3}\right)\end{bmatrix}

= \displaystyle \begin{bmatrix}1 + 0 + 0 & -1 + 1 + 0 & 0 -1 + 1\right)\\0 + 0 + 0 & 0 + 1 + 0 & 0 -1 + 1\right)\\0 + 0 + 0 & 0 + 0 + 0 & 0 + 0 + 1\end{bmatrix}

= \displaystyle \begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{bmatrix}

Controlla…

\displaystyle A^{-1}\cdot A = \displaystyle \begin{bmatrix}1 & -1 & 0\\0 & \displaystyle\frac{1}{2} & \displaystyle-\frac{1}{2}\\0 & 0 & \displaystyle\frac{1}{3}\end{bmatrix}\cdot \begin{bmatrix}1 & 2 & 3\\0 & 2 & 3\\0 & 0 & 3\end{bmatrix} = … = \displaystyle \begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{bmatrix}