No history yet

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 m×nm \times n (that's mm rows and nn columns) and Matrix B with dimensions p×qp \times q. To multiply them in the order A×BA \times B, the number of columns in A (nn) must be exactly the same as the number of rows in B (pp).

We can write their dimensions side-by-side to check compatibility:

The dimensions nn and pp 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, mm and qq, 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 m×nm \times n matrix by an n×pn \times p matrix gives you a brand new m×pm \times p matrix. The inner dimensions (nn) disappear, and the outer ones form the shape of the product.

Matrix AMatrix BCompatible?Resulting Size
2×32 \times 33×43 \times 4Yes2×42 \times 4
4×14 \times 11×51 \times 5Yes4×54 \times 5
3×33 \times 33×33 \times 3Yes3×33 \times 3
5×25 \times 25×25 \times 2NoNot possible
1×71 \times 78×18 \times 1NoNot possible

Notice that order matters. If we try to multiply the matrices from the first example in reverse order (B×AB \times A), we'd be checking a 3×43 \times 4 against a 2×32 \times 3. The inner dimensions would be 4 and 2. Since they don't match, the multiplication B×AB \times A is undefined, even though A×BA \times B worked perfectly.

This is a huge difference from regular multiplication, where 5×45 \times 4 is the same as 4×54 \times 5. 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 4×24 \times 2 matrix by a 2×32 \times 3 matrix?

The inner dimensions are 2 and 2. They match. The outer dimensions are 4 and 3. So yes, the result will be a 4×34 \times 3 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.

Quiz Questions 1/5

If Matrix A has dimensions m×nm \times n and Matrix B has dimensions p×qp \times q, under what condition can they be multiplied in the order A×BA \times B?

Quiz Questions 2/5

You are given a 4×24 \times 2 matrix and a 2×32 \times 3 matrix. What will be the dimensions of the resulting matrix after multiplication?