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:9:55

Representing linear systems with matrix equations

Video transcript

I have a system of two equations with two unknowns here we've seen how to solve this and there's multiple techniques we've used substitution elimination and we could do that right over here in fact you could just add the two the left sides of the equations and the right sides of the equations the esses would cancel out actually let's just do it to show how that's relatively straightforward for at least of this example right over here you add the left-hand sides these cancel out you're left with negative T negative T is equal to is equal to 7 plus negative 6 is equal to 1 or you get the T is equal to negative 1 T is equal to negative 1 and if T is equal to negative 1 this top this top equation you could use either one would simplify to 2 times s negative 5 times negative 1 is plus 5 plus 5 is equal to 7 is equal to let me use those same colors that we have over there is equal to 7 or and we could do this part in our head 2's must be equal to 2 and that s is equal to 1/2 times 1 plus 5 is 7 and so we have s is equal to 1 so that was pretty straightforward what we're going to do in this video is represent the same system but we're going to represent it essentially as a matrix equation and we're going to solve it using inverse matrices and I'll give you a little bit of a warning it's going to be more involved it's going to take us more time to this and you're probably going to say well why are we even going through the trouble of it and the value of what we're going to do in this video is that it's very useful in computation where you might solve almost the same system over and over and over again maybe the left-hand sides are the same the right hands keep changing and this might be something that you you might see while writing a computer game or awhile while working on you know some type of a computer problem and so and this is a general theme a lot of the value of matrices are they are ways to represent problems mathematical problems ways to represent data and they there and then we can use matrix operations matrix equations to essentially manipulate them in a waise if we're for the most part writing computer programs or things like computer programs so bear with me you will enjoy it eventually what we're about to do and one day you will see that it is actually quite useful so the first thing we need to see or need to appreciate is that this can be represented by a matrix equation now what I'm going to do is I'm going to take the coefficients here so I'm going to take the coefficients here so 2 negative 5 to negative 5 negative 2 negative 2 and 4 and positive 4 so all I've done is I've taken the coefficients here and I'm going to claim that that times the column vector column vector St s and T being equal to be equal to the column vector being equal to the column vector 7 negative 6 7 negative 6 is the exact same thing as what we have right over here these are representing the same constraints on the variable s and T so why don't I don't quite get that and if you're saying you don't quite get that multiply this out multiply this out and think about which entries they need to be equal to when you multiply it out and you would see well this entry this first row first column that's going to be this row we're going to be dealing with this row and that column so if you think about it it's going to be this this tells us that 2 2 times s 2 times s plus negative 5 times T so I could say minus 5 times T must be equal to the first entry up here first row first column is equal to 7 all I did is I multiplied I dealt with the first row first column it said well when I when I take essentially the dot product of those and we if you don't know what a dot product is don't worry we'll explain it other places it's essentially what I just did here the first and the first entry here times the first entry the second entry here times the second entry and we add them together that that must be equal to 7 but when you do that you essentially construct this first equation and when you do it with a second and this column you construct the second equation you get negative two times s negative two times s plus four times T plus four times t four times T is equal to negative six is equal to negative six is equal to negative six so hopefully you appreciate that this contains the same information as that and there's other ways that I could have done it for example you could have instead of writing it this way obviously this system is obviously the same thing is obviously the same thing as and actually let me just copy and paste it is the same thing as so copy and paste is the same thing as this system where I'm really just swapping so once again copy and paste I'm just obviously I've written the second one first and I've written the first one second so these this is obviously the same system and so if I wanted to construct a matrix equation with this system I would just swap all of the rows the first row here would be negative 2 4 and well I would swap the rows for the coefficients but I would still keep the s and T's in the same order and you could do that try to try to represent this right over here as a matrix equation you would have the matrix here would be negative 2 4 2 negative 5 and this would be negative 6 7 but now that we've set this up how do we actually solve something like this why do we even do this and to think about this let's actually think about it in terms of literally a matrix equation so let's say that a the matrix a is this thing right over here this thing over here is the matrix a let's say that this right over here this is the column vector X and since so I'll write it as a vector X right over here so you have the column vector X and then this right over here you could say that this is equal it what's called us the column vector B so this is equal to the column vector B so we're essentially saying that a the matrix a time's the column vector X is equal to is equal to the column vector B let me write that and right over here just to emphasize it the matrix a time's the column vector X is going to be equal to is equal to the column vector B and so this is what they're talking about when they say a matrix equation and actually even before we even think about computation and computer graphics and all that you will see a lot of things like this in physics where they're speaking in general terms where there might not even be specifying the dimensions of the matrix or the dimensions of this vector but they're talking about some general property and say physics and so you will see vector equal matrix vector equations like this a lot as you get into higher and higher Sciences but once again let's just just go back to our core issue of how do we actually solve this well one way you could think about it we've already seen that if a matrix is invertible that means that there's a matrix a inverse that exists such that a inverse times a is equal to the identity is equal to the identity matrix so what if we multiplied the left-hand sides of both sides of this equation by a inverse remember order matters when you are multiplying matrices so we multiply the left-hand sides of both sides of the equation by a inverse which would get us a inverse times a times X is equal to is equal to a inverse remember I'm multiplying the left-hand sides of both equations a inverse times the column vector B now why is this interesting well we just said that the inverse times a assuming that a is invertible that this right over here is going to be equal to the identity matrix so that's going to be the identity matrix times column vector column vector X and that's going to be equal to that's going to be equal to this stuff that's going to be equal to that so let me just copy and paste that that's going to be equal to that now why is that interesting well the identity matrix times some some other matrix this column vector essentially is a two by one matrix that's just going to be this column vector again so it's just going to simplify to that our column vector is equal to our column vector is equal to the inverse matrix times our column vector or cut or our column vector X is equal to the inverse matrix times the column vector B and so once again emphasizing why is this useful well yes you do have to go through the trouble of calculating a inverse but once you've done that you could keep swapping in different different bees you know this one is seven negative six but you can have other bees here and if you're running a computer program you want to do this over and over again you just have to do multiple matrix multiplications so I'll leave that thought here I've realized that I'm approaching ten minutes which I never like to cross in these videos in the next video we'll actually compute what a inverse is and calculate what the solution vector X is