MCS 471 Final Exam of Spring 2002

  1. Consider the representation of floating-point numbers with base 10 and 2 digits in the fraction part. The values for the exponents are between -10 and +10.
    1. What is the machine precision is this number system?
    2. Represent the numbers 319 and 284 as floating-point numbers.

      Illustrate the calculation of 319+284 and 319-284. Use rounding everywhere.

                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  2. What is error propagation? Give an illustration on a method we have seen.
                                                            +--------+
                                                            |    /10 |
                                                            +--------+
    

  3. Consider f(x) = x^2 - 3 x. Apply three steps of the golden section search method to find the minimum of f(x) in the interval [0,1]. Write the values for a, b, x1, x2, f(x1), and f(x2) in the table (4 decimal places):
    +------+----------+----------+----------+----------+-----------+-----------+
    | step |    a     |    b     |    x1    |    x2    |   f(x1)   |   f(x2)   |
    +======+==========+==========+==========+==========+===========+===========+
    |   0  | 0.000E+0 | 1.000E+0 |          |          |           |           |
    |   1  |          |          |          |          |           |           |
    |   2  |          |          |          |          |           |           |
    +------+----------+----------+----------+----------+-----------+-----------+
    
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  4. Consider the linear system A x = b. The condition number of the matrix A is 10^9. Assuming the relative error on A is of magnitude 10^(-16), and using exact arithmetic, how many decimal places in the answer can we trust? Justify your answer.
                                                            +--------+
                                                            |    /10 |
                                                            +--------+
    

  5. Suppose you are given a nonlinear boundary-value problem. Which method would you choose to solve it: shooting or finite differences? Justify your choice.
                                                            +--------+
                                                            |    /10 |
                                                            +--------+
    

  6. Consider the matrix
              [ -1.000   4.000  -1.000  ]
          A = [  1.000   2.000   4.000  ]
              [  3.000  -3.000   4.000  ]
    
    1. Compute the LU decomposition of A with partial pivoting.

      Calculate with four decimal places, using rounding: write the answer of every step rounded to four decimal places, and use the rounded number in the calculations of the next step.

    2. What is the determinant of A?
                                                            +--------+
                                                            |    /25 |
                                                            +--------+
    

  7. We sampled a function f at x = 0,1,2,3 and obtained the function values f(0) = -6, f(1) = -5, f(2) = -2, and f(3) = 3. Compute the Newton form of the polynomial which interpolates the data (i,f(i)), i=0,1,2,3.
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  8. The Maclaurin expansion of arcsin(x) is
                          1   3    3   5    5   7   35   9    (  10 )
         arcsin(x) = x + --- x  + --- x  + --- x + ---- x  + O( x   )
                          6        40      112     1152       (     )
    
    
    Use this Maclaurin expansion to construct a Padé approximation for arcsin(x) as a quotient of two quadrics.
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  9. Consider a function whose values are tabulated below:
         *=======*==============*
         |   x   |    f(x)      |
         *=======*==============*
         | 0.000 | 0.0000000000 |
         | 0.125 | 0.1256551366 | 
         | 0.250 | 0.2553419212 |
         | 0.375 | 0.3936265759 |
         | 0.500 | 0.5463024898 |
         | 0.625 | 0.7214844410 |
         | 0.750 | 0.9315964599 |
         | 0.875 | 1.197421629  |
         | 1.000 | 1.557407725  |
         *=======*==============*
    
    1. Compute the most accurate approximation for f'(0.5).
    2. How many decimal places in your answer are correct? Justify.
                                                            +--------+
                                                            |    /25 |
                                                            +--------+
    

  10. Apply the method of underdetermined coefficients to derive an Adams-Bashforth formula which uses three function evaluations.
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  11. Suppose we want to solve the initial-value problem y' = f(x,y), y(0) = 1, with a predictor-corrector method using four points in each step. Calculate how many times we evaluate f to approximate y(0.7), using step size h = 0.1.
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  12. Consider the boundary-value problem y" + y = 3 x^2, y(0) = 1, and y'(1) = 0.

    Give the linear system one has to solve in the method of finite differences with h = 0.2. Be considerate for the mixed boundary conditions.

                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    

  13. Consider the boundary-value problem y" + y' = x, with y(0) = 2 and y(1) = 5.

    With our first guess y'(0) = 1 we find 0.735758 at x=1. Our second guess y'(0) = 3 yields 1.47152 at x=1. What is your next guess for y'(0) in the shooting method?

                                                            +--------+
                                                            |    /15 |
                                                            +--------+