 Another important operation we can do with vectors is known as the dot product. So this is defined as follows. Let's say I have two vectors, both of which have n components, the dot product. And sometimes this is also referred to as the scalar product, which is a little bit confusing because we have a scalar multiple, which is very different. The dot product is going to be the sum, we're going to write it, vector u dot vector v, and this is going to be the sum of ui. That's the component of u times vi, that's the corresponding component of v, and we can imagine this nice compact notation, but this really represents the sum of the products of the components of the two vectors. So for example, if one vector is 1, 3, negative 4, 5, and the other vector negative 1, negative 2, 3, and 4, then my dot product, I'm going to multiply the corresponding components and add them together. So there's my first component of u times the first component of v, I'm going to add the first second component of u times the second component of v, I'm going to add the third component times the third component, and then the fourth component times the fourth component. And so I'll do the multiplication first, that's order of operations, and then I'll sum them up, and that gives me my dot product equal to 1. Now again, it would be nice to have some sort of geometric interpretation of what the vector is, so let's think about that. Well, we'll try a special case, let's start off with u dot u, in other words a vector dot product with itself. What should we make of this particular dot product? Well again, we can view a dot vector as giving directions from a point to some place else, and it's easiest to think about this as giving the direction from the origin to a terminal point. So from the origin to a terminal point, and again I should emphasize, we don't have to start at the origin, we can start anywhere we want to. The vector tells us how to get from some point to some other point, it's merely convenient to imagine that we start at the origin, because if we do that, the point we end up at the terminal point has the same coordinates as our vector does. So let's think about that as a set of coordinates, well what do those coordinates mean? Again, here's that algebra to geometry transition, algebraically I have the coordinates of a point, geometrically, well the first coordinate, if I'm in R2, the first coordinate tells me horizontal distance, the second coordinate tells me vertical distance, and the thing that's noteworthy here is that I have two sides of a right triangle. And I know what that third side is, I can find the third side because I know the Pythagorean theorem. Meanwhile, when I take a look at the dot product between the two vectors, I'll multiply the corresponding components u1 times u1, that's u1 squared, u2 times u2, that's u2 squared, I'll add them together and I end up with the dot product. Well, the thing to notice here is that my hypotenuse square root of u1 squared plus u2 squared is the same as the square root of the dot product. So what does that tell me? Well, the dot product of u with itself is going to be the square of the length of this vector. And this introduces an important idea, the modulus of u, and we write this as u bar with a set of vertical bars surrounding it, this is going to be the square root of the dot product. Now for vectors in R and the modulus corresponds to the length of the vector. Now here's an important idea, you can tell how important something is by the number of names that its basic ideas have. And since linear algebra is only used by a few specialists in a very limited number of fields, well actually linear algebra is used by nearly everyone in nearly every quantitative field. It is probably used by more scientists and researchers and engineers than calculus is. So this is something that's very, very, very, very, very, very common. And what that means is notation and terminology is unfortunately rather inconsistent. So sometimes you'll see what is what we're calling the modulus. You might see it referred to as the L2 norm of a vector. This is actually something you would probably hear about mathematicians say because they want to talk about other norms as well. But we could also talk about it as a magnitude of the vector and the notation where we're writing single bars. This is sometimes also written using double bars to distinguish it from absolute value. And since I can't predict what context, what field you're going to be using linear algebra in, you might as well get used to all the forms of notation. And to prepare you for that, we will make no effort whatsoever to be consistent in our notation or our terminology. Alright, so let's take a quick example here. Say I want to find the magnitude of the vector u, 3, negative 1, 5, negative 6. Well the magnitude is the norm is the modulus is the square root of the dot product. So I'll find that dot product. So that's going to be first component of u, 3 times the first component of u, also 3, that's 3 times 3. Second component of u times the second component of u, third component times the third component, fourth component times the fourth component. And so I add those together and after all the dust settles I get the magnitude square root of 71. And if I want to view it this way, this is a vector in R4 and the length of that vector is going to be square root of 71. Or the distance from the origin to the terminal point of the vector is also going to be square root of 71.