Return to main text



Motivation for matrix multiplication

In this discussion all αs and βs are fixed real number coefficients. And x,y,z,w,x',y',x",y",z" are arbitrary real numbers (variables).
The following linear equations provide a method for systematicly converting any array (x,y,z,w) of size 4 into an array (x',y') of size 2:
(*)
x' = β11x + β12y + β13z + β14w
y' = β21x + β22y + β23z + β24w

The following linear equations provide a method for systematicly converting any array (x',y') of size 2 into an array (x",y",z") of size 3:
(**)

x" = α11x' + α12y'
y" = α21x' + α22y'
z" = α31x' + α32y'

Then it is possible to convert any array (x,y,z,w) of size 4 into an array (x",y",z") by replacing x',y' in (**) by their equal expressions given in (*):

   x" = α1111x + β12y + β13z + β14w) + α1221x + β22y + β23z + β24w)
       = (α11β11 + α12β21)x + (α11β12 + α12β22)y + (α11β13 + α12β23)z + (α11β14 + α12β24)w

   y" = α2111x + β12y + β13z + β14w) + α2221x + β22y + β23z + β24w)
       = (α21β11 + α22β21)x + (α21β12 + α22β22)y + (α21β13 + α22β23)z + (α21β14 + α22β24)w

   z" = α3111x + β12y + β13z + β14w) + α3221x + β22y + β23z + β24w)
       = (α31β11 + α32β21)x + (α31β12 + α32β22)y + (α31β13 + α32β23)z + (α31β14 + α32β24)w

Therefore,
(***)
   x" = (α11β11 + α12β21)x + (α11β12 + α12β22)y + (α11β13 + α12β23)z + (α11β14 + α12β24)w
   y" = (α21β11 + α22β21)x + (α21β12 + α22β22)y + (α21β13 + α22β23)z + (α21β14 + α22β24)w
   z" = (α31β11 + α32β21)x + (α31β12 + α32β22)y + (α31β13 + α32β23)z + (α31β14 + α32β24)w

The coefficients of equations in (**) and (*) form the following two matrices (3x2) A and (2x4) B respectively:
(#)

				A =			B =
				α11  α12		β11  β12  β13  β14	
	(matrices)		α21  α22		β21  β22  β23  β24		
 				α31  α32	
					

The coefficients of equations in (***) form the following 3x4 matrix C:
(###)

             C  = 
                     α11β11 + α12β21      α11β12 + α12β22      α11β13 + α12β23      α11β14 + α12β24
    (matrix)         α21β11 + α22β21      α21β12 + α22β22      α21β13 + α22β23      α21β14 + α22β24
                     α31β11 + α32β21      α31β12 + α32β22      α31β13 + α32β23      α31β14 + α32β24

Each element of matrix C is a sum of products. But the inner product of two arrays of the same length is defined as the sum of products of all the corresponding coordinates (entries). The [i,j] entry in matricx C is

αi1β1j + αi2β2j = (αi1, αi2)*(β1j, β2j)t

This motivates the following rule:

The [i,j] entry in the product of two matrices is equal to the inner product of rowi of the first matrix and columnj of the second matrix.
For the inner product to happen the size of any row of the first matrix must equal the size of any column of the second matrix, i.e. the two matrices are compatible for multiplication.