Mastering Matrix Multiplication and Applications
Matrix Compatibility
The Handshake Rule
Unlike adding or subtracting numbers, you can't just multiply any two matrices together. They have to be compatible, following a strict rule. Think of it like a handshake. For two matrices to connect, their “inner” dimensions must match.
For the multiplication of two matrices A and B to be defined, the number of columns in A must equal the number of rows in B.
Let's say we have Matrix A with dimensions (that's rows and columns) and Matrix B with dimensions . To multiply them in the order , the number of columns in A () must be exactly the same as the number of rows in B ().
We can write their dimensions side-by-side to check compatibility:
The dimensions and are the inner dimensions. If they match, the matrices are considered for multiplication. If they don't, the operation is impossible. It's a simple, non-negotiable check.
Determining the Result
If the inner dimensions match, the multiplication is valid. But what size will the new matrix be? That's where the outer dimensions, and , come in. The resulting matrix will always have the number of rows from the first matrix and the number of columns from the second.
So, multiplying an matrix by an matrix gives you a brand new matrix. The inner dimensions () disappear, and the outer ones form the shape of the product.
| Matrix A | Matrix B | Compatible? | Resulting Size |
|---|---|---|---|
| Yes | |||
| Yes | |||
| Yes | |||
| No | Not possible | ||
| No | Not possible |
Notice that order matters. If we try to multiply the matrices from the first example in reverse order (), we'd be checking a against a . The inner dimensions would be 4 and 2. Since they don't match, the multiplication is undefined, even though worked perfectly.
This is a huge difference from regular multiplication, where is the same as . With matrices, changing the order can change everything, a property first explored in detail by the mathematician in the 1850s.
Let's check one more. Can you multiply a matrix by a matrix?
The inner dimensions are 2 and 2. They match. The outer dimensions are 4 and 3. So yes, the result will be a matrix.
Before you ever calculate a single number in a matrix multiplication problem, always check the dimensions. It's a fast way to see if the problem is even solvable.
If Matrix A has dimensions and Matrix B has dimensions , under what condition can they be multiplied in the order ?
You are given a matrix and a matrix. What will be the dimensions of the resulting matrix after multiplication?