2

Let $ \vec u = \begin{bmatrix} u_1\\ u_2 \end{bmatrix}$ and $\vec v = \begin{bmatrix} v_1\\ v_2 \end{bmatrix}$

Doesn't the number of columns in u have to equal number rows in v?

Why are they multiplied directly across?

EDIT: I feel that my question is unique to the one proposed (The dot product of two vectors.) b/c it succinctly addresses confusion arising from multiplication of two column-vectors, and the definition of $\vec u \cdot \vec v$.

Romaion
  • 425
  • 4
    This is the dot product or the inner product of the two vectors, not a matrix product. The definition of the dot product for two column vectors of the same length (or two row vectors as the case may be) in a context like this is simply the sum of the products of each respective entry. E.g. $(u_1,u_2,u_3,u_4)\bullet (v_1,v_2,v_3,v_4)=u_1v_1+u_2v_2+u_3v_3+u_4v_4$. There really isn't anything more to explain than that. – JMoravitz Mar 26 '17 at 19:49
  • 2
    If you have a few hours, this video series explains it quite well eventually (video 7). The general attitude in those films is that matrix multiplication is a consequence of how linear maps act on vectors, and the interpretation of scalar product as a matrix product (where you first transpose one of the vectors) is somewhat of a happy coincidence (and at the same time a manifestation of duality). – Arthur Mar 26 '17 at 19:52

2 Answers2

1

The definition of the dot product of two vectors $u=(u_{1},u_{2})$ and $v=(v_{1},v_{2})$ is $u \cdot v = u_{1}v_{1}+u_{2}v_{2}$. We are not viewing these vectors as matrices when we multiply them (as you say, this makes no sense). However, we can view the dot product as the matrix product $u^{T}v$, where $u^{T}$ is a $1 \times 2$ matrix and $v $ is an $2 \times 1$ matrix. Their product is then a $1 \times 1$ matrix:
$$\pmatrix{u_{1} & u_{2}}\pmatrix{v_{1}\\v_{2}}=u_{1}v_{1}+u_{2}v_{2}$$ where, as usual, we view $1 \times 1$ matrices as scalars and drop the brackets.

1

The short answer is: $$ \vec{u}\cdot\vec{v} = \vec{u}^TG\vec{v}, $$ where $^T$ is transpose and $G$ is a special matrix called metric tensor. For standard $\mathbb{R}^n$ space this tensor has signature $(n,0,0)$ which is just identity $n\times n$ matrix. Thus in $\mathbb{R}^2$ $$ \begin{pmatrix}u_1 \\ u_2\end{pmatrix}\cdot\begin{pmatrix}v_1 \\ v_2\end{pmatrix} = \begin{pmatrix}u_1 & u_2\end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}\begin{pmatrix}v_1 \\ v_2\end{pmatrix} = u_1v_1 + u_2v_2. $$


In other spaces with other metrices the scalar product may has another forms. For example, in Minkowski space the metric tensor has signature $(3,-1,0)$, and the matrix $G$ from the first equation there has the following form: $$ G = \begin{pmatrix}-1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\end{pmatrix}. $$ Thus for two vectors $\vec{s}_1 = (t_1, x_1, y_1, z_1)^T$ and $\vec{s}_2 = (t_2, x_2, y_2, z_2)^T$ the scalar product has the form $$ \vec{s}_1\cdot\vec{s}_2 = -t_1t_2 + x_1x_2 + y_1y_2 + z_1z_2. $$