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)

\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à.

\displaystyle \begin{bmatrix}d_{11} & 0 & 0 & | & ? & ? & ?\\0 & d_{22} & 0 & | & ? & ? & ?\\0 & 0 & d_{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à.

\displaystyle \begin{bmatrix}1 & 0 & 0 & | & ?? & ?? & ??\\0 & 1 & 0 & | & ?? & ?? & ??\\0 & 0 & 1 & | & ?? & ?? & ??\end{bmatrix}

Le manipolazioni su A (e su I) possono essere rappresentate come il prodotto per una matrice X

  • A \, | \, I
  • X\cdot A \, | \, X\cdot I
  • I \, |\, X
  • I \, | \, A^{-1}

La matrice X ha trasformato la matrice A nella matrice identità, X\cdot A = I, quindi X è l’inversa di A!


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 \leftarrow R_2 -m_1 \cdot R_1 = R_2 -3\cdot R_1

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

= \displaystyle \begin{bmatrix}3 & 4 & | & 0 & 1\end{bmatrix}-\begin{bmatrix}3 & 6 & | & 3 & 0\end{bmatrix}

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

\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 \leftarrow R_1 -m_2 \cdot R_2 = R_1 -(-1) R_2

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

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

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

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

\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 \leftarrow R_2 -m_3 \cdot R_3 = R_2 -R_3

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

\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 \leftarrow R_1 -m_3 \cdot R_3 = R_1 - R_3

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

\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 \leftarrow R_1 -m_2 \cdot R_2 = R_1 - R_2

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

\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 \leftarrow \displaystyle \frac{R_2}{a_{22}} = \displaystyle\frac{R_2}{2}

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

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

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

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

\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}

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}