0:01

So, we've looked at the two main vector operations of addition and scaling by a number.

Â And those are all the things we really need to be able to

Â do to define what we mean by a vector,

Â the mathematical properties a vector has.

Â Now, we can move on to define two things: the length of a vector,

Â also called its size,

Â and the dot product of a vector,

Â also called its inner, scalar or projection product.

Â The dot product is a huge and amazing concept

Â in linear algebra with huge numbers of implications,

Â and we'll only be able to touch on a few parts of it here, but enjoy.

Â It's one of the most beautiful parts of linear algebra.

Â So, when we define the vector initially, this guy,

Â r, we did it without reference to any coordinate system.

Â In fact, it's the geometric object,

Â this thing just has two properties: it's length here and its direction,

Â which is going this way as opposed to this way or this way.

Â So, irrespective of the coordinate system we decided to use,

Â we want to know how to calculate

Â those two properties: its length and the direction it's going.

Â Now, if the coordinate system that we used to define r,

Â used these two vectors, r and j,

Â we can say that r is equal to ai plus bj,

Â or is equal to a,b,

Â the way we were writing it in the last video.

Â Now, if we want to know the length of r,

Â well, we can draw a triangle, right? And then we can use Pythogoras' theorem.

Â So, we've got ai's going along this way,

Â and we've got bj's going along this way.

Â And if i and j are both of unit length that the length of those is just

Â a here and b here where these vertical lines on either side means the size.

Â So then, we can use Pythagoras' theorem just for

Â a triangle where we've got a there, b there.

Â This length then from Pythagoras' theorem will

Â be the square root of a squared plus b squared.

Â And we can say that that's equal to the length of r,

Â it's the square root of a squared plus b squared.

Â So, the length of, r is equal to a,b. So, r is that.

Â And the length of r, we defined to be equal to

Â the square root of a squared plus b squared.

Â Now, we've done this for two spatial directions defined by the unit vectors,

Â i and j, and those are at right angles to each other.

Â But this definition of the size of a vector is more general than that.

Â It doesn't matter if the different components of the vector are

Â dimensions in space or even things with

Â different, physical units like bedrooms or bathrooms or length and time and price,

Â we still define the size of a vector through

Â the sums of the squares of its components, all square rooted.

Â The next thing we're going to do is define the dot product which is one way,

Â one way of several,

Â of multiplying two vectors together.

Â So, we've got two vectors here,

Â r and s. I'm going to make this a bit more general, actually.

Â I'm going to give them components. So, I'm going to call it r_i, r_j.

Â So, r has a component i,

Â in this case, 3, and a component j, in this case, 2

Â in the j directions and the i directions, respectively.

Â And s, we could do the same thing.

Â We could say s has components s_i and s_j.

Â So then, we define the dot product,

Â and the product is just a number, like 3.

Â It doesn't have any associated spatial dimension or direction along the vectors i and j.

Â We'll define the dot product r dot s, to be equal to,

Â what happens if I multiply r_i by s_i,

Â and add it

Â to r_j times s_j.

Â So, in this case, that gives me,

Â in this case it gives me three there times minus one,

Â plus two times two.

Â So, that gives me three plus four - sorry, minus three plus four, which is equal to one.

Â So, the dot product of r dot s,

Â in this case, is minus three plus four, which is one.

Â Now, we can go on to look at one property of

Â the dot product which is that it's commutative.

Â So, commutative which is spelled commutative.

Â And that means that r dot s

Â is equal to s dot r. It doesn't matter which way around we do it.

Â And we can see that fairly simply because if we just switch that around,

Â we'd have s_i times r_i,

Â plus s_j times r_j,

Â and that's going to be the same number.

Â So, we can see immediately,

Â fairly trivially, that the dot product is commutative.

Â It doesn't matter which order we do it in.

Â The second property we're going to prove is

Â the dot product is distributive over addition.

Â So, if I have some third vector,

Â let's take some third vector, t,

Â what being distributive means is

Â that r dot s plus t is the same as r dot s plus r dot t. That is,

Â we can multiply out this bracket in the way that we would if they were just numbers.

Â And we're going to prove this in the general case for any dimension vectors.

Â So, we'll have a vector r is equal to the components r_1,

Â r_2, for i's and j's,

Â all way up to some dimension r_n.

Â And s is some other vector, s_1,

Â s_2, all the way up to some s _n.

Â And t is another one which is equal to t_1,

Â t_2, all the way up to some component t_n.

Â And then, r dot s plus t

Â is going to be equal to r_1 times s_1 plus t_1,

Â plus r_2, for the second dimension,

Â times s_2 plus t_2,

Â plus all the other dimensions,

Â plus r_n times s_n plus t_n,

Â if I multiply it out for all the dimensions.

Â And then, I can just multiply out those brackets,

Â that's going to be r_1 s_1 plus r_1 t_1,

Â plus, now multiply out this bracket,

Â r_2 s_2 plus r_2 t_2,

Â plus, all the dots,

Â r_n s_n plus r_n t_n.

Â And if I collect together the rs term,

Â so I've got r_1 s_1, r_2 s_2, and r_n s_n,

Â so that's r dot s,

Â and if I collect all the t terms together,

Â I've got r dot t. So,

Â we've demonstrated that this distributive property is in fact true.

Â So, it's also kind of obvious that if we multiply a vector through by a scalar,

Â so if we take a times s,

Â our other fundamental operation was multiplying by a scalar,

Â and then do the dot product on that,

Â so we do r dot a s,

Â then that's going to be equal to a times r dot s. Because if we take this s here,

Â when we do this, if we multiply s here,

Â through by a number, a,

Â we're just going to get the number a come out of all the components.

Â So, that's going to be if we do it r_i times as_i plus r_j times as_j,

Â that's the left-hand side,

Â and that's equal to a times r_i s_i plus r_j s_j.

Â So, that is, this property is called that it's

Â associative over scalar multiplication.

Â Over scalar, that's the number a, multiplication.

Â So, we've got three properties.

Â We've got it's associative over scalar multiplication,

Â the dot product is distributive, and it's commutative.

Â Now, the last thing we need to do is draw the link

Â between the dot product and the size of the vector.

Â This is quite surprising!

Â If we take r and dot it with itself,

Â we get r_i times r_i,

Â plus r_j times r_j,

Â plus all the other components, whatever they are.

Â So, that's equal to r_i squared plus r_j squared.

Â But we said that the size of the vector was the square root of that.

Â So, r dot r is equal to the size of the vector squared.

Â So, that is

Â the size of the vector is just given,

Â in some senses, by r dotted with itself, which is quite cool.

Â