Matrices and Matrix Operations – Linear Algebra

1 & 2. Matrix Notation, Terminology & Equality

A Matrix is simply a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. Matrices are considered Equal only if they have the exact same dimensions AND every corresponding element is identical.

2
4
-1
9
=
2
4
-1
9

Conversely, here is an example of matrices that are NOT Equal. Even though they share some numbers, their dimensions (2×2 vs 2×3) are completely different.

2
4
-1
9
2
4
0
-1
9
0

3. Addition & Subtraction

To add or subtract matrices, they must be the exact same size. You simply add or subtract the elements in the matching positions.

1
3
+
5
2
=
6
5

Subtraction works the exact same way. Just be careful with your double negatives!

8
-3
5
-7
=
3
4

4. Matrix Multiplication

Multiplication is where things get interesting. You compute the “dot product” of the rows of the first matrix with the columns of the second matrix. Because of this, the number of columns in Matrix A must equal the number of rows in Matrix B.

1
2
3
4
×
5
6
=
?
?

5. Partitioned (Block) Matrices

Sometimes it is useful to slice a matrix into smaller sub-matrices, called blocks. This is used heavily in advanced algorithms to simplify massive computations.

A
B
C
D
E
F
G
H
I

6 & 7. Linear Combinations & Row/Column Expansions

The product of a matrix A and a vector x can be viewed as a Linear Combination of the columns of A. Expansion allows us to break down a matrix product by focusing on one row or column at a time.

x
a
c
+
y
b
d
=
ax + by
cx + dy

8. The Transpose of a Matrix

Transposing a matrix flips it over its main diagonal. The rows become columns, and the columns become rows. Click the button below to see it in action on a 3×3 square matrix!

1
2
3
4
5
6
7
8
9

When you transpose a non-square matrix, the entire dimensions of the matrix flip. A 2×3 matrix physically transforms into a 3×2 matrix.

1
2
3
4
5
6
Transposed
1
4
2
5
3
6

9. Trace of a Matrix

The Trace is only defined for square matrices. It is incredibly simple: it is just the sum of the elements on the main diagonal (from top-left to bottom-right). Click to highlight the trace elements.

5
9
2
1
-3
4
6
8
7

References

  • Anton, H., & Rorres, C. Elementary Linear Algebra, 11th Edition (pp. 25-36).
error: