Matrix multiplication

MATHEMATICS

In this article we will continue to delve into linear algebra and, in particular, we will begin to look at some operations that can be performed on tensors. For simplicity, for the following examples we will use only 2D (two-dimensional) tensors, that is, matrices. In this article, we will deal specifically with the operation of tensor multiplication. The matrix product, also called the row-by-column product, is one of the most delicate matrix operations. Unlike scalar multiplication, the product of matrices is not commutative and can only be performed under certain conditions. When it can be carried out, it returns a matrix having as many rows as the first matrix and as many columns as the second. So in the following example:

begin{bmatrix} 1 & 2 & 3 \ 3 & 0 & 1 end{bmatrix} X begin{bmatrix} 1 & 0 & 2 \ 0& 1 & 1\ 1& 2 & 1 end{bmatrix}

the result of the multiplication will be a 2X3 matrix. To multiply two matrices, they must be dimensionally compatible, that is, the first matrix must have the same number of columns as the rows of the second matrix. In our example the first matrix, in fact, has shape 2X3 while the second matrix has shape 3×3. To determine whether the two matrices are compatible for multiplication, we can use a very simple method: write the shapes of the matrices and check whether the middle terms are equal. In our case we have: 2X3 3X3 and therefore the matrices are compatible for multiplication. But what will the result be?

Well, the result will be a 2X3 matrix of the form:

M=begin{bmatrix} M_{11} & M_{12} & M_{13} \ M_{21} & M_{22} & M_{23} end{bmatrix}

where:

\M_{11}=1*1+2*0+3*1\ \M_{12}=1*0+2*1+3*2 \...

 

Se vuoi farmi qualche richiesta o contattarmi per un aiuto riempi il seguente form

    Comments