Implementation Issues¶
Exercise 8.1¶
(a)¶
(b)¶
Forward substitution gives
Backward substitution yields
(c)¶
Suppose that \(\tilde{B}\) is \(B\) (8.9) with the second column replaced by
Suppose that \(\tilde{a}_j = \begin{bmatrix} 1 & 0 & -1 & 0 & 0 \end{bmatrix}^\top\) and the goal is to solve
Applying the forward and backward substitutions gives
The desired quantity is
Since \(\tilde{B} \Delta \tilde{x}_\mathcal{B}\) gives \(\tilde{a}_j\), the solution is correct.
(d)¶
Recall from (8.5) that
where \(a_j\) is associated with the entering variable \(x_j\) and \(a_i\) is associated with the leaving variable \(x_i\).
Suppose that \(\tilde{B}\) is \(B\) (8.9) with the second column replaced by
The goal is to solve
where
Since the decomposition of \(B = LU\) did not use any permutations, the LU-factorization is updated as
without permuting the columns and rows. To remove the spike and convert the matrix back into upper-triangular form, define a permutation matrix
and
so that
Forward substitution gives
Given \(y\), the next step is to solve
Finally, backward substitution yields
Exercise 8.2¶
Let \(P_{ij}\) denote a permutation matrix that swaps rows \(i\) and \(j\) when post-multiplied by a matrix; \(P_{ij}\) swaps columns \(i\) and \(j\) when pre-multiplied by a matrix. By inspection, \(P_{ij}^2 = P_{ij} P_{ij} = I\).
Note that the row indices of \(L\) and column indices of \(U\) have been permuted by \(P_R = P_{35} P_{23} P_{14}\) and \(P_C = P_{15} P_{23} P_{34}\) respectively. These need to be accounted for when applying the forward and backward substitutions to solve (8.9). The original linear system can be reconstructed as \(B = P_R^{-1} LU P_C^{-1} = P_R^\top LU P_C^\top\).
The forward substitution now gives
The backward substitution now yields
Exercise 8.3¶
Given a permutation \(\pi \colon \{1, \ldots, m\} \mapsto \{1, \ldots, m\}\), a permutation matrix can be defined as
where \(\mathbf{e}_{\pi(j)} = \mathbf{e}_{\pi_j}\) denotes a standard basis vector.
Let \(\pi' \colon \{1, \ldots, m\} \mapsto \{1, \ldots, m\}\) denote a mapping for the columns of \(P_\pi\) such that
and \(\pi'_j\) is the row index of column \(j\) that contains the one.
(a)¶
Let \(B\) be an \(m \times m\) matrix. Pre-multiplying \(B\) by \(P_\pi\)
and post-multiplying \(B\) by \(P_\pi\)
will yield the same permutation when \(\pi\) is an identity permutation or the elements of the swapped rows and columns have corresponding values. Otherwise, post-multiplying by \(P_\pi^\top\) is the only way to permute the column indices in the same order as row indices.
(b)¶
As derived in (a), every permutation of the rows of a matrix \(B\) can be represented as a mapping \(\pi\).
(c)¶
Recall that \(\mathbf{e}_i^\top \mathbf{e}_j = 1\) if and only if \(i = j\); otherwise, the scalar product is zero.
Exercise 8.4¶
Given \(B = LU\), solving \(B^\top x = U^\top L^\top x = b\) can be done in two steps.
Use forward substitution on \(U^\top y = b\).
Follow up with backward substitution on \(L^\top x = y\).