Numerical Analysis Lecture by Prof Tony J
Numerical Analysis Lecture by Prof Tony J
Lecture 11
Department of Mathematics
Indian Institute of Technology Bombay
[email protected]
September 5, 2017
xn −→ ξ
en = ξ − xn
If there exists p ≥ 0 and a constant C 6= 0 such that
|en+1 |
lim = C.
n→∞ |en |p
4. { n1r } −→ 0, here r ≥ 1 p = 1.
We do step 2 first
=⇒ U is an invertible matrix.
Exercise:
Show that an upper triangular matrix U = (uij ) is invertible iff all
diagonal entries (i.e., uii ) are non-zero.
bn
xn =
unn
bn−1 − un−1,n xn
xn−1 =
un−1,n−1
P
bi − uij xj
j>i
xi = for i = n − 1, n − 2, · · · , 2, 1
uii
This process is called back-substitution.
Instructor: Prof. Tony J. Puthenpurakal Numerical Analysis : [ MA214 ] Lecture 11
Example:
3x1 + x2 + 2x3 = 6
4x2 + 2x3 = 7
3x3 = 9
9
x3 = =3
3
1
4x2 + 6 = 7 =⇒ x2 =
4
1 1
3x1 + + 6 = 6 =⇒ x1 = −
4 12
Gaussian Elimination
x1 − x2 + 2x3 = −6
2x1 − 2x2 + 3x3 = −14
x1 + x2 + x3 = −2
1 −1 2 : −6 1 −1 2 : −6
2 −2 3 : −14 R2 − 2R1 0 0 −1 : −2
−−−−−−→
1 1 1 : −2 1 1 1 : −2
1 −1 2 : −6 1 −1 2 : −6
R3 − R1 0 0 −1 : −2 R2 ←→ R3 0 2 −1 : 4
−−−−−→ −−−−−−−→
0 2 −1 : 4 0 0 −1 : −2
−x3 = −2 =⇒ x3 = 2
2x2 − x3 = 4 =⇒ x2 = 3
x1 − x2 + 2x3 = −6 =⇒ x1 = −7
Instructor: Prof. Tony J. Puthenpurakal Numerical Analysis : [ MA214 ] Lecture 11
Algorithm for Gaussian Elimination
To solve Ax = b
W = [A : b] “augmented matrix”
Step 1 For i = 1, 2, · · · , n − 1 do steps 2,3,4.
Step 2 Let p be the smallest integer with i ≤ p ≤ n and api 6= 0. If no
integer p can be found then output “no unique solution exists and
stop”.
Step 3 If p 6= i then interchange Row Ri ↔ Row Rj .
Step 4 For j = i + 1, · · · , n do steps 5,6.
aji
Step 5 Set mji = aii .
Step 6 perform Rj − mji Ri .
Step 7 If ann = 0 “no unique solution exists and stop”.
Step 8 U = first n columns of W . b = last column of W .
Operation Count
Addition/subtraction: (n − i)(n − i + 1)
n−1
P n3 −n
Total addition/subtraction: (n − i)(n − i + 1) = 3
i=1
n2 −n
2 addition/subtraction
Exercise
Ax = b for tridiagonal systems can be solved in θ(n) steps.
Not all matrices have this type of representation. However many matrices
that occur in practice have this property.
If we do GE each time then we would need θ(n3 /3) operation each time
we solve Ax = b.
is upper-triangular matrix.
Set U = A(n)
Also A = LU.
1 0 0 ··· 0
−m21 1 0 ··· 0
(1)
−m31 0 1 ··· 0
M =
.. .. .. . . ..
. . . . .
−mn−1,1 0 0 ··· 0
−mn1 0 0 ··· 1
1 0 0 ··· 0
m21
1 0 ··· 0
(1) −1
m31 0 1 ··· 0
[M ] =
.. .. .. . . ..
. . . . .
mn−1,1 0 0 ··· 0
mn1 0 0 ··· 1
and so on
Instructor: Prof. Tony J. Puthenpurakal Numerical Analysis : [ MA214 ] Lecture 11
One can prove that
1 0 0 ··· 0
m21 1 0 ··· 0
m31 m32 1 ··· 0
L=
.. .. .. .. ..
. . . . .
mn−1,1 mn−1,2 mn−1,3 · · · 0
mn1 mn2 mn3 ··· 1
Example:-
x1 + x2 + 0x3 + 3x4 = 4
2x1 + x2 − x3 + x4 = 1
3x1 − x2 + −x3 + 2x4 = −3
−x1 + 2x2 + 3x3 − x4 = 4
−1 0 0 1
−7
1 0 0 0 y1 8
2 1 0 0 y2 7
=
3 4 1 0 y3 14
−1 −3 0 1 y4 −7
y1 = 8
2y1 + y2 = 7 =⇒ y2 = −9
3y1 + 4y2 + y3 = 14 =⇒ y3 = 26
−y1 − 3y2 + y4 = −7 =⇒ y4 = −26
−13x4 = −26 =⇒ x4 = 2
3x3 + 13x4 = 26 =⇒ x3 = 0
−x2 − x3 − 5x4 = −9 =⇒ x2 = −1
x1 + x2 + 3x4 = 8 =⇒ x1 = 3