 Hi, I'm Zor. Welcome to Unisor Education. We will be talking today about how to solve a general system of linear equations using the matrices. The lecture will be rather short because we have already prepared all the machinery, all the tools which we are going to use for this. What's interesting is that if the theory is really right and well thought, then the results of using the theory must be really very simple. Now, what I'm talking about this, you see matrices allow you to work with system of like n linear equations in a relatively similar way to solving a single system. If you have a system like this, one variable x and you have to solve this equation, sorry, linear equation, how you solve it? Well, you divide by a, right? So, b times a to the minus one, which is one over a, that's the x, right? So, this is the way how you solve one single linear equation. And the matrices allow you to approach solution to a system of linear equation in relatively the same way. And that's what I'm going to show you today. And we have already prepared all the machinery. We know about matrix multiplication. We know about inverse matrices. We also know about what is the determinant of the matrices. So, all these elements of the matrix usage will be used. And it will show how easily it is to solve this system of linear equations using this exactly methodology and approach. So, let's consider the system of n linear equations with n variables. It looks approximately like this. So, that's the first equation. Then we have the second equation with different coefficients. And then we have all other equations and the last one which would look like this one. So, we have to solve this system. And we actually know that certain methodology how to use this system. When I was talking about linear equations and systems of linear equations, we were talking about something like a substitution. Solve this for instance for xn and then substitute to each one of these equations. And that would reduce your system of equations from the n unknowns to n-1 unknowns. And then you can repeat the same thing again and again and finally you will get solution. Okay, that's fine. That works without any problems. However, what I'm talking right now about is how to use matrices to basically encapsulate all this theory of solving the system of n linear equations into something which resembles solving one particular linear equation. And here is how we can do it. First of all, I would like you to consider all these b1, bn, the free members of this particular system as a column vector. I would also like to consider all these coefficients as forming a matrix. And finally, I would like you to consider the unknown variables as again a column vector. So, we all know what is a matrix, what is a matrix which actually has one column, which we call usually the column vector. And now what I would like to consider is a multiplication of this matrix by this column vector. Now, this matrix has n by n dimension. This column vector has n rows by one column dimension. Now, as we know, if we multiply matrix n by n times another matrix n by 1, now we have to have these numbers the same and they are the same. And the resulting matrix would be the number of rows in the left and number of columns on the right multiplier. So, the result will be n by 1, right? Now, how this result of multiplication would look right? Alright, well, we know this is n by 1, which is actually a column vector, right? Similar to this one and similar to this one. And the first row of this column vector would be multiplication of this times this. As a scalar multiplication of this row vector by this column vector, which is a11 times x1 plus a12 times x2, etc., plus a1n times xn. Which is exactly the first equation. So, the first member of this multiplication is exactly the right side of the first equation. Now, we have this equation is equal to b1. So, the multiplication of this matrix by this column vector has the first member equals to the first member of the b column vector. How about the second one? Well, the second one of the multiplication, the second member of the result of the multiplication is formed by second row and the first and only column, right? a21 times x1 plus a22 times x2, etc., which is exactly the second equation, the right side of the second equation. And it's equal to b2, which is this one, etc. So, my point is that the result of multiplication of this by this, which is the column vector, would be exactly the same value as this column vector. So, this particular system of equations is equivalent in the matrix lingo to this. And that's the most important part, actually, which I wanted to emphasize. So, we can rewrite the whole system of n equations with n variables using matrix notation, which looks like this, where this is a true matrix multiplication. It's a matrix multiplication of the matrix of the coefficients by the matrix, which represents the column vector, actually, of the unknown variables. And on the left, you have exactly the three members of these equations. Now, why did I do it in this way? Is it easier or not? Well, it's compact. Let's put it this way. That's for sure. And remember, if you have a single linear equation, it might look like this. So, you see the similarity. This is a single equation, and this is a system of n linear equations. Now, how did we solve the single equation? Well, let's multiply both sides by 1 over a. Since it's 1 over a, this gives me 1, and I have a solution. Obviously, it's true only in case a is not equal to 0, right? Okay. Let's do exactly the same thing here. Now, since we have a matrix notation of our system, and we know actually what matrix multiplication is, we know what is an inverse matrix. So, let's try to use exactly the same technique. Multiply both sides of this equation by an inverse matrix to the matrix of the coefficients a. It's a square matrix, n by n. So, hopefully it has an inverse matrix, which is not always the case. I understand that. But let's assume that it does have an inverse matrix. So, if it does, then this thing is true. We know that matrix multiplication is associative, which means I can actually put these parentheses differently. Now, what is the multiplication of an inverse matrix by the original one? Well, we know this is identity matrix, right? The matrix which has all zeros except the main diagonal. So, that's what we have now. Now, what is an identity matrix multiplied by a column vector? Well, it's called identity for a reason, right? We obviously know that the multiplication of identity matrix by anything really doesn't change that anything. This is actually x. And we have come up with a solution. x is equal to a minus 1 b, which is very much similar to a linear equation, a single linear equation solution. So, I promised this lecture would be a simple one, and a short one. Well, this is the reason we have already prepared everything. All we had to do is to rewrite our system of equation in the matrix format and then use the properties of the multiplication by an inverse matrix. And this is a solution. How simple it is, right? Well, again, I told you that the nice and very well-thought-through theory should produce beautiful results. Well, this is actually a certain element of beauty which matrices bring into the system of linear equations. I mean, there are other purposes, of course, but this is something which is probably the purpose why I was talking about matrices. Because this solution, which looks exactly like the solution for a single linear equation, is the purpose why I brought the whole theory of matrices into this course. Sorry. Now, it seems to be simple, but why people are making a big deal out of the system of linear equations? Well, because it's not easy to get this matrix, the inverse matrix to a matrix of coefficients. In simple cases, it's simple to do. It's more complicated cases. It's not easy to do. Well, so, number one, I have to tell something which I usually prefer not to. I have to tell something, so you will believe me without the proof. I always try to prove whatever statements I'm making. This is something which I cannot prove because it's a little bit beyond the scope of this course. Inverse matrix exists only if the determinant of the matrix itself, the A matrix, the determinant not equal to zero. So, this is a condition for the solubility of this particular solution to exist. Well, if matrix, original matrix, has the determinant equal to zero, then again, believe me, the original system of equations will not have a proper single solution anyway because we were already talking about when exactly the matrix can have the determinant equal to zero. Well, for instance, when a couple of rows are linearly combined, produce the third row or something like this, which actually means that the system of our equations does not contain n equations if one of them is a linear combination of another or a couple of others, then we're no longer talking about system of n independent equations. And if the number of equations is less than the number of variables, then we cannot count in a good solution anyway. It might be either zero or infinite number of solutions, etc. So, this is actually an essential condition for any linear system to have a proper single unique solution. So, that's why actually I have brought this here because this is also the necessary and sufficient condition for the matrix to have an inverse one. Now, as a conclusion to this, which I believe is, you know, aesthetically it's quite beautiful. At least that's how I view it. The way how you solve the linear equation using the inverse matrix. Now, how to make this inverse matrix? There are methodologies which probably again are a little bit beyond the course, this particular course, but I would like to tell one little thing. When computers are supposed to solve the system of linear equations and obviously, if you have a system of a thousand equations, for instance, it's only the computers which are actually used to this. They have their algorithms based on this formula. So, we have to basically teach the computer to calculate the determinant and if it's not equal to zero, how to inverse the matrix. And there are certain algorithms which are doing it. Known algorithms, which means that the system of linear equations can be actually solved using computers basically using the same formula. And well, that's basically the goal of the whole topic of the matrices which I wanted to present to you. It's very important to understand why actually we are learning matrices just because they are making our life easier in certain cases. Like in this particular case, the system of linear equations and its solution are made much more understandable and really very similar to the single equation. And that was the purpose of the whole theory to be developed. Well, that's it for today. I just wanted you to basically have the knowledge about this general solution of the system of n equations with this condition, obviously, which is in somewhat equivalent to a condition on a single linear equation. We were saying something like the coefficient a should not be equal to zero. If you have b is equal to a times x, a should not be equal to zero. So in case of the matrices, this role of zero plays the determinant of this matrix. It's the same kind of a... The determinant of the matrix plays exactly the same role as the value of this particular coefficient whether it's equal to zero or not equal to zero. And by the way, if you consider this particular single coefficient as a matrix of the size one by one, one row and one column, its determinant is equal to a. So basically the determinant not equal to zero is not only a good rule for a system of just any n equations with n unknown but also one equation with one unknown. If you can consider this as a matrix which has dimension of one by one and this is the column vector one by one this is the column of unknowns which is also one by one. Okay, now that's it. I have obviously notes for this lecture which basically explain everything in a written format. I do suggest you to go through these notes as well. And as usually, try to go to unisor.com to become a registered student. You would need a supervisor or a parent who would enroll you in certain classes and that would allow you to get through exams for instance. And basically topic by topic you can master by doing all these exams and your supervisor or a parent will consider this topic as completed and enroll you in the next topic, etc. So this is intended as a process basically not just one single lecture which you might find on YouTube and watch. Alright, so that's it. Thanks very much and good luck.