Information

Author(s) Loan
Deadline No deadline
Submission limit No limitation

Sign in

[EXO] Exercices produits matriciels

Contexte

Le produit matriciel désigne la multiplication de matrices.
Si tu n'as jamais entendu parler de matrices, dis toi que c'est juste un tableau rempli de nombres (comme dans Excel).
Il en existe de plusieurs formes, ici nous aurons juste besoin de la plus simple.

Soit :
- Une matrice \(A = (a_{i,j})\) de taille \((m, n)\)
- Une matrice \(B = (b_{i,j})\) de taille \((n, p)\)
Alors leur produit matriciel, noté \(AB = (c_{i,j})\) est une matrice de taille \((m, p)\) donnée par :
$$\forall i,j: c_{i,j} = \sum^n_{k=1} a_{i,k} \cdot b_{k,j} = a_{i,1} \cdot b_{1,j} + a_{i,2} \cdot b_{2,j} + ... + a_{i,n} \cdot b_{n,j}$$
C'est un peu difficile à comprendre comme ça, mais tu verras que même si la formule et la notation sont complexes, en pratique c'est simple à faire.
Il te suffit juste de multiplier et additionner les bons éléments ensemble ;)

Exemple

Prenons \(A = \begin{pmatrix}a_{1,1} & a_{1,2}\\ a_{2,1} & a_{2,2}\\a_{3,1} & a_{3,2}\\a_{4,1} & a_{4,2}\end{pmatrix}\) et \(B = \begin{pmatrix}b_{1,1} & b_{1,2} & b_{1,3}\\b_{2,1} & b_{2,2} & b_{2,3}\end{pmatrix}\), on peut calculer le produit matriciel \(AB\) de la façon suivante :
https://upload.wikimedia.org/wikipedia/commons/e/eb/Matrix_multiplication_diagram_2.svg

La valeur du cercle jaune à bordure rouge se calcule comme étant : \(c_{1,2} = a_{1,1} \cdot b_{1,2} + a_{1,2} \cdot b_{2,2}\)
La valeur du cercle vert à bordure bleue se calcule comme étant : \(c_{3,3} = a_{3,1} \cdot b_{1,3} + a_{3,2} \cdot b_{2,3}\)
Et ainsi de suite pour chaque autre case de la matrice.

Prenons \(A =\begin{pmatrix}1 & 0\\2 & -1\end{pmatrix}\) et \(B =\begin{pmatrix}3 & 4\\-2 & -3\end{pmatrix}\). \(AB\) est alors :
\[AB = \begin{pmatrix}1 \cdot 3 + 0 \cdot -2 & 1 \cdot 4 + 0 \cdot -3 \\2 \cdot 3 + -1 \cdot -2 & 2 \cdot 4 + -1 \cdot -3\end{pmatrix} = \begin{pmatrix}3 & 4\\ 8 & 11\end{pmatrix} \]
Je suis conscient que ce n'est pas facile au début, mais après quelques exercices tu devrais pouvoir y parvenir sans problème ;)

Objectif
Calcul les produits matriciels suivants \(AB\) avec les \(A\), \(B\) donnés

Question 1:

\[A=\begin{pmatrix}1 & 0\\2 & -1\end{pmatrix} \quad B=\begin{pmatrix}3 & 4\\-2 & -3\end{pmatrix}\]

Question 2:

\[A=\begin{pmatrix}1 & 0\\2 & -1\end{pmatrix} \quad B=\begin{pmatrix}2 & -1\\0 & 1\end{pmatrix}\]

Question 3:

\[A=\begin{pmatrix}1 & 2\\3 & 4\end{pmatrix} \quad B=\begin{pmatrix}2 & -1\\0 & 1\end{pmatrix}\]

Question 4:

\[A=\begin{pmatrix}1 & 2 & 3 & 4\end{pmatrix} \quad B=\begin{pmatrix}1 \\ 0\\-1 \\ 2\end{pmatrix}\]

Question 5:

\[A=\begin{pmatrix}1 & 2 \\ 3 & 4 \\ 1 & 2 \\ 3 & 4\end{pmatrix} \quad B=\begin{pmatrix}1 & 0 & -1 \\ 2 & -1 & 0\end{pmatrix}\]