TD 2: Bases et Rang

MIA

On considère l’application linéaire \(f : (x,y,z) \mapsto (2x+y, y+x, z+y)\).

  1. Écrire sa matrice dans la base canonique de \(\mathbb{R}^3\).
  2. Calculer son rang.
Correction
  1. On regarde les images de \((1,0,0)\), \((0,1,0)\) et \((0,0,1)\) et on les met comme les colonnes de la matrice. On trouve donc :
\[\begin{pmatrix} 2 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}\]
  1. On effectue un pivot de Gauss.
\[\begin{pmatrix} 2 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}\]

\(C_2 \gets C_2 - C_1\)

\[\begin{pmatrix} 2 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]

Échange\((C_1,C_2)\)

\[\begin{pmatrix} -1 & 2 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]

Nous sommes sous forme étagée, on a donc un rang égal à \(3\).

MĂŞme question avec \(f : (x,y,z) \mapsto (2x+y, x+y+z, -y-2z)\).

Correction

On prend Ă  nouveau les images des vecteurs de la base canonique en colonne.

\[\begin{pmatrix} 2 & 1 & 0 \\ 1 & 1 & 1 \\ 0 & -1 & -2 \end{pmatrix}\]

Pour le calcul du rang, on fait Ă  nouveau un pivot de Gauss :

\(C_2 \gets C_2 - {C_1 \over 2}\)

\[\begin{pmatrix} 2 & 0 & 0 \\ 1 & {1/2} & 1 \\ 0 & -1 & -2 \end{pmatrix}\]

\(C_3 \gets C_3-2C_2\)

\[\begin{pmatrix} 2 & 0 & 0 \\ 1 & {1/2} & 0 \\ 0 & -1 & 0 \end{pmatrix}\]

On est sous forme étagée et on trouve donc que le rang est \(2\).

Calculer l’inverse de :

\[\begin{pmatrix} 2 & 2 & 3 \\ 0 & 2 & 4 \\ 1 & 5 & 2 \end{pmatrix}\]
Correction

On fait un pivot de Gauss jusqu’à trouver l’identité. On reporte les mêmes transformations sur l’identité et on trouve l’inverse de la matrice.

\[\begin{pmatrix} 2 & 2 & 3 \\ 0 & 2 & 4 \\ 1 & 5 & 2 \end{pmatrix}\] \[\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]
  • \(C_2 \gets C_2 - C_1\)
  • \(C_1 \gets {C_1 \over 2}\)
  • \(C_3 \gets C_3 - 3C_1\)
\[\begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 4 \\ {1 \over 2} & 4 & {1 \over 2} \end{pmatrix}\] \[\begin{pmatrix} {1 \over 2} & -1 & -{3 \over 2} \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]
  • \(C_3 \gets C_3 - 2C_2\)
  • \(C_2 \gets {C_2 \over 2}\)
\[\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ {1 \over 2} & 2 & -{15 \over 2} \end{pmatrix}\] \[\begin{pmatrix} {1 \over 2} & -{1 \over 2} & {1 \over 2} \\ 0 & {1 \over 2} & -2 \\ 0 & 0 & 1 \end{pmatrix}\]
  • \(C_3 \gets {-2 \over 15} C_3\)
  • \(C_2 \gets C_2 - 2C_3\)
  • \(C_1 \gets C_1 - {C_3 \over 2}\)
\[\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\] \[\begin{pmatrix} {8 \over 15} & {-11 \over 30} & -{1 \over 15} \\ -{2 \over 15} & -{1 \over 30} & {4 \over 15} \\ {1 \over 15} & {4 \over 15} & -{2 \over 15} \end{pmatrix}\]

(à faire plutôt à la maison) Proposer une implémentation du pivot de Gauss permettant de calculer le rang d’une matrice. Implémenter aussi une méthode permettant de calculer l’inverse d’une matrice (remarquons cependant que cette fonction existe déjà, voir numpy.linalg.inv.