Transcript for:
Understanding Condition Numbers in Matrices

hello everyone welcome to the next lecture on the numerical analysis today we will discuss about condition number which is related to The Matrix no myself Dr harishkar you can simply follow my YouTube channel where you can find the various lecture on the numerical analysis so as we have discussed and we all knows how you can solve the system of the equation ax is going to be there are several methods first of all you have know about that I you can solve this by using the direct method but how you can solve this system when you are trying to move on the nomadically then which are categorized into the two one one is equal as the direct method second is called as the iterative method and this method is also called as indirect method and which are the classification of here but before solving this solution of this system we must know about that there are there exists many linear system axis B whose Solutions are not stable what is the meaning of that if you simply perturb the values in b or in the value of a or in the both then we we will not get a stable solution for example if I consider this system then you all knows how you can solve this system of the equation you can simply find the inverse of the Matrix a this is my a you can find the inverse of the Matrix a and then multiply this by B you will get the solution as here find that's a very simple problem for you now if I simply perturb this right hand side Vector like here you can see I simply change 32 to the 32.1 23 to the 22.9 that is a there is a plus minus 1.1 difference between them you can also see you can 32.1 you can round off them to the 32 you can round off them to be the 32 or 22.9 is you can round off them to break 23. similarly 33.1 you can round off them to be the 33 and 30.9 you can round off them to be 31. so but can you make the round of as easy as look like say this one so you can see if I simply perturb the right hand side and if you find the solution of this problem then you will get the right answer as here and you can see which is very very far away from the original solution so what is the meaning of that if you simply round off these numbers to the original original linear system then the solution is very far away from the original one on the other end if I simply truncate or I can simply perturb The Matrix like of this you can see I can simply change this number to a to the 8.1 7 to the 7.25 to be the 5.04 and so on clearly says this Matrix is again becomes a when you round off them to be a certain accuracy like 4.99 is becomes a 5 6.99 becomes a 7 5.98 becomes a 6 9.98 becomes a 10 and so on all these numbers are converted into the original sequence and here I can preserve the B as a fixed number then if you find the solution of Again by using the axis a inverse B again you will be analyzed the solution is very far away from this original one one comma 1 comma one you can see there is a very very far away from the solution so what is the meaning of that a small change in the data either in the form of the b or in the form of the a will change the result drastically fine so what is the meaning of that you can't truncate or you can't round off them to the any number until unless you will get some desired accuracy so what is the meaning of that it means the system of the equation is a very sensitive to the round of error like as I Define you the two example you can simply round off them it is approximately to be the same system but it is a very very sensitive to the solution as you can see from these cases so what is the meaning of that so it means we can get a different solution when you get a rounding off to the desired or the different number of the decimal digits so why this happening the question arises is why this happening so this problem is occurring in The Matrix because of the badly condition what is the meaning of the badly conditions so this badly condition is basically categorized into the two category one is called as the ill condition foreign when you can say any of the Matrix a or system ax is going to be is set to the ill condition or the well condition so for that we need some results so what is that result is so if I look at again these two examples here I change the value of the B only so in all these cases whether you can change the b or you can change the a as I discussed earlier all these cases will leads to the ill condition what is the meaning of the ill condition when when you get a drastic change when you get a drastic change in the solution when you get a drastic change in the solution then the system is called as the ill condition and you can see if I consider simply changing the B and you can see the solutions are drastically changed on the other hand if you get a solution like of This 1.01 1.2 1.0 and 0.99 you can see it's a very less change in the solution then we can say the solution is my well condition or the system is called as the well condition now what is the meaning of the ill condition how you can measure them because it's not an always easy you can solve the system by the perturbation but how you can measure the illness in less condition the measure of the Endless condition is given by this condition number and that's the lecture of this today's topic so that's what is the what is the use of the condition number is it can measure how much the strength of the ill condition in the system of the equation now in order to understand this condition let us explain in detail this concept of ill condition so as we have a system of the ax is going to be we can get a solution only when a is my invertible vectors that means determinant of a must be non-zero or you can say a inverse exist then as I told you there are two kind of the changes which we can get a solution either we can change the right hand side that is a b to the B plus small change and a to the small of Delta a so let's firstly discuss the case one so if you have the two system one is that ax is going to be original system and second is when you change the B to be the B plus Delta B the solution will be changed from X to X Plus Delta X fine then on the other hand if I change the Matrix a to the A Plus Delta B and keeping the B value as a preserve then the system will be changed from the X Plus Delta X then we can find what will be the error bound what is the maximum change in the error we can observe then the following inequality holds in the case one what is that Delta X this is this is nothing but my relative error fine this is nothing but my relative error of X this is the relative error of the B on the other hand if I change the Matrix a then we can get the solution in this form but how we can correlate with them so let's see explain in in the detail one so see first case I can I can prove this result in this couple of slides so that you can easily understand the result so let's say if I change the Matrix B to be the B plus Delta fine so now if I see you can see I this number is nothing but my X Plus Delta X fine this number is my B plus Small Change in the B so now if I open this bracket what will happen this becomes my a because you can open them now a is equal to ax is equal to B so it will be cancel out so this number becomes my a small change in the x is Small Change in the B because a is my invertible so you can find the a inverse of here then you can take any of the norm as per on your convenience you can take as Norm is as Max knob this is called as the max knob or it is also called as the maximum rho sum no fine that's on your choice so this is that by taking the norm on this so what is the meaning of that Norm of B is Norm of a into X so we all knows what is the property of the norm of a b Which is less than or equal to Norm of a norm of B so I can use this property here it is a norm of a into Norm of B so I can return like here from this same I can apply the norm definition here you will get this result why because you can see Norm of Delta X is from this case which is equal to Norm of this one fine then I can use this property product of the norm must be less than or equal to Norm of this then what you can do you can find the value of the norm of x from here what is the norm of the X from this it will be less than or equal to this one then I can see this is question number one this is equation number two I can multiply this equation number one and equation number 2 you will get this is the required expression what is that this is the relative error in X this is the relative error in the B and this is the case of the this is a bound this is a bound of relative error find when you Small Change in the when you perturb the right hand side vector okay second when you perturb the a matrix to the A Plus like here you can simply change a to be the eight plus one six to be the 5.98 and so on so this value this Matrix is called as a plus Delta a this is my X Plus Delta X and B is my same so I call as a p again I can open this bracket it is my ax plus a Delta X Plus so on so you will get this expression again ax will be cancel out so I can return like here a is my invertible Matrix so I can found the value of here again you can take the norm on the both side the first expression becomes my here by using this property now I can take the norm on the second side so this is the norm of a is Norm of minus a inverse of X Plus Delta X of Delta a now I can use this property what is the alpha here Alpha is my minus 1 so what is the mode of alpha in this case it is my plus 1 then in this case I use this property which is nothing but less than or equal to here again I can count the value of this or I I can find this number I can take X on the left hand side which comes to be here so again from 1 and 2 you can easily derive this equation that's again this is the error bound on this equation what is the meaning of that if it means if we simply take Delta of a that says changes in The Matrix a is very very small then it is not a reasonable or unreasonable to expect that this ratio is also closer to the relative F you can't say that so what is the conclusion of that so we can see there are the two different bounds on the system of the equations so from this system bounds we can see when you perturb the two systems we can see the relative error is bounded by the relative error of this this is a relative error change in the a this is the relative error change in the B so which is bounded by the relative error in the information multiply by this number you can see that both the numbers are same and this this result will motivate us to define the number called as the condition number is this number which is a common to the both side is called as the condition so if you have the invertible Matrix a and the Matrix Norm any of the Matrix Norm here then this Pro this quantity is called as the condition number with respect to the relative Norm this condition number is also denoted by K of a we can write like here what is that if K of a is large what is that it means if condition number is large it means the product of them is a large number so the condition number is large is when you Small Change in The Matrix a or small change in the vector B then it will produce a very large change in the system here that means the condition is L condition on the other hand when your system when the condition number is approximately same or approximately 1 or it will be the less than one then you can see the condition is well conditioned or system is called as the well condition what are the different form of the condition numbers based on the different Norm of the spec different Norm because this is my Norm it can be the norm of infinity or next Norm it can be of the spectral Norm it can be of Norm of 1 and many more are there so if I consider the spectral Norm that means it is on the L2 node fine or it is also called as including no fine then how you can find the norm of this so you can write like here and as we already discussed the vector Norms in our previous lectures which is quantity here where Lambda and mu are the largest and the smallest eigen value in the modulus of a star of a but if your Matrix a is hermitian or the real or the symmetric then we all knows a and the a star are same then we can say this number is nothing but my a square so the eigen value is nothing but my only Lambda over mu the largest and the smallest eigenvalue of this why because if I simply take this is the Lambda square and this is then scale will be cancel out we will get the same expression so what is the condition number is that it measures how the sensitivity of the system ax is equal to B meaning or how sensitivity with respect to the variation of the B and A so we can say the condition number is large whenever the conditioner is large the system is a ill condition whenever the condition number is a very small number then we can say it's a Well condition for example how you can find the condition number of the matrix by using the absolute sum row that means you are using this one this is a norm so what is the definition of that condition number is you have to hear so for that you need to to be the next Norm so how you can find of this by the definition of this you can take the absolute value of this row sum so this is the first row find comma you can find the absolute sum of the second nine plus 16 comma and so on for this third so the absolute sum of the first row is my 14 absolute sum of the second row is my 29 and so on so maximum value is my 50. in order to find the absolute sum of the a inverse we firstly find the a inverse we have the Matrix a you can find the inverse of this then what is that Norm of the a inverse maximum absolute row of this so what is the meaning of that it will be Plus 31 over 8 it's a minus but we take the absolute values is plus 44 by 8 plus 17 by 8. find comma similarly you can take the second row it's a 44 by 8 plus 56 by 8 and so on you will get as these are the sums means if you take the sum of the first row it is 92 by 8 if you take the sum of second it's a 115 it's a 44 by 8 then the maximum value will be 50. substitute both the values at here you will get this number as now clearly say this number is very large number so it means that this system is my ill condition so if you Small Change in the any of the number it will give you a very drastic change in the solution look at the another one find again we have considered same example here but now we are using the spectral Norm that means we are taking the L2 Norm it is also called as the including knot so as the Matrix is real and symmetric that means if a is equal to a star or you can see a is equal to a transpose then the condition number is nothing but Lambda or mu where mu and Lambda are the minimum and the maximum eigen value how you can find the eigenvalue I can start from here we can find this value where I is my 3 cross 3 Matrix you can expand this determinant you can get this equation so you can use your calculator you can find the cubic equation Roots which comes to be here or you can find the roots by using the bisection method by using the regular policy method secant method fixed Point method Newton absent method or any other now from this case can you find the value of what is what is the maximum absolute value this is my maximum value and what is the minimum absolute value what is the minimum value is my here in terms of the modulus so this is my mu this is my Lambda so I can substitute here you will get as the condition number this so clearly say this is again a very large number so we can say this is again a ill condition problem look at this one so you can see uh this is if you round the round of them to be the one then the determinant will be zero so we can see whether it's a ill condition or not so since the norm is not given to you so I can simply consider it as a infinity so what is the norm of infinity so we can take the maximum value of absolute sum of the first row absolute sum of the second row fine so what is the max value is 3.001 for finding the a inverse we can find the a inverse and then we can take the a inverse of this take the absolute sum of this so the absolute sum will be my 20 000. and the absolute sum will be 10 000.5 what is the maximum of this it's my 10 20 000 is here fine now you can substitute both the values at here you will get as 60 thousands of two Clearly say that which is a very large number so it means Small Change in the value of the a will give you a drastic effect of the solution look at this one find the condition of the Matrix a and then check whether and check when the Matrix a is said to be the ill condition so again we are using the same definition what is a norm of a Infinity so we can take the maximum of 1 plus mod of c and mod of C plus one so which one is the maximum since both are same so the maximum value will be same you can find the a inverse which comes to be here then what is the a inverse of this it will be the maximum of the first value will be 1 over 1 minus C Square not plus mod of C divided by 1 minus C Square comma similarly for a second you can get as here now you can see again both the numbers are same so what is that I can return as a minus of more c as a plus of theta now I can substitute both value here what is that this value becomes my square is my condition number now when it will be the ill condition means your condition number will be very large or it will be greater than one so when it will be the large number you can see when you take C either as a 1 or you can take C is by minus one in both the cases your condition number becomes my infinite that's very large number so you can see the possible value of the C is when you take c is either exactly one or the mod of C is approximately to be the one then the condition becomes my condition look at another example if you have the Matrix a which are depending upon the parameter Alpha you have to find the alpha so that condition number will be minimized and we are using the max node so this is the definition of the max Now by taking the infinity okay so you have the a you can find the a inverse find the max of a inverse so that's the sum of this so what is that of a of infinity maximum of sum of this values it is a 0.2 of this number and the sum of this will be my 2.5 fine so you can't say that this number is greater than because in depending upon the alpha so yours by using the max knob it will be here and similarly for this case you will get as this one now if I when it will be the minimum so I can substitute both the values in this equation you will get or you can see from here this number will definitely be a maximum because each quantity has a similar now I can substitute equation by 1 and equation number 2 in this equation fine then your target is to prove this will be the minimum how you can prove because I can simply firstly multiply this quantity in inside so I can return this number as Max of I can multiply 0.2 Alpha of this Alpha will be cancel so it is my 0.4 of this plus it will be when you multiply this it will be my point it will be my it's a 10 it's a 6. comma then I can multiply 2.5 with this quantity you will get as this expression fine now when it will be minimum the question arises is for what value of the alpha you can choose so that this will be minimum so this will be minimum only because we all knows that if I say this is my X this is my y well it will be minimum when X is equal to 1 because whenever X is less than y then you can say the minimum is my X but when you take X is greater than y the minimum will be y so this will be minimum only when both the numbers are 9 same so can you find the value of the Alpha from here you can simplify this and you will get the alpha as here then I can substitute this value of the alpha in here and you can take this maximum you will get the right answer as 11. now the last result is what is the upper bound of the relative air what is the meaning of that if you have the invertible Matrix a x star is my approximate solution of this R is my residual then the maximum Norm of this is my here or you can say if x is my non-zero then this quantity what is that this quantity is called as my relative f fine the the previous two results which I have explained that this is the relative change with respect to change in the b or a relative change with respect to the a but here this is a relative error with respect to the residual what is the meaning of that residual is error it's fine so look at that what is the meaning of the residual list if you have the system ax is going to be if I know X star is my approximate solution that means B minus ax is my error or call as the residue I can substitute the value of the B this is a so I can take Matrix a as a common so it will be x minus x dash then we need as a norm of this so we can Define as a is invertible because it is given so I can count as here then I can Target is to firstly prove this result so take the norm on both sides fine how you can sell that so it will be less than of Norm of this and Norm of this by using the vector Norm property Norm of this is less than of Norm of a norm of B and that's the quite proof of this result fine then how you can prove this one this is already similar I can take the norm of this Vector so what is the norm of this Vector is a norm of B is equal to Norm of ax and Norm of ax I can return as here so from this I can find the value of this so I can multiply the equation by 2 and equation number one you will get the simple maximum bound of this here what is the significance of this Norm we can see the counter exam if I say x star is my approximate solution of this system you can found the bound on the relative l what is that firstly you can start with the residue because we need this so I need to find the norm of R I need to find the norm of P Norm of B you can easily find that so what is the norm of B maximum value of this 9.7 fine can you find the norm of X star we know we don't know near the norm of X star we firstly find the value of x so we can start with the residue B we have a we have we can have a x star so you can substitute this value as here so what is the norm of R you can take the maximum value of the absolute so the absolute value is my 0.0820 and 0.1540 so this value will be my 0.1542 fine so this number we have already computed Norm of B we already computed from here Norm of B is my absolute value in the row sum that's a 7 9.7 then we have to find the norm of the a what is the norm of the a or D L over the max Norm you can take the row sum as a maximum so determinant of a is non-zero a inverse is now Define of this maximum of 3.9 plus 1.6 and the second is 6.8 plus 2.9 so the maximum value of this becomes my 9.7 similarly from here I can take the absolute sum of this plus this absolute sum of this so it becomes my twenty four point something so it is my here now I can substitute all these values in my this equation you will get as here so after the calculation you will get as this one so it means if you consider this system the maximum error Bound in the relative maximum bound of the relative is my 3.832 so this is the way you can learn about the concept of the condition number So based on this condition number we will try to explain you in the next lecture as the ghost elimination methods and the other lectures as well till then you can simply like share and comments on my video best of luck students happier