2017 Numerical Analysis Midterm Exam  
When is the best time for you?
Wed Nov 1 16:30-18:30  32% of the voters. 12% of the votes.    11
Thu Nov 2 18:00-20:00  9% of the voters. 3% of the votes.    3
Fri Nov 3 10:00-12:00  12% of the voters. 4% of the votes.    4
Fri Nov 3 13:00-15:00  18% of the voters. 7% of the votes.    6
Fri Nov 3 15:00-17:00  21% of the voters. 8% of the votes.    7
Fri Nov 3 17:00-19:00  35% of the voters. 13% of the votes.    12
Sat Nov 4 11:00-13:00  21% of the voters. 8% of the votes.    7
Mon Nov 6 16:30-18:30  71% of the voters. 26% of the votes.    24
Wed Nov 8 16:30-18:30  50% of the voters. 19% of the votes.    17
Poll ended at 2:04 am on Monday October 30th 2017. Total votes: 91. Total voters: 34.
Monday 6th November 2017
16:30 — 18:30


NO NOTES OR BOOKS; ANSWER ALL 4 QUESTIONS; ALL QUESTIONS HAVE EQUAL VALUE.
10.19.17
Question #1
It is desired to minimize the number of bits that can store a certain range of numbers. The range lower limit is $3\times 10^{-65}$, and the range upper limit is $10^{32}$. Do the following:
(a)  Find the minimum number of bits needed to store the exponent.
(b)  Find the minimum number of bits needed to store the significand.
(c)  Find the total number of bits needed.
Question #2
Consider a system of equations expressed as: $$ A X = B $$ with $$ A=\left[\begin{array}{cccc} -2 & 0 & 0 & 0 \\ 0 & 3 & -1 & 5 \\ -4 & 0 & 4 & 2 \\ 0 & 6 & -2 & -5 \end{array} \right] $$ Find the matrices $L$ and $U$ by hand such that $A=LU$ and $L$ is a lower-triangular matrix and $U$ is a upper-triangular matrix.
Question #3
(a)  Consider a number of real type. Knowing that the machine accuracy (non-denormal) is of $\epsilon_{\rm mach}=9.5367 \times 10^{-7}$ and that the maximum positive number must be at least as high as $10^{23}$, do the following:
(i) find the minimum number of bits for the exponent;
(ii) find the minimum number of bits for the significand.
(b)  Consider the number $9.5367\times 10^{-4}$ stored in memory as a real type. Knowing that the exponent of the real type has 4 bits what is the minimum number of bits that the significand should have if the relative error on the number is less than 0.01?
Question #4
Consider the function $f=\sin(x)$ with $x$ in radians. Find the root $f=0$ for the initial condition $x_0=2.8$ using the following iterative method: $$ x^{n+1}=x^n - 0.05\frac{f(x^n)}{f'(x^n)} - 0.95\frac{f(x^n)(x^{n-1}-x^{n-2})}{f(x^{n-1})-f(x^{n-2})} $$ Do so in two different ways:
(a)  By hand, with enough iterations to yield a root accurate to at least 4 significant digits. How many iterations are needed to find a root accurate to at least 4 significant digits?
(b)  With a C code that starts as follows:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

double f(double x){
  double ret;
  ret=sin(x);
  return(ret);
}

double dfdx(double x){
  double ret;
  ret=cos(x);
  return(ret);
}


int main(void){
10.20.17
PDF 1✕1 2✕1 2✕2
$\pi$