No history yet

Matrix Multiplication Dynamics

The Mechanics of Multiplication

Unlike simple addition or scalar multiplication, matrix multiplication has a specific rule about dimensions. For two matrices to be multiplied, the number of columns in the first matrix must match the number of rows in the second. This is often called the "inner dimensions must match" rule.

If you multiply an m×nm \times n matrix by an n×pn \times p matrix, the result is an m×pm \times p matrix. The inner dimension, nn, essentially cancels out.

Am×n×Bn×p=Cm×pA_{m \times n} \times B_{n \times p} = C_{m \times p}

For example, you can multiply a 3×23 \times 2 matrix by a 2×52 \times 5 matrix to get a 3×53 \times 5 matrix. But you cannot multiply a 3×23 \times 2 matrix by a 3×53 \times 5 matrix because the inner dimensions (2 and 3) do not match.

Calculating the Entries

Each entry in the resulting matrix is calculated using a operation. To find the entry in the ii-th row and jj-th column of the product matrix, you take the dot product of the ii-th row of the first matrix and the jj-th column of the second matrix. This means you multiply corresponding entries and then sum the results.

Let's see this in action. Suppose we want to multiply matrix AA by matrix BB.

A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

To find the element in the first row, first column of the product matrix ABAB, we take the first row of AA and the first column of BB:

(1×5)+(2×7)=5+14=19(1 \times 5) + (2 \times 7) = 5 + 14 = 19

For the element in the first row, second column, we use the first row of AA and the second column of BB:

(1×6)+(2×8)=6+16=22(1 \times 6) + (2 \times 8) = 6 + 16 = 22

By continuing this process for all entries, we get the final product.

Lesson image
AB=((1)(5)+(2)(7)(1)(6)+(2)(8)(3)(5)+(4)(7)(3)(6)+(4)(8))=(19224350)AB = \begin{pmatrix} (1)(5)+(2)(7) & (1)(6)+(2)(8) \\ (3)(5)+(4)(7) & (3)(6)+(4)(8) \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}

A Rule That Breaks

In regular arithmetic, multiplication is commutative: 3×53 \times 5 is the same as 5×35 \times 3. With matrices, this is almost never true. The order of multiplication matters significantly. In general, ABBAAB \neq BA. This property is known as and is one of the most important distinctions in matrix algebra.

Using our previous example, let's calculate BABA.

BA=(5678)(1234)=((5)(1)+(6)(3)(5)(2)+(6)(4)(7)(1)+(8)(3)(7)(2)+(8)(4))BA = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} (5)(1)+(6)(3) & (5)(2)+(6)(4) \\ (7)(1)+(8)(3) & (7)(2)+(8)(4) \end{pmatrix}
BA=(23343146)BA = \begin{pmatrix} 23 & 34 \\ 31 & 46 \end{pmatrix}

As you can see, the result is completely different from ABAB. In some cases, BABA may not even be a valid operation if the dimensions don't align, even when ABAB is perfectly fine.

Properties to Rely On

While commutativity doesn't hold, some familiar properties from arithmetic do carry over to matrix multiplication. Two of the most important are associativity and distributivity.

The associative law states that (AB)C=A(BC)(AB)C = A(BC). The way you group matrices in a chain of multiplications doesn't change the final result. This is crucial for applying multiple transformations in sequence.

The distributive law works just as you'd expect: A(B+C)=AB+ACA(B+C) = AB + AC. You can distribute a matrix over the sum of two other matrices, provided the dimensions for all operations are valid.

There's also a special matrix that acts like the number 1 in regular multiplication: the , denoted as II. It's a square matrix with 1s on the main diagonal and 0s everywhere else. Multiplying any matrix by the identity matrix leaves it unchanged.

I=(1001)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

For any matrix AA where the multiplication is defined, the following is true:

AI=IA=AAI = IA = A

Understanding these rules provides the foundation for using matrices to solve complex problems in fields ranging from computer graphics to quantum mechanics.

Quiz Questions 1/5

If matrix A has dimensions 3×53 \times 5 and matrix B has dimensions 5×25 \times 2, what are the dimensions of the product matrix ABAB?

Quiz Questions 2/5

In general, for two matrices A and B, the product ABAB is equal to the product BABA.