LA Chapter1-2
LA Chapter1-2
Gaussian Elimination
李龍豪 (Lung-Hao Lee)
助教信箱:[email protected]
Row Echelon Form
• To be of row echelon form (列梯型), a matrix must have the
following properties
① If a row does not consist entirely of zeros, the the rst nonzero
number is the row is 1. We called this is a leading 1 (⾸項1)
② If there are any rows that consist entirely of zeros, then they
are grouped together at the bottom of the matrix. (元素全為0
的列,置於矩陣底部)
2
fi
Examples for Row Echelon Form
⎡ 1 4 −3 7 ⎤ ⎡ 1 1 0 ⎤
⎢ ⎥ ⎢ ⎥
⎢ 0 1 6 2 ⎥ ⎢ 0 1 0 ⎥
⎢⎣ 0 0 1 5 ⎥⎦ ⎢⎣ 0 0 0 ⎥⎦
⎡ 0 1 2 6 0 ⎤
⎢ ⎥
⎢ 0 0 1 −1 0 ⎥
⎢⎣ 0 0 0 0 1 ⎥⎦
3
Reduced Row Echelon Form
• A matrix that is in reduced row echelon form (簡約列梯型)
must have the following properties
4
Examples for Reduced Row Echelon Form
⎡ 1 0 0 4 ⎤ ⎡ 1 0 0 ⎤
⎢ ⎥ ⎢ ⎥
⎢ 0 1 0 7 ⎥ ⎢ 0 1 0 ⎥
⎢⎣ 0 0 1 −1 ⎥⎦ ⎢⎣ 0 0 1 ⎥⎦
⎡ 0 1 −2 0 1 ⎤
⎢ ⎥ ⎡ 0 0 ⎤
⎢ 0 0 0 1 3 ⎥
⎢ ⎥
⎢ 0 0 0 0 0 ⎥ ⎣ 0 0 ⎦
⎢ 0 0 0 0 0 ⎥⎦
⎣
5
More Examples
• Row echelon form * denotes any real numbers
⎡ 1 * * * ⎤ ⎡ 1 * * * ⎤ ⎡ 1 * * * ⎤ ⎡ 0 1 * * * * * * * * ⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
0 1 * * 0 1 * * 0 1 * * ⎢ 0 0 0 1 * * * * * * ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ 0 0 1 * ⎥ ⎢ 0 0 1 * ⎥ ⎢ 0 0 0 0 ⎥ ⎢ 0 0 0 0 1 * * * * * ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 0 0 0 0 0 1 * * * * ⎥
⎣ 0 0 0 1 ⎦ ⎣ 0 0 0 0 ⎦ ⎣ 0 0 0 0 ⎦ ⎢ ⎥
⎢⎣ 0 0 0 0 0 0 0 0 1 * ⎥⎦
6
Unique Solution
• Suppose that the augmented matrix for a linear system in
the unknowns x1, x2, x3, and x4 has been reduced by
elementary row operations to ⎡ 1 0 0 0 3 ⎤
⎢ ⎥
⎢ 0 1 0 0 −1 ⎥
⎢ 0 0 1 0 0 ⎥
⎢ 0 0 0 1 5 ⎥
⎣ ⎦
• This matrix is in reduced row echelon form and
correspond to the equations
x1 =3
x4 = 5
7
Linear Systems in Three Unknowns
• Given reduced row echelon form, solve the system
⎡ 1 0 0 0 ⎤ ⎡ 1 0 3 −1 ⎤ ⎡ 1 −5 1 4 ⎤
(a) ⎢ ⎥ (b) ⎢ ⎥ (c) ⎢ ⎥
⎢ 0 1 2 0 ⎥ ⎢ 0 1 −4 2 ⎥ ⎢ 0 0 0 0 ⎥
⎢⎣ 0 0 0 1 ⎥⎦ ⎢⎣ 0 0 0 0 ⎥⎦ ⎢⎣ 0 0 0 0 ⎥⎦
8
fi
Leading variables vs. Free variables
10
fi
fi
Elimination procedure
• How easy it is to solve a system of linear equations once
its augmented matrix is reduced row echelon form
⎡ 0 0 −2 0 7 12 ⎤ ⎡ 1 2 0 3 0 7 ⎤
⎢ ⎥ ⎢ ⎥
⎢ 2 4 −10 6 12 28 ⎥ ⎢ 0 0 1 0 0 1 ⎥
⎢⎣ 2 4 −5 6 −5 −1 ⎥⎦ ⎢⎣ 0 0 0 0 1 2 ⎥⎦
11
Elimination procedure: Step 1
• Locate the leftmost column that dose not consist entirely
of zeros (找出不全為零元素的最左⾏)
⎡ 0 0 −2 0 7 12 ⎤
⎢ ⎥
⎢ 2 4 −10 6 12 28 ⎥
⎢⎣ 2 4 −5 6 −5 −1 ⎥⎦
12
Elimination procedure: Step 2
• Interchange the top row with another row, if necessary, to
bring a nonzero entry to the top of the column in Step 1
(視需要,以另⼀列交換最頂列)
⎡ 2 4 −10 6 12 28 ⎤
⎢ ⎥ The rst and second
⎢ 0 0 −2 0 7 12 ⎥ rows in the preceding
matrix were interchanged
⎢⎣ 2 4 −5 6 −5 −1 ⎥⎦
13
fi
Elimination procedure: Step 3
• If the entry that is now at the top of the column found in
Step 1 is a, multiply the rst row by 1/a in order to
introduce a leading 1 (若找出的⾏最頂端的元素是a, 則將
第⼀列乘以1/a)
⎢⎣ 2 4 −5 6 −5 −1 ⎥⎦
14
fi
fi
Elimination procedure: Step 4
• Add suitable multiples of the top row to the rows below so
that all entries below the leading 1 becomes zero (將頂列乘
以適當倍數加置底下幾列,使其在⾸項1底下的元素皆變為0)
⎡ 1 2 −5 3 6 14 ⎤
⎢ ⎥
⎢ 0 0 −2 0 7 12 ⎥ -2 times the rst row of
⎢⎣ 0 0 5 0 −17 −29 ⎥⎦ the preceding matrix was
added to the third row
15
fi
Elimination procedure: Step 5
• Now cover the top row in the matrix and begin again with Step
1 applied to the submatrix that remains. Continue in this way
until the entire matrix is in row echelon form (保留矩陣的頂列且
重新使⽤步驟1處裡留下的⼦矩陣,直到整成列梯型)
⎡ ⎤
⎡ 1 2 −5 3 6 14 ⎤ ⎢ ⎥
⎢ ⎥ ⎢ 1 2 −5 3 6 14 ⎥
⎢ 0 0 −2 0 7 12 ⎥
⎢ 7 ⎥
⎢⎣ 0 0 5 0 −17 −29 ⎥⎦ ⎢ 0 0 1 0 −2 −6 ⎥
Leftmost ⎢ ⎥
nonzero column ⎢ 0 0 0 0 1 1 ⎥
in the submatrix ⎢⎣ 2 ⎥⎦
Leftmost
⎡ 1 2 −5 3 6 14 ⎤ nonzero column
⎢ ⎥ in the
⎢ 0 0 1 0 −7 −6 ⎥ Row
new sub matrix
⎢ 2 ⎥ Echelon
⎢ 0 0 0 0 1 2 ⎥⎦
Form
⎣
Elimination procedure: Step 6
• Beginning with the last nonzero row and working upward, add
suitable multiples of each row to the rows above to introduce
zeros above the leading 1’s (由最後的非零列開始往上做,使得
⾸項1上⾯皆為0)
⎡ 1 2 −5 3 6 14 ⎤ ⎡ 1 2 −5 3 6 14 ⎤ 7/2 times the third row of the
⎢
⎢ 0 0 1 0 −7
⎥
⎢ ⎥
⎢ 2
−6 ⎥
⎥ ⎢ 0 0 1 0 0 1 ⎥ preceding matrix was added
⎢ 0 0 0 0 1 2 ⎥⎦
⎣ ⎢⎣ 0 0 0 0 1 2 ⎥⎦ to the second row
17
fi
fi
Gauss-Jordan Elimination
• The procedure (algorithm) we have just described for reducing a
matrix to reduced row echelon form is called Gauss-Jordan
Elimination (⾼斯-喬丹消去法). This method consists of two parts
18
Solved by Gauss-Jordan Elimination(1/5)
⎡ 1 3 −2 0 2 0 0 ⎤
⎢ ⎥
⎢ 2 6 −5 −2 4 −3 −1 ⎥
⎢ 0 0 5 10 0 15 5 ⎥
⎢ 2 6 0 8 4 18 6 ⎥⎦
⎣
19
Solved by Gauss-Jordan Elimination(2/5)
• Adding -2 times the rst row to the second and fourth
rows gives
⎡ 1 3 −2 0 2 0 0 ⎤
⎢ ⎥
⎢ 0 0 −1 −2 0 −3 −1 ⎥
Step 4
⎢ 0 0 5 10 0 15 5 ⎥
⎢ 0 0 4 8 0 18 6 ⎥⎦
⎣
⎡ 1 3 −2 0 2 0 0 ⎤
⎢ ⎥
⎢ 0 0 1 2 0 3 1 ⎥ Step 2
Row
Echelon ⎢ 1 ⎥
⎢ 0 0 0 0 0 1
Form 3 ⎥ Step 3
⎢ ⎥
⎢⎣ 0 0 0 0 0 0 0 ⎥⎦
21
Solved by Gauss-Jordan Elimination(4/5)
• Adding -3 times the third row to the second row and then
adding 2 times the second row of the resulting matrix to
the rst row yields the reduced row echelon form
⎡ 1 3 0 4 2 0 0 ⎤
⎢ ⎥
Reduced ⎢ 0 0 1 2 0 0 0 ⎥
Row ⎢ 1 ⎥
Echelon ⎢ 0 0 0 0 0 1 ⎥
Form 3
⎢ ⎥
⎢⎣ 0 0 0 0 0 0 0 ⎥⎦
22
fi
Solved by Gauss-Jordan Elimination(5/5)
• The corresponding system of equations is
⎡ 1 3 0 4 2 0 0 ⎤ x1 + 3x2 +4x4 + 2x5 =0
⎢ ⎥
⎢ 0 0 1 2 0 0 0 ⎥
⎢ 1 ⎥ x3 + 2x4 =0
⎢ 0 0 0 0 0 1 ⎥
3
⎢ ⎥ 1
⎢⎣ 0 0 0 0 0 0 0 ⎥⎦ x6 =
3
• Solving for the leading variables we obtain
1
x1 = −3x2 − 4x4 − 2x5 , x3 = −2x4 , x6 =
3
24
Nontrivial solutions
• Because a homogeneous linear system always has the trivial solution,
there are only two possibilities for its solutions
25
fi
Solve the homogeneous linear system
• Assigning the free variables x2, x4, and x5, we can express
the solution set parametrically
x1=-3r-4s-2t, x2=r, x3=-2s, x4=s, x5=t, x6=0
Note that the trivial solution results when r=s=t=0
27
More about homogeneous linear systems
X k1 + ∑( )=0
X k1 + ∑( ) = 0
...
X kr + ∑ ( )=0
28
Theorems for Homogeneous System
Theorem 1.2.1
Free Variable Theorem for Homogeneous System
Theorem 1.2.2
29
fi
Solved by Back-Substitution
• For large linear systems that require a computer solution, it’s
generally more e cient to use Gaussian elimination
(reduction to row echelon form) followed by a technique
known as back-substitution (倒回代換法)
30
ffi
Back-Substitution: Step 1
• Solving the equations for the leading variables
31
Back-Substitution: Step 2
• Beginning with the bottom equation and working upward,
successively substitute each equation into all the
equations above it
1
x1 = −3r − 4s − 2t, x2 = r , x3 = −2s , x4 = s, x5 = t , x6 =
3
33
More Examples for Back-Substitution
• These matrices are all in row echelon form but not reduced
roe echelon form. Discuss the existence and uniqueness of
solutions to the corresponding linear systems
• The reduced row echelon form and all row echelon forms
of a matrix A have the same number of zero rows, and the
leading 1’s always occur in the same positions in the
row echelon forms of A. Those are called the pivot
positions (軸元位置) of A. The columns containing the
leading 1’s are called the pivot columns (軸元⾏) of A
35
Pivot Positions and Columns
⎡ 0 0 −2 0 7 12 ⎤
• A row echelon form of A = ⎢
⎢ 2 4 −10 6 12 28
⎥
⎥
⎢⎣ 2 4 −5 6 −5 −1 ⎥⎦
⎡ 1 2 −5 3 6 14 ⎤
to be ⎢ ⎥
⎢ 0 0 1 0 −7 −6 ⎥
⎢ 2 ⎥
⎢ 0 0 0 0 1 2 ⎥⎦
⎣
36
Chapter 1.2
Concept Review
• Reduced row echelon form / row echelon form
• Back-substitution
37