If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:18:53

Video transcript

in the last video we showed you the cow she sorts inequality cow she shorts shorts inequality inequality and I think it's worth rewriting because this is the something that's going to show up a lot it's a very useful tool and that just told us if I have two vectors x and y they're both members of RN and they're both nonzero nonzero vectors and that was an assumption we had to make when we did the proof otherwise we there's a potential of dividing by one of their magnitudes so that would have been a big no-no but if we assume that they're both nonzero then we can say that the absolute value the absolute value of their dot products is going to be less than or equal to the products of their individual lengths so that's the length of vector X and we define that a couple of videos ago and then this is the length of vector Y and of course this is just a regular number and then each of these are just regular numbers they're not vectors once you take a length this go the length of a 50 dimensional vector could just be the number three it's just a scalar value so this this is this is just scalar multiplication here and we also learned that the only time that this inequality turns into an equality is the situation where X where X is equal to some scalar multiple of Y and so in some textbooks you'll say and this has to be a nonzero scalar multiple but that's a bit obvious I told you that x and y are nonzero so if this was zero then X would be zero and that we I just said that X is non zero but if you want to say there you could say that you know C also is going to be nonzero non zero but that essentially just falls out of this information there but if this is the case and if and only if this is the case then we can say that the absolute value of the dot product of the two vectors is equal to the product of their lengths now this is all just a review of what I did in the last video now what else can we do that's useful with it so let's just play around a little bit but well I can't claim to be experimenting I know where this is going to go let's see what happens if I were to take if I were to take the length if I were to take the length of X plus y so I'm going to add the two vectors and then take the length of that vector squared well we know from a couple of videos ago that the length squared can also be re-written as the dot product of a vector with itself this right here X plus y I know it looks like two vectors because two vectors added to it each other so it's really a vector X plus y is a real vector I could graph X plus y so the length of X plus y squared I can rewrite it as the dot product of that vector with itself so X plus y dot X plus y and all of these are vectors these aren't just numbers and this is the dot product it's just not normal multiplication but we saw two videos ago that the dot product that has a distributive and the associative and the commutative property is just like regular scalar multiplication so you can kind of foil this out if you if that's how you remember multiplying your binomials or I always think of it more as just doing the distributive property twice so this can be re-written as this can be rewritten as X dot X actually let me write it as a distributive property because that's sometimes not obvious to a lot of people so let me write this X as a yellow X and light and let me write this this whole term is X plus y so this right here can be re-written as X dot so this X dot this X plus y and then it would be plus this Y dot I wanted to switch colors Plus this Y dot x+ why it's good to see that when you're multiplying these you're just applying the distributive property right all I did is I distributed this term along each of these terms in this sum right here so then I got this and then I can distribute each of these into the sum so then this becomes I'll be careful with the colors X dot X dot X plus X dot Y I just maybe this was a little bit overkill but I think it's good to see that this isn't just some magic here and we're just using the exact properties that we proved with the dot product so that's that right there and then it's plus plus y dot X so Y dot X Y dot X plus this yellow Y yellow y dot the yellow X dot the yellow star hit dot the blue y dot the blue Y so the magnitude or the length of our vector X plus y squared can be rewritten like this and this and I'll just switch back to one color so this equals that and all of that what is this equal this is equal to X dot X so this is equal to what's X dot X X dot X is just the magnitude so let me write this is just equal to the magnitude of our vector X I should stop using the word magnitude the length of our vector x squared and then I have two terms here I have an X dot Y and a Y dot X but we know that x dot y and Y dot X are really the same thing we show that that you can order doesn't matter when you take the dot product just like it doesn't matter with regular multiplication so these are really the same terms so we could write plus two times X 2 times X dot Y and then finally we have that last term sitting here we have this y dot y Y dot y is the same thing as the length of our vector Y the length of our vector Y squared now let's see if we can break out our cow she Swartz inequality or maybe Schwartz's I don't know if I'm pronouncing it right but X dot y so x dot y we have the absolute value of x dot y here right but we know that the that just x dot y x dot y is going to be it has to be less than or equal to the absolute value of x dot y let me x dot y why is that well this could be negative I can show you examples of dot products that are negative in fact if X has all positive terms and and Y has all negative terms you're going to have a a negative dot product so this could be negative or it could be positive it's positive the absolute value they're equal to each other if this is negative then this absolute value is definitely going to be greater than it so we can even we can add to the couchy swartz inequality and this is a bit obvious we could say look we could add a little hmm we could add a little x dot y is less than or equal to the absolute value of x dot y which is AB less than or equal to the mag the length of X times the length of Y so X dot y is definite this the length of X dot or the dot product of X with y is definitely less than its absolute value of that which is definitely less than the lengths of those two multiplied so if I rewrite this this this statement right here is definitely less than or equal to so this is definitely less than or equal to this exact statement but if I replace these with the lengths of the vectors so that is definitely less than or equal to I'm just rewriting this x squared and I'll write the I'll write the plus two there plus two but I want to vary make it very clear what I'm replacing here and then I have the plus length of my vector Y they're squared now this I'm saying this is definitely less than the absolute value of x dot y which is definitely less by the couchy swartz inequality definitely less than then the product of the two lengths so all I did here so I'm just replacing this with the product of their two lengths so I'm going to put X the length of X times the length of Y right and since this is the same as that this is the same as that but this is definitely less than this this whole term has to be less than this whole term now let me just remind you what we were doing I said that this thing this thing that I wrote over here this is the same as that so this thing up here which is the same as that which is less than that also so we can write that the magnitude of X plus y squared and not the magnitude the length of the vector X plus y squared is less than this whole thing that I wrote out here now or less than or equal to now what is this thing remember I mean this might look all fancy with the mean my little double lines around everything but these are just numbers this mag this length of x squared this is just a number each of these are numbers and I can just say hey look this looks like a perfect square to me this looks just like this term on the right hand side is the exact same thing as the length of X plus the length of Y plus the length of Y everything everything squared right if you just squared this out you'll get x squared plus 2 times the length of x times the length of y plus y squared so our length of the vector X plus y the length of our vector X plus y squared is less than or equal to this quantity over here and if we just take the square root of both sides of this you get the length of our vector X plus y is less than or equal to is less than or equal to the length of the vector X by itself plus the length of the vector Y and we call this the triangle inequality which you might have remembered from geometry triangle inequality triangle inequality now why is it called the triangle inequality well you could imagine each of these to be separate sides of a triangle in fact let's draw it we can draw this in r2 let me turn my my graph paper on let me let me see where the graphs show up if I turn my graph paper on right there maybe I'll draw it here so let's draw my vector X so let's say that my vector X looks something like this let's say that's my vector X it's the vector 2 4 so that's my vector X and let's say my vector Y well I'm just going to do it I'm just going to do it head to tail because I'm going to add the two so my vector Y I'm going to do it a non-standard position let's say it looks something like oh let's say my vector Y looks something like this I'm going to draw it properly so that's let's say that that's my vector Y so that's my vector Y then what does X plus y I look like X plus y and remember I'm just I can't necessarily draw any two vectors on two-dimensional space like this I'm just assuming that these are in r2 but this is just to give you the idea so then I'm so then this is there some right you took from the tail of X to the head of Y so this vector right here is the vector X plus y and that's why it's called the triangle inequality it's just saying that look this thing is always going to be less than or equal to or the length of this thing the length of this thing is always going to be less than or equal to the length of this thing plus the length of this thing and that's kind of obvious when you just learn two-dimensional geometry that look this is this is a much more efficient way of getting from this point to this point then going out here and then going out here and then what's the limiting or what's the case in which this length is equal to these lengths well if you keep flattening this triangle out and you go to the extreme case you go to the extreme case where maybe the vector X looks like this the vector X looks like this and if the vector Y is just kind of going in the exact same let me vector Y is going in the exact same direction maybe it's going a little bit further right so that is that this is vector X this is vector Y now X plus y will just be this whole vector now that whole thing is x plus y and this is the case now where you actually where the where the triangle inequality turns into an equality that's why the little equal sign there the extreme case where essentially x and y are collinear and why does that work out we can even go back to our math and understand that so let me turn my graph off we can go back to our math here if I go to back to this point remember right here I made the statement look this thing is definitely less than this thing over here but what if I made an assumption what if I said what if I said that X X is equal to some scalar times Y and actually I have to be careful because just some scalar times Y remember our cauchy's swartz inequality said that look the the inequality turns into an equality if X is some nonzero scalar of Y and then we can apply this we can say that the absolute value of x dot y is the same as this over here but I don't have the absolute value of x dot y here I don't know that this is positive I can say definitively this is a positive quantity because I took the absolute value of it no absolute value here so the only way that I can ensure that this is a positive quantity that this is the same thing as the absolute value of x dot y is to enforce if I'm kind of going to go down this road is to enforce this term right here that C be positive because if C is positive then x dot y if x dot y then that would be the same thing as C Y dot Y which we know is just the same thing as C times the magnitude of y-squared and the only way that I can ensure that this expression right here is equal to the absolute value of x dot y the only way I can assure this is if C is positive if C is negative then this is going to then this is going to be a negative number while this is a positive so if I assume that this is positive if I assume that this is positive then I can say that X dot y x dot y is equal to the magnitude is equal to the absolute value of x dot Y and since it's a scalar multiple then I could say that that term is equal to is equal to not just less than or equal to the magnitude of X's and Y's so I hope I'm not confusing you so all I'm saying is if I can assume that X is some positive scalar multiple of Y that this wouldn't be a less than sign then I could say that X dot Y is the same thing as the absolute value of x dot y since this is positive and if it's the same thing as the absolute value of x dot y and it's some scalar multiple of each other then we could go down this other route we could say that this thing here I don't want to get too messy we could say that this is equal to that if this is equal to that then this would have become an equal sign not a less than or equal to sign and then we would have had the limiting case we would have the limiting I don't call the limiting case but we could say that X plus y we've done the same work but we've had an equal sign the whole way would equal the length of X the length of X plus y would equal the length of X plus the length of Y in the situation where X is equal to some positive scalar times y so C is greater than 0 if we can these two imply each other and we saw that geometrically I don't I lost my axes here but we see that the only time that X the Matt the length of X plus y is equal to the length of X plus the length of Y is when they're collinear right over here this Plus this is clearly you can just visually look at it longer than this right there so you might be saying Sal once again you know this linear algebra is a little bit silly we learn the triangle inequality in eighth or ninth grade you know why did you go through all of this pain to redefine it and this is the interesting thing what I just drew here and what this is what you learned in this is what you learned in ninth grade geometry this is just this is just an r2 this is just you know your Cartesian coordinates or I don't want to use the word dimension too much because we're going to define that formally but this is kind of your two-dimensional space that's going on but I what's interesting or what's what's useful about linear algebra is we've just defined the triangle inequality for an arbitrarily large vectors or vectors that have an arbitrarily high number of components each of these these don't have to these don't have to be an r2 these could be this could be this is true if we ran our our 100 where every vector has 100 components to it we've just defined some notion of the triangle inequality we've abstracted well beyond just our two-dimensional Cartesian coordinates well beyond even our three dimensions to essentially n dimensional space and I haven't defined dimensions yet but I think you're starting to appreciate what they are but anyway hopefully that you found that useful and well now we can now take this result we can now take this result and actually that result with this result and define what the notion of an angle between two vectors are and once again this is very this is you know on some level you like why do we have to define an angle isn't an angle just you know if isn't isn't that just an angle well yeah we know what an angle is in two dimensions but what does an angle mean when you abstract things to n dimensions or when you where you're in RN so that's what we'll talk about in the next video