A matrix is a rectangular array of numbers. Its position structure matters: entries in different rows and columns play different roles. Matrix operations follow rules that preserve or combine that structure.
Read dimensions as rows by columns
The matrix has 2 rows and 3 columns, so its dimensions are Its entry in row 2, column 1 is 4.
Two matrices can be added or subtracted only when they have the same dimensions. Combine entries in matching positions. Scalar multiplication multiplies every entry by the same number.
For example, if then Multiplying only a row or only the diagonal would not be scalar multiplication.
Example: combine matching entries
Let and use B above. Then
Each position is its own arithmetic calculation. The upper-right entry is 4 because subtracting adds 2. Keep row and column alignment while working.
Multiplication combines a row with a column
If A has dimensions and D has dimensions the product AD is defined and has dimensions The inner dimensions must match because each dot product needs equally many paired entries.
An entry of AD is found by multiplying matching entries in one row of A and one column of D, then adding those products. Matrix multiplication is not generally entry-by-entry multiplication.
Example: a complete product
Take and Both products are defined. For BC, the upper-left entry is and the upper-right is
The second row gives and Thus
But The results differ: matrix multiplication is not commutative. Even when both orders are defined, they need not agree.
Interpret a product in context
A row might list quantities of two items, while a column lists their prices. Their product is the total cost,
The ordering must match: the first price must belong to the first item. Dimensions alone do not guarantee that a real-world model uses consistent categories.
The identity matrix preserves a compatible matrix under multiplication. Its diagonal ones select the original entries while zeros contribute nothing.
Dimensions can show why order matters before calculating
A matrix A can multiply a matrix B because the inner dimensions match. The product AB has dimensions But BA would require the inner dimensions 1 and 2 to agree, which they do not, so BA is undefined.
Even for square matrices where both orders are defined, the entries can differ, as the worked example shows. A formula that moves matrix factors around as though they were ordinary numbers can therefore become invalid. Addition of same-size matrices is commutative, but multiplication has its own structure.
For a matrix times a matrix, each output entry contains three products in its row-column sum. The output has four entries because its dimensions are Counting both the number of entries and the number of terms inside each dot product gives a useful completeness check. Missing a third product is a common error when a student is accustomed only to two-by-two examples.
Try it yourself
Multiply What are the dimensions of the answer?
Answer: A matrix times a matrix gives a result:
What to remember
Check dimensions first. Add matching positions, scale every entry, and multiply rows by columns. Preserve factor order and align real-world categories consistently.