Docsity

MCS 471: Sample Exam 1 - Solutions for FP Systems, Secant Method, and Linear Eqns., Exams of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
MCS 471: SAMPLE EXAM 1 6/28/02 NAME:
Show all work in your exam book then record answers in the space provided on this test paper. Use 4 digit round exam
precision.
1. (a) What is the machine epsilon εfor a floating point number system with B= 10, precision t= 4, and the
exponent range L=−5and U= 5.Soln: 10−3
(b) Define Relative roundoff error and show how it is related to ε.Soln: |f l(x)−x|/|x|< ε/2,ε/2 =
rounding unit.
(c) What is the smallest normalized floating point number in this system? Soln: .1000 ×10−5
2. Secant Method:
(a) State the Secant Method Algorithm.
(b) Explain why it is preferable to use the secant method instead of Newton’s method. Soln: No derivataive is
needed.
(c) Use the Secant method starting with x1= 0 and x2= 1, with |xk+1 −xk|<0.03 as a stopping criterion,
to find a root of
f(x) = ex−4x3
Algorithm: You fill this in.
k xkxk+1 f(xk)f(xk+1)
1 0 1 1 -1.282
2 1 .4382 -1.282 1.213
3 .4382 .7113 1.213 .5971
4 .7113 .9760 .5971 -1.065
5 .9760 .8064 -1.065
3. Consider f(x) = 0 with a triple root at x=r.
(a) Give conditions for f(x)to have a triple root a x=r.
Soln: f(x) = (x−r)3g(x)or f(r) = f0(r) = f00(r) = 0 f000 (r)6= 0
(b) At what rate does the Newton-Raphson algorithm converge to the triple root at x=r. Justify your answer.
(Use exam book or back of this sheet.)
Soln: Writing in the form of a fixed point iteration then g(x) = x−f(x)
f0(x)The error satisfies ek+1 =
g0(r)ek. By differentiating, we find that g0(r)6= 0 so that the rate is 1.
1
pf2

Partial preview of the text

Download MCS 471: Sample Exam 1 - Solutions for FP Systems, Secant Method, and Linear Eqns. and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MCS 471: SAMPLE EXAM 1 6/28/02 NAME:

Show all work in your exam book then record answers in the space provided on this test paper. Use 4 digit round exam precision.

  1. (a) What is the machine epsilon ε for a floating point number system with B = 10, precision t = 4, and the exponent range L = − 5 and U = 5. Soln: 10 −^3 (b) Define Relative roundoff error and show how it is related to ε. Soln: |f l(x) − x|/|x| < ε/ 2 , ε/2 = rounding unit. (c) What is the smallest normalized floating point number in this system? Soln:. 1000 × 10 −^5
  2. Secant Method: (a) State the Secant Method Algorithm. (b) Explain why it is preferable to use the secant method instead of Newton’s method. Soln: No derivataive is needed. (c) Use the Secant method starting with x 1 = 0 and x 2 = 1, with |xk+1 − xk| < 0. 03 as a stopping criterion, to find a root of f (x) = ex^ − 4 x^3 Algorithm: You fill this in. k xk xk+1 f (xk) f (xk+1) 1 0 1 1 -1. 2 1 .4382 -1.282 1. 3 .4382 .7113 1.213. 4 .7113 .9760 .5971 -1. 5 .9760 .8064 -1.
  3. Consider f (x) = 0 with a triple root at x = r. (a) Give conditions for f (x) to have a triple root a x = r. Soln: f (x) = (x − r)^3 g(x) or f (r) = f ′(r) = f ′′(r) = 0 f ′′′(r) 6 = 0 (b) At what rate does the Newton-Raphson algorithm converge to the triple root at x = r. Justify your answer. (Use exam book or back of this sheet.) Soln: Writing in the form of a fixed point iteration then g(x) = x − (^) ff ′((xx)) The error satisfies ek+1 = g′(r)ek. By differentiating, we find that g′(r) 6 = 0 so that the rate is 1.

MCS 471: SAMPLE EXAM 1 NAME:

  1. Solve

  2. 000 x 1 + 10. 00 x 2 + 6. 000 x 3 = 10. 00

  3. 000 x 1 + 8. 000 x 2 + 1. 000 x 3 = 100. 0

  4. 00 x 1 + 16. 00 x 2 + 12. 00 x 3 = 0. 1000 Use Gaussian elimination, virtual partial pivoting and virtual scaling. Record the pivot vector and scale vectors at each step. Write the final augmented matrix with the multipliers (circled) stored in place of zeros. Give the final solution, the determinant and an LU decomposition.

pivot vector =

scale vector =

[

]

Your choice so no interchange.

Augmented Matrices:

Solutions: x 1 = 8.725 x 2 = 13.

x 3 = -26.97 det(A) = -184.0 (careful with sign)

L =

 , U =

  1. (a) What is a sufficient condition for the Gauss-Seidel interation for Ax = b to converge to the solution x? Soln: diagonal dominance (b) Give a Gauss-Seidel algorithm for the system below that is guaranteed to converge to the solution. 4 x − 8 y + z = − 21 − 2 x + y + 5z = 15 4 x − y − z = 7 Soln: Interchange rows 3 and 1 then 3 and 2. You should work out the iteration strating with (0,0,0).