2

I have an algorithms class and a question is referring to $||X||$. I know that $|X|$ would be referring to the size of an object, I have searched around and only found information about vectors that I do not entirely understand.

What does this double bar symbol mean? Apparently the symbols are interchangeable, is this true?

ArsenBerk
  • 13,211
  • 1
    $||x||$ usually indicates a norm. See https://en.wikipedia.org/wiki/Normed_vector_space – Francesco Polizzi Dec 29 '17 at 15:42
  • 3
    This would very much depend on the context. Where is the question from? –  Dec 29 '17 at 15:44
  • 1
    To reiterate what has already been said, $|X|$ refers to the "norm" of the object $X$, but what a "norm" is depends entirely on what context you are working in. In some cases, it might be in euclidean space and you are referring to the euclidean norm (as in Godel's answer below). In other cases, perhaps you are working with $X$ as an operator and $|X|$ refers to the operator norm. It could be some other completely different norm in any of those scenarios as well, there are infinitely many possibilities. Your book or lecture notes should have defined what exactly they mean earlier. – JMoravitz Dec 29 '17 at 16:08
  • Most things you know about absolute value will also remain true for norms as well and vice versa since absolute value is also a type of a norm. We have for example $|\alpha X|=|\alpha|\cdot|X|$ and that $|X+Y|\leq |X|+|Y|$ as well as $|X|=0\iff X=$"0" for whatever "0" makes sense in our context. How one specifically calculates a norm depends again entirely on context and which norm and which objects we are talking about. – JMoravitz Dec 29 '17 at 16:12
  • The context is this: X is a list of numbers (Array in computing). With n size. – jackdewinter Dec 29 '17 at 17:06

1 Answers1

1

In the simplest case, for a vector $x\in\mathbb{R}^n$ such that $x:=(x_1,x_2,\dots,x_n)$, we can define $$ ||x||:=\sqrt{\sum_{i=1}^n x_i^2} $$

Now, if $n=1$ (that is, if $x$ is a real number) we have $$ ||x||=\sqrt{x^2}=|x| $$

YCB
  • 2,691
  • This is helpful, is a vector like a list? Would it make sense to say that ||x|| is used to express length when the value could be anything (n) and |x| is for a value that can be calculated? – jackdewinter Dec 29 '17 at 17:10
  • @jackdewinter yes, a vector can be seen as a list. Now, suppose that n=2, by pythagoras theorem we have that $||x||$ is the length of the hypotenuse of a rectangle triangle with sides $x_1,x_2$. That is, the length of vector $x:=(x_1,x_2)$. – YCB Dec 29 '17 at 17:54
  • That makes sense, thank you. – jackdewinter Dec 29 '17 at 18:33