Course Test · University: upper level

Numerical analysis: test

The double nearest 0.1 and machine epsilon, catastrophic cancellation, bisection, Newton, secant and fixed-point iteration with their rates, Lagrange interpolation, natural cubic splines, Chebyshev nodes, least squares, Richardson extrapolation, the trapezoid, Simpson and Gauss rules, Euler and Runge–Kutta steps and the stability limit of Euler's method, LU factorisation, condition numbers, Jacobi iteration and the power method.

Twenty exercises of the kind this course sets. Answers are on the independent answers page; the same exercises done with RatMath are on the RatMath answers page.

  1. 1.Floating point
    What exact rational number does the double nearest to 0.1 equal? What is machine epsilon (the gap from 1 to the next double)?
  2. 2.Catastrophic cancellation
    Evaluate x+1−x\sqrt{x + 1} - \sqrt{x} at x=1016x = 10^{16} in double precision. What goes wrong, and what is the true value?
  3. 3.Bisection
    Bisection on x2−2x^2 - 2 over [1,2][1, 2]: how many steps until the guaranteed error (b−a)/2n+1(b - a)/2^{n+1} is below 10−610^{-6}?
  4. 4.Newton's method
    Apply Newton's method to x2−2x^2 - 2 from x0=1x_0 = 1. Give x1,x2,x3x_1, x_2, x_3.
  5. 5.Secant method
    Apply the secant method to x2−2x^2 - 2 from x0=1x_0 = 1, x1=2x_1 = 2. Give x2x_2 and x3x_3.
  6. 6.Fixed-point iteration
    For xk+1=cos⁡xkx_{k+1} = \cos x_k, by what factor does the error shrink each step near the fixed point?
  7. 7.Interpolation
    Find the polynomial through (0,1)(0, 1), (1,3)(1, 3), (2,7)(2, 7) and evaluate it at 3.
  8. 8.Natural cubic spline
    Find the natural cubic spline through (0,0)(0, 0), (1,1)(1, 1), (2,0)(2, 0) and its value at x=12x = \tfrac12.
  9. 9.Chebyshev nodes
    Give the three Chebyshev nodes on [−1,1][-1, 1].
  10. 10.Least squares
    Fit a least-squares line to (0,1)(0, 1), (1,3)(1, 3), (2,4)(2, 4), (3,4)(3, 4).
  11. 11.Richardson extrapolation
    Estimate f′(0)f'(0) for f=exf = e^x with central differences at h=0.1h = 0.1 and h=0.05h = 0.05, then one Richardson step.
  12. 12.Trapezoid rule
    Approximate ∫01x2 dx\int_0^1 x^2\,dx by the trapezoid rule with 4 panels.
  13. 13.Simpson's rule
    Apply Simpson's rule with one panel (three points) to ∫01x4 dx\int_0^1 x^4\,dx.
  14. 14.Gaussian quadrature
    Apply two-point Gauss–Legendre quadrature to ∫−11x4 dx\int_{-1}^1 x^4\,dx.
  15. 15.Euler's method
    Use Euler's method with h=0.1h = 0.1 on y′=yy' = y, y(0)=1y(0) = 1, up to t=0.5t = 0.5.
  16. 16.Runge–Kutta
    Take one classical RK4 step of size 0.1 on y′=yy' = y, y(0)=1y(0) = 1.
  17. 17.Stability
    For y′=−10yy' = -10y, what is the largest step for which Euler's method does not grow?
  18. 18.LU factorisation
    Factor A=(2143)A = \begin{pmatrix}2&1\\4&3\end{pmatrix} as LULU (no pivoting).
  19. 19.Condition number
    Find κ∞\kappa_\infty of (1111.0001)\begin{pmatrix}1&1\\1&1.0001\end{pmatrix}.
  20. 20.Iterative methods and eigenvalues
    (a) Two Jacobi steps for 4x+y=14x + y = 1, x+3y=2x + 3y = 2 from (0,0)(0, 0). (b) The dominant eigenvalue of (2113)\begin{pmatrix}2&1\\1&3\end{pmatrix} by the power method.