Artificial intelligent assistant

Does LU factorization needs pivoting? Today I have a numerical methods exam,and of course i tried some exercices, but today I heard something that messed my mind, I always do LU fact. Like this : I take Lower triangular matrix, and then upper one with the 1s on the diameter, I calculate the product of two matrices and set equal to the matrix that I want to factorize, so does this process need a pivoting? If yes how? If we move a row in our original matrix it will affect our calculations and of course we get a wrong answer. Thanks for your help.

_If_ there are $L,U$ such that $A=LU$, then you find them without pivoting.

However, not all (invertible) matrices admit an LU decomposition. For this case there os a related method with pivoting, sometimes called LUP.

See the Wikipedia page of LU decomposition for details on.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7f3d386ab6e96640bb58426a50354956