MATH 251 Midterm, Fall 2006
American University of Beirut · Numerical Computing · 9 pages
More MATH 251 files
Show the text of this exam
AMERICAN UNIVERSITY OF BEIRUT
Faculty of Arts and Sciences
Mathematics Department
MATH-CMPS 251
MID TERM EXAMINATION
FALL 2006-2007
Closed Book, One hour 15 minutes
SUBMIT THE QUESTION SHEET WITH BOOKLET
(ONLY NON-PROGRAMMABLE AND NON-GRAPHIC
CALCULATORS ARE ALLOWED)
STUDENT NAME
ID NUMBER
Problem
Out of
Grade
1
10
2
10
3
15
4
15
TOTAL
50
1
1. Let x ∈ F ≡ F(b, p, emin, emax), with x = ±m × be.
-(4 points) Fill in the missing statements in the following MATLAB pro-
gram that generates the positive elements of a floating-point system
F(b, p, emin, emax).
function x=float(b,p,emin,emax)
x=[];
epsm=b^(-p+1);
%M represents all possible values taken by the mantissa
M=.................................;
E=b^emin;
for ..............................
x=[x M*E];
E=E*.........;
end
-(3 points) How many floating-point operations (additions and multi-
plications) would be required to execute the above program.
-(3 points) Find the cardinality of F if F = F(7, 6, −4, 4)
2
2. Consider the floating-point system F = F( 10, 7, −6, 7). This system
uses rounding to the closest.
(a) (4 points) Fill in the following table.
Values of following parameters and elements in IEEE single precision system
xmin
xmax
ϵM (epsilon machine)
Representation of
1
13
succ( 1
13)
(b) (6 points) Convert x = (653.325)10 into octal form? Give then the
hexadecimal form of the internal IEEE single precision floating
point representation of x, using rounding to the closest.
Conversion of x = (653.325)10
to octal and IEEE hexadecimal form
Corresponding octal form
Corresponding IEEE hexadecimal form
3
3. Consider the function f(x) = e−x − 4x(1 − x).
(a) (3 points) Show graphically that this function has only 2 distinct
roots on (−∞, ∞). Locate these roots.
4
(b) (3 points) Find the least number of iterations that provide an ap-
proximation to r within 6 significant figures using the bisection
method.
Number of iterations:
-Apply the bisection method twice to find approximations to EACH
of the two rooots.
Approximation to first root :
Approximation to second root:
(c) (4 points) Let f(x) = a − 1
x, a > 0
-Write the Newton iteration to find the root r of f(x).
-Give the interval (α, β) such that when x0 ∈ (α, β) the iteration
converges. Justify your answer.
5
(d) (5 points) Prove that the Newton sequence {xn} verify:
��xn − 1
a
�� = an ��x0 − 1
a
��2n
-Assume that 1 ≤ a < 2 and |x0 − 1
a| ≤ 1
2. How many iterations
are needed to get 1
a within 6 significant figures.
6
4. Consider the system of linear equations Ax = b, where A ∈ R4,4, x,
b ∈ R4, given by:
9x1
+
4x2
+
7x3
+
5x4
=
20
2x1
+
7x3
+
8x4
=
9
6x1
+
8x2
+
x3
=
15
4x1
+
5x2
+
4x3
+
3x4
=
12
(a) (10 points) Give the augmented matrix [A|b] of this system, then
solve the given system (i.e. find x1,x2,x3,x4) using Gauss reduc-
tion with scaled partial pivoting followed by backward substi-
tution. Specify all the parameters of the reduction, particularly
the scales, the multipliers and the interchange of rows through
an index vector IV .
Carry out this procedure using whenever
necessary fraction representation of numbers.
7
(...Continued...)
8
(b) (10 points) Find the determinant det(A) of the system matrix A,
then specify the elements of the 4 by 4 matrices L and U, which
verify
B = A(IV, :) = LU
Write out this equality, exbiting the elements of B,L and U.
9