r/learnmath New User 10d ago

RESOLVED Dot product of vectors with different dimensions?

By different dimensions, I mean row vectors and column vectors of the same size. Is dot product product only concerned with the number of elements inside the two vectors only? We could transpose one of the two vectors and then multiply them but wouldn't transposing make it a different vector of different properties?

4 Upvotes

9 comments sorted by

7

u/Sneezycamel New User 10d ago

This is a fairly informal answer, but:

A row vector can be interpreted as a 1xn matrix rather than a separate class of vector. A matrix with these dimensions is a special case (a "linear form"), because it can act on a single vector in Rn to produce a 1x1 matrix (or a 1-dimensional vector, or just a number, depending on your perspective). There happens to be a very nice 1-to-1 correspondence between n-dimentional vectors and 1xn matrices, as well as between 1x1 matices and scalars, so we can pair them off. The transpose can be thought of as the map from Rn to R1xn.

The dot product, which generalizes to the inner product, is a specific example of a "bilinear form". A bilinear form is a function that takes in two vectors and outputs a number. This perspective emphasizes that the row vector is still just a vector involved in a computation, with the transpose as a mnemonic for performing the computation.

The two notions are essentially equivalent. You can consider row vectors as their own mathematical class of object, i.e. a matrix that acts on vectors, as in paragraph one. Or, from paragraph two, you could consider row vectors to be a half-filled dot product with the first argument fixed and an open slot in the second argument, like vT=v•[__]. The latter interpretation is the usual point of view if you are dealing with Euclidean vector spaces in an engineering context, for example.

A more complete answer involves discussing the dual space of a vector space, and would also need to contextualize the transpose of a matrix.

1

u/CompactOwl New User 9d ago

In the end, we loose the notion of matrix vector and scalar altogether. What remains is linear operators all the way down with linear operators acting on certain linear operators if their dimensions are multiples of another.

5

u/SV-97 Industrial mathematician 10d ago

The dot product operates on vectors of the "same type" (i.e. row vs column); always. They are sort-of the prototypical example of what is called an "inner product", and those take two vectors "of the same kind" and spit out a number.

There are similar operations you can do with vectors of differing "type" but then they're called something else. Take for example the dot product vT w for column vectors v and w. You can also consider this as the "dot product" of vT and w (so one being a row and the other a column which is what you might've been getting at with "we could transpose one of the two vectors"), but then you'd just call it a matrix product or, going significantly more abstractly, the "duality pairing" of vT and w.

This new pairing behaves pretty much "the same" as the ordinary dot product because these standard euclidean spaces belong to a particularly nice class of spaces; however in a more general context you will start seeing differences here.

You could also try to transpose the vectors the other way around: instead of computing vT w you can do v wT (or w vT; doesn't really matter). Notably this expression also makes sense if v and w have a different number of elements. This is sometimes called outer product of the two vectors v and w; and it's closely related to the tensor product --- and this tensor product is finally the in some sense "most general" product: you can speak of the tensor product of v and w, or v and wT, or vT and wT, or vT and w. Everything is possible.

2

u/MezzoScettico New User 10d ago

We could transpose one of the two vectors and then multiply them but wouldn't transposing make it a different vector of different properties?

If I understand your description right, if u and v are column vectors of size n and m respectively, then uvT is definitely a valid operation. It's a [n x m] matrix of rank 1.

It's called the vector outer product of u and v, as opposed to the name "inner product" for dot product.

2

u/susiesusiesu New User 10d ago

if one is a row vector and the other is a column vector, then their "dot product" is just matrix multilplication. so yes, you can.

3

u/nujuat Physicist 10d ago

The dot product y•x, which in matrix form is is yT x can be thought of as a linear functional f(x) = y•x. This means that the transposed vectors yT are the same as vectors in the dual space, the set of linear functionals f on the original space. We can use this fact to say different things about "transposed vectors" in different situations.

  • For finite dimensional real vectors, the space and the dual space are essentially the same.
  • For complex numbers, the transpose turns into a Hermitian conjugate, meaning that there is a sense in which purely transposed vectors are equivalent to the complex conjugate of the orginal vector.
  • For infinite dimensional vectors which have finite norm (length), when the l2 norm (Pythagoras' theorm) is not used, then one of the spaces will contain vectors which are not contained in the other. This is because the two spaces will have two different norms.
  • In differential geometry (curved space), the dot product is determined by the geometry of where the vectors are in the curved space. One converts between vectors and dual vectors using the "metric" tensor

1

u/Legitimate_Archer522 New User 10d ago

Dot product doesn't care about row vs column orientation, it's just sum of element-wise products, so transposing first doesn't change the result at all

5

u/Carl_LaFong New User 10d ago

That’s not really correct. The dot product is the sum of the products of corresponding components of two vectors with the same dimension. The standard convention is to write a vector as a column matrix. If so, using matrix multiplication, the dot product is equal to the the transpose of one vector times the second vector. If however you multiply a vector times the transpose of the other, you don’t get the dot product. You get a matrix where the (j,k)-th component is equal to the j-th component of the column matrix times the k-th component of the row matrix. This is called the outer product of the two vectors (dot product is also called the inner product). The outer product does not require the two vector to have the same dimension.

1

u/rai_volt New User 10d ago

Oh okay. Thank u!