Suppose A has 2 rows and 3 columns. It can turn a three-coordinate input into a two-coordinate output. Each output coordinate comes from one row of A paired with all three input coordinates.
2×3[142536]3×1102=2×1[716].
The first output is 1⋅1+2⋅0+3⋅2=7. The second is 4⋅1+5⋅0+6⋅2=16. Each row needs exactly as many entries as the input provides.
Match the inside. Keep the outside.
Explore it yourself
Can these shapes connect?
Matrix multiplication pairs a row with a column. The two inner dimensions must match.
Preparing interactive controls…
For matrices A∈Rm×n and B∈Rp×q, the product AB is defined when n=p. Its result then has shape m×q.
A(m×n)B(n×q)⟶m×q.
“Match the inside, keep the outside” is a memory aid. The reason is a row–column dot product: a row with n values must pair with a column with n values. Click the output cells to inspect the actual calculation, not only the shape.
Three operations, three checks
Operation
Requirement
Result
A+B
Same number of rows and columns
Same shape
αA
α is a scalar
Same shape as A
AB
A’s column count equals B’s row count
A’s row count by B’s column count
If A is 2×3 and B is 3×4, then AB exists and is 2×4. The reverse product BA is not defined because 4 and 2 do not match. Even when both orders are defined, their values need not agree.
Matching dimensions does not prove a calculation is correct. It only rules out one kind of mistake. A wrong formula can still have the right shape.
Apply the check to a familiar scalar
For column vectors x,y∈Rn, the expression x⊤y multiplies a 1×n row by an n×1 column. The result is a scalar:
x⊤y=i=1∑nxiyi.
For x=(2,1)⊤ and y=(3,4)⊤, it equals 2⋅3+1⋅4=10. Module 2 will connect this calculation to angles and projections.
Make a prediction
A is 3 × 2 and B is 2 × 4. What shape is AB?
You can now read the next chapter
You can distinguish objects, translate notation, and check dimensions. Next comes the deeper question: what makes a collection of vectors a vector space? Modules beyond these foundations are still being developed; the existing vector-scaling sample offers a first preview.