---
title: "Matrix multiplication and what it represents"
description: "A matrix records a linear rule. Multiplying matrices composes the rules, which is why the product is defined by rows against columns and why order matters."
canonical: https://lightmysky.com/learn/mathematics/matrix-multiplication-and-what-it-represents-mt_0fJOMPlCxr
source: https://lightmysky.com/learn/mathematics/matrix-multiplication-and-what-it-represents-mt_0fJOMPlCxr.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Matrix multiplication and what it represents

A matrix records a linear rule. Multiplying matrices composes the rules, which is why the product is defined by rows against columns and why order matters.

Subject: Mathematics · Area: Linear Algebra · Ages 18 to 19
Page: https://lightmysky.com/learn/mathematics/matrix-multiplication-and-what-it-represents-mt_0fJOMPlCxr

## Ready when they can

- Multiply two matrices and state when the product is defined
- Give two matrices whose products in the two orders differ
- Read a matrix-vector product as a combination of the columns

## Lesson: Multiplying matrices in the right order

**Example.** A matrix is a linear rule that turns inputs into outputs. A shape m by n means m rows and n columns. AB applies B first, then A. Reversing the order can change the rule. AB exists when A's number of columns equals B's number of rows. For 2 by 5 times 5 by 3, the inner sizes agree and the product is 2 by 3. The identity matrix I has 1s on its diagonal and 0s elsewhere. With matching sizes, AI = A and IA = A: I leaves inputs unchanged.

**Example.** Take A with rows (1, 2) and (3, 4), and B with rows (5, 6) and (7, 8). The top left entry of AB pairs row 1 of A with column 1 of B: 1(5) + 2(7) = 19.

Order matters. A 4 by 2 times a 2 by 3 works, but the reverse does not exist. When both orders exist, the values can still differ. With A rows (1, 1), (0, 1) and B rows (1, 0), (1, 1), the top left entry of AB is 1(1) + 1(1) = 2, but in BA it is 1(1) + 0(0) = 1.

Read a matrix-vector product Av as a combination of the columns of A. Each entry of v scales one column, and the scaled columns are added entry by entry, as in 3(1, 2) + (4, 1) = (7, 7). So v needs one entry per column of A.

*(drawing: One product entry comes from one row of the first matrix and one column of the second.)*

To test whether A times B exists, use the rightmost dimension of A and the leftmost dimension of B. For a 4 by 3 matrix A, a right factor must have 3 rows. A 3 by 2 factor works and produces a 4 by 2 product. A 4 by 3 factor does not work.

**Example.** Use A with rows (2, 0) and (1, 3), and B with rows (4, 1) and (5, 2). The bottom right entry of AB uses row 2 of A, (1, 3), and column 2 of B, (1, 2): 1 times 1 plus 3 times 2 equals 7.

**Recap.** Check shapes first, pair rows with columns, keep the order, and read Av as weighted columns.

*Original lesson and assessment text by the Open Source Taxonomy project.*

## Practice

14 questions on this page, each with its working shown.

## Needs first

- [Gaussian elimination and row echelon form](https://lightmysky.com/learn/mathematics/gaussian-elimination-and-row-echelon-form-mt_PZBce3UvRm)

## Optional connections

- [Transformations of Graphs](https://lightmysky.com/learn/mathematics/transformations-of-graphs-mt_691_c-7Z5M)

## Opens up

- [The Inverse of a Matrix and When It Exists](https://lightmysky.com/learn/mathematics/the-inverse-of-a-matrix-and-when-it-exists-mt_1K6lcfMQ_b)
- [Data as a Matrix: Rows, Features and the Target](https://lightmysky.com/learn/computing/data-as-a-matrix-rows-features-and-the-target-mt_KEN-TU1Gpn)
- [Linear Programming, Duality and Rounding](https://lightmysky.com/learn/computing/linear-programming-duality-and-rounding-mt_rsj6G8iydV)
- [Conformal Maps and Mobius Transformations](https://lightmysky.com/learn/mathematics/conformal-maps-and-mobius-transformations-mt_WtHCbAT4GI)
