# LU decomposition with zeros on diagonal

How to do LU decomposition with unit lower triangular matrix L, in case a decomposed matrix has zeros on diagonal? This is obviously possible for positive defined matrix.

For example suppose instead of 4 we have 0 here:

then u11 = 0 and determinant of the right part = 0.

What is limitations of LU decomposition?

• The short answer: You need to multiply by a permutation matrix representing the row operations required as part of Gaussian elimination. Read about pivoting in the wikipedia article: en.wikipedia.org/wiki/LU_decomposition – Harald Hanche-Olsen Dec 13 '13 at 21:04
• @klm123: In this example, the diagonal entries would not be zero. – Amzoti Dec 13 '13 at 21:33
• @Amzoti, probably you missed "For example suppose instead of 4 we have 0 here"? – klm123 Dec 13 '13 at 21:46
• @klm123: My apologies for missing that, but I also answered that the LU would not exist in this case given that the determinant of the first leading submatrix is zero. In that case, the pivoting strategies and permutation matrices may be able to solve the problem. Regards – Amzoti Dec 13 '13 at 21:48

We have:

$$\begin{bmatrix}4 & 3\\6 & 3\end{bmatrix} = \begin{bmatrix} l_{11} & 0\\l_{21} & l_{22}\end{bmatrix} \begin{bmatrix}u_{11} & u_{12}\\0 & u_{22}\end{bmatrix}$$

This gives us in order of calculation:

• $l_{11} = l_{22} = 1$
• $u_{11} = 4$
• $l_{21} = \dfrac{3}{2}$
• $u_{12} = 3$
• $u_{22} = -\dfrac{3}{2}$

In this example, we do not have zeros in the diagonal.

An invertible matrix $A$ has an $LU$ decomposition provided that all its leading submatrices have non-zero determinants.

You can see other types of LU decompositions / examples in my answer here asking what are pivot numbers in LU decomposition? please explain me in an example.