Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · Advanced undergraduate

Numerical analysis

Name: ______________________

Date: ______________________

You will learn to

  • Define condition numbers and prove the perturbation bound for linear systems; distinguish forward error, backward error and backward stability
  • Solve linear systems by LU factorisation with partial pivoting, explain why pivoting is needed and why one should not form A−1A^{-1}
  • Solve least-squares problems by QR factorisation, explain why the normal equations square the condition number, and describe the QR algorithm for eigenvalues
  • Prove that Euler's method converges with order 1, state and test the order of Runge–Kutta methods, and analyse absolute stability, stiffness and A-stability
  1. 1.

    What is the condition number κ∞(A)=∥A∥∞∥A−1∥∞\kappa_\infty(A) = \|A\|_\infty\|A^{-1}\|_\infty of A=(4000.004)A = \begin{pmatrix} 4 & 0 \\ 0 & 0.004 \end{pmatrix}?

  2. 2.

    A solver returns x^\hat x for Ax=bAx = b, and you find that x^\hat x is the exact solution of (A+δA)x^=b(A + \delta A)\hat x = b with ∥δA∥/∥A∥≈10−16\|\delta A\| / \|A\| \approx 10^{-16}. What can you conclude?

    • A.The backward error is tiny; the forward error may still be as large as about κ(A)⋅10−16\kappa(A) \cdot 10^{-16}.
    • B.x^\hat x is accurate to about 16 digits.
    • C.The solver is unstable.
    • D.Nothing at all about the error in x^\hat x.
  3. 3.

    You solve Ax=bAx = b in IEEE double precision (u≈10−16u \approx 10^{-16}) with a backward-stable method, and κ(A)≈1010\kappa(A) \approx 10^{10}. Roughly how many correct significant decimal digits can you expect in the solution?

  4. 4.

    Which of these invertible matrices has no factorisation A=LUA = LU (with LL unit lower triangular and UU upper triangular) unless rows are swapped?

    • A.(0111)\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}
    • B.(1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
    • C.(2112)\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}
    • D.(3507)\begin{pmatrix} 3 & 5 \\ 0 & 7 \end{pmatrix}
  5. 5.

    Why should you solve Ax=bAx = b by LU with partial pivoting rather than by computing A−1A^{-1} and multiplying? Choose all correct reasons.

    • A.Forming A−1A^{-1} costs about 2n32n^3 flops, three times the 23n3\frac23 n^3 of LU.
    • B.For a sparse matrix, A−1A^{-1} is usually dense, while LU factors can often be kept sparse.
    • C.The residual ∥b−Ax^∥\|b - A\hat x\| of fl(A−1)b\mathrm{fl}(A^{-1})b can be about κ(A)\kappa(A) times larger: it is not backward stable.
    • D.A−1A^{-1} cannot be computed in floating point.
    • E.Computing A−1A^{-1} increases the condition number of the problem.
  6. 6.

    Which Lean conclusion correctly expresses Theorem 1, ∥δx∥∥x∥≤κ(A)∥δb∥∥b∥\frac{\|\delta x\|}{\|x\|} \le \kappa(A)\frac{\|\delta b\|}{\|b\|}, without dividing by norms that might be zero?

    • A.‖δx‖ * ‖b‖ ≤ condNum A * ‖δb‖ * ‖x‖
    • B.‖δx‖ * ‖x‖ ≤ condNum A * ‖δb‖ * ‖b‖
    • C.condNum A * ‖δb‖ * ‖x‖ ≤ ‖δx‖ * ‖b‖
    • D.‖δx‖ ≤ condNum A * ‖δb‖
  7. 7.

    Explicit Euler is applied to y′=−200yy' = -200y on [0,1][0, 1] with NN equal steps (h=1/Nh = 1/N). What is the smallest NN for which the numerical solution decays, i.e. ∣1+hλ∣<1|1 + h\lambda| < 1?

  8. 8.

    Write rk4(f, y0, t_end, n) that applies nn steps of the classical fourth-order Runge–Kutta method to y′=f(t,y)y' = f(t, y), y(0)=y0y(0) = y_0, with step h=tend/nh = t_{\text{end}}/n, and returns the approximation to y(tend)y(t_{\text{end}}).

    Computational — Practice

  9. 9.

    Let A∈Rm×nA \in \R^{m \times n} (m>nm > n) have full column rank and 2-norm condition number κ2(A)=108\kappa_2(A) = 10^8. Which statements are true? Choose all that apply.

    • A.κ2(ATA)=1016\kappa_2(A^TA) = 10^{16}, so the normal equations may lose all accuracy in double precision.
    • B.Householder QR followed by Rx=QTbRx = Q^Tb is backward stable for the least-squares problem.
    • C.The least-squares solution is unique.
    • D.The minimal residual ∥Ax−b∥2\|Ax - b\|_2 is 00.
    • E.The normal equations are both cheaper and more accurate than QR.
  10. 10.

    Which of these methods are A-stable, i.e. ∣R(z)∣≤1|R(z)| \le 1 for every complex zz with Re⁡z≤0\operatorname{Re} z \le 0? Choose all that apply.

    • A.Backward Euler, R(z)=11−zR(z) = \frac{1}{1 - z}
    • B.The trapezoidal rule, R(z)=1+z/21−z/2R(z) = \frac{1 + z/2}{1 - z/2}
    • C.Explicit Euler, R(z)=1+zR(z) = 1 + z
    • D.Classical RK4
Code: Apache-2.0 · Content: CC BY-SA 4.0