LU decomposition of matrix using column pivoting

659 Views Asked by At

I want to find the LU decomposition of the following matrix $A$ using Gauss algorithm and column pivoting. $$A=\begin{pmatrix}6 & 4 & 3 & 1\\ 1 & 1 & 0 & 2 \\ 2 & 3 & 1 & 6 \\ 1 & 3 & 7 & 3\end{pmatrix}$$ $6$ is the largest element of the first column, so we don't have to change something and then by applying the Gaussian algorithm we get $$\begin{pmatrix}6 & 4 & 3 & 1\\ 0 & \frac{1}{3} & -\frac{1}{2} & \frac{11}{6} \\ 0 & \frac{5}{3} & 0 & \frac{17}{3} \\ 0 & \frac{7}{3} & \frac{13}{2} & \frac{17}{6}\end{pmatrix}$$ Now the largest element of the submatrix is $\frac{7}{3}$, so we exchange the second and last row and we get $$\begin{pmatrix}6 & 4 & 3 & 1 \\ 0 & \frac{7}{3} & \frac{13}{2} & \frac{17}{6} \\ 0 & \frac{5}{3} & 0 & \frac{17}{3} \\ 0 & \frac{1}{3} & -\frac{1}{2} & \frac{11}{6}\end{pmatrix}$$ Applying again the Gaussian algorithm we get $$\begin{pmatrix}6 & 4 & 3 & 1 \\ 0 & \frac{7}{3} & \frac{13}{2} & \frac{17}{6} \\ 0 & 0 & -\frac{65}{14} & \frac{51}{14} \\ 0 & 0 & -\frac{10}{7} & \frac{10}{7}\end{pmatrix}$$ After one more step of Gaussian algorithm we get $$\begin{pmatrix}6 & 4 & 3 & 1 \\ 0 & \frac{7}{3} & \frac{13}{2} & \frac{17}{6} \\ 0 & 0 & -\frac{65}{14} & \frac{51}{14} \\ 0 & 0 & 0 & \frac{4}{13}\end{pmatrix}$$ Now the matrix is in row echelon form.

The $U$ matrix of the decomposition is the one that we got, i.e. $$U=\begin{pmatrix}6 & 4 & 3 & 1 \\ 0 & \frac{7}{3} & \frac{13}{2} & \frac{17}{6} \\ 0 & 0 & -\frac{65}{14} & \frac{51}{14} \\ 0 & 0 & 0 & \frac{4}{13}\end{pmatrix}$$ The matrix $L$ is $$P\cdot P_0\cdot G_1^{-1}\cdot P_1\cdot G_2^{-1}\cdot P_2\cdot G_3^{-1}$$ where $$P_0=P_2=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix}, \ P_1=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0\end{pmatrix}$$ or not? Then we get $$P=P_2\cdot P_1\cdot P_0=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0\end{pmatrix}$$ Is then the matrix $L=\begin{pmatrix}1 & 0 & 0 & 0 \\ \frac{1}{6} & 1 & 0 & 0 \\\frac{1}{3} & \frac{5}{7} & 1 & 0 \\ \frac{1}{6} & \frac{1}{7} & -\frac{4}{13} & 1\end{pmatrix}$ ?

But it doesn't hold that $LU=PA$, does it? So, have I done something wrong? Are the matrices $P_i$ maybe wrong?