Docsity

Test 1 with Solutions - Numerical Analysis | MATH 4340, Exams of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
University of Wyoming Student Name:
Department of Mathematics
Spring 2008
Instructor: Man-Chung Yeung
Numerical Analysis 4340, Test 1 (2/19/2008)
1. (50 points) Consider the linear system
2x1+x2−3x3+4x4= 2
−3x1+2x2+5x3−3x4= 1
8x1+x2−3x3+2x4= 4
−4x1+2x2+3x3−x4= 5.
a) Solve the linear system by Gaussian elimination with pivoting.
b) Solve the linear system by
(a) finding A−1with Gauss-Jordan method with pivoting,
(b) computing A−1b,
where Ais the coefficient matrix and bthe right hand side of the linear system.
c) Which method requires more operation? Why?
d) Find the condition number K(A).
Solution.
a)
2 1 −3 4 |2
−3 2 5 −3|1
8 1 −3 2 |4
−4 2 3 −1|5
⇒(r1↔r3)
8 1 −3 2 |4
−3 2 5 −3|1
2 1 −3 4 |2
−4 2 3 −1|5
⇒(r2←r2+3
8r1, r3←r3+−2
8r1, r4←r4+4
8r1)
8 1 −3 2 |4
0 2.375 3.875 −2.25 |2.5
0 0.75 −2.25 3.5|1
0 2.5 1.5 0 |7
⇒(r2↔r4)
8 1 −3 2 |4
0 2.5 1.5 0 |7
0 0.75 −2.25 3.5|1
0 2.375 3.875 −2.25 |2.5
⇒(r3←r3+−0.75
2.5r2, r4←r4+−2.375
2.5r2)
8 1 −3 2 |4
0 2.5 1.5 0 |7
0 0 −2.7 3.5| −1.1
0 0 2.45 −2.25 | −4.15
pf3
pf4

Partial preview of the text

Download Test 1 with Solutions - Numerical Analysis | MATH 4340 and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

University of Wyoming Student Name: Department of Mathematics Spring 2008 Instructor: Man-Chung Yeung

Numerical Analysis 4340, Test 1 (2/19/2008)

  1. (50 points) Consider the linear system

2 x 1 +x 2 − 3 x 3 +4x 4 = 2 − 3 x 1 +2x 2 +5x 3 − 3 x 4 = 1 8 x 1 +x 2 − 3 x 3 +2x 4 = 4 − 4 x 1 +2x 2 +3x 3 −x 4 = 5.

a) Solve the linear system by Gaussian elimination with pivoting. b) Solve the linear system by (a) finding A−^1 with Gauss-Jordan method with pivoting, (b) computing A−^1 b, where A is the coefficient matrix and b the right hand side of the linear system. c) Which method requires more operation? Why? d) Find the condition number K(A).

Solution.

a)   

   ⇒ (r 1 ↔ r 3 )

  

  

⇒ (r 2 ← r 2 + 38 r 1 , r 3 ← r 3 + − 82 r 1 , r 4 ← r 4 + 48 r 1 )

  

  

⇒ (r 2 ↔ r 4 )

  

  

⇒ (r 3 ← r 3 + − 20 .. 575 r 2 , r 4 ← r 4 + −^22 ..^3755 r 2 )

   

   

⇒ (r 4 ← r 4 + − −^22.^45. 7 r 3 )

   

   

Back-substitution, then x 1 = − 1. 52 x 2 = 6. 88 x 3 = − 6. 8 x 4 = − 5. 56

b) (a)

  

  

⇒ (r 1 ↔ 12 r 1 )

  

  

⇒ (r 2 ↔ r 2 + 3r 1 , r 3 ↔ r 3 − 8 r 1 , r 4 ↔ r 4 + 4r 1 )

   

   

⇒ (r 2 ↔ (^31). 5 r 2 )

  

  

⇒ (r 1 ↔ r 1 − 0. 5 r 2 , r 3 ↔ r 3 + 3r 2 , r 4 ↔ r 4 − 4 r 2 )   

  

  

  

The number of floating-point multiplications and divisions needed in the elimination phase, that is, Steps #1 - #3 of Alg. 2.3.1, is 2(n − 1). The back-substitution phase, that is, Step #4 in Alg. 2.3.1, is 3(n − 1) FLOPs. So in total,

5(n − 1)