Foundations of Linear Algebra
Vectors and Matrices
Getting Started with Vectors
In math and physics, some quantities just have a size, or magnitude. Your height, the temperature outside, or the speed of a car are all examples. These are called scalars. But what about something like a car's velocity? For that, you need to know not just its speed, but also its direction. Quantities that have both magnitude and direction are called vectors.
Vector
noun
A mathematical object that has both magnitude (size or length) and direction.
Think of a vector as an arrow. The arrow's length represents the magnitude, and the way it points shows the direction. We usually write vectors as a list of numbers called components, enclosed in brackets. In a 2D plane (like a flat piece of paper), a vector has two components: one for its movement along the horizontal x-axis and one for the vertical y-axis.
For example, the vector that represents moving 3 units to the right and 4 units up would be written like this:
Now let's see what we can do with them.
Vector Operations
Working with vectors is straightforward. The main operations are addition, subtraction, and scalar multiplication.
Vector Addition: To add two vectors, you just add their corresponding components. Think of it as following one arrow, and then starting the next arrow where the first one ended. The total journey from start to finish is the new vector.
For example, if and , their sum is:
Vector Subtraction: Subtraction works the same way, but you subtract the components.
Scalar Multiplication: This means scaling a vector by a plain number (a scalar). You multiply every component of the vector by that number. This changes the vector's magnitude (length) but not its direction (unless you multiply by a negative number, which flips it around).
Multiplying our vector by the scalar 2 gives us a new vector that's twice as long but points in the same direction.
Introducing Matrices
If a vector is a list of numbers, a matrix is a grid of numbers. It's a way to organize data in rows and columns. We describe the size of a matrix by its number of rows and columns, written as rows columns.
This is a matrix because it has 2 rows and 3 columns.
Just like with vectors, we can perform operations on matrices.
Matrix Addition: To add two matrices, they must have the exact same dimensions. You simply add the corresponding elements in each position.
Matrix Multiplication: This one is a bit more complex. To multiply two matrices, the number of columns in the first matrix must equal the number of rows in the second. The element in the -th row and -th column of the new matrix is found by multiplying each element of the -th row of the first matrix by the corresponding element of the -th column of the second matrix, and then summing up the results.
It's a "row-times-column" process. Let's see an example.
Unlike regular number multiplication, matrix multiplication is generally not commutative. This means that is not usually the same as .
Matrix Transposition: The transpose of a matrix, written as , is what you get when you swap the rows and columns. The first row becomes the first column, the second row becomes the second column, and so on.
Time to check your understanding.
Which of the following is a vector quantity?
Given the vectors and , what is their sum, ?
Vectors and matrices are the alphabet of linear algebra. Mastering these basic definitions and operations will set you up for understanding the more powerful things they can do.
