Matrix-vector multiplication
Matrix-vector multiplication is an operation between a matrix and a vector that produces a new vector. In this post, I’ll define matrix vector multiplication as well as three angles from which to view this concept. The third angle entails viewing matrices as functions between vector spaces
Introduction
In a previous post, we discussed three ways one can view a matrix: as a table of values, as a list of vectors, and finally, as a function. It is the third way of viewing matrices that really gives matrices their power. Here, we’ll introduce an operation between matrices and vectors, called matrix-vector multiplication, which will enable us to use matrices as functions.
Matrix-vector multiplication is an operation between a matrix and a vector that produces a new vector. Notably, matrix-vector multiplication is only defined between a matrix and a vector where the length of the vector equals the number of columns of the matrix. It is defined as follows:
Definition 1 (Matrix-vector multiplication): Given a matrix and vector the matrix-vector multiplication of and is defined as
where is the th column vector of .
Like most mathematical concepts, matrix-vector multiplication can be viewed from multiple angles, at various levels of abstraction. These views come in handy when we attempt to conceptualize the various ways in which we utilize matrix-vector multiplication to model real-world problems. Below are three ways that I find useful for conceptualizing matrix-vector multiplication ordered from least to most abstract:
- As a “row-wise”, vector-generating process: Matrix-vector multiplication defines a process for creating a new vector using an existing vector where each element of the new vector is “generated” by taking a weighted sum of each row of the matrix using the elements of a vector as coefficients
- As taking a linear combination of the columns of a matrix: Matrix-vector multiplication is the process of taking a linear combination of the column-space of a matrix using the elements of a vector as the coefficients
- As evaluating a function between vector spaces: Matrix-vector multiplication allows a matrix to define a mapping between two vector spaces.
I find all three of the perspectives useful. The first two perspectives provide a way of understanding the mechanism of matrix-vector multiplication whereas the third perspective provides the essence of matrix-vector multiplication. It is this third perspective of matrix-vector multiplication that enables us to view matrices as functions, as we discussed in the previous post.
Matrix-vector multiplication as a “row-wise”, vector-generating process
A useful way for viewing the mechanism of matrix-vector multiplication between a matrix and a vector is to see it as a sort of “process” (or even as a computer program) that constructs each element of the output vector in an iterative fashion where we iterate over each row of . Specifically, for each row of , we take and compute the dot product between and the th row of the matrix thereby producing the th element of the output vector (See Theorem 1 in the Appendix to this post):
where is the th row-vector in . This process is illustrated schematically in the figure below:

Matrix-vector multiplication as taking a linear combination of the columns of a matrix
Matrix-vector multiplication between a matrix and vector can be understood as taking a linear combination of the column vectors of using the elements of as the coefficients. This is illustrated schematically below:

We can also view this geometrically:

In Panel A, we depict two column vectors of some matrix . In Panel B, we take a linear combination of the two column vectors of according to the elements of some vector thus producing the vector (black vector) as shown in Panel C.
Matrix-vector multiplication as evaluating a function between vector spaces
If we hold a matrix as fixed, this matrix maps vectors in to vectors in . Making this more explicit, we can define a function as: where uses the matrix to performing the mapping.
This is illustrated schematically below:

In fact, as we show in a later post, such a matrix-defined function is a linear function. Even more importantly, any linear function between finite-dimensional vector spaces is uniquely defined by some matrix.
Appendix
Theorem 1: Given a matrix and vector , it holds that
where is the th row-vector in .
Proof: