Ceng 375 Numerical Computing
Midterm
Nov 14, 2011 15.40-17.30
Good Luck!

  1. (30 pts) Consider the difference approximation for derivative of a function;

    \begin{displaymath}
f'_n=\frac{-f_{n+2}+4f_{n+1}-3f_n}{2h}
\end{displaymath}

    where $f_n$ means $f(x)$ and $f_{n+1}$ means $f(x+h)$
    i
    (15 pts) Use this formula to approximate the derivative of $f(x) = cos(x)$ at $x = 0$ using step sizes of $h = 0.10$ and $h = 0.20$.
    ii
    (15 pts) Make an error analysis by finding the difference with the exact value at each step size, $h$ . Estimate the order of error $(O(h^?))$ by the ratio of these errors.
  2. (30 pts) Consider the solution to $f(x) = 0.5$ where $f(x) = x^3$. Choosing initial guesses of $x_a = 0$ and $x_b = 1$,
    iii
    (5 pts) Describe the general working of a bracketing method. What are the assumptions for this family of methods? Are these assumptions satisfied for $f(x)$?
    iv
    (10 pts) Write down an expression to show how the error $\varepsilon_n$ in the bisection method decreases with subsequent iterations. Find the required number of iterations when the error after $n$ iterations is $10^{-4}$
    v
    (15 pts) Using the bisection method, determine the solution to four decimal places by filling the table below. Does the number of iterations this took agree with the predicted number in previous item?
    i $x_1$ $x_2$ $x_3$ $f(x_3)$ $ \mid x_3$- $x_{exact} \mid$
    1 0.00000 1.00000 0.50000 0.12500 0.29370
    2 0.50000 1.00000 0.75000 0.42188 0.04370
    3 0.75000 1.00000 0.87500 0.66992 0.08130
    4 0.75000 0.87500 0.81250 0.53638 0.01880
    5 0.75000 0.81250 0.78125 0.47840 0.01245
               
               
               
               
               
               
               
               
               
               
  3. (25 pts) Consider the function $f(x)$, on $[0, 1]$, defined by

    \begin{displaymath}
f(x) = \sqrt{x}-cos(x)
\end{displaymath}

    vi
    (10 pts) Describe how the secant method determine a smaller sub-interval containing a root.
    vii
    (15 pts) Apply the secant method to $f(x)$ twice.
  4. (25 pts) Find the $LU$ factorization of

    \begin{displaymath}
A=\left[
\begin{array}{rrrr}
1 & 3 & 1 & 1 \\
2 & 5 & 2 & 2 \\
-1 &-3 &-3 & 5 \\
1 & 3 & 2 & 2 \\
\end{array} \right]
\end{displaymath}

    by Gaussian elimination (without pivoting). Clearly show how you get the entries of $L$ and $U$.


Cem Ozdogan 2012-01-17