# 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 has rows and columns, it is called a 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 and a column in the second matrix.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=\left[\begin{array}{rr}{1} &3 \\ 2& 4 \\ 2& 5 \end{array}\right]$ and $B=\left[\begin{array}{rrrr}{1} &3&2&2 \\ 2& 4&5&1 \end{array}\right]$

To find , we take the the dot product of a row in and a column in . This means that the

*the number of entries in each row of must be the same as the number of entries in each column of .*$A=\left[\begin{array}{rr}{\maroonC1} &\maroonC3 \\ 2& 4 \\ 2& 5 \end{array}\right]$ and $B=\left[\begin{array}{rrrr}{\maroonC1} &3&2&2 \\ \maroonC2& 4&5&1 \end{array}\right]$

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

**3)**is a matrix and is a matrix.

## Dimension property

The product of an matrix and an matrix is an matrix.

Let's consider the product , where
$A=\left[\begin{array}{rr}{1} &3
\\ 2& 4
\\ 2& 5
\end{array}\right]$ and $B=\left[\begin{array}{rrrr}{1} &3&2&2
\\ 2& 4&5&1
\end{array}\right]$.

From above, we know that is defined since the number of columns in matches the number of rows in .

To find , we must be sure to find the dot product between each row in and each column in . So, the resulting matrix will have the same number of rows as matrix and the same number of columns as matrix . It will be a matrix.