In this article, we will build some intuition about the geometry of vectors, their properties, and the operations on them.
In this article, we will build some intuition about the geometry of vectors, their properties, and the operations on them.
To understand vectors, we recommend familiarity with the concepts in
Follow the above links to first get acquainted with the corresponding concepts.
In the following interactive, we show a \(2\)-dimensional vector. The vector is an arrow, with the tail at the origin, and the head at the value of the vector. In this sense, the vector is an ordered tuple, such that the X-coordinate is the first coordinate of the vector and the Y-coordinate is the second.
A similar geometric interpretation can be imagined for an \( n \)-dimensional vector, in an \(n\)-dimensional space.
A vector has magnitude and direction. This should be intuitive from the geometric perspective you saw earlier.
The magnitude of a vector is measured in terms of its norm. The \( p \)-norm, for \( p \ge 1 \), provides a generalized way of computing any norm of a vector.
$$ ||\va||_p = \left( \sum_{i=1}^n |a_i|^p \right)^\frac{1}{p} $$
Three norms, derived from \(p\)-norm, are popular in machine learning.
$$ ||\va||_1 = \sum_{i=1}^n |a_i| $$
$$ ||\va||_2 = \left( \sum_{i=1}^n a_i^2 \right)^\frac{1}{2} $$
$$ ||\va||_\infty = \max_{i = 1}^n |a_i| $$
A vector with unit Euclidean norm, \( || \va ||_2 = 1 \), is known as a unit vector.
Any vector can be normalized to a unit vector by dividing it with its norm, for example, the Euclidean norm.
$$ \vec{\va} = \frac{\va}{||\va||_2} $$
\(\vec{\va} \) has the same direction as that of the original vector, but has unit-magnitude.
Next, we present an interactive demonstration of vector norms.
Stretch and rotate the vector \( \va \). Note the change in the various norms to build an intuition about vector magnitudes and direction. Also, use the slider to change the norm type to get a shape of the unit ball, the region that is traversed by the unit vector of a given norm type.
Understanding the shapes of these regions is crucial in choosing appropriate norm types in machine learning.
The magnitude of the vector can be stretched or shrunk. This is achieved by multiplication with a scalar.
$$ \vb = \alpha \va $$
The result, \( \vb \), is a vector with the same number of entries as \( \va \). It is easy to prove that the magnitude of \( \vb \) and that of \( \va \) are related.
$$ || \vb ||_2 = |\alpha| || \va ||_2 $$
Note that the scalar multiplication can also change direction.
To build intuition about scalar multiplication, try out our interactive demo presented next. Vary the value of the scalar multiplier \( c \) by adjusting the slider. Note the difference in the vector \( \va \) while you do that.
Next, we present an interactive demonstration of scalar multiplication with a vector. Stretch and rotate the vector \( \va \) by moving the arrowhead or change the scalar multiplier \( c \) using the slider. Note the change in their product \( c\va \).
Understanding these results intuitively is crucial to building a geometric perspective scalar multiplication of vectors.
We saw that vectors have direction and that they can be shrunk, stretched, or flipped. In linear combination of vectors we will study how vectors can be rotated!
Now that you understand vector geometry, it is time to build expertise in other topics in linear algebra.
Help us create more engaging and effective content and keep it free of paywalls and advertisements!
Stay up to date with new material for free.