Transcript for:
Understanding LU Decomposition Method

Hello and welcome to Ganesh Institute channel. So today we are going to solve a system of linear equation by LU decomposition method. So when I say LU decomposition method that means you have to split a matrix. into its lower triangular form and upper triangular form. And you have to just multiply it, alright? So, let's begin. You can see here is a system of linear equation and the values for which you have to solve it. x1 x2 and x3 so what you need to do you when we do by matrix inversion method we have to take ax is equals to B right this is as similar as that the only difference is you have to split a matrix into L and Q all right and then substitute the value of a here Okay, so let's begin it. So A, you know the matrix A is the coefficient of variables. So 1, 1, 1, 4, 3, minus 1, 3. Make sure you are taking the right order. The coefficient of x1 here, if any of the coefficient is missing that means you have to take the value as 0. So the coefficient of x2 here and coefficient of x3 here. Sometimes questions mess up with the order. So you have to make sure that order is right. So this is A. Your x is what? The values for which you have to find out. So x1, x2, x3 and what is b? You're right inside 164. Alright, so a is lu. So let me tell you what is l and what is u. Your L is lower triangular matrix. That means upper triangle would be 0. The elements of our upper triangle would be 0. So 1, 1, 1. And these are 0s. Now these three. terms you have to fill so you know what is it second row first column so this is 2 1 third row first column 3 1 and 3 2 okay then your u for u because it is upper triangular matrix you have to take lower triangle as 0 rest of the element this is first row first column because these are the places where you have to put your elements in so u 1 1 u 1 2 u 1 3 This 1 1 1 2 signifies its position. U first row first column, first row second column, first row third column. Then U 2 2, U 2 3 and U 3 3. Now solve for all these values. This is all okay. Multiply first row, see first row with first column. What is it? this would be my plan with this so u11 rest of becomes 0 then u12 first row third column u13 right then second row first column so see second row first column would be l21 u11 right second row second column so l21 u12 second row second column then U22 and this would become 0. Then second row third column U13 L21 then this U23 and this would become 0. Then third row first column L31 U11 this would become 0. Third row second column L31 U12 plus L32 U22, this would become 0. Then third row, third column. So L31, U13 plus L32, U23 plus U33. Right? Now compare all of the elements with their respective positions. So U11 is 1, U12 is 1, U13 is 1. Right? Now here, L21 U11 is 4, L21 U12 plus U2 is 3, U13 L21 plus U23 is minus 1. okay and then L3 this is L3 1 right so L3 1 U1 1 is 3 L3 1 U1 2 plus L3 2 U2 2 is 5 then L3 1 U1 3 L3 2 U2 3 plus U3 3 is 3 Now get all the values for these variables. So u11 is 1. So L21 becomes 4 divided by 1 is 4. Alright. Now L21 is 4. u12 is 1. So u22 becomes 4 times 1 is 4. 3 minus 4 is minus 1. Right. Then u13 is 1. L21, let's find out the value of here. L21 is 4, U23 is minus 1, so U23 becomes minus 1 minus 4 is minus 5. Now U11 is 1, so L31 becomes 3, L31 is 3, U12 is 1, L32 we have to find out. and u22 is minus 1 so 5 minus 3 is 2 and this is here minus 2 now l31 is 3 u13 is 1 l32 is minus 2 u23 is minus 5 plus u33 3 times 1 is 3 minus minus plus right So u3 becomes 10. That is also minus 10. Right? So you have got all these values. Now substitute. So you have got your lower triangular matrix and upper triangular matrix. LU. Right? If you substitute or put the value of a as LU in this and let us suppose that your ux something called Y. How? Let Ux is Y where Y is a matrix having the elements Y1, Y2, Y3. Okay? So what you have to do? This is U. What is your U? See, this is your U. U11 which is 1, 0, 0. U12 which is 1. u22 is minus 1 this is 0 u13 is 1 u23 is minus 5 and u33 is u33 is minus 10 this is your u you have taken your ux as y right so now your equation is this ly equals b right so your l is what is your l 1, L21 is 4, L31 is 3, 0, 1, L32 is minus 2, 0, 0, 1. This is your L, your Y is what? Y1, Y2, Y3 is equals to B, which is what? 164. So from here you can find out the value of L. y1, y2, y3, what it would be? First row, first column. So y1 is 1, right? See, first row, first column, this is y1, this is 4y1 plus y2 equals 6. So your y1 is what? 1, 4 times 1 is 4, 6 minus 4 is 2, right? And what is your y3? So 3y1. minus 2y2 plus y3 equals 4, right? I hope you can see it. So 3, y1, 3 times 1 is 1, minus 2y2 is 4. So what you have got? 4 minus 3 is minus 1, 4 plus 1, right? You have got your y matrix. You have got your y matrix as 1, 2 and 5. Right? So if you substitute here, your value of u is this. X is X1, X2, X3 and Y is what? 1, 2, 5. Now you can find out the value of X1, X2, X3. How? Let me solve it here. So, first row, first column. X1 plus X2 plus X3 equals 1. Second rows, this is second row, then first column. So 0 times x1 is 0, minus 1x2, minus 5x3 equals 2. And then third row, then first column, this is 0, this is 0, and this is minus 10x3 equals 5. So from here, your x3 is 5 by 10, that means 1 by 2. From here, your x3 is minus 1 by 2, so minus minus. plus 5 by 2 equals 2. So your x2 becomes 5 by 2. See, take this x2 to right hand side and bring this 2 onto left hand side. So 2 times 2 is 4. 5 minus 4 is 1. So your x2 becomes 1 by 2. Right? And now it comes to x1. So x1 is 1 minus x2 minus x3. So x2 is 1 by 2 minus x3 minus minus plus. So this is cancelled. What is x? 1. So you can see your values of x1, x2, x3 are 1, 1 by 2 and minus 1 by 2 respectively. I know you might be thinking of that, okay, with this matrix inversion method, we could have solved it in much easier way. But you know what guys, question has asked specially, this is I think the question from 2016 December question paper of BSE and question has specially asked solve it via or through LU decomposition method. Then you have to follow what question is asking for right. So that's why you must know how you can find out the value by splitting the matrix into L and U and then putting it find out the value of these variables. putting it back into these forms and then consider this ax is equals to b form put the value of a as lu consider this as y find out the variables of y and then find through that the value of x i hope you understand it and if so then don't forget to like share and subscribe to my channel i'm really sorry guys that i am not monotonous in my job but i should be I will definitely be making finger cross some more videos in coming weekend. So take care till then bye bye.