0% found this document useful (0 votes)
4 views33 pages

L02 Slides SolvingLinearSystems

This document outlines methods for solving linear systems, specifically focusing on Gaussian elimination and Gauss-Jordan elimination. It explains how to identify row echelon form (REF) and reduced row echelon form (RREF) of matrices, along with examples and procedures for finding these forms. The document also discusses the conditions for unique and infinitely many solutions in linear systems.

Uploaded by

trololo trololo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views33 pages

L02 Slides SolvingLinearSystems

This document outlines methods for solving linear systems, specifically focusing on Gaussian elimination and Gauss-Jordan elimination. It explains how to identify row echelon form (REF) and reduced row echelon form (RREF) of matrices, along with examples and procedures for finding these forms. The document also discusses the conditions for unique and infinitely many solutions in linear systems.

Uploaded by

trololo trololo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Lecture 2

Solving Linear Systems


Team
Dr. Inas Taymour
Dr. Ahmed Abdel-Naby
Dr. Mohamed Wafa
𝒙 + 𝟐𝒚 + 𝟑𝒛 = 𝟏𝟓
Recall: 𝟑𝒙 + 𝒚 − 𝒛 = −𝟓
𝟐𝒙 − 𝟑𝒚 + 𝟐𝒛 = 𝟎
𝟏 𝟐 𝟑 𝟏𝟓 Augmented
𝟑 𝟏 −𝟏 อ −𝟓
row matrix
𝟐 −𝟑 𝟐 𝟎
operations
𝟏 𝟐 𝟑 𝟏𝟓 • REF
𝟎 𝟏 𝟐 อ 𝟏𝟎 • Gaussian elimination
𝟎 𝟎 𝟏 𝟒 with back substitution
more row
operations 𝟏 𝟎 𝟎 −𝟏
𝟎 𝟏 𝟎อ 𝟐 • RREF
𝟎 𝟎 𝟏 𝟒 • Gauss-Jordan elimination
MTH0001 Algebra 2
Lecture Outline
• Echelon forms of a matrix
• Define row echelon form (REF) and reduced row echelon form (RREF)
• Find the REF and RREF of a matrix

• Two methods for solving linear systems


• Gaussian elimination (with back substitution)
• Gauss-Jordan elimination

Reference: Anton & Rorres, “Elementary Linear Algebra,” Section 1.2.

MTH0001 Algebra 3
Echelon Forms of a Matrix
Properties:
1. Zero rows (rows where all entries are zeros), if exist, appear at
the bottom.
RREF

2. The first nonzero entry from the left in any row is a 1 (called a
REF

leading 1).
3. A leading 1 appears to the right and bottom of the leading 1
in the preceding row (“echelon” or staircase pattern).
4. In a column that contains a leading 1, all other entries are zeros.

MTH0001 Algebra 4
Identifying Echelon Forms
𝟏 𝟐 𝟎 𝟒
Example 1: Identify as REF, RREF, or neither: 𝟎 𝟎 𝟎 𝟎
𝟎 𝟎 𝟏 −𝟑

MTH0001 Algebra 5
Identifying Echelon Forms (cont.)

𝟏 𝟎 𝟑
Example 2: Identify as REF, RREF, or neither: 𝟎 𝟐 −𝟐
𝟎 𝟎 𝟏

MTH0001 Algebra 6
Identifying Echelon Forms (cont.)

𝟏 𝟎 𝟑 𝟒
𝟎 𝟏 −𝟐 𝟓
Example 3: Identify as REF, RREF, or neither:
𝟎 𝟏 𝟐 𝟐
𝟎 𝟎 𝟎 𝟎

MTH0001 Algebra 7
Identifying Echelon Forms (cont.)
𝟏 𝟐 𝟑 𝟒
𝟎 𝟏 −𝟐 𝟓
Example 4: Identify :
𝟎 𝟎 𝟏 𝟐
𝟎 𝟎 𝟎 𝟎
1. Zero rows:
2. Leading ones:
3. Staircase:
4. Columns with leading ones:

MTH0001 Algebra 8
Identifying Echelon Forms (cont.)
𝟏 𝟐 𝟎 𝟎 𝟏
Example 5: Identify : 𝟎 𝟎 𝟏 𝟐 𝟑
𝟎 𝟎 𝟎 𝟎 𝟎
1. Zero rows:
2. Leading ones:
3. Staircase:
4. Columns with leading ones:

MTH0001 Algebra 9
𝟎 𝟏 𝟏 𝟐
Ex. 6: Find the REF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
We follow a 5-step procedure:
(1) Start at the left-most column 𝟎 𝟏 𝟏 𝟐
which does not consist entirely of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
zeros.
(2) Interchange the top row with 𝟎 𝟏 𝟏 𝟐
another row, if necessary, to bring a 𝟐 𝟑 𝟎 −𝟐
nonzero entry to the top of the 𝟑 𝟑 𝟔 𝟗
column.

MTH0001 Algebra 10
𝟎 𝟏 𝟏 𝟐
Ex. 6 (cont.): Find the REF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
(3) If the entry at the top of this 𝟑 𝟑 𝟔 𝟗
column is not 1, multiply the top row 𝟐 𝟑 𝟎 −𝟐
by a constant to obtain a leading 1. 𝟎 𝟏 𝟏 𝟐
(4) Zero out all entries below the
leading 1 by adding suitable multiples
of the top row to the rows below.
(5) Cover the top row and apply the
steps again to the remaining
submatrix.

MTH0001 Algebra 11
𝟎 𝟏 𝟏 𝟐
Ex. 6 (cont.): Find the REF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
𝟏 𝟏 𝟐 𝟑
𝟎 𝟏 −𝟒 −𝟖
𝟎 𝟏 𝟏 𝟐

MTH0001 Algebra 12
𝟎 𝟏 𝟏 𝟐
Ex. 6 (cont.): Find the REF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
𝟏 𝟏 𝟐 𝟑
𝟎 𝟏 −𝟒 −𝟖
𝟎 𝟎 𝟓 𝟏𝟎

MTH0001 Algebra 13
𝟎 𝟏 𝟏 𝟐
Ex. 7: Find the RREF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
(1) Find the REF of the matrix, as explained in Ex. 6.

(2) Zero out all entries above all leading ones (do one leading 1 at a
time, starting at the right-most leading 1 and moving to the left.

𝟏 𝟏 𝟐 𝟑
𝟎 𝟏 −𝟒 −𝟖
𝟎 𝟎 𝟏 𝟐

MTH0001 Algebra 14
𝟎 𝟏 𝟏 𝟐
Ex. 7 (cont.): RREF of 𝟐 𝟑 𝟎 −𝟐
𝟑 𝟑 𝟔 𝟗
𝟏 𝟏 𝟐 𝟑
(1) Find the REF: 𝟎 𝟏 −𝟒 −𝟖
𝟎 𝟎 𝟏 𝟐

MTH0001 Algebra 15
Notes on Finding the RREF
After we find the REF, we can either:
• Zero out above leading ones, 𝟏 𝟏 𝟐 𝟑
starting at the right-most leading 1 𝟎 𝟏 −𝟒 −𝟖
and moving to the left (i.e., column 𝟎 𝟎 𝟏 𝟐
3, then column 2), as
Or
• Zero out above leading ones,
starting at the left-most leading 1
and moving to the right (i.e.,
column 2, then column 3).
MTH0001 Algebra 16
Notes on Finding the RREF (cont.)
Alternatively: 𝟏 𝟏 𝟐 𝟑
𝟎 𝟏 −𝟒 −𝟖
After we zero out below the
𝟎 𝟏 𝟏 𝟐
leading 1 in column 1, we can
zero out above and below
each of the remaining leading
ones.

MTH0001 Algebra 17
Solving Linear Systems
• We can find the REF or RREF of any matrix

• Therefore, we can use Gaussian elimination or Gauss-Jordan


elimination to solve any linear system.

1. Gaussian elimination: (1) Find REF of the augmented matrix


(2) Solve using back substitution
2. Gauss-Jordan elimination: (1) Find RREF of the augmented matrix
(2) Solve!

MTH0001 Algebra 18
Ex. 8: Gaussian Elimination
𝒚+ 𝒛 = 𝟐
Solve 𝟐𝒙 + 𝟑𝒚 = −𝟐 using Gaussian elimination.
𝟑𝒙 + 𝟑𝒚 + 𝟔𝒛 = 𝟗
𝟎 𝟏 𝟏 𝟐
The augmented matrix is: 𝟐 𝟑 𝟎อ −𝟐 (Ex. 6)
𝟑 𝟑 𝟔 𝟗
𝟏 𝟏 𝟐 𝟑
1. Find the REF of the augmented matrix: 𝟎 𝟏 −𝟒อ −𝟖 (Ex. 6)
𝟎 𝟎 𝟏 𝟐
2. Solve using back substitution:

MTH0001 Algebra 19
Ex. 9: Gauss-Jordan Elimination
𝒚+ 𝒛 = 𝟐
Solve 𝟐𝒙 + 𝟑𝒚 = −𝟐 using Gauss-Jordan elimination.
𝟑𝒙 + 𝟑𝒚 + 𝟔𝒛 = 𝟗
𝟎 𝟏 𝟏 𝟐
The augmented matrix is: 𝟐 𝟑 𝟎อ −𝟐 (Ex. 7)
𝟑 𝟑 𝟔 𝟗
𝟏 𝟎 𝟎 −𝟏
1. Find the RREF of the augmented matrix: 𝟎 𝟏 𝟎อ 𝟎 (Ex. 7)
𝟎 𝟎 𝟏 𝟐
2. Solve:

MTH0001 Algebra 20
Ex. 8 and Ex. 9: A Unique Solution
𝑦+ 𝑧 = 2
Ex. 8 and Ex. 9 show that 2𝑥 + 3𝑦 = −2 has a unique solution:
3𝑥 + 3𝑦 + 6𝑧 = 9
1. Gaussian elimination (with back substitution):
1 1 2 3
• The REF is 0 1 −4อ −8 → The solution is 𝒙 = −𝟏, 𝒚 = 𝟎, 𝒛 = 𝟐
0 0 1 2
2. Gauss-Jordan elimination:
1 0 0 −1
• The RREF is 0 1 0อ 0 → The solution is 𝒙 = −𝟏, 𝒚 = 𝟎, 𝒛 = 𝟐
0 0 1 2
MTH0001 Algebra 21
Ex. 8 and Ex. 9: Justification
Use either the REF or RREF to count:
1. # leading variables (unknowns whose columns contain leading ones).
2. # nonzero rows in the augmented matrix.
3. # unknowns (1 less than the columns of the augmented matrix).
𝒙 𝒚 𝒛 𝒙 𝒚 𝒛
𝟏 𝟏 𝟐 𝟑 𝟏 𝟎 𝟎 −𝟏
REF: 𝟎 𝟏 −𝟒อ −𝟖 RREF: 𝟎 𝟏 𝟎อ 𝟎
𝟎 𝟎 𝟏 𝟐 𝟎 𝟎 𝟏 𝟐
If # leading variables # nonzero rows # unknowns  unique solution
MTH0001 Algebra 22
𝒙 + 𝒚 + 𝟐𝒛 = 𝟏
Ex. 10: Solve 𝒚+ 𝒛 = 𝟎 using Gauss-Jordan Elimination
𝒙+ 𝒛 = 𝟏

MTH0001 Algebra 23
Ex. 10 (cont.): infinitely Many Solutions
𝒙 𝒚 𝒛
𝟏 𝟎 𝟏 𝟏
The RREF is: 𝟎 𝟏 𝟏อ 𝟎
𝟎 𝟎 𝟎 𝟎
Justification:
1. # leading variables =
2. # nonzero rows =
3. # unknowns =
# leading variables # nonzero rows # unknowns  Infinitely many
solutions
MTH0001 Algebra 24
Ex. 10 (cont.): The General Solution
𝒙 𝒚 𝒛
𝟏 𝟎 𝟏 𝟏 𝒙 +𝒛 = 𝟏
𝟎 𝟏 𝟏อ 𝟎 ≡ 𝒚+𝒛 = 𝟎
𝟎 𝟎 𝟎 𝟎
• The system has infinitely many solutions.
• Express the general solution parametrically (i.e., assign parameters
to the free variables):

MTH0001 Algebra 25
𝒙 + 𝒚 + 𝟐𝒛 = 𝟏
Ex. 11: Solve 𝒙 + 𝒛 = 𝟐 using Gaussian Elimination
𝟐𝒙 + 𝒚 + 𝟑𝒛 = 𝟒

MTH0001 Algebra 26
Ex. 11 (cont.): No Solution
𝒙 𝒚 𝒛
The third equation is incorrect:
𝟏 𝟏 𝟐 𝟏
𝟎+𝟎+𝟎=𝟏
The REF is: 𝟎 𝟏 𝟏อ −𝟏
The system has no solution.
𝟎 𝟎 𝟎 𝟏
Justification:
1. # leading variables =
2. # nonzero rows =
3. # unknowns =
# leading variables # nonzero rows  No solution

MTH0001 Algebra 27
Ex 12: What is the solution…
𝟏 𝟐 𝟎 𝟎 𝟎 𝟕
if the RREF of the augmented matrix is 𝟎 𝟎 𝟏 𝟎 𝟎 𝟏?
𝟎 𝟎 𝟎 𝟏 𝟏 𝟐

• The size of the augmented matrix is:


• Therefore, we have equations in unknowns.
# leading variables =
𝟏 𝟐 𝟎 𝟑 𝟎 𝟕 # nonzero rows =
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏 # unknowns =
𝟎 𝟎 𝟎 𝟏 𝟏 𝟐
MTH0001 Algebra 28
Ex 12 (cont.): The General Solution
𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒙𝟒 𝒙𝟓
𝟏 𝟐 𝟎 𝟎 𝟎 𝟕
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏 ≡
𝟎 𝟎 𝟎 𝟏 𝟏 𝟐

• The free variables are:


• The general solution is:

MTH0001 Algebra 29
𝒙 − 𝒚 + 𝟑𝒛 = 𝟎
Ex 13: Solve 𝟐𝒙 + 𝒚 + 𝟑𝒛 = 𝟎
using Gauss-Jordan elimination.

MTH0001 Algebra 30
𝒙 − 𝟐𝒚 − 𝟖𝒛 = 𝟎
Ex 14: Solve 𝟑𝒙 + 𝟐𝒚 = 𝟎 using Gaussian elimination.
𝒙 − 𝒚 − 𝟕𝒛 = 𝟎

MTH0001 Algebra 31
Gaussian and Gauss-Jordan Elimination
• Both methods can:
1. be used to solve non-homogeneous and homogeneous systems.
2. be used to solve square and non-square systems.
• Square system: number of equations = number of unknowns.
3. deal with the three types of solutions: (1) unique solution, (2)
infinitely many solutions, and (3) no solution.

• These are advantages over other methods which only deal with
square systems which have a unique solution, such as Cramer’s rule
(which employs determinants).
MTH0001 Algebra 32
Summary
• Properties of matrices in REF and RREF
• Two methods for solving linear systems:
1. Gaussian elimination: (1) REF, (2) Solve using back substitution
2. Gauss-Jordan elimination: (1) RREF, (2) Solve!
The linear system has if
A unique solution # leading variables = # nonzero rows = # unknowns
Infinitely many solutions # leading variables = # nonzero rows < # unknowns
No solution # leading variables < # nonzero rows
MTH0001 Algebra 33

You might also like