Lessons › math · taught by Ada
Adding and multiplying matrices
Learn how to add matrices entry by entry and multiply them using rows times columns, including size rules and dot products.
Learn this with Ada, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.appWhat a matrix holds
A matrix is just a neat box of numbers. The rows go across, and the columns go down.
We will add matrices entry by entry. Then we will multiply matrices by rows times columns.
First, let us predict: what must be true before two matrices can be added?
Predict: add only matching sizes
What must be true before two matrices can be added?
- They must have the same size
- They must both be square
- Their top-left numbers must match
Show answer
They must have the same size: Yes. Add only matrices with the same number of rows and columns.
Add matching entries only
Here is a worked example. We add the numbers in the same spots.
The top left goes with the top left, and so on. That is why the shapes must match.
The answer is a new matrix with the same size.
Quick check: same-position rule
In matrix addition, what should you do next?
- Add the entries in the same positions
- Multiply the top row by the left column
- Add only the biggest numbers
Show answer
Add the entries in the same positions: Correct. Match each position with the same position, then add.
Why sizes must match
Think of two grids that line up like graph paper. If one grid has extra rows or columns, there is no partner number for those spots, so addition would not be well defined.
This is why same size matters. Every entry needs a partner.
No partner means no addition in that spot.
So matching shapes is the rule, not a trick.
Multiply rows by columns
Now multiplication is different. We do not multiply matching spots.
We take a row from the first matrix and a column from the second matrix.
Their dot product gives one entry in the answer.
One dot product entry
Let us build one product carefully. First row times first column.
Multiply the pairs, then add them. That is the dot product.
Repeat for each row of the first matrix.
Quick check: inner sizes
Which pair can be multiplied?
- 2×3 matrix times 3×1 matrix
- 2×3 matrix times 2×2 matrix
- 3×2 matrix times 3×2 matrix
Show answer
2×3 matrix times 3×1 matrix: Yes. The inside numbers must match: 3 and 3.
Why inner sizes must match
Here is the reason. Each row must have the same number of entries as the column it meets.
Then every pair can be multiplied one by one.
That is why we check the inner sizes first.
Watch out for a common mistake
A common mistake is to treat matrix multiplication like regular multiplication of single numbers.
Another mistake is adding entries instead of using rows and columns.
Matrix multiplication has its own rule: row times column.
Your turn: add then multiply
Let A = [2 1] and B = [3 4]. What is A + B?
- [5 5]
- [6 4]
- [2 4]
Show answer
[5 5]: Correct. Add the matching entries: two plus three, and one plus four.
Recap: keep the two rules
Here is your checklist. First, ask if the matrices have the same size for addition.
Second, for multiplication, check the inner sizes.
Third, use row times column to build each entry.
Finally, the outer sizes tell you the answer size.