Skip to main content
Mathematics LibreTexts

2.7E: LU-Factorization Exercises

  • Page ID
    132806
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Exercises for 1

    solutions

    2

    Find an LU-factorization of the following matrices.

    1. \(\left[ \begin{array}{rrrrr} 2 & 6 & -2 & 0 & 2 \\ 3 & 9 & -3 & 3 & 1 \\ -1 & -3 & 1 & -3 & 1 \end{array} \right]\)
    2. \(\left[ \begin{array}{rrr} 2 & 4 & 2 \\ 1 & -1 & 3 \\ -1 & 7 & -7 \end{array} \right]\)
    3. \(\left[ \begin{array}{rrrrr} 2 & 6 & -2 & 0 & 2 \\ 1 & 5 & -1 & 2 & 5 \\ 3 & 7 & -3 & -2 & 5 \\ -1 & -1 & 1 & 2 & 3 \end{array} \right]\)
    4. \(\left[ \begin{array}{rrrrr} -1 & -3 & 1 & 0 & -1 \\ 1 & 4 & 1 & 1 & 1 \\ 1 & 2 & -3 & -1 & 1 \\ 0 & -2 & -4 & -2 & 0 \end{array} \right]\)
    5. \(\left[ \begin{array}{rrrrrr} 2 & 2 & 4 & 6 & 0 & 2 \\ 1 & -1 & 2 & 1 & 3 & 1 \\ -2 & 2 & -4 & -1 & 1 & 6 \\ 0 & 2 & 0 & 3 & 4 & 8 \\ -2 & 4 & -4 & 1 & -2 & 6 \end{array} \right]\)
    6. \(\left[ \begin{array}{rrrrr} 2 & 2 & -2 & 4 & 2 \\ 1 & -1 & 0 & 2 & 1 \\ 3 & 1 & -2 & 6 & 3 \\ 1 & 3 & -2 & 2 & 1 \end{array} \right]\)
    1. \(\left[ \begin{array}{rrr} 2 & 0 & 0 \\ 1 & -3 & 0 \\ -1 & 9 & 1 \end{array} \right] \left[ \def\arraystretch{1.5}\begin{array}{rrr} 1 & 2 & 1 \\ 0 & 1 & -\frac{2}{3} \\ 0 & 0 & 0 \end{array} \right]\)
    2. \(\left[ \begin{array}{rrrr} -1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & -1 & 1 & 0 \\ 0 & -2 & 0 & 1 \end{array} \right] \left[ \begin{array}{rrrrr} 1 & 3 & -1 & 0 & 1 \\ 0 & 1 & 2 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{array} \right]\)
    3. \(\left[ \begin{array}{rrrr} 2 & 0 & 0 & 0 \\ 1 & -2 & 0 & 0 \\ 3 & -2 & 1 & 0 \\ 0 & 2 & 0 & 1 \end{array} \right] \left[ \def\arraystretch{1.5}\begin{array}{rrrrr} 1 & 1 & -1 & 2 & 1 \\ 0 & 1 & -\frac{1}{2} & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{array} \right]\)

    Find a permutation matrix \(P\) and an LU-factorization of \(PA\) if \(A\) is:

    \(\left[ \begin{array}{rrr} 0 & 0 & 2 \\ 0 & -1 & 4 \\ 3 & 5 & 1 \end{array} \right]\) \(\left[ \begin{array}{rrr} 0 & -1 & 2 \\ 0 & 0 & 4 \\ -1 & 2 & 1 \end{array} \right]\) \(\left[ \begin{array}{rrrrr} 0 & -1 & 2 & 1 & 3\\ -1 & 1 & 3 & 1 & 4 \\ 1 & -1 & -3 & 6 & 2 \\ 2 & -2 & -4 & 1 & 0 \end{array} \right]\) \(\left[ \begin{array}{rrrr} -1 & -2 & 3 & 0 \\ 2 & 4 & -6 & 5 \\ 1 & 1 & -1 & 3 \\ 2 & 5 & -10 & 1 \end{array} \right]\)

    1. \(P = \left[ \begin{array}{rrr} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{array} \right]\)
      \(PA = \left[ \begin{array}{rrr} -1 & 2 & 1 \\ 0 & -1 & 2 \\ 0 & 0 & 4 \end{array} \right]\)
      \({} = \left[ \begin{array}{rrr} -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 4 \end{array} \right] \left[ \begin{array}{rrr} 1 & -2 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{array} \right]\)

    2. \(P = \left[ \begin{array}{rrrr} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{array} \right]\)
      \(PA = \left[ \begin{array}{rrrr} -1 & -2 & 3 & 0 \\ 1 & 1 & -1 & 3 \\ 2 & 5 & -10 & 1 \\ 2 & 4 & -6 & 5 \end{array} \right]\)
      \({} = \left[ \begin{array}{rrrr} -1 & 0 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 2 & 1 & -2 & 0 \\ 2 & 0 & 0 & 5 \end{array} \right] \left[ \begin{array}{rrrr} 1 & 2 & -3 & 0 \\ 0 & 1 & -2 & -3 \\ 0 & 0 & 1 & -2 \\ 0 & 0 & 0 & 1 \end{array} \right]\)

    In each case use the given LU-decomposition of \(A\) to solve the system \(A\mathbf{x} = \mathbf{b}\) by finding \(\mathbf{y}\) such that \(L\mathbf{y} = \mathbf{b}\), and then \(\mathbf{x}\) such that \(U\mathbf{x} = \mathbf{y}\):

    1. \(A = \left[ \begin{array}{rrr} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 1 & 1 & 3 \end{array} \right] \left[ \begin{array}{rrrr} 1 & 0 & 0 & 1\\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 1 \end{array} \right]\);
      \(\mathbf{b} = \left[ \begin{array}{r} 1 \\ -1 \\ 2 \end{array} \right]\)

    2. \(A = \left[ \begin{array}{rrr} 2 & 0 & 0 \\ 1 & 3 & 0 \\ -1 & 2 & 1 \end{array} \right] \left[ \begin{array}{rrrr} 1 & 1 & 0 & -1\\ 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right]\);
      \(\mathbf{b} = \left[ \begin{array}{r} -2 \\ -1 \\ 1 \end{array} \right]\)

    3. \(A = \left[ \begin{array}{rrrr} -2 & 0 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ -1 & 0 & 2 & 0 \\ 0 & 1 & 0 & 2 \end{array} \right] \left[ \def\arraystretch{1.5}\begin{array}{rrrr} 1 & -1 & 2 & 1 \\ 0 & 1 & 1 & -4 \\ 0 & 0 & 1 & -\frac{1}{2} \\ 0 & 0 & 0 & 1 \end{array} \right]\);
      \(\mathbf{b} = \left[ \begin{array}{r} 1 \\ -1 \\ 2 \\ 0 \end{array} \right]\)

    4. \(A = \left[ \begin{array}{rrrr} 2 & 0 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ -1 & 1 & 2 & 0 \\ 3 & 0 & 1 & -1 \end{array} \right] \left[ \begin{array}{rrrr} 1 & -1 & 0 & 1 \\ 0 & 1 & -2 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right]\);
      \(\mathbf{b} = \left[ \begin{array}{r} 4 \\ -6 \\ 4 \\ 5 \end{array} \right]\)

    1. \(\mathbf{y} = \left[ \begin{array}{r} -1 \\ 0 \\ 0 \end{array} \right] \mathbf{x} = \left[ \begin{array}{c} -1 + 2t \\ -t \\ s \\ t \end{array} \right] s\) and \(t\) arbitrary
    2. \(\mathbf{y} = \left[ \begin{array}{r} 2 \\ 8 \\ -1 \\ 0 \end{array} \right] \mathbf{x} = \left[ \begin{array}{c} 8 - 2t \\ 6 - t \\ -1 - t \\ t \end{array} \right] t\) arbitrary

    [ex:ex2_7_4] Show that \(\left[ \begin{array}{rr} 0 & 1 \\ 1 & 0 \end{array} \right] = LU\) is impossible where \(L\) is lower triangular and \(U\) is upper triangular.

    Show that we can accomplish any row interchange by using only row operations of other types.

    \(\left[ \begin{array}{c} R_{1} \\ R_{2} \end{array} \right] \rightarrow \left[ \begin{array}{c} R_{1} + R_{2} \\ R_{2} \end{array} \right] \rightarrow \left[ \begin{array}{c} R_{1} + R_{2} \\ -R_{1} \end{array} \right] \rightarrow \left[ \begin{array}{c} R_{2} \\ -R_{1} \end{array} \right] \rightarrow \left[ \begin{array}{c} R_{2} \\ R_{1} \end{array} \right]\)

    1. Let \(L\) and \(L_{1}\) be invertible lower triangular matrices, and let \(U\) and \(U_{1}\) be invertible upper triangular matrices. Show that \(LU = L_{1}U_{1}\) if and only if there exists an invertible diagonal matrix \(D\) such that \(L_{1} = LD\) and \(U_{1} = D^{-1}U\). [Hint: Scrutinize \(L^{-1}L_{1} = UU_{1}^{-1}\).]
    2. Use part (a) to prove Theorem [thm:006697] in the case that \(A\) is invertible.
    1. Let \(A = LU = L_{1}U_{1}\) be LU-factorizations of the invertible matrix \(A\). Then \(U\) and \(U_{1}\) have no row of zeros and so (being row-echelon) are upper triangular with \(1\)’s on the main diagonal. Thus, using (a.), the diagonal matrix \(D = UU_{1}^{-1}\) has \(1\)’s on the main diagonal. Thus \(D = I\), \(U = U_{1}\), and \(L = L_{1}\).

    [ex:ex2_7_7] Prove Lemma [lem:006547](1). [Hint: Use block multiplication and induction.]

    If \(A = \left[ \begin{array}{cc} a & 0 \\ X & A_{1} \end{array} \right]\) and \(B = \left[ \begin{array}{cc} b & 0 \\ Y & B_{1} \end{array} \right]\) in block form, then \(AB = \left[ \begin{array}{cc} ab & 0 \\ Xb + A_{1}Y & A_{1}B_{1} \end{array} \right]\), and \(A_{1}B_{1}\) is lower triangular by induction.

    [ex:ex2_7_8] Prove Lemma [lem:006547](2). [Hint: Use block multiplication and induction.]

    A triangular matrix is called unit triangular if it is square and every main diagonal element is a \(1\).

    1. If \(A\) can be carried by the gaussian algorithm to row-echelon form using no row interchanges, show that \(A = LU\) where \(L\) is unit lower triangular and \(U\) is upper triangular.
    2. Show that the factorization in (a.) is unique.
    1. Let \(A = LU = L_{1}U_{1}\) be two such factorizations. Then \(UU_{1}^{-1} = L^{-1}L_{1}\); write this matrix as \(D = UU_{1}^{-1} = L^{-1}L_{1}\). Then \(D\) is lower triangular (apply Lemma [lem:006547] to \(D = L^{-1}L_{1}\)); and \(D\) is also upper triangular (consider \(UU_{1}^{-1}\)). Hence \(D\) is diagonal, and so \(D = I\) because \(L^{-1}\) and \(L_{1}\) are unit triangular. Since \(A = LU\); this completes the proof.

    Let \(\mathbf{c}_{1}, \mathbf{c}_{2}, \dots, \mathbf{c}_{r}\) be columns of lengths \(m, m - 1, \dots, m - r + 1\). If \(\mathbf{k}_{j}\) denotes column \(j\) of \(I_{m}\), show that \(L^{(m)} \left[ \mathbf{c}_{1}, \mathbf{c}_{2}, \dots, \mathbf{c}_{r} \right] =\) \(L^{(m)} \left[ \mathbf{c}_{1} \right] L^{(m)} \left[ \mathbf{k}_{1}, \mathbf{c}_{2} \right] L^{(m)} \left[ \mathbf{k}_{1}, \mathbf{k}_{2}, \mathbf{c}_{3} \right] \cdots\)
    \(L^{(m)} \left[ \mathbf{k}_{1}, \mathbf{k}_{2}, \dots, \mathbf{k}_{r-1}, \mathbf{c}_{r} \right]\). The notation is as in the proof of Theorem [thm:006646]. [Hint: Use induction on \(m\) and block multiplication.]

    [ex:ex2_7_11] Prove Lemma [lem:006829]. [Hint: \(P_{k}^{-1} = P_{k}\). Write \(P_{k} = \left[ \begin{array}{cc} I_{k} & 0 \\ 0 & P_{0} \end{array} \right]\) in block form where \(P_{0}\) is an \((m - k) \times (m - k)\) permutation matrix.]


    2.7E: LU-Factorization Exercises is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?