Formality - writing dot product in terms of matrix multiplication

75 Views Asked by At

I saw several professors taking points in exams since student writes $\mathbf{x}\mathbf{y}$ instead of $\mathbf{x}^T \mathbf{y}$ where $\mathbf{x},\mathbf{y}\in\mathbb{R}^n$.

Is it mathematically incorrect to write $\mathbf{x} \mathbf{y}$? Does writing $\mathbf{x}\cdot \mathbf{y}$ make it correct? If one is sceptical about $\mathbf{x}\mathbf{y}$ meaning $\mathbf{x}\cdot \mathbf{y}$, why not be sceptical about what a "dot" symbol means between vectors? Like, in none of those classes, there was another use of vector product, no cross product, no outer product, etc. Why insist on interpreting dot product as matrix multiplication? What is the point of taking down many points in Advanced courses (graduated courses) on a pretty standard convention?

4

There are 4 best solutions below

2
On BEST ANSWER

If we are given that $\mathbf{x}, \mathbf{y} \in \Bbb{R}^n$, then $\mathbf{x}\cdot\mathbf{y}$ is an accepted notation for the scalar product as is $\mathbf{x}^T\mathbf{y}$ (as also $\langle \mathbf{x}, \mathbf{y}\rangle$, and, for some authors, $(\mathbf{x}, \mathbf{y})$). The notation $\mathbf{x}\mathbf{y}$ is not a standard notation for the scalar product.

Note: we have to make a choice about whether to view $\Bbb{R}^n$ as comprising column vectors or row vectors when we write a scalar product as a matrix product. If we choose column vectors, then $\mathbf{x}^T\mathbf{y}$ is correct. If we choose row vectors (which would be my preferred choice, just because in English we write along lines not down colums), then it should be $\mathbf{x}\mathbf{y}^T$

0
On

If you don't put the dot, $uv$ means matrix multiplication, which makes sense only if the number of columns of the matrix $u$ equals the number of rows of the matrix $v$. When $x$ and $y$ are vectors, i.e. column matrices (with the same number of rows), only $x\cdot y$ or $x^Ty$ make sense (and are equal).

6
On

As another analogy, say you have two matrices $A, B \in \mathbb{R}^{n \times m}$ where $n \neq m$. Then you can only multiply the matrices if the dimensions line up. However, $AB$ can either refer to $A^T B$ or $AB^T$, which are literally different matrices of different dimension. If you were to write $AB$, this doesn't make sense because it is ambiguous which one you're talking about.

In your case, when you write $xy$, you could also be referring to $x y^T$, which would be a square matrix. That's also a valid way to interpret $xy$ (as opposed to $x^T y$, which is a scalar). So the reason your notation is not ok isn't just because it's not convention, but it's legitimately unclear what your notation is supposed to mean. I agree that the dot product notation is sort of arbitrary as well, but it's a well defined notation at least.

2
On

Many students assume (and this is a persistent misconception, in the sense that it remains present for many students even after they are taught that it is incorrect) that if $\textbf{x} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}$ and $\textbf{y} = \begin{bmatrix} y_1 \\ y_2 \\ \vdots \\ y_n \end{bmatrix}$ then the product $\textbf{xy}$ denotes the component-wise product $\begin{bmatrix} x_1 y_1 \\ x_2 y_2 \\ \vdots \\ x_n y_n\end{bmatrix}$. There are good reasons for this misconception:

  1. It is analogous to the standard, component-wise definition for vector addition.
  2. It is, in some real-world contexts at least, meaningful: for example if $\textbf{x}$ is understood as a list of prices of $n$ different products (in dollars per unit) and $\textbf{y}$ is a list of quantities (number of units) of those same products, then the component-wise product is a list of costs for each unit. Similarly if $\textbf{x}$ is a list of velocities of $n$ different moving objects, and $\textbf{y}$ is a list of travel times for each object, then the component-wise product is a list of total distances traveled for each object.
  3. Finally, this interpretation of $\textbf{xy}$ is widely used in many computer languages and computing environments. I am not an expert in coding so I will refrain from getting into the details but I will say that in MatLab this is exactly what it means to "multiply" two vectors.

Notwithstanding all of the above, this interpretation of $\textbf{xy}$ is not standard in most mathematical disciplines. Certainly it is not the case in the context of (e.g.) a course in vector calculus or linear algebra.

Speaking of vector calculus: in $\mathbb R^3$ there are two different "product-like" operations, namely the standard dot product and the standard cross product. Because they are very different operations, one is denoted with a $\cdot$ symbol and the other with a $\times$ symbol, and (this is the important bit) neither one is denoted by simple adjacency.

So: in $\mathbb R^n$ the notation $\textbf{xy}$ admits at least one plausible interpretation that is generally regarded as incorrect, and in $\mathbb R^3$ there are two different "products", each of which is denoted with its own special symbol, and neither of which is denoted by adjacency.

Given this background, how is the professor supposed to know what YOU mean when you write $\textbf{xy}$, and why do you think they should assume that you know which operation you are talking about?