.. _LU_decompHW: LU Decomposition Homework ========================== #. How can LU decomposition improve the computational efficiency of finding solutions to :math:`\mathbf{A}\,\bm{x} = \bm{b}` for a set of several :math:`\bm{b}` vectors? #. Start with the matrix .. math:: \mathbf{A} = \begin{bmatrix} 6 & 9 & -2 \\ -3 & 0 & 1 \\ 6 & 4 & 6 \end{bmatrix}. Using LU decomposition, find the matrix factors of :math:`\bf{A}` (:math:`\bf{L}`, :math:`\bf{U}`, and :math:`\bf{P}`). What are the determinants of each? Find the determinant of :math:`\bf{A}` by means LU decomposition, ``det(P)*prod(diag(U))``. Verify that ``det(A)`` gives the same answer. #. Using LU decomposition with Python, find the solution to the following system of equations (:math:`\mathbf{A}\,\bm{x} = \bm{b}`). Use :math:`\bf{L}`, :math:`\bf{U}`, and :math:`\bf{P}` in your solution. :: A = np.array([[-8, 2, 8, -1], [2, -6, 6, 4], [-3, 9, 14, 11], [-9, 8, -4, 13]]).astype(float) b = np.array([[11, 5, 1, 4]]).astype(float).T