1
Lecture 3
Gaussian elimination and Gauss-Jordan
elimination for
(i) Underdetermined systems
(ii) Overdetermined systems
Instructor: Dr. Rehana Naz
Linear Algebra
2
Number of equations <Number of unknown
Underdetermined systems may or may not be consistent.
ο¨
ο¨
If an underdetermined system is consistent, it must
have infinitely many solutions.
We can find solutions of underdetermined
homogeneous and nonhomogeneous systems only
by Gaussian elimination and Gauss-Jordan
elimination methods.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1:
3
Solve the following system via Gaussian elimination
(nonhomogeneous system)
2π₯ − 3π¦ − π§ + 2π€ + 3π£ = 4
4π₯ − 4π¦ − π§ + 4π€ + 11π£ = 4
2π₯ − 5π¦ − 2π§ + 2π€ − π£ = 9
2π¦ + π§ + 4π£ = −5
Solution: For this system Number of equations <Number of
unknown
The augmented matrix is
2 −3 −1 2 3
4
4 −4 −1 4 11 4
2 −5 −2 2 −1 9
0 2
1 0 4 −5
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1:
4
We use elementary row operations to transform this matrix into row
echelon form.
(1/2)R1 → R1
3
1
3
1 −
−
1
2
2
2
2
4 −4 −1 4 11 4
2 −5 −2 2 −1 9
0 2
1 0 4 −5
R2 +(-4) R1 → R2, R3 +(-2)R1 → R3
3
1
3
1 −
−
1
2
2
2
2
0 2
1 0 5 −4
0 −2 −1 0 −4 5
0 2
1 0 4 −5
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1:
5
(1/2)R2 → R2
3
1
1 −
−
2
2
1
0 1
2
0 −2 −1
0 2
1
R3 +2R2 → R3, R4 +(-2)R2 → R4
3
1
1 −
−
2
2
1
0 1
2
0 0
0
0 0
0
Instructor: Dr. Rehana Naz
1
0
0
0
1
0
0
0
3
2
2
5
−2
2
−4 5
4 −5
3
2
2
5
−2
2
1
1
−1 −1
Linear Algebra
Example 1:
6
R4 +R3→ R4
3
1 −
2
1
3
−
1
2
2
2
1
5
0 1
0
−2
2
2
0 0
0 0 1 1
0 0
0 0 0 0
This yields row echelon form of augmented matrix.
ο¨ Its associated system is
3
1
3
π₯− π¦− π§+π€+ π£ =2
2
2
2
1
5
π¦ + π§ + π£ = −2
2
2
π£=1
ο¨ Now above system
can
be Naz
solved by
back-substitution
method:
Instructor: Dr.
Rehana
Linear
Algebra
Example 1:
7
Solving for leading variables, we obtain
3
1
3
π₯ = π¦+ π§−π€− π£+2
2
2
2
1
5
π¦ =− π§− π£−2
2
2
π£=1
ο¨ Substituting the bottom equation into those above yields
3
1
1
π₯ = π¦+ π§−π€+
2
2
2
1
9
π¦=− π§−
2
2
π£=1
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1:
8
And substituting the second equation into the top yields
25 1
π₯ =− − π§−π€
4 4
9 1
π¦=− − π§
2 2
π£=1
ο¨ Assign arbitrary values to the free variables. If we assign z=s and
w=t, the general solution is given by
25 1
π₯ =− − π −π‘
4 4
9 1
π¦=− − π
2 2
π£ = 1, π§ = π , π€ = π‘
ο¨ Infinite many solutions exist in this example.
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 2:
9
Solve by Gauss-Jordan elimination (homogeneous
system)
2π₯1 + 2π₯2 − π₯3 + π₯5 = 0
−π₯1 − π₯2 + 2π₯3 − 3π₯4 + π₯5 = 0
π₯1 + π₯2 − 2π₯3 − π₯5 = 0
π₯3 + π₯4 + π₯5 = 0
ο¨ Solution: The augmented matrix
2
2 −1 0
1 0
−1 −1 2 −3 1 0
1
1 −2 0 −1 0
0
0
1
1
1 0
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 2:
10
can be expressed in following reduced row-echelon form
1 1 0 0 1 0
0 0 1 0 1 0
0 0 0 1 0 0
0 0 0 0 0 0
ο¨ The associated linear system is
π₯1 + π₯2 + π₯5 = 0
π₯3 + π₯5 = 0
π₯4 = 0
ο¨ Solving for leading variables yield
π₯1 = −π₯2 − π₯5
π₯3 = −π₯5
π₯4 = 0
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 2:
11
ο¨
Thus general solution is
π₯1 = −π − π‘, π₯2 = π , π₯3 = −π‘ , π₯4 = 0, π₯5 = π‘
ο¨ Thus we have infinite many solutions for this case.
ο¨ Note that the trivial solution is obtained when s=0,
t=0.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 3:
12
Suppose that the augmented matrix for a system of
linear equations has been reduced by row operations to
the given reduced row-echelon form. Solve the system.
1 −6 0 0 3 −2
0 0 1 0 4 7
0 0 0 1 5 8
0 0 0 0 0 0
ο¨ Solution: The corresponding system of equations is
π₯1 − 6π₯2 + 3π₯5 = −2
π₯3 + 4π₯5 = 7
π₯4 + 5π₯5 = 8
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 3:
13
Here leading variables are π₯1 , π₯3 , π₯4 and free
variables are π₯2 and π₯5 . Solving for leading variables
in terms of free variables gives
π₯1 = 6π₯2 − 3π₯5 − 2
π₯3 = −4π₯5 + 7
π₯4 = −5π₯5 + 8
ο¨ If we assign free variables π₯2 and π₯5 arbitrary values s
and t. The general solution is given by formulas
π₯1 = 6π − 3π‘ − 2, π₯2 = π , π₯3 = −4π‘ + 7, π₯4
= −5π‘ + 8, π₯5 = π‘
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 4:
14
ο¨
ο¨
Solve the following system via Gaussian elimination
3π₯1 − π₯2 + π₯3 − 4π₯4 = 2
6π₯1 + 3π₯2 − π₯3 − 4π₯4 = 3
9π₯1 + 2π₯2 − 8π₯4 = 6
Solution: The augmented matrix is
3 −1 1 −4 2
6 3 −1 −4 3
9 2
0 −8 6
Instructor: Dr. Rehana Naz
Linear Algebra
Example 4:
15
R2 +(-2) R1 → R2, R3 +(-3)R1 → R3
3 −1 1 −4 2
0 5 −3 4 −1
0 5 −3 4
0
R3 –R2→ R3
3 −1 1 −4 2
0 5 −3 4 −1
0 0
0
0
1
is in row-echelon form.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 4:
16
The associated linear system is
3π₯1 − π₯2 + π₯3 − 4π₯4 = 2
5π₯2 − 3π₯3 + 4π₯4 = −1
0π₯1 + 0π₯2 + 0π₯3 + 0π₯4 = 1
Last equation can never be satisfied; the system has
no solution and hence is inconsistent.
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Number of equations >Number of unknown
17
Overdetermined systems are usually (but not
necessarily) inconsistent.
ο¨ We can find solutions of overdetermined
homogeneous and nonhomogeneous systems
only by Gaussian elimination and Gauss-Jordan
elimination methods.
ο¨
Instructor: Dr. Rehana Naz
Linear Algebra
Example 5:
18
Solve following overdetermined system by Gauss-Jordan
elimination
π₯1 + 2π₯2 = 5
2π₯1 + 3π₯2 = 1
5π₯1 + 2π₯2 = 1
ο¨ Solution: The augmented matrix
1 2 5
2 3 1
5 2 1
can be expressed in following reduced row echelon form
1 0 0
0 1 0
0 0 Linear
1 Algebra
Instructor: Dr. Rehana Naz
ο¨
Example 5:
19
ο¨
The associated linear system is
π₯1 = 0
π₯2 = 0
0. π₯1 + 0. π₯2 = 1
ο¨
This last equation can never be satisfied; hence this
linear system is inconsistent.
Instructor: Dr. Rehana Naz
Linear Algebra
Section 2.2: Evaluating Determinants by Row
Reduction
20
ο¨
This method is important since it is the most computationally efficient way to find
the higher order determinants.
Instructor: Dr. Rehana Naz
Linear Algebra
Section 2.2: Evaluating Determinants by Row
Reduction
21
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1: Consider 2×2 matrix
22
1.
1.
2
6
3
1
ο¨
π΄=
ο¨
Where det(A)=2-18= -16
ο¨
Solution:
Multiply first row of A by 2 and call resulting matrix as B,
4 6
= 4 − 36 = −32
6 1
ο¨
det π΅ =
ο¨
=2(-16)=2det(A)
if we interchange any two rows then sign of determinant changes i.e. det(B)=-det(A)
ο¨
det π΅ =
6 1
= 18 − 2 = 16 = −det(π΄)
2 3
Instructor: Dr. Rehana Naz
Linear Algebra
Example 1: Consider 2×2 matrix
23
1.
A multiple of second is added to first row then det(B)=det(A)
ο¨
2R1+R2 → R2
ο¨
det π΅ =
2 3
= 14 − 30 = −16 = det(π΄)
10 7
ο¨
Determinants that are Zero: The determinant of a matrix will be zero if
1.
An entire row is zero.
2.
Two rows or columns are equal.
3.
A row or column is a constant multiple of another row or column
Instructor: Dr. Rehana Naz
Linear Algebra
24
Example 2: Evaluate the following
determinants by inspection
a.
3
π΄= 4
3
−2
7
−2
5
−1
5
b.
2
π΅= 5
0
−1
8
0
3
−2
0
c.
1
πΆ= 4
3
−2
7
−6
5
−1
15
Instructor: Dr. Rehana Naz
Linear Algebra
25
Example 2: Evaluate the following
determinants by inspection
ο¨
Solution:
(a)
det(A)=0 since first and third rows are equal.
(b)
Third row of matrix B consists of zeros only thus det(B)=0.
(c)
The third row of matrix C is multiple of first row therefore det(C)=0.
Instructor: Dr. Rehana Naz
Linear Algebra
26
Instructor: Dr. Rehana Naz
Linear Algebra
Elementary Matrices
27
ο¨
An elementary matrix results from performing a single elementary row operation
on an identity matrix πΌπ .
ο¨
πππ‘(πΌπ ) = 1
Instructor: Dr. Rehana Naz
Linear Algebra
Example 3
28
ο¨
The following determinants of elementary matrices, are evaluated by inspection
1
0
0
0
ο¨
0
3
0
0
0 0
0 0
=3
1 0
0 1
The second row of πΌ4 was multiplied by 3.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 3
29
0
0
0
1
ο¨
0
1
0
0
0
0
1
0
1
0
= −1
0
0
The first and last rows of πΌ4 were interchanged.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 3
30
1
0
0
0
ο¨
0
1
0
0
0 7
0 0
=1
1 0
0 1
7 times the last row of πΌ4 was added to the first row.
Instructor: Dr. Rehana Naz
Linear Algebra
Example 4
31
ο¨
Evaluate det(A) by row reduction where
0
π΄= 3
2
Instructor: Dr. Rehana Naz
1
−6
6
5
9
1
Linear Algebra
Example 4
32
ο¨
Solution: We will reduce A to row-echelon form which is upper triangular.
0 1
π΄ = 3 −6
2 6
Instructor: Dr. Rehana Naz
5
9
1
Linear Algebra
Example 4
33
1
= −3 0
2
−2 3
1 5 (Taking 3 as common from first row)
6 1
π
3 +(-2) π
1 → π
3
1 −2
= −3 0 1
0 10
Instructor: Dr. Rehana Naz
3
5
−5
Linear Algebra
Example 4
34
π
3 +(-10) π
1 → π
3
1 −2
3
= −3 0 1
5
0 0 −55
1 −2 3
= −3 (−55) 0 1 5 (Taking -55 as common from third row)
0 0 1
= −3 −55 1 = 165
Instructor: Dr. Rehana Naz
Linear Algebra
Example 5
35
ο¨
Use row reduction to compute the determinant of
2 3
0 4
π΄=
2 −1
0 −4
Instructor: Dr. Rehana Naz
3
3
−1
−3
1
−3
−3
2
Linear Algebra
Example 5
36
2 3
3
1
0 4
3 −3
π΄ =
2 −1 −1 −3
0 −4 −3 2
Taking 2 common from first row
1 3/2 3/2 1/2
0
4
3
−3
=2
2 −1 −1 −3
0 −4 −3
2
Instructor: Dr. Rehana Naz
Linear Algebra
Example 5
37
π
3 − 2π
1 → π
3
1
0
=2
0
0
3/2 3/2 1/2
4
3
−3
−4 −4 −4
−4 −3
2
Taking 4 common from second row
Instructor: Dr. Rehana Naz
Linear Algebra
Example 5
38
1 3/2 3/2 1/2
0
1
3/4 −3/4
= 2 (4)
0 −4 −4
−4
0 −4 −3
2
π
3 + 4π
2 → π
3 , π
4 + 4π
2 → π
4
1 3/2 3/2 1/2
0
1
3/4 −3/4
= 2 (4)
0
0
−1
−7
0
0
0
−1
Instructor: Dr. Rehana Naz
Linear Algebra
Example 5
39
Taking -1 common from third and fourth rows we have
1 3/2
0
1
= 2 4 −1 (−1)
0
0
0
0
3/2 1/2
3/4 −3/4
1
−7
0
1
Compute the determinant of the upper triangular matrix
π΄ = 2 4 −1 −1 1 = 8
Instructor: Dr. Rehana Naz
Linear Algebra
Example 6
40
Find the determinant of a 4x4 matrix
1
2
π΄=
0
7
Instructor: Dr. Rehana Naz
0
7
6
3
0
0
3
1
3
6
0
−5
Linear Algebra
Example 6
41
Solution:
1
2
π΄ =
0
7
0
7
6
3
0 3
0 6
3 0
1 −5
Observe that this can be converted to lower triangular form if we can make first two
entries (3 and 6) of last column πΆ4 as zero. Is it possible?
Instructor: Dr. Rehana Naz
Linear Algebra
Example 6
42
The answer is yes, we can do just in one step i.e. πΆ4 − 3πΆ1 → πΆ4 yields
1
2
=
0
7
0
7
6
3
0
0
3
1
0
0
0
−26
now it is in lower triangular form and thus determinant is simply sum of diagonal elements
=(1)(7)(3)(-26)=-546
Instructor: Dr. Rehana Naz
Linear Algebra
43
Instructor: Dr. Rehana Naz
Linear Algebra