2
$\begingroup$

I am not sure how to deal with the L with we do row exchange in PA = LU decomposition. Here's my example:

$ A = \left[ {\begin{array}{ccc} 1 & 1 & 1\\ 0 & 0 & 1\\ 2 & 3 & 4\\ \end{array} } \right] $

Step 1: Swap row 1 and row 3

$ U = \left[ \begin{array}{ccc} 2 & 3 & 4\\ 0 & 0 & 1\\ 1 & 1 & 1\\ \end{array} \right] $

$ P = \left[ \begin{array}{ccc} 0 & 0 & 1\\ 0 & 1 & 0\\ 1 & 0 & 0\\ \end{array} \right] $

Step 2: row 3 <-- (-1/2) * row 1 + row 3

$ U = \left[ \begin{array}{ccc} 2 & 3 & 4\\ 0 & 0 & 1\\ 0 & 1 & 2\\ \end{array} \right] $

$ P = \left[ \begin{array}{ccc} 0 & 0 & 1\\ 0 & 1 & 0\\ 1 & 0 & 0\\ \end{array} \right] $

Step 3: swap row 2 and row 3

$ U = \left[ \begin{array}{ccc} 2 & 3 & 4\\ 0 & 1 & 2\\ 0 & 0 & 1\\ \end{array} \right] $

$ P = \left[ \begin{array}{ccc} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0\\ \end{array} \right] $

Therefore: $ L = \left[ \begin{array}{ccc} 1 & 0 & 0\\ 1/2 & 1 & 0\\ 0 & 0 & 1\\ \end{array} \right] $ The reason why I build L at the last step, is because we are sure the order of the rows after the row swaps so we can plug the low diagonal elements back to L. Element (2,1) is 1/2 because of step 2, the rest of lower diagonals are 0 because in row 3 elements (3,1) and (3,2) are originally 0s.

But I tried to use L * U but it doesn't equal to L*A. Could someone explain why I am wrong? Thanks!

$\endgroup$
3
$\begingroup$

When you check you answer you have to check it by PA = LU.

What I did first was put A in an upper triangle.

$ A = \left[ {\begin{array}{ccc} 1 & 1 & 1\\ 0 & 0 & 1\\ 2 & 3 & 4\\ \end{array} } \right] $

Step 1: $r_3$-2$r_1$→$r_3$

$ = \left[ \begin{array}{ccc} 1 & 1 & 1\\ 0 & 0 & 1\\ 0 & 1 & 2\\ \end{array} \right] $

Step 2: $r_3$⟷$r_2$

$ = \left[ \begin{array}{ccc} 1 & 1 & 1\\ 0 & 1 & 2\\ 0 & 0 & 1\\ \end{array} \right] $ $$\\$$ Now, every row swap you did on matrix A you to that to a 3x3 identity matrix because A is a 3x3 matrix.

$ P = \left[ \begin{array}{ccc} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\ \end{array} \right] $

Step 3: $r_3$⟷$r_2$

$ = \left[ \begin{array}{ccc} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0\\ \end{array} \right] $ $$\\$$ Now form C=PA because it will have an LU decomposition.

$$ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix} \times \begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \\ 2 & 3 & 4 \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 \\ 2 & 3 & 4 \\ 0 & 0 & 1 \end{bmatrix}$$ $$\\$$ Now you find the LU decomposition on matrix C. And you get:

$ U = \left[ {\begin{array}{ccc} 1 & 1 & 1\\ 0 & 1 & 2\\ 0 & 0 & 1\\ \end{array} } \right] $

$ L = \left[ {\begin{array}{ccc} 1 & 0 & 0\\ 2 & 1 & 0\\ 0 & 0 & 1\\ \end{array} } \right] $

$\endgroup$
  • $\begingroup$ Very clear answer, thank you! $\endgroup$ – munmunbb Jun 25 '17 at 21:02
  • $\begingroup$ I think you made a typo in your answer and wrote 0 instead of 1 in u22 field of the U matrix in the final C=LU equation. $\endgroup$ – kalmor Nov 11 '17 at 15:00
  • $\begingroup$ but do anyone know, why we do this PA=LU decomposition? in which cases one should do (use) it? $\endgroup$ – ZelelB Jun 20 '18 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.