The Maths You Actually NeedLesson 10 of 76

Module 2 · Matrices, and what a layer really does

Doing a matrix multiplication yourself, once

In this lesson

  • 8 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 1 of 9 in this chapter

This chapter’s goalMultiply two matrices by hand and predict the output shape of any chain of layers, explain what the rank of a weight matrix costs and buys, and use singular values to justify replacing a 4096x4096 matrix with two thin ones and to state what that replacement gives up.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Every entry of AB is one dot productCol 1 of B: 7 9 11Col 2 of B: 8 10 12Row 1 of A: 1 2 3587 + 18 + 33648 + 20 + 36Row 2 of A: 4 5 613928 + 45 + 6615432 + 50 + 72Four entries, four dot products of length three. The inner dimension has to be 3 on both sides becausea dot product needs two lists of equal length, and that is the whole explanation for the shape erroryou will meet most often in your first month.
Four entries, four dot products of length three. The inner dimension has to be 3 on both sides because a dot product needs two lists of equal length, and that is the whole explanation for the shape error you will meet most often in your first month.

Figure 2.1

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

Do it once and you never fear it again

Matrix multiplication looks like a rule to memorise. It is one sentence: entry (i, j) of the answer is the dot product of row i of the left matrix with column j of the right matrix. Everything else follows from that, including the shape rule and the fact that order matters.

Here is a full worked example. Take

Text
A = [ 1  2  3 ]        B = [ 7   8 ]
    [ 4  5  6 ]            [ 9  10 ]
                           [ 11 12 ]

A is 2×3, B is 3×2. Work out each of the four answer entries.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Doing a matrix multiplication yourself, once’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/matrix-multiplication-by-hand (Accessed: 29 November 2026).