Uniqueness of the LUP decomposition

linear algebralu decompositionnumerical methods

Given the matrix $$A=\begin{pmatrix} 0 & 0 & 2 \\ 1 & 2 & 3 \\ 2 & 2 & 3 \end{pmatrix},$$ I want to compute the LUP decomposition $PA=LU$.

Here's what I got:
$$P=\begin{pmatrix} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{pmatrix}$$
$$L=\begin{pmatrix} 1 & 0 & 0 \\ 1/2 & 1 & 0 \\ 0 & 0 & 1\end{pmatrix} $$
$$U=\begin{pmatrix} 2 & 2 & 3 \\ 0 & 1 & 1.5 \\ 0 & 0& 2 \end{pmatrix}$$

WolframAlpha says it's correct.

The solution says:

$$ \begin{array}{l}\left(\begin{array}{lll}0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0\end{array}\right) \cdot\left(\begin{array}{lll}0 & 0 & 2 \\ 1 & 2 & 3 \\ 2 & 2 & 3\end{array}\right)=\left(\begin{array}{lll}1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & 0 & 1\end{array}\right) \cdot\left(\begin{array}{ccc}1 & 2 & 3 \\ 0 & -2 & -3 \\ 0 & 0 & 2\end{array}\right) \\ =P \cdot A=L \cdot R\end{array}$$

Again, WolframAlpha says it's correct.

Both seem to work? My permutation matrix switches the third and the first row, the solution the first and the second. The permutation matrix in the solution manual switches the second and the first row.

When I compute the LU decomposition using WolframAlpha, I get the solution of the book … see here.

What's going on here?

Best Answer

Your use of the definite article in “the LUP decomposition” is unwarranted. LUP decompositions aren’t unique (an answer to Is the permutation matrix P of PLU decomposition unique? shows that it’s not even unique if $L$ or $U$ is required to have $1$s on the diagonal), so no explanation is required for the fact that you found more than one LUP decomposition for a given matrix.

Related Question