Recent chats

How can I tell whether two matrices can be multiplied in a particular order?

Quick answer

Write each matrix’s dimensions as rows × columns. For a product AB, the number of columns in A must equal the number of rows in B; those matching numbers are the inside dimensions. The result has the number of rows in A and columns in B. Check the reversed product separately: BA may be undefined, or it may be defined but have a different value.

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

What should I check before I start multiplying two matrices?

Geez

Write down the size of each matrix in rows × columns, then check the order you actually intend to multiply. For AB, compare the columns of A with the rows of B. These are the inside dimensions: if they match, AB is defined; if they do not, AB is not defined. When it is defined, the answer has the outside dimensions: A’s row count × B’s column count. [S1]

A handy pattern is (m × r)(r × n) = (m × n). The two r values must match. Don’t compare the first matrix’s rows with the second matrix’s columns to decide whether multiplication is allowed—that pair instead tells you the result’s size.

Follow-up question

Can you show that check with actual dimensions?

Geez

Suppose A is 3 × 4 and B is 4 × 2.

  1. For AB, write (3 × 4)(4 × 2).
  2. Compare the inside numbers: 4 and 4. They match, so AB is defined.
  3. Keep the outside numbers: 3 and 2. The product AB is 3 × 2. [S1]

This checks whether the product is possible and predicts its dimensions. It does not calculate the entries; you would still need to take each row of A and combine it with each column of B to find those.

Follow-up question

If AB works, can I assume BA works too?

Geez

No. Check BA from scratch, switching which matrix comes first. With the example above, BA has dimensions (4 × 2)(3 × 4). Its inside numbers are 2 and 3, which do not match, so BA is undefined. In this case AB exists but BA does not. [S1]

Even when both orders are defined, the products need not have the same entries. For example, let A = [[1, 1], [0, 1]] and B = [[1, 0], [1, 1]]. Both products are allowed because both matrices are 2 × 2. Multiplying gives AB = [[2, 1], [1, 1]], while BA = [[1, 1], [1, 2]]. So order can matter even when the dimensions allow both orders. [S1]

Follow-up question

Can I use one reusable note to check a problem and explain my answer?

Geez

Yes. Copy this short template and fill in the dimensions before doing any entry calculations:

“___ is ___ × ___ and ___ is ___ × ___. For ___ × ___, the inside dimensions are ___ and ___, so the product [is defined / is not defined]. If defined, its dimensions are ___ × ___. For the reverse order, the inside dimensions are ___ and ___, so ___.”

For A = 3 × 4 and B = 4 × 2, the completed note is: “A is 3 × 4 and B is 4 × 2. For AB, the inside dimensions are 4 and 4, so the product is defined and is 3 × 2. For BA, the inside dimensions are 2 and 3, so BA is not defined.”

This dimension check does not tell you the product’s numerical entries; it only establishes whether the multiplication is possible and, if so, the size of the result.

A practical checklist

  • Write each matrix’s dimensions in rows × columns order.

  • Name the product order explicitly, such as AB or BA.

  • Compare the first matrix’s columns with the second matrix’s rows.

  • If they match, record the result size using the first matrix’s rows and second matrix’s columns.

  • Check the reversed order separately; do not assume its product exists or has the same entries.

A few more useful answers

Which dimensions are the inside dimensions?

For AB, they are the column count of A and the row count of B. They must match for AB to be defined. [S1]

How do I know the size of a defined product?

Use the outside dimensions: the rows of the first matrix and the columns of the second. For example, a defined (3 × 4)(4 × 2) product is 3 × 2. [S1]

Does a valid dimension check mean AB equals BA?

No. It only establishes whether each order is defined and the dimensions of its result. Even if both orders are possible, their entries can differ. [S1]

Sources

References used for this guide.

  1. [S1] OpenStax Algebra and Trigonometry: Matrix Products and Dimensions
    openstax.org · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work