In the last video, we defined inner products. Now we will use inner products to compute lengths of vectors and distances between vectors. The length of a vector is defined via the inner product using the following equation. The length of a vector X is defined as the square root of the inner product of X with itself. Remember that the inner product is positive definite. That means, this expression is greater or equal than zero. Therefore, we can take the square root. We can now also see that the length of a vector depends on the inner product and depending on the choice of the inner product, the length of a vector can be quite different. Similarly, the geometry in the vector space can be very different. The length of X is also called the norm of X. So let's have a look at an example. Assume we're interested in computing the length of a vector in two dimensions and X is given as the vector (1,1). So, in a diagram, we have one here and approximately here, then our vector X would be here. And now we're interested in computing the length of this vector. So, in order to compute the length of the vector, we need to define an inner product. So why don't we start with a standard dot product? So, if we define (X,Y) to be X transpose Y, so the inner product of X and Y to be X transpose times Y, then the length of X is the square root of two. So it's one squared plus one squared, and we take the square root of this. Now let's have a look at a different inner product. Let's defined (X,Y) to be X transpose times one, minus a half, minus a half, one times Y, which we can also write as X1 times Y1 minus a half (X1Y2 plus X2Y1) plus X2Y2. Using the definition of this inner product, then the length of a vector is the square root of X1 squared minus a half (X1X2 plus X2X1) plus X2 squared. And this is identical to the square root of X1 squared minus X1X2 plus X2 squared. And we will get smaller values than the dot product definition up here if this expression is positive. If we now use the definition of this inner product to compute the length of our vector up here, we will get that the squared norm or the inner product of X with itself is one plus one minus one, which is one. And therefore, the norm of X is just one. And one, in this case, would be the length of the vector using this unusual definition of an inner product, whereas the same vector would be longer had we used the dot product up here. The norm that we just looked at also has some nice properties. Let me write a few of those down. So, in particular, one of the properties is that if we take a vector and stretch it by a scalar lambda, then the norm of this stretched version is the absolute value of lambda times the norm of X. The second property is the triangle inequality, which says that the norm of X plus Y is smaller or equal to than the norm of X plus the norm of Y. Let's have a look at an illustration. So let's assume we have our coordinate system in two dimensions and we use the standard vectors X equals (1,0). So, X would be sitting exactly here. So this is X. And Y is (0,1). Then, X plus Y is sitting here. If we use the dot product as our inner product, then the norm of X is one, which is the same as the norm of Y, and the norm of X plus Y is square root two. So, what the triangle inequality says that X plus Y norm is smaller or equal than the norm of X plus the norm of Y. And that is also true in our case because squared of two is smaller or equal than two. And there is another inequality I would like to mention, which is the Cauchy-Schwarz inequality. And that one says that the absolute value of the inner product of X with Y is smaller or equal than the product of the individual norms of the two vectors. In this video, we looked at length of vectors using the definition of inner products, and now we're going to use this to compute distances between vectors in the next video.