Matrix Multiplication
Matrix Multiplication
To multiply matrices there’s 2 simple things you need to
know:
• 1. The method of multiplying the matrices together
• 2. Are the matrices compatible with each other?
Multiplication Process
The process is the same for the second row and then repeated across the entire matrix.
• First, each entry in the row of the first matrix is multiplied by the
corresponding entry in the column of the second matrix and summed up.
• This will produce the first entry in the final matrix. Thame row is then
multiplied for the rest of the columns in the second matrix. The process is
the same for the second row and then repeated across the entire matrix.
EXAMPLE:
• 2 x 3 matrix and a 3 x 2 matrix
1 2 3 3 5 1*3 + 2*7 + 3*3 1*5 + 2*5 + 3*2 26 21
4 5 6 x 7 5 = 4*3 + 5*7 + 6*5 4*5 + 5*5 +6*2 = 56 57
3 2
• The same row is then multiplied for the rest of the columns in the second matrix.
Now in reverse
The same 3x2 matrix and a 2x3 matrix multiplied in reverse will
produce a 3x3 matrix
3 5 1 2 3 3*1 + 5*4 3*2 + 5*5 3*3+5*6 = 23 31 39
7 5 x 4 5 6 = 7*1 + 5*4 7*2 + 5*5 7*3+5*6 = 27 39 51
3 2 3*1 + 2*4 3*2 + 2*5 3*3+2*6 = 11 16 21
Note that the number of rows in the first matrix and number of
columns in the second matrix (shown in bold above) will determine the
size of the final matrix
3*1 + 5*4 3*2 + 5*5 3*3+5*6 = 23 31 39
7*1 + 5*4 7*2 + 5*5 7*3+5*6 = 27 39 51
3*1 + 2*4 3*2 + 2*5 3*3+2*6 = 11 16 21
Compatibility
• A matrix is compatible with another ONLY IF the number of columns
in the first matrix is equal to the number of rows in the second
EXAMPLE:
• 2 x 3 matrix and a 3 x 3 matrix will produce a 3x3 matrix
1 2 3 3 5 1
4 5 6 7 5 2 COMPATIBLE
3 2 4
• 2 x 3 matrix and a 2 x 3 matrix = UNCOMPATIBLE
1 2 3 1 3 5
4 5 6 2 3 7
-------- << one more row required
Some more examples to try

Matrix multiplication

  • 1.
  • 2.
    Matrix Multiplication To multiplymatrices there’s 2 simple things you need to know: • 1. The method of multiplying the matrices together • 2. Are the matrices compatible with each other?
  • 3.
    Multiplication Process The processis the same for the second row and then repeated across the entire matrix. • First, each entry in the row of the first matrix is multiplied by the corresponding entry in the column of the second matrix and summed up. • This will produce the first entry in the final matrix. Thame row is then multiplied for the rest of the columns in the second matrix. The process is the same for the second row and then repeated across the entire matrix. EXAMPLE: • 2 x 3 matrix and a 3 x 2 matrix 1 2 3 3 5 1*3 + 2*7 + 3*3 1*5 + 2*5 + 3*2 26 21 4 5 6 x 7 5 = 4*3 + 5*7 + 6*5 4*5 + 5*5 +6*2 = 56 57 3 2 • The same row is then multiplied for the rest of the columns in the second matrix.
  • 4.
    Now in reverse Thesame 3x2 matrix and a 2x3 matrix multiplied in reverse will produce a 3x3 matrix 3 5 1 2 3 3*1 + 5*4 3*2 + 5*5 3*3+5*6 = 23 31 39 7 5 x 4 5 6 = 7*1 + 5*4 7*2 + 5*5 7*3+5*6 = 27 39 51 3 2 3*1 + 2*4 3*2 + 2*5 3*3+2*6 = 11 16 21 Note that the number of rows in the first matrix and number of columns in the second matrix (shown in bold above) will determine the size of the final matrix 3*1 + 5*4 3*2 + 5*5 3*3+5*6 = 23 31 39 7*1 + 5*4 7*2 + 5*5 7*3+5*6 = 27 39 51 3*1 + 2*4 3*2 + 2*5 3*3+2*6 = 11 16 21
  • 5.
    Compatibility • A matrixis compatible with another ONLY IF the number of columns in the first matrix is equal to the number of rows in the second EXAMPLE: • 2 x 3 matrix and a 3 x 3 matrix will produce a 3x3 matrix 1 2 3 3 5 1 4 5 6 7 5 2 COMPATIBLE 3 2 4 • 2 x 3 matrix and a 2 x 3 matrix = UNCOMPATIBLE 1 2 3 1 3 5 4 5 6 2 3 7 -------- << one more row required
  • 6.