What vectors and matrices are
A vector is an ordered list of numbers called components. In the plane, the vector (3, 4) can be drawn as an arrow from the origin to the point with x-coordinate 3 and y-coordinate 4. Its length is the square root of 3 squared plus 4 squared, which is the square root of 25, so 5.
A matrix is a rectangular grid of numbers. A matrix with 2 rows and 3 columns is called a 2 by 3 matrix, and the row count is always stated first. A vector can be seen as a matrix with a single column or a single row.
Adding, scaling and multiplying
Vectors of the same size are added component by component. Multiplying a vector by a number, called a scalar, multiplies each component by that number. Matrices of the same size follow the same two rules.
Matrix multiplication works differently. The product AB is defined only when the number of columns of A equals the number of rows of B. Each entry of AB is found by taking a row of A and a column of B, multiplying matching entries, and adding the results. This row-by-column sum is called a dot product.
Worked example: a matrix acting on a vector
Let A be the 2 by 2 matrix with rows (1, 2) and (3, 4), and let v be the column vector (5, 6). The first entry of Av is 1 times 5 plus 2 times 6, which is 5 + 12 = 17. The second entry is 3 times 5 plus 4 times 6, which is 15 + 24 = 39.
So Av is the vector (17, 39). The matrix has turned one vector into another. This is why matrices describe transformations such as rotations, stretches and reflections of the plane.
Common misconceptions
Matrix multiplication is usually not commutative. For most pairs of matrices, AB and BA differ, and sometimes only one of them exists. Order matters.
Another error is multiplying matrices entry by entry. That operation exists, but it is not the standard matrix product. A third error is treating a vector as only a point. A vector describes a displacement, and the same vector can be placed at any starting point.
Where they show up
Vectors and matrices are used to write systems of linear equations compactly, as Ax = b, where A holds the coefficients. They appear in physics for forces and velocities, in computer graphics for transforming shapes, and in statistics and data science for tables of data.
Courses in linear algebra build on these ideas to study determinants, inverses and eigenvalues.
Key terms
- Vector
- An ordered list of numbers, often drawn as an arrow with length and direction.
- Matrix
- A rectangular array of numbers arranged in rows and columns.
- Scalar
- A single number used to scale a vector or matrix.
- Component
- One of the numbers in a vector.
- Dot product
- The sum of the products of matching entries of two lists of equal length.
- Dimension of a matrix
- The number of rows by the number of columns, such as 2 by 3.
