📖 How Matrix Addition/Multiplication Works
Matrices are the backbone of linear algebra, computer graphics, engineering simulations, and machine learning. This calculator performs the two most common operations — addition and multiplication — on 2×2 and 3×3 matrices, showing the exact result instantly as you change any value.
Matrix Addition
Addition is element-wise: you simply add each entry in matrix A to the entry in the same position in matrix B. Both matrices must have the same dimensions. For example, adding [[1,2],[3,4]] and [[5,6],[7,8]] gives [[6,8],[10,12]] — each cell is just the sum of its two corresponding cells.
Matrix Multiplication
Multiplication is more involved than addition: each entry in the result is the dot product of a row from A and a column from B. This is why matrix multiplication is not commutative — A×B usually does not equal B×A, unlike ordinary number multiplication. For a 2×2 example, multiplying [[1,2],[3,4]] by [[5,6],[7,8]] gives [[19,22],[43,50]], where the top-left entry 19 comes from (1×5 + 2×7).
Where Matrix Operations Are Used
- Computer graphics: Rotating, scaling, and translating 2D/3D objects on screen uses matrix multiplication.
- Machine learning: Neural network layers are essentially chained matrix multiplications applied to input data.
- Engineering & physics: Systems of linear equations (structural loads, circuit analysis) are solved using matrix methods.
- Economics: Input-output models that track how industries depend on each other use matrix multiplication.
Key Rules to Remember
- Addition requires both matrices to be the exact same size.
- Multiplication requires the number of columns in A to equal the number of rows in B.
- The identity matrix (1s on the diagonal, 0s elsewhere) leaves any matrix unchanged when multiplied.
- Matrix multiplication is associative — (AB)C = A(BC) — but not commutative.
❓ Why isn't matrix multiplication commutative?
Because each entry of the product depends on a specific row-by-column combination. Swapping the order changes which rows pair with which columns, producing a different (or sometimes undefined) result. This is one of the biggest conceptual differences from ordinary arithmetic.
❓ Can I multiply matrices of different sizes?
Only if the number of columns in the first matrix equals the number of rows in the second. A 2×3 matrix can be multiplied by a 3×2 matrix (producing a 2×2 result), but not by another 2×3 matrix.
❓ What's a real-world example of matrix addition?
Combining two sales spreadsheets for the same regions and product categories — adding this month's numbers to last month's, cell by cell, is literally matrix addition.