Skip to content

2.3-exam1-2004

Quiz 1, 2004 · Section 2.3: Matrix Computations and A = LU Source: exam1_1.pdf, pp. 99, 108

Problem

1 Let

\[ A = \begin{bmatrix} 2 & 2 & 2 \\ 4 & 3 & 1 \\ -2 & -1 & 4 \end{bmatrix}. \]

(a) Compute an LDU factorization of \(A\) if one exists.

(b) Give all solutions to \(Ax = b\) where \(b = \begin{bmatrix} 2 \\ -3 \\ 11 \end{bmatrix}\).

Solution (a) \[ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ -2 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 2 & 2 & 2 \\ 4 & 3 & 1 \\ -2 & -1 & 4 \end{bmatrix} = \begin{bmatrix} 2 & 2 & 2 \\ 0 & -1 & -3 \\ 0 & 1 & 6 \end{bmatrix} \qquad (E_{31},\ E_{21},\ A), \] \[ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix} \begin{bmatrix} 2 & 2 & 2 \\ 0 & -1 & -3 \\ 0 & 1 & 6 \end{bmatrix} = \begin{bmatrix} 2 & 2 & 2 \\ 0 & -1 & -3 \\ 0 & 0 & 3 \end{bmatrix} \qquad (E_{32}). \] So for the \(A = LU\) decomposition we have \[ L = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \qquad \text{and} \qquad U = \begin{bmatrix} 2 & 2 & 2 \\ 0 & -1 & -3 \\ 0 & 0 & 3 \end{bmatrix}. \] But this is not the \(U\) we want for the \(A = LDU\) decomposition; for that, we factor out the pivot values of the old \(U\) and put them in \(D\). In this way we get \[ \begin{bmatrix} 2 & 2 & 2 \\ 4 & 3 & 1 \\ -2 & -1 & 4 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \begin{bmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 3 \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 3 \\ 0 & 0 & 1 \end{bmatrix}. \] (b) The quick way to do this is by forward and backward substitution, using the result of the previous part. We want \(Ax = b\), that is, \(LDUx = b\). Setting \(DUx = c\), we first solve \(Lc = b\) for \(c\), and then \(DUx = c\) for \(x\). Now \(Lc = b\) is \[ \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \\ c_3 \end{bmatrix} = \begin{bmatrix} 2 \\ -3 \\ 11 \end{bmatrix}, \] so clearly \(c_1 = 2\), so \(c_2 = -7\), and so \(c_3 = 6\). With that, \(DUx = c\) becomes \[ \begin{bmatrix} 2 & 2 & 2 \\ 0 & -1 & -3 \\ 0 & 0 & 3 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 2 \\ -7 \\ 6 \end{bmatrix}, \] and hence we get \(x_3 = 2\), so \(x_2 = 1\), so finally \(x_1 = -2\). Hence, the one and only solution to \(Ax = b\) is \[ x = \begin{bmatrix} -2 \\ 1 \\ 2 \end{bmatrix}. \]

Keywords: LDU factorization, LU factorization, back substitution, pivots