Matrix Addition and Scalar Multiplication
Problem
For A = [[1,2],[3,4]] and B = [[5,6],[7,8]], compute A + B, A − B, and 3A. Explain why these operations are element-wise.
Explanation
The two simplest matrix operations
Matrix addition (only for matrices of the same size):
Scalar multiplication:
Both are element-wise — each entry is computed independently.
Step-by-step
Setup: .
A + B:
A − B:
3A:
Properties
These operations make (the set of real matrices) into a vector space:
- Commutative: .
- Associative: .
- Zero matrix: where has every entry zero.
- Additive inverse: .
- Distributive over scalars: , .
- Scalar associativity: .
Dimension must match
is undefined if and have different shapes. A matrix and a matrix cannot be added — not even by transposing first. The sum only makes sense element-by-element, and that requires matched shapes.
Geometric interpretation
Think of a matrix as a list of column vectors (or row vectors). Addition adds the vectors componentwise; scalar multiplication stretches each by the same factor. On the example:
- Columns of : , .
- Columns of : , — same directions, three times longer.
Common mistakes
- Mixing unequal shapes. Double-check dimensions before adding.
- Applying the scalar to only the first entry. A scalar multiplies every entry.
- Confusing addition with multiplication. Matrix multiplication is a completely different operation involving dot products, and it's not element-wise.
Try it in the visualization
Adjust the scalar with a slider and watch each entry of update. Toggle vs. vs. to see the overlay.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.