If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Matrix multiplication dimensions

Learn about the conditions for matrix multiplication to be defined, and about the dimensions of the product of two matrices.

What you should be familiar with before taking this lesson

A matrix is a rectangular arrangement of numbers into rows and columns. Each number in a matrix is referred to as a matrix element or entry.
The dimensions of a matrix give the number of rows and columns of the matrix in that order. Since matrix A has 2 rows and 3 columns, it is called a 2×3 matrix.
If this is new to you, we recommend that you check out our intro to matrices.
In matrix multiplication, each entry in the product matrix is the dot product of a row in the first matrix and a column in the second matrix.
b1b2a1a2[1274][3532]=[a1b1a2b1a1b2a2b2]ABC
If this is new to you, we recommend that you check out our matrix multiplication article.

What you will learn in this lesson

We will investigate the relationship between the dimensions of two matrices and the dimensions of their product. Specifically, we will see that the dimensions of the matrices must meet a certain condition for the multiplication to be defined.

When is matrix multiplication defined?

In order for matrix multiplication to be defined, the number of columns in the first matrix must be equal to the number of rows in the second matrix.
To see why this is the case, consider the following two matrices:
A=[132425] and B=[13222451]
To find AB, we take the dot product of a row in A and a column in B. This means that the number of entries in each row of A must be the same as the number of entries in each column of B.
A=[132425] and B=[13222451]
Note that if a matrix has two entries in each row, then the matrix has two columns. Similarly, if a matrix has two entries in each column, then it must have two rows.
So, it follows that in order for matrix multiplication to be defined, the number of columns in the first matrix must be equal to the number of rows in the second matrix.

Check your understanding

1) A=[246473] and B=[2185].
Is AB defined?
Choose 1 answer:

2) C=[53616853] and D=[218755].
Is CD defined?
Choose 1 answer:

3) A is a 4×2 matrix and B is a 2×3 matrix.
Is AB defined?
Choose 1 answer:

Is BA defined?
Choose 1 answer:

Dimension property

The product of an m×n matrix and an n×k matrix is an m×k matrix.
Let's consider the product AB, where A=[132425] and B=[13222451].
From above, we know that AB is defined since the number of columns in A3×2 (2) matches the number of rows in B2×4 (2).
To find AB, we must be sure to find the dot product between each row in A and each column in B. So, the resulting matrix will have the same number of rows as matrix A3×2 (3) and the same number of columns as matrix B2×4 (4). It will be a 3×4 matrix.
b1b2b3b4a1a2a3[122345][12342521]=[a1b1a2b1a3b1a1b2a2b2a3b2a1b3a2b3a3b3a1b4a2b4a3b4]ABAB

Check your understanding

4) A=[246473] and B=[2185].
What are the dimensions of AB?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
×
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

5) C=[431672] and D=[314].
What are the dimensions of CD?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
×
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

6) A is a 2×3 matrix and B is a 3×4 matrix.
What are the dimensions of AB?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
×
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

7) X is a 2×1 matrix and Y is a 1×2 matrix.
What are the dimensions of matrix XY?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
×
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Want to join the conversation?