If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Matrix vector products

Defining and understanding what it means to take the product of a matrix and a vector. Created by Sal Khan.

## Want to join the conversation?

• It doesn't feel like you should just be able to call the rows and columns of a matrix vectors. Are these just notational tricks?
• No! they are not just notational tricks, but have much deeper meaning than one would initially believe. For instance, if we have 3 vectors that live in R^3 say x, y, z we can use the determinant to determine whether or not they are linearly dependent. If det(x,y,z) = 0 then the set {x,y,z} is dependent, independent whenever the determinant is non-zero. Another standard practice in Linear Algebra is to take vectors from the basis and write them as a matrix, this can be useful for changing coordinate systems. Even further, you can look at row vectors as linear functions that operate on column vectors. This leads to the vector space called the Dual Space which is important because many functions actually live in this dual space such as the Integration map, or the dot product! So no, it is not a notational trick; it is deep mathematics at work!
• Matrix-vector product is a dot or cross product? At first it looks like cross product because result is not scalar. A bit confused.
• Matrix-vector product isn't a cross product or a dot product. The dot product inputs 2 vectors and outputs a scalar. The cross product inputs 2 R3 vectors and outputs another R3 vector. The matrix-vector product inputs a matrix and a vector and outputs a vector.

If you think of a matrix as a set of row vectors, then the matrix-vector product takes each row and dots it with the vector (thus the width of the matrix needs to equal the height of the vector). In general:
`Ax = b`(A is an mxn matrix, x is an Rn vector, and b is Rm vector)
or
`⎡a₁⎤ ⎡a₁•x⎤`
`⎢a₂⎥ ⎢a₂•x⎥`
`⎢..⎥ ⎢....⎥`
`⎣am⎦x = ⎣am•x⎦`(all a's are Rn row vectors)
• You made a mistake, the green matrix goes to Bm not Bn, because it is an mx1.
• If the dot product is a row vector times a column vector, what is the cross product in terms of matrix multiplication?
• It reminds a lot of the determinant, nut remember! cross-product is only defined in R3, as Sal tells us in a previous video.
• Do the number of variables (columns) in the matrix denote the space it's in? For example, the matrix at at has four columns (variables.) Does this denote R^4?
• The matrix itself does not "live" in R^4 or R^3. One way to think about it is a transformation from R^4 into R^3. It's input will be vectors in R^4 and its output is vectors in R^3.
• Since a 3x4 matrix maps R^4 to R^3, is it in R^(4 by 3)?

Does R^(4 by 3) = R^12?
• They aren't equal, but they are isomorphic. That means that there is a mapping from R^(4x3) to R^12 that preserves vector addition and scalar multiplication. That mapping is nothing more exciting than the mapping that takes ((a,b,c,d),(e,f,g,h),(i,j,k,l)) to (a,b,c,d,e,f,g,h,i,j,k,l).
• I cannot understand how a vector can be a sequence of data... A vector has a direction, a weight, a verso, no multiple value..
• This is more of a physics definition of a vector than a mathematical one, in math a vector is simply an object that lives in a vector space. The dimension is given by the number of basis vectors; these basis vectors can refer to any sort of information that you'd like, as long as it satisfies the algebraic properties of vectors!
• how would you multiply a 3 x 4 matrix with a 4 x 2 for example.
Because the first has the same amount of columns as the second has rows so we know it can be multiplied but because the second isn't a 4 x 1 matrix you cant just multiply all the rows of the first with its one column you need to somehow know witch rows to multiply with witch columns. if the second matrix had the same amount of columns as the first has rows it would be easy but in a 3x4*4x2 you would somehow need to get a 3x2 matrix as your answer
and I am unsure how you would need to multiply to get that answer.
• I am going to use variables to demonstrate. so lets say the 3x4 matrix is

a b c d
e f g h
i j k l

and the 4x2 matrix is
m n
o p
q r
s t

The resulting 3x2 matrix would look like this. I am going to put all entries in parenthesis to better seperate them

(ma+ob+qc+sd) , (na+pb+rc+td)
(me+of+qg+sh) , (ne+pf+rg+th)
(mi+oj+qk+sl) , (ni+pj+rk+tl)

So you line up the xth row of the matrix on the left of the multiplication and the yth column of the matrix on the right.

Let me know if this did not help, I will be happy to offer further explanation.
• Why is this the definition of matrix vector product? Are there alternative definitions?
(1 vote)
• This definition follows from the fact that the matrix is a set of vectors which transform a vector into another vector. It can be shown that every linear transformation from x, a vector in R^n to y, a vector in R^m can be represented by an m-by-n matrix A as follows:
Ax = y
Using the definition from the video.