

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Mid Term exam: CMSC/AMSC/MAPL 460 Computational Methods 03/15/
A representation could be as [s|eeee|fffff], or as (-1) s^ ×1.xxxxx× 2 (-1)xxx
s can take value 0 or 1 | e can take value from -111 to 111 or (-7 to 7 in decimal) f can take value from 00000 to 11111 (0 to ½+1/4+1/8+1/16+1/ machine epsilon is 1/32 (or ½ that 0.03125 or 0.015625) b) Which machine number is closest to π? (π=3.1415926535897…) 11.00100 =1.10010× 2 +1^ = 2(1+1/2+1/16)=3.125 is the right answer (5 points)
1 1 1 1 1 3 9 1 1 1 1 1 3 1 1 3 1 1 1 3 1 1 3 1 9 1 1 9 1 1 1 9 1 1 9 1 1 3 9 4 4 0 20 5 0 20 0 11 20 0 164 45
So we need to solve the above system v
a b c a b c ⎡ ⎤ ⎡ − ⎤ (^) ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎢ (^) − − ⎥ ⎢ (^) − ⎥ (^) ⎢ ⎥ ⎢ (^) − − ⎥ ⎢ (^) −⎥ ⎢ ⎥ ⎢ ⎥ (^) ⎢ ⎥=⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ (^) ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢⎣ ⎥ ⎢⎦ ⎣ ⎥⎦ ⎣ ⎦ ⎢⎣ ⎥ ⎢⎦ ⎣ ⎥⎦ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ (^) =⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢⎣ ⎥ ⎢⎦ ⎣ ⎥⎦ ⎢⎣ ⎥⎦
ia LU decomposition. We could do this with pivoting or without. For this example let us do it without.
Eliminate the 20 in the first column by subtracting 5 times 1st row. 4 0 20 0 20 0 0 0 64
a b c
⎡ ⎤ ⎡ ⎢ ⎥ ⎢ ⎢ ⎥ ⎢ ⎢⎣ ⎥ ⎢⎦ ⎣
2
5 11 20 and we are done! 20 / 64 11/ 20 (5 20 20 / 64) / 4 5 25 / 4 0 20 0 20 0 0 0 64
1 0 0 0 1 0 5 0 1
So the fit function is 45 /16 11 / 20 20 / 64
c b a
U
L
Check LU A
y x x
⎤ ⎡ ⎤ ⎥ (^) =⎢ ⎥ ⎥ ⎢ ⎥ ⎥⎦ ⎢⎣ ⎥⎦
= = = − × = − ⎡ ⎤ = ⎢^ ⎥ ⎢ ⎥ ⎢⎣ ⎥⎦
⎡ ⎤ = ⎢^ ⎥ ⎢ ⎥ ⎢⎣ ⎥⎦
=
= + +
a. Write down the normal equations for solving this problem via least squares
2 (^1 1 ) 2 2 2 2 (^23) 3 3 (^2 ) 4 4
Our equation for the coefficients can be written as 1 1 1 1 Substituting for ( , ) 1 3 9 1 1 1 1 1 1 1 1 1 1 3 9 4
i i
x x (^) y a x x y b x x y c x x y x y
a b c
This equation has the form Ax = b. The normal equations are A t Ax = A t b b. Solve the resulting system of equations via LU decomposition