logo
Tsung-Ming Huang
Department of Mathematics National Taiwan Normal University, Taiwan
E-mail: min@math.ntnu.edu.tw
November 30, 2014
1 / 255
logo
Outline
1 Linear systems of equations
2 Pivoting Strategies
3 Matrix factorization
4 Special types of matrices
2 / 255
logo
Outline
1 Linear systems of equations
2 Pivoting Strategies
3 Matrix factorization
4 Special types of matrices
3 / 255
logo
Outline
1 Linear systems of equations
2 Pivoting Strategies
3 Matrix factorization
4 Special types of matrices
4 / 255
logo
Outline
1 Linear systems of equations
2 Pivoting Strategies
3 Matrix factorization
4 Special types of matrices
5 / 255
logo
Linear systems of equations
Three operations to simplify the linear system:
1 (λEi) → (Ei): Equation Ei can be multiplied by λ 6= 0 with the resulting equation used in place of Ei.
2 (Ei+ λEj) → (Ei): Equation Ej can be multiplied by λ 6= 0 and added to equation Eiwith the resulting equation used in place of Ei.
3 (Ei) ↔ (Ej): Equation Ei and Ej can be transposed in order.
Example 1
E1 : x1 + x2 + 3x4 = 4,
E2 : 2x1 + x2 − x3 + x4 = 1, E3 : 3x1 − x2 − x3 + 2x4 = −3, E4 : −x1 + 2x2 + 3x3 − x4 = 4.
6 / 255
logo
Linear systems of equations
Three operations to simplify the linear system:
1 (λEi) → (Ei): Equation Ei can be multiplied by λ 6= 0 with the resulting equation used in place of Ei.
2 (Ei+ λEj) → (Ei): Equation Ej can be multiplied by λ 6= 0 and added to equation Eiwith the resulting equation used in place of Ei.
3 (Ei) ↔ (Ej): Equation Ei and Ej can be transposed in order.
Example 1
E1 : x1 + x2 + 3x4 = 4,
E2 : 2x1 + x2 − x3 + x4 = 1, E3 : 3x1 − x2 − x3 + 2x4 = −3, E4 : −x1 + 2x2 + 3x3 − x4 = 4.
7 / 255
logo
Linear systems of equations
Three operations to simplify the linear system:
1 (λEi) → (Ei): Equation Ei can be multiplied by λ 6= 0 with the resulting equation used in place of Ei.
2 (Ei+ λEj) → (Ei): Equation Ej can be multiplied by λ 6= 0 and added to equation Eiwith the resulting equation used in place of Ei.
3 (Ei) ↔ (Ej): Equation Ei and Ej can be transposed in order.
Example 1
E1 : x1 + x2 + 3x4 = 4,
E2 : 2x1 + x2 − x3 + x4 = 1, E3 : 3x1 − x2 − x3 + 2x4 = −3, E4 : −x1 + 2x2 + 3x3 − x4 = 4.
8 / 255
logo
Linear systems of equations
Three operations to simplify the linear system:
1 (λEi) → (Ei): Equation Ei can be multiplied by λ 6= 0 with the resulting equation used in place of Ei.
2 (Ei+ λEj) → (Ei): Equation Ej can be multiplied by λ 6= 0 and added to equation Eiwith the resulting equation used in place of Ei.
3 (Ei) ↔ (Ej): Equation Ei and Ej can be transposed in order.
Example 1
E1 : x1 + x2 + 3x4 = 4,
E2 : 2x1 + x2 − x3 + x4 = 1, E3 : 3x1 − x2 − x3 + 2x4 = −3, E4 : −x1 + 2x2 + 3x3 − x4 = 4.
9 / 255
logo
Solution:
(E2− 2E1) → (E2), (E3− 3E1) → (E3)and (E4+ E1) → (E4):
E1: x1 + x2 + 3x4 = 4,
E2: − x2 − x3 − 5x4 = −7, E3: − 4x2 − x3 − 7x4 = −15,
E4: 3x2 + 3x3 + 2x4 = 8.
(E3− 4E2) → (E3)and (E4+ 3E2) → (E4):
E1: x1 + x2 + 3x4 = 4,
E2: − x2 − x3 − 5x4 = −7,
E3: 3x3 + 13x4 = 13,
E4: − 13x4 = −13.
10 / 255
logo
Solution:
(E2− 2E1) → (E2), (E3− 3E1) → (E3)and (E4+ E1) → (E4):
E1: x1 + x2 + 3x4 = 4,
E2: − x2 − x3 − 5x4 = −7, E3: − 4x2 − x3 − 7x4 = −15,
E4: 3x2 + 3x3 + 2x4 = 8.
(E3− 4E2) → (E3)and (E4+ 3E2) → (E4):
E1: x1 + x2 + 3x4 = 4,
E2: − x2 − x3 − 5x4 = −7,
E3: 3x3 + 13x4 = 13,
E4: − 13x4 = −13.
11 / 255
logo
Backward-substitution process:
1 E4 ⇒ x4= 1
2 Solve E3for x3: x3=1
3(13 − 13x4) =1
3(13 − 13) = 0.
3 E2gives
x2= −(−7 + 5x4+ x3) = −(−7 + 5 + 0) = 2.
4 E1gives
x1= 4 − 3x4− x2= 4 − 3 − 2 = −1.
12 / 255
logo
Backward-substitution process:
1 E4 ⇒ x4= 1
2 Solve E3for x3: x3=1
3(13 − 13x4) =1
3(13 − 13) = 0.
3 E2gives
x2= −(−7 + 5x4+ x3) = −(−7 + 5 + 0) = 2.
4 E1gives
x1= 4 − 3x4− x2= 4 − 3 − 2 = −1.
13 / 255
logo
Backward-substitution process:
1 E4 ⇒ x4= 1
2 Solve E3for x3: x3=1
3(13 − 13x4) =1
3(13 − 13) = 0.
3 E2gives
x2= −(−7 + 5x4+ x3) = −(−7 + 5 + 0) = 2.
4 E1gives
x1= 4 − 3x4− x2= 4 − 3 − 2 = −1.
14 / 255
logo
Backward-substitution process:
1 E4 ⇒ x4= 1
2 Solve E3for x3: x3=1
3(13 − 13x4) =1
3(13 − 13) = 0.
3 E2gives
x2= −(−7 + 5x4+ x3) = −(−7 + 5 + 0) = 2.
4 E1gives
x1= 4 − 3x4− x2= 4 − 3 − 2 = −1.
15 / 255
logo
Backward-substitution process:
1 E4 ⇒ x4= 1
2 Solve E3for x3: x3=1
3(13 − 13x4) =1
3(13 − 13) = 0.
3 E2gives
x2= −(−7 + 5x4+ x3) = −(−7 + 5 + 0) = 2.
4 E1gives
x1= 4 − 3x4− x2= 4 − 3 − 2 = −1.
16 / 255
logo
Solve linear systems of equations
a11x1+ a12x2+ · · · + a1nxn = b1
a21x1+ a22x2+ · · · + a2nxn = b2
...
an1x1+ an2x2+ · · · + annxn = bn
Rewrite in the matrix form
Ax = b, (1)
where
A =
a11 a12 · · · a1n a21 a22 · · · a2n
... ... . .. ... an1 an2 · · · ann
, b =
b1 b2
... bn
, x =
x1 x2
... xn
and [A, b] is called the augmented matrix.
17 / 255
logo
Solve linear systems of equations
a11x1+ a12x2+ · · · + a1nxn = b1
a21x1+ a22x2+ · · · + a2nxn = b2
...
an1x1+ an2x2+ · · · + annxn = bn
Rewrite in the matrix form
Ax = b, (1)
where
A =
a11 a12 · · · a1n a21 a22 · · · a2n
... ... . .. ... an1 an2 · · · ann
, b =
b1 b2
... bn
, x =
x1 x2
... xn
and [A, b] is called the augmented matrix.
18 / 255
logo
Solve linear systems of equations
a11x1+ a12x2+ · · · + a1nxn = b1
a21x1+ a22x2+ · · · + a2nxn = b2
...
an1x1+ an2x2+ · · · + annxn = bn
Rewrite in the matrix form
Ax = b, (1)
where
A =
a11 a12 · · · a1n a21 a22 · · · a2n
... ... . .. ... an1 an2 · · · ann
, b =
b1 b2
... bn
, x =
x1 x2
... xn
and [A, b] is called the augmented matrix.
19 / 255
logo
Gaussian elimination with backward substitution
The augmented matrix in previous example is
1 1 0 3 4
2 1 −1 1 1
3 −1 −1 2 −3
−1 2 3 −1 4
.
(E2− 2E1) → (E2), (E3− 3E1) → (E3)and (E4+ E1) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 −4 −1 −7 −15
0 3 3 2 8
.
(E3− 4E2) → (E3)and (E4+ 3E2) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 0 3 13 13
0 0 0 −13 −13
.
20 / 255
logo
Gaussian elimination with backward substitution
The augmented matrix in previous example is
1 1 0 3 4
2 1 −1 1 1
3 −1 −1 2 −3
−1 2 3 −1 4
.
(E2− 2E1) → (E2), (E3− 3E1) → (E3)and (E4+ E1) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 −4 −1 −7 −15
0 3 3 2 8
.
(E3− 4E2) → (E3)and (E4+ 3E2) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 0 3 13 13
0 0 0 −13 −13
.
21 / 255
logo
Gaussian elimination with backward substitution
The augmented matrix in previous example is
1 1 0 3 4
2 1 −1 1 1
3 −1 −1 2 −3
−1 2 3 −1 4
.
(E2− 2E1) → (E2), (E3− 3E1) → (E3)and (E4+ E1) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 −4 −1 −7 −15
0 3 3 2 8
.
(E3− 4E2) → (E3)and (E4+ 3E2) → (E4):
1 1 0 3 4
0 −1 −1 −5 −7
0 0 3 13 13
0 0 0 −13 −13
.
22 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
23 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
24 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
25 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
26 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
27 / 255
logo
The general Gaussian elimination procedure
Provided a116= 0, for each i = 2, 3, . . . , n,
Ei− ai1 a11
E1
→ (Ei).
Transform all the entries in the first col. below the diagonal are zero. Denote the new entry in the ith row and jth col. by aij. For i = 2, 3 . . . , n − 1, providedaii 6= 0,
Ej−aji
aiiEi
→ (Ej), ∀ j = i + 1, i + 2, . . . , n.
Transform all the entries in the ith column below the diagonal are zero.
Result anupper triangularmatrix:
a11 a12 · · · a1n b1
0 a22 · · · a2n b2
... . .. ... ... ... 0 · · · 0 ann bn
.
28 / 255
logo
The process of Gaussian elimination result in a sequence of matrices as follows:
A = A(1) → A(2)→ · · · → A(n)=upper triangular matrix The matrix A(k)has the following form:
A(k)=
a(1)11 · · · a(1)1,k−1 a(1)1k · · · a(1)1j · · · a(1)1n
... . .. ... ... ... ...
0 · · · a(k−1)k−1,k−1 a(k−1)k−1,k · · · a(k−1)k−1,j · · · a(k−1)k−1,n 0 · · · 0 a(k)kk · · · a(k)kj · · · a(k)kn
... ... ... ... ...
0 · · · 0 a(k)ik · · · a(k)ij · · · a(k)in
... ... ... ... ...
0 · · · 0 a(k)nk · · · a(k)nj · · · a(k)nn
29 / 255
logo
The process of Gaussian elimination result in a sequence of matrices as follows:
A = A(1) → A(2)→ · · · → A(n)=upper triangular matrix The matrix A(k)has the following form:
A(k)=
a(1)11 · · · a(1)1,k−1 a(1)1k · · · a(1)1j · · · a(1)1n
... . .. ... ... ... ...
0 · · · a(k−1)k−1,k−1 a(k−1)k−1,k · · · a(k−1)k−1,j · · · a(k−1)k−1,n 0 · · · 0 a(k)kk · · · a(k)kj · · · a(k)kn
... ... ... ... ...
0 · · · 0 a(k)ik · · · a(k)ij · · · a(k)in
... ... ... ... ...
0 · · · 0 a(k)nk · · · a(k)nj · · · a(k)nn
30 / 255
logo
The entries of A(k)are produced by the formula
a(k)ij =
a(k−1)ij , for i = 1, . . . , k − 1, j = 1, . . . , n;
0, for i = k, . . . , n, j = 1, . . . , k − 1;
a(k−1)ij − a
(k−1) i,k−1
a(k−1)k−1,k−1 × a(k−1)k−1,j, for i = k, . . . , n, j = k, . . . , n.
The procedure will fail if one of the elements a(1)11, a(2)22, . . . , a(n)nn is zero.
a(i)ii is called the pivot element.
31 / 255
logo
The entries of A(k)are produced by the formula
a(k)ij =
a(k−1)ij , for i = 1, . . . , k − 1, j = 1, . . . , n;
0, for i = k, . . . , n, j = 1, . . . , k − 1;
a(k−1)ij − a
(k−1) i,k−1
a(k−1)k−1,k−1 × a(k−1)k−1,j, for i = k, . . . , n, j = k, . . . , n.
The procedure will fail if one of the elements a(1)11, a(2)22, . . . , a(n)nn is zero.
a(i)ii is called the pivot element.
32 / 255
logo
The entries of A(k)are produced by the formula
a(k)ij =
a(k−1)ij , for i = 1, . . . , k − 1, j = 1, . . . , n;
0, for i = k, . . . , n, j = 1, . . . , k − 1;
a(k−1)ij − a
(k−1) i,k−1
a(k−1)k−1,k−1 × a(k−1)k−1,j, for i = k, . . . , n, j = k, . . . , n.
The procedure will fail if one of the elements a(1)11, a(2)22, . . . , a(n)nn is zero.
a(i)ii is called the pivot element.
33 / 255
logo
Backward substitution
The new linear system is triangular:
a11x1 + a12x2 + · · · + a1nxn = b1, a22x2 + · · · + a2nxn = b2,
...
annxn = bn
Solving the nth equation for xngives xn= bn
ann.
Solving the (n − 1)th equation for xn−1and using the value for xnyields
xn−1= bn−1− an−1,nxn
an−1,n−1
. In general,
xi= bi−Pn
j=i+1aijxj
aii , ∀ i = n − 1, n − 2, . . . , 1.
34 / 255
logo
Backward substitution
The new linear system is triangular:
a11x1 + a12x2 + · · · + a1nxn = b1, a22x2 + · · · + a2nxn = b2,
...
annxn = bn
Solving the nth equation for xngives xn= bn
ann.
Solving the (n − 1)th equation for xn−1and using the value for xnyields
xn−1= bn−1− an−1,nxn
an−1,n−1
. In general,
xi= bi−Pn
j=i+1aijxj
aii , ∀ i = n − 1, n − 2, . . . , 1.
35 / 255
logo
Backward substitution
The new linear system is triangular:
a11x1 + a12x2 + · · · + a1nxn = b1, a22x2 + · · · + a2nxn = b2,
...
annxn = bn
Solving the nth equation for xngives xn= bn
ann.
Solving the (n − 1)th equation for xn−1and using the value for xnyields
xn−1= bn−1− an−1,nxn
an−1,n−1
. In general,
xi= bi−Pn
j=i+1aijxj
aii , ∀ i = n − 1, n − 2, . . . , 1.
36 / 255
logo
Backward substitution
The new linear system is triangular:
a11x1 + a12x2 + · · · + a1nxn = b1, a22x2 + · · · + a2nxn = b2,
...
annxn = bn
Solving the nth equation for xngives xn= bn
ann.
Solving the (n − 1)th equation for xn−1and using the value for xnyields
xn−1= bn−1− an−1,nxn
an−1,n−1
. In general,
xi= bi−Pn
j=i+1aijxj
aii , ∀ i = n − 1, n − 2, . . . , 1.
37 / 255
logo
Algorithm 1 (Backward Substitution)
Suppose thatU ∈ Rn×n isnonsingular upper triangularand b ∈ Rn. This algorithm computes the solution ofU x = b.
For i = n, . . . , 1 tmp = 0
For j = i + 1, . . . , n
tmp = tmp + U (i, j) ∗ x(j) End for
x(i) = (b(i) − tmp)/U (i, i) End for
38 / 255
logo
Example 2
Solve system of linear equations.
6 −2 2 4
12 −8 6 10
3 −13 9 3
−6 4 1 −18
x1 x2
x3
x4
=
12 34 27
−38
Solution:
1st step Use 6 as pivot element, the first row as pivot row, and multipliers 2,12, −1are produced to reduce the system to
6 −2 2 4
0 −4 2 2
0 −12 8 1
0 2 3 −14
x1 x2
x3
x4
=
12 10 21
−26
39 / 255
logo
Example 2
Solve system of linear equations.
6 −2 2 4
12 −8 6 10
3 −13 9 3
−6 4 1 −18
x1 x2
x3
x4
=
12 34 27
−38
Solution:
1st step Use 6 as pivot element, the first row as pivot row, and multipliers 2,12, −1are produced to reduce the system to
6 −2 2 4
0 −4 2 2
0 −12 8 1
0 2 3 −14
x1 x2
x3
x4
=
12 10 21
−26
40 / 255
logo
2nd step Use −4 as pivot element, the second row as pivot row, and multipliers 3, −12 are computed to reduce the system to
6 −2 2 4
0 −4 2 2
0 0 2 −5
0 0 4 −13
x1
x2
x3 x4
=
12 10
−9
−21
3rdstep Use 2 as pivot element, the third row as pivot row, and multipliers 2 is found to reduce the system to
6 −2 2 4
0 −4 2 2
0 0 2 −5
0 0 0 −3
x1 x2
x3 x4
=
12 10
−9
−3
41 / 255
logo
2nd step Use −4 as pivot element, the second row as pivot row, and multipliers 3, −12 are computed to reduce the system to
6 −2 2 4
0 −4 2 2
0 0 2 −5
0 0 4 −13
x1
x2
x3 x4
=
12 10
−9
−21
3rdstep Use 2 as pivot element, the third row as pivot row, and multipliers 2 is found to reduce the system to
6 −2 2 4
0 −4 2 2
0 0 2 −5
0 0 0 −3
x1 x2
x3 x4
=
12 10
−9
−3
42 / 255
logo
4thstep The backward substitution is applied:
x4 = −3
−3 = 1, x3 = −9 + 5x4
2 = −9 + 5 2 = −2, x2 = 10 − 2x4− 2x3
−4 = 10 − 2 + 4
−4 = −3, x1 = 12 − 4x4− 2x3+ 2x2
6 = 12 − 4 + 4 − 6
6 = 1.
This example is done since a(k)kk 6= 0 for all k = 1, 2, 3, 4.
How to do if a(k)kk = 0for some k?
43 / 255
logo
4thstep The backward substitution is applied:
x4 = −3
−3 = 1, x3 = −9 + 5x4
2 = −9 + 5 2 = −2, x2 = 10 − 2x4− 2x3
−4 = 10 − 2 + 4
−4 = −3, x1 = 12 − 4x4− 2x3+ 2x2
6 = 12 − 4 + 4 − 6
6 = 1.
This example is done since a(k)kk 6= 0 for all k = 1, 2, 3, 4.
How to do if a(k)kk = 0for some k?
44 / 255
logo
4thstep The backward substitution is applied:
x4 = −3
−3 = 1, x3 = −9 + 5x4
2 = −9 + 5 2 = −2, x2 = 10 − 2x4− 2x3
−4 = 10 − 2 + 4
−4 = −3, x1 = 12 − 4x4− 2x3+ 2x2
6 = 12 − 4 + 4 − 6
6 = 1.
This example is done since a(k)kk 6= 0 for all k = 1, 2, 3, 4.
How to do if a(k)kk = 0for some k?
45 / 255
logo
Example 3
Solve system of linear equations.
1 −1 2 −1 2 −2 3 −3
1 1 1 0
1 −1 4 3
x1 x2
x3
x4
=
−8
−20
−2 4
Solution:
1st step Use 1 as pivot element, the first row as pivot row, and multipliers 2, 1, 1 are produced to reduce the system to
1 −1 2 −1
0 0 −1 −1
0 2 −1 1
0 0 2 4
x1 x2
x3
x4
=
−8
−4 6 12
46 / 255
logo
Example 3
Solve system of linear equations.
1 −1 2 −1 2 −2 3 −3
1 1 1 0
1 −1 4 3
x1 x2
x3
x4
=
−8
−20
−2 4
Solution:
1st step Use 1 as pivot element, the first row as pivot row, and multipliers 2, 1, 1 are produced to reduce the system to
1 −1 2 −1
0 0 −1 −1
0 2 −1 1
0 0 2 4
x1 x2
x3
x4
=
−8
−4 6 12
47 / 255
logo
2nd step Since a(2)22 = 0and a(2)32 6= 0, the operation
(E2) ↔ (E3)is performed to obtain a new system
1 −1 2 −1
0 2 −1 1
0 0 −1 −1
0 0 2 4
x1
x2 x3 x4
=
−8 6
−4 12
3rdstep Use −1 as pivot element, the third row as pivot row, and multipliers −2 is found to reduce the system to
1 −1 2 −1
0 2 −1 1
0 0 −1 −1
0 0 0 2
x1
x2 x3 x4
=
−8 6
−4 4
48 / 255
logo
2nd step Since a(2)22 = 0and a(2)32 6= 0, the operation
(E2) ↔ (E3)is performed to obtain a new system
1 −1 2 −1
0 2 −1 1
0 0 −1 −1
0 0 2 4
x1
x2 x3 x4
=
−8 6
−4 12
3rdstep Use −1 as pivot element, the third row as pivot row, and multipliers −2 is found to reduce the system to
1 −1 2 −1
0 2 −1 1
0 0 −1 −1
0 0 0 2
x1
x2 x3 x4
=
−8 6
−4 4
49 / 255
logo
4thstep The backward substitution is applied:
x4 = 4 2 = 2, x3 = −4 + x4
−1 = 2, x2 = 6 − x4+ x3
2 = 3,
x1 = −8 + x4− 2x3+ x2
1 = −7.
This example illustrates what is done if a(k)kk = 0for some k.
If a(k)pk 6= 0 for some p with k + 1 ≤ p ≤ n, then the operation (Ek) ↔ (Ep)is performed to obtain new matrix.
If a(k)pk = 0for each p, then the linear system does not have a unique solution and the procedure stops.
50 / 255
logo
4thstep The backward substitution is applied:
x4 = 4 2 = 2, x3 = −4 + x4
−1 = 2, x2 = 6 − x4+ x3
2 = 3,
x1 = −8 + x4− 2x3+ x2
1 = −7.
This example illustrates what is done if a(k)kk = 0for some k.
If a(k)pk 6= 0 for some p with k + 1 ≤ p ≤ n, then the operation (Ek) ↔ (Ep)is performed to obtain new matrix.
If a(k)pk = 0for each p, then the linear system does not have a unique solution and the procedure stops.
51 / 255