1
$\begingroup$

What do the double vertical lines around $\vec i$ and $\vec j$ in this equation actually mean?

$$ sim(i,j) = cos(\vec i, \vec j) = \frac{\vec i \cdot \vec j}{\lVert \vec i\rVert^2 * \lVert\vec j\rVert^2} $$

$\endgroup$
  • 1
    $\begingroup$ Length of a vector. $\endgroup$ – Artem Apr 6 '14 at 16:09
  • $\begingroup$ Or similarly $\|\vec{i}\|^2=\vec{i}\cdot\vec{i}$ so $\|\vec{i}\|=\sqrt{\;\vec{i}\cdot\vec{i}}$ $\endgroup$ – snulty Apr 6 '14 at 16:24
  • $\begingroup$ It's not "double \mid" but rather \| (or a double || if anything else). The command \mid is a separator; whereas | and \| are not. The difference is in the spacing. $\endgroup$ – Asaf Karagila Apr 6 '14 at 18:14
  • $\begingroup$ Actually, it should be \lVert + \rVert. \| has the problem that it's unclear whether TeX should treat it as a mathopen or mathclose. $\endgroup$ – kahen Apr 6 '14 at 18:30
  • $\begingroup$ Thanks guys, I'm new to TeX so please excuse the newbie mistakes $\endgroup$ – conorgriffin Apr 6 '14 at 21:29
2
$\begingroup$

It signifies the "norm" of the vector. There are many types of norms you can define, which all follow basic rules. Based on what you posted, they are using it to refer to the "Euclidean Norm" which is, as the comments suggest, the "length" of the vectors here. Single lines always means the Euclidean Norm (from my experience) but double lines can mean any norm.

$\endgroup$
1
$\begingroup$

When discussing real or complex vectors, you often also have real or complex numbers in the conversation. If these things are represented symbolically, every little thing you can do to remind the reader which symbols represent vectors and which symbols represent numbers is good. For example, the meaning of $\left|a\right|\left|v\right|$ is not as clear as that of $\left|a\right|\left|\vec{v}\right|$, and it's even more clear to write $\left|a\right|\left\|\vec{v}\right\|$.

Incidentally, \left\|...\right\| looks better than \mid\mid...\mid\mid. Compare $\left\|\vec{v}\right\|$ to $\mid\mid\vec{v}\mid\mid$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.