Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Matrix multiplication is a way to combine two arrays of numbers so that rows from the first matrix interact with columns from the second matrix. It is essential in algebra, computer graphics, data science, physics, engineering, and systems of equations. Unlike ordinary number multiplication, the order of matrix multiplication usually matters.

Learning the row-by-column rule helps you see exactly where each entry in the product comes from.

If A is an m by n matrix and B is an n by p matrix, then AB is defined and has size m by p. Each entry in AB is found by multiplying matching entries from one row of A and one column of B, then adding the products. This process is a dot product, so every output entry summarizes how one row matches one column.

Matrix multiplication is not commutative because AB and BA may have different sizes or different entries.

Understanding Math: Matrix Multiplication

A useful way to understand multiplication is as a chain of actions. A matrix can represent a rule that takes an input list of numbers and produces an output list. When two matrices are multiplied, the right-hand matrix acts first.

Its output becomes the input for the left-hand matrix. This is why the inside dimensions must match. The first rule must produce exactly the kind of list that the next rule can accept.

The outside dimensions describe the starting list and the final list. This viewpoint makes the size rule feel less like a fact to memorize and more like a requirement for connecting two machines.

Matrix multiplication appears whenever several quantities affect one result at once. In a shop, a row can contain the number of each item bought, while a column contains item prices. Their product gives a total cost.

In a school timetable model, one matrix can link students to classes and another can link classes to rooms. The product can show which rooms are used by which students.

Each result combines several contributions into one number. The multiplication and addition steps are important because a final quantity often depends on many separate pathways, not just one direct connection.

Computer graphics gives a clear physical example. A point on a screen or in a game world can be stored as a short list of coordinates. One matrix may stretch the point, another may rotate it, and a third may shift the viewing direction when more advanced coordinate methods are used.

Multiplying the matrices creates one combined transformation. The order changes the outcome.

Rotating an object before stretching it can place its points differently from stretching before rotating. This matters in animation, image editing, robotics, and physics simulations, where a small mistake in order can make an object move in the wrong direction.

When working by hand, organize the calculation carefully. Mark the row from the first matrix and the column from the second matrix before multiplying any entries. Keep each product visible until the final sum is complete.

A common error is to multiply entries in the same positions, which is a different operation called entrywise multiplication. Another common error is to produce the wrong number of entries. The product has one result for every possible choice of a row from the first matrix and a column from the second.

Check dimensions before starting, then check whether each answer has a reasonable size. Zero entries can be meaningful because they may show no connection, no contribution, or effects that cancel exactly.

Key Facts

  • If A is m by n and B is n by p, then AB is defined and AB is m by p.
  • The entry in row i and column j of AB is (AB)ij = ai1b1j + ai2b2j + ... + ainbnj.
  • Row-by-column rule: use row i of A and column j of B to find entry (i, j) of AB.
  • Matrix multiplication is generally not commutative: AB is not usually equal to BA.
  • A 2 by 3 matrix times a 3 by 2 matrix produces a 2 by 2 matrix.
  • The identity matrix acts like 1 for matrices: AI = A and IA = A when the sizes match.

Vocabulary

Matrix
A matrix is a rectangular array of numbers arranged in rows and columns.
Entry
An entry is a single number in a matrix, identified by its row and column position.
Dimension
The dimension of a matrix is its number of rows by its number of columns.
Dot product
A dot product multiplies matching components of two lists and adds the results.
Identity matrix
An identity matrix is a square matrix with 1s on the main diagonal and 0s elsewhere.

Common Mistakes to Avoid

  • Multiplying entries in the same positions, because matrix multiplication is not entry-by-entry multiplication. Each product entry must come from a full row times a full column.
  • Ignoring matrix dimensions, because AB is only defined when the number of columns of A equals the number of rows of B. Always check the inner dimensions before multiplying.
  • Assuming AB = BA, because matrix multiplication is usually not commutative. Even when both products are defined, they can have different values.
  • Writing the product with the wrong size, because the outer dimensions determine the size of AB. If A is m by n and B is n by p, the result must be m by p.

Practice Questions

  1. 1 Let A = [[2, 1], [0, 3]] and B = [[4, 5], [6, 7]]. Compute AB.
  2. 2 Let A be a 2 by 3 matrix and B be a 3 by 4 matrix. What is the size of AB, and how many entries does it have?
  3. 3 Explain why matrix multiplication is not generally commutative, using either dimensions or a small example to support your reasoning.