Matrix multiplication

Matrix multiplication involves combining two matrices to produce a third matrix. Not every pair of matrices can be multiplied together.

Rule for multiplication

Two matrices are multipliable if the number of columns, nn, in the first matrix equals the number of rows in the second matrix.

Matrix multiplication dimensions
Matrix multiplication dimensions

In other words, we can multiply any two matrices having equal inner dimensions, and the result would be a new matrix with an order equaling the outer dimensions:

Resulting dimensions
Resulting dimensions

Matrix multiplication through dot product

The simplest way to understand matrix multiplication is through dot product. The dot product of two vectors is simply the sum of the products of corresponding elements. Consider the vectors a=(2,4,6)a=(2,4,6) and b=(1,3,5)b=(1,3,5). The dot product of aa and bb is (21+43+65)=44(2∗1+4∗3+6∗5)=44. A general representation of a dot product is

The same dot product can be used to represent matrix multiplication. Consider the matrices AA, a row matrix, and BB, a column matrix.

Multiplying a row matrix with a column matrix
Multiplying a row matrix with a column matrix

Below is an example of matrix multiplication where AA and BB are a (3×2)(3 \times 2)and a (2×2)(2 \times 2) matrix, respectively. The result is matrix CC of size (3×2).(3 \times 2).

Matrix multiplication (step by step)
1 of 6

Properties of matrix multiplication

  • The commutative property doesn’t always hold: ABBA.AB \neq BA.Consider:

  • The cancellation property doesn’t always hold: AB=ACAB=AC  doesn’t imply that B=C.B=C. Consider:

  • Matrix multiplication is associative: (AB)C=A(BC)(AB)C=A(BC)

  • Multiplication is distributive over addition: A+(B+C)=AB+ACA+(B+C)=AB+AC

  • The identity matrix II is the multiplicative identity of matrices: IA=AIA=A

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved