Foundations of Linear Algebra
Vectors and Matrices
What Are Vectors?
Imagine you're giving someone directions. You wouldn't just say "go 5 miles." You'd say "go 5 miles north." That combination of a magnitude (5 miles) and a direction (north) is the core idea of a vector.
Vectors are mathematical objects that have both length and direction. They are often represented as arrows in space, where the arrow's length is the vector's magnitude and the way it points is its direction. In text, we typically write them as a list of numbers, called components, inside brackets. These components tell us how far the vector travels along each axis, like the x-axis and y-axis in a 2D plane.
For example, a vector in a 2D plane has two components: one for the x-direction and one for the y-direction. We usually write it as a column.
Here, tells you how many units to move horizontally, and tells you how many units to move vertically. A vector with components points 3 units to the right and 2 units up.
Vector Operations
We can perform arithmetic with vectors, just like with regular numbers (which are called scalars in this context). The three basic operations are addition, subtraction, and scalar multiplication.
Vector addition is like taking two journeys back-to-back. The final vector represents the direct path from your starting point to your final destination.
To add vectors, we simply add their corresponding components. If we have two vectors, and , their sum is a new vector.
Vector subtraction works similarly. Subtracting a vector is the same as adding its negative. A negative vector has the same length but points in the exact opposite direction.
Scalar multiplication involves multiplying a vector by a single number (a scalar). This operation scales the vector's length. If you multiply by 2, the vector becomes twice as long. If you multiply by 0.5, it becomes half as long. Multiplying by a negative scalar, like -1, reverses the vector's direction.
To perform scalar multiplication, you multiply each component of the vector by the scalar.
Introducing Matrices
If a vector is a list of numbers, a matrix is a grid of numbers, arranged in rows and columns. Matrices are incredibly useful for organizing data and representing transformations, like rotations or scaling.
A matrix's size, or dimension, is described by its number of rows and columns. A matrix with 2 rows and 3 columns is called a 2x3 matrix.
Here is an example of a 2x3 matrix:
There are a few special types of matrices. The zero matrix is a matrix where every entry is 0. It's the matrix equivalent of the number zero.
Another important one is the identity matrix. This is a square matrix (it has the same number of rows and columns) with 1s on the main diagonal (from top-left to bottom-right) and 0s everywhere else. The identity matrix, usually written as , acts like the number 1 in multiplication. Multiplying a matrix by the identity matrix doesn't change it.
Matrix Operations
Like vectors, we can add and subtract matrices. The rule is simple: the matrices must have the exact same dimensions. If they do, you just add or subtract the corresponding elements in each position.
Matrix multiplication is more complex. You can't just multiply corresponding elements. To multiply two matrices, the number of columns in the first matrix must equal the number of rows in the second matrix.
Let's say we have matrix (size m x n) and matrix (size n x p). Their product, , will be a matrix of size m x p. To find the element in the -th row and -th column of , you take the dot product of the -th row of and the -th column of . This means you multiply their corresponding entries and then sum the results.
For example, to get the element in the first row, first column of the result, you multiply the elements of the first row of matrix A by the elements of the first column of matrix B, and add them up.
One crucial property of matrix multiplication is that it's not commutative. This means that, in general, . The order you multiply matrices in matters a great deal.
Ready to test your knowledge?
What two properties are essential for defining a vector?
What is the result of adding the vectors and ?
Vectors and matrices are the alphabet of linear algebra. By understanding how to manipulate them, you're ready to explore more advanced and powerful concepts.

