CS314 Summer 2003

Final Exam

Name:_____________________________________

 
Problem Max. Grade
1. 10
2. 10
3. 10
4. 15
5. 15
6. 10
7. 10
8. 10
9. 10
Total: 100

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

1. (10 pts) Find the value of A in the function  y=Ax, that ,minimizes the sqare error with the following data:

 
xk yk
-4 -3
-1 -1
0 0
2 1
3 2

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

2. (10 pts) a) Derive the normal equations to find the least sqares curve f(x)=Acos(x)+Bsin(x). b) Use this result to find A and B for the following data:

 
xk yk
-3.0 -0.1385
-1.5 -2.1587
0.0 0.8330
1.5 2.2774
3.0 -0.5110

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

3. (10 pts.) Determine if the following functions are cubic splines:


(a) f(x)= 
                     19/2 - (81/4)x+15x2-(13/4)x3    for 1 <=x <= 2
                     -77/2 + (207/4)x - 21x2 + (11/4)x for 2 <= x <= 3
 

(b) f(x) = 
                      11 - 24x + 18x2 - 4x  for 1 <= x <= 2
                       -54 + 72x - 30x2 + 4x for 2 <=x <=3
 
 

(c)  f(x) =
                      13 - 31x + 23x2 -5x3 for 1<=x<=2
                       -35+51x-22x2+3x3 for 2 <=x<=3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

4. (15 pts) Verify that Simpson's rule (M=1, h=1) is exact for polynomials of degree <= 3 of the form f(x)=c3x3+c2x2+c1x+c0

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

5. (15 pts) Solve the differential equation y'=e-2t-2y with y(0)=1/10. Let h=0.1 and do four steps.

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

6. (10 pts.) Use both the Gauss-Seidel and the Jacobi iteration methods to find (xk,yk) for k = 1, 2, 3. Start at the point (x0,y0)=(0,0). Choose iteration equations that will make the method converge.

-x +3y = 1
6x -2y = 2

 
 

































 


7. (10 pts.) Let f(x)= 2sin(3.14x/6), where x is in radians. Use quadratic Lagrange interpolation based on the nodes x0=0, x 1=1, and x2=3 to approximate f(4) 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

8. (10 pts.) Given the following table, compute the divided-difference table for the function x1/2. Also, write down the Newthon polynomials P1(x), P2(x), and P3(x).


k xk f(xk)
0 4.0 2.00000
1 5.0 2.23607
2 6.0 2.44949
3 7.0 2.64575

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 


 

9. (10 pts.) Using Pade' approximations, find R2,2(x) for f(x)=arctan(x1/2)/x1/2. Start with the Maclaurin expansion: 

f(x)=1 - x/3 + x2/5 - x3/7 + x4/9