Matrizenmultiplikation

Matrizenmultiplikation

Studium
(AB)ij=∑k=1naik bkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} \, b_{kj}

Voraussetzung: A∈Rm×n,A \in \mathbb{R}^{m \times n}, B∈Rn×pB \in \mathbb{R}^{n \times p}

A=(aik)A = (a_{ik})
Matrix mit m Zeilen und n Spalten
B=(bkj)B = (b_{kj})
Matrix mit n Zeilen und p Spalten
(AB)ij(AB)_{ij}
Eintrag des Produkts in Zeile i und Spalte j; AB hat m Zeilen und p Spalten
nn
Spaltenzahl von A, gleich der Zeilenzahl von B

Der Eintrag in Zeile i und Spalte j des Produkts AB ist das Skalarprodukt der i-ten Zeile von A mit der j-ten Spalte von B.

Erklärung

Zwei Matrizen lassen sich nur multiplizieren, wenn die Spaltenzahl der linken gleich der Zeilenzahl der rechten ist. Aus einer m×nm \times n- und einer n×pn \times p-Matrix entsteht eine m×pm \times p-Matrix.

Jeder Eintrag entsteht nach der Regel „Zeile mal Spalte“: Man nimmt die ii-te Zeile von AA und die jj-te Spalte von BB, multipliziert die Einträge paarweise und addiert. Das ist das Skalarprodukt dieser Zeile mit dieser Spalte.

Wichtige Eigenschaften:

  • Nicht kommutativ: Im Allgemeinen ist AB≠BAAB \neq BA, selbst wenn beide Produkte definiert sind.
  • Assoziativ und distributiv: (AB)C=A(BC)(AB)C = A(BC), A(B+C)=AB+ACA(B + C) = AB + AC.
  • ABAB entspricht der Hintereinanderausführung der linearen Abbildungen: erst BB, dann AA.
  • det⁡(AB)=det⁡A⋅det⁡B\det(AB) = \det A \cdot \det B für quadratische Matrizen.

Ein Spezialfall ist Matrix mal Vektor (p=1p = 1). So schreibt man lineare Gleichungssysteme kompakt als Ax⃗=b⃗A\vec{x} = \vec{b}.

Beispiele

(1234)(015−2)=(1⋅0+2⋅51⋅1+2⋅(−2)3⋅0+4⋅53⋅1+4⋅(−2))=(10−320−5)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 5 & -2 \end{pmatrix} = \begin{pmatrix} 1 \cdot 0 + 2 \cdot 5 & 1 \cdot 1 + 2 \cdot (-2) \\ 3 \cdot 0 + 4 \cdot 5 & 3 \cdot 1 + 4 \cdot (-2) \end{pmatrix} = \begin{pmatrix} 10 & -3 \\ 20 & -5 \end{pmatrix}

In umgekehrter Reihenfolge:

(015−2)(1234)=(34−12)\begin{pmatrix} 0 & 1 \\ 5 & -2 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} 3 & 4 \\ -1 & 2 \end{pmatrix}

Die beiden Produkte sind verschieden. Der Determinantensatz gilt trotzdem: det⁡(AB)=10⋅(−5)−(−3)⋅20=10\det(AB) = 10 \cdot (-5) - (-3) \cdot 20 = 10 und det⁡A⋅det⁡B=(−2)⋅(−5)=10\det A \cdot \det B = (-2) \cdot (-5) = 10.

Eine 2×32 \times 3-Matrix mal einen Vektor aus R3\mathbb{R}^3:

(102−131)(312)=(3+0+4−3+3+2)=(72)\begin{pmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \end{pmatrix} \begin{pmatrix} 3 \\ 1 \\ 2 \end{pmatrix} = \begin{pmatrix} 3 + 0 + 4 \\ -3 + 3 + 2 \end{pmatrix} = \begin{pmatrix} 7 \\ 2 \end{pmatrix}

Typische Fehler

  • Eintragsweise multiplizieren (aij⋅bija_{ij} \cdot b_{ij}). Das ist das Hadamard-Produkt, nicht das Matrizenprodukt.
  • AB=BAAB = BA annehmen und Faktoren beim Umformen vertauschen. Aus AX=BAX = B folgt (für invertierbares AA) X=A−1BX = A^{-1}B, nicht X=BA−1X = BA^{-1}.
  • Matrizen mit unpassenden Formaten multiplizieren, z.B. eine 2×32 \times 3- mit einer 2×32 \times 3-Matrix.

Verwandte Formeln