LU Decomposition

154 Views Asked by At

I'm having trouble understanding which answer is correct.

I'm currently reading a paper: lecture 12 - They give the following example:

Let:

$$ A = \begin{bmatrix} 1&2&3 \\ 2&5&12 \\ 0&2&10 \end{bmatrix} $$

Then they say state that L and U are given as:

$$ L =\begin{pmatrix} 1&0&0 \\ 2&1&0 \\ 0&-2&1 \end{pmatrix} $$ $$ U = \begin{pmatrix} 1&-2&3 \\ 20&-1&6 \\ 0&0&2 \end{pmatrix} $$

Using an online calculator bluebit they give:

$$ L =\begin{pmatrix} 1&0&0 \\ 0&1&0 \\ 0.5&-0.250&1 \end{pmatrix} $$ $$ U = \begin{pmatrix} 2&5&12 \\ 0&2&10 \\ 0&0&-0.500 \end{pmatrix} $$

Which one is therefore right in this instance? I need to calculate the determinant of a large matrix and therefore trying to implement the LU Decomposition and are using these two as a guide and want to know if it's right.

1

There are 1 best solutions below

1
On BEST ANSWER

The first one is correct when the typos are fixed: $$ \overbrace{\begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & -2 & 1 \\ \end{bmatrix}}^L \overbrace{\begin{bmatrix} 1 & -2 & 3 \\ 0 & -1 & 6 \\ 0 & 0 & 2 \\ \end{bmatrix}}^U = \overbrace{\begin{bmatrix} 1 & -2 & 3 \\ 2 & -5 & 12 \\ 0 & 2 & -10 \\ \end{bmatrix}}^A$$ as in the lecture notes.

I believe there's going to be a combination of bugs with the software approach; likely involving typos, but also the LU decomposition also involves a permutation matrix. It instead gives:

$$\begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0.5 & 0.25 & 1 \\ \end{bmatrix} \begin{bmatrix} 2 & -5 & 12 \\ 0 & 2 & -10 \\ 0 & 0 & -0.5 \\ \end{bmatrix}=A$$ which is probably not the decomposition you want.