Serlo: EN: Matrix multiplication

Aus testwiki
Version vom 2. September 2024, 18:18 Uhr von imported>Sascha Lill 95 (Further reading)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

{{#invoke:Mathe für Nicht-Freaks/Seite|oben}} In this article, you learn how to multiply matrices. We will see that matrix multiplication is equivalent to the composition of linear maps. We will also prove some properties of the matrix multiplication.

Introduction

How can we multiply matrices?

In the article on matrices of linear maps, we learned how we can use matrices to describe linear maps f:VW between finite-dimensional vector spaces V and W. This requires fixing a basis B of V and a basis C of W, with respect to which we can define the mapping matrix MCB(f). In a plane of coordinates, this matrix descibes what the linear mapping f does with a vector vV: Vorlage:Einrücken where kB:VKn is the coordinate mapping with respect to B, which maps a vector v=λ1b1++λnbn to the coordinate vector (λ1,,λn)T with respect to B. Similarly, kC:WKm is the coordinate mapping with respect to C.

We can concatenate linear maps f:VW and g:WX by executing them one after the other, which results in a linear map gf:VX. Can we define a suitable "concatenation" of matrices? By suitable, we mean that the "concatenation" of the matrices corresponding to f and g should become the matrix of the map gf. We will call this "concatenation" of the matrices also the matrix product since it will turn out to behave almost like a product of numbers.

For example, let's consider two matrices AKm×l and BKp×n with the corresponding linear mas Vorlage:Einrücken and Vorlage:Einrücken given by matrix-vector-multiplication. Then A is the matrix of fA (with respect to the standard bases in Kl and Km), and B is the matrix of fB (with respect to the standard bases in Kp and Kn). The product AB of A and B should then be the matrix of fAfB.

However, in order to be able to execute the maps fA and fB one after the other, the target space of fB must be equal to the space on which fA is defined. This means that Kp=Kl, i.e. p=l. Therefore, the number of columns of A must be equal to the number of rows of B, otherwise we cannot define the product matrix AB.

Computing the product matrix

What is the product AB of A and B corresponding to the map fAfB:KnKm? To compute it, we need to calculate the images of the standard basis vectors e1,,enKn under the map fAfB. They will form the columns of the matrix of fAfB, that is, the matrix AB.

We denote the entries of A by aij and those of B by bij, i.e. A=(aij)Km×p and B=(bij)Kp×n. We also denote the desired matrix of fAfB by AB=C=(cij)Km×n.

For i{1,,m} and j{1,,n}, the entry cij is given by the definition of the matrix representing fAfB by the i-th entry of the vector fA(fB(ej))Km. We can easily calculate it using the definition of fA and fB using the definition of matrix-vector-multiplication: Vorlage:Einrücken This defines all entries of the matrix C and we conclude Vorlage:Einrücken This is exactly the product C=AB of the two matrices A and B.

Definition and rule of thumb

Mathematically, we can also understand matrix multiplication as an operation (just as the multiplication of real numbers).

Mathe für Nicht-Freaks: Vorlage:Definition

However, there is an important difference to the multiplication of real numbers: With matrices, we have to make sure that the dimensions of the matrices we want to multiply match. Mathe für Nicht-Freaks: Vorlage:Hinweis Mathe für Nicht-Freaks: Vorlage:Warnung

To calculate the matrix product, we use the scheme "row times column".

Rule of thumb: row times column

According to the definition, each entry in the product AB is the sum of the component-wise multiplication of the elements of the i-th row of A with the k-th column of B. This procedure can be remembered as row times column, as shown in the figure on the right.

Concrete example

Example 1

We consider the following two matrices A2×3 and B3×4: Vorlage:Einrücken We are looking for the matrix product C=AB2×4. This matrix has the form Vorlage:Einrücken We have to calculate the individual entries cik. We will do this here in detail for the entry c23. The calculation of the other entries works analogously.

According to the formula Vorlage:Einrücken

This calculation can also be seen as the "multiplication" of the 2nd row of A with the 3rd column of B. To illustrate this, we mark the entries from the sum in the matrices. We have the sum Vorlage:Einrücken These are the following entries in the matrices: Vorlage:Einrücken In this way, we can also determine the other entries of C and obtain Vorlage:Einrücken

Example 2

We consider the following matrices A1×3 and B3×1: Vorlage:Einrücken In this case, we can calculate both AB and BA. Let C:=AB. Then C is a 1×1-matrix C=(c11). We calculate its only entry: Vorlage:Einrücken Thus, AB=(1).

Let D:=BA. Then D is a 3×3-matrix. We can calculate the entries of D by the scheme "row times column". For example, the first entry of D is the first row of B times the first column of A, i.e. 15=5. If we do this with each entry, we get Vorlage:Einrücken

Example 3

In this example, we want to illustrate that the matrix multiplication really corresponds to "concatenating two matrices". That means, if we have two matrices A and B that we apply to a vector v, then we always have (AB)v=A(Bv). As an example, let A2×2 and B2×3 be the following matrices with entries in : Vorlage:Einrücken Let further v=(2,0,1)T. We check that (AB)v=A(Bv). To do so, we first calculate the matrix product AB: Vorlage:Einrücken Now we multiply this matrix with v: Vorlage:Einrücken Next, we compute A(Bv). Vorlage:Einrücken We now apply A to this vector: Vorlage:Einrücken Indeed, here we have (AB)v=A(Bv).

Properties of matrix multiplication

We now collect a few properties of the matrix multiplication.

Shortening rule for matrices representing linear maps

The following theorem shows that matrix multiplication actually reflects the composition of linear mappings. Mathe für Nicht-Freaks: Vorlage:Satz

Mathe für Nicht-Freaks: Vorlage:Warnung

Associativity of matrix multiplication

Mathe für Nicht-Freaks: Vorlage:Satz

Compatibility with scalar multiplication

Mathe für Nicht-Freaks: Vorlage:Satz

Distributivity of matrix multiplication

Here we must be careful that the sizes of the matrices are compatible.

Mathe für Nicht-Freaks: Vorlage:Satz

Mathe für Nicht-Freaks: Vorlage:Satz

Left and right neutral element of matrix multiplication

We denote the entries of the unit matrix with δij, i.e. Im=(δij). Then Vorlage:Einrücken

Mathe für Nicht-Freaks: Vorlage:Satz

Non-commutativity

Mathe für Nicht-Freaks: Vorlage:Beispiel

Mathe für Nicht-Freaks: Vorlage:Warnung

Further reading

Mathe für Nicht-Freaks: Vorlage:Hinweis


{{#invoke:Mathe für Nicht-Freaks/Seite|unten}}