Gaussian elimination

advertisement
Section 8.2
Solving a System of
Equations Using Matrices
(Guassian Elimination)
2x
+
y
+
3z
=
1
3x
−
2y
+
4z
=
−1
2 1 3
3 −2 4
x
1
y = −1
2x
−
4y
+
2z
=
−2
2 −4 2
z
−2
A
x
b
System of Equations
Ax = b
2
1
3
|
1
3
2
−2
−4
4
2
|
|
−1
−2
Augmented Matrix
System in
matrix form
Not every system has a unique solution.
There are three different possible solutions
• a unique solution
(exactly one solution)
• infinitely many solutions
• no solution
the system is called
consistent
the system is called
inconsistent
1
Starting with an augmented matrix, you have two options:
Use row operations to reduce to:
row-echelon form
reduced row-echelon form
Any row consisting of all zeros must
be on the bottom of the matrix
Row echelon form +
Find all the leading ones.
For all nonzero rows, the first nonzero
All other entries in the column
entry must be a 1. This is called the “leading 1”. containing a leading 1 should be zero
Take any 2 consecutive nonzero rows:
(above and below the leading 1).
The leading 1 for the higher row must be to
the left of the leading 1 of the lower row.
The leading ones must “staircase down”
from left to right.
Reduction to reduced row-echelon
form is called :
Reduction to row-echelon form is called :
Gaussian elimination
Gauss-Jordan elimination
The solution is then found by
back-substitution
The solution is then found by
inspection or by a few simple steps
Row-echelon, Reduced row-echelon, or Neither
1.
2.
3.
1 2 5
|
3
1 0 1
|
5
0 0 1
0 0 0
|
|
2
0
0 0 1
0 1 4
|
|
2
1
row-echelon
1 0 3
0 1 2
neither
4.
|
0
1 0 2 2
0 0 0 1
0 0 0 0
|
|
|
6
0
0
1
4
reduced row-echelon
5.
1 3 0 2
|
|
6.
1 2 0 0
0 0 1 0
0 0 0 1
|
|
|
9
1
7
0 0 0 0
|
0
1
3
−4
|
7
0
0
1
0
2
1
|
|
2
5
neither
reduced row-echelon
row-echelon
Order Matters!
row-echelon – for each column (move left to right), first
get the appropriate leading 1, then get 0’s underneath it.
reduced row-echelon – for each column (move left to right), first
get the appropriate leading 1, then get 0’s above and below it.
2
3 Permitted Row Operations :
(remember: every row represents an equation)
a) Multiply a row by a number
3
−9
6
|
15
5
2
−2
−4
4
2
|
|
−1
−2
1
3
⋅ R1
1
−3
2
|
5
5
2
−2
−4
4
2
|
|
−1
−2
b) Switch rows
1
7
3
|
1
0
0
−2
1
4
2
|
|
−1
−2
1
R2 ↔ R3 0
0
7
1
−2
3
2
4
|
|
|
1
−2
−1
c) Add a multiple of one row to another row
Row that is
not changing
1
−2
1
|
−1
3
2
−2
1
4
3
|
|
−1
1
−3 R1 + R2 = New R2
+
Row you want
to replace
− 3 R1 − 3
R2
3
NewR2 0
6
−2
−3
4
|
|
3
−1
4
1
|
2
1
0
2
−2
4
1
1
1
3
−1
2
1
|
|
|
To get 1’s :
a) Switch Rows if there is a 1 in the same column but
below the desired spot.
1
7
3
|
1
0
0
−2
1
4
2
|
|
−1
−2
1
R2 ↔ R3 0
0
7
1
−2
3
2
4
|
|
|
1
−2
−1
1
k
b) If k is the entry in the desired spot, multiply the row by
if every other entry in the row is divisible by k.
3
−9
6
|
15
5
2
−2
−4
4
2
|
|
−1
−2
1
3
⋅ R1
−3
−2
−4
1
5
2
2
4
2
|
|
|
5
−1
−2
c) Do step b) followed by step a) if there is another row
where every entry is divisible by k.
2
1
3
|
1
3
−2
4
|
−1
2
−4
2
|
−2
1
2
⋅ R3
2
3
1
1
−2
−2
3
4
1
|
|
|
1
1
−1
3
−1 R3 ↔ R1 2
−2
−2
1
1
4
3
|
|
|
−1
−1
1
These are the “easier” ways to get a 1
3
To get 1’s : (continued)
d) Use “elimination” step – add one row to a multiple of
another row
3
−2
4
|
2
2
1
−4
3
7
|
|
−1 − R2 + R1 = New R1
1
−2
1
2
2
−3
1
−4
1
3
7
|
|
|
−2
1
−2
− R2 −2 −1 −3
+
−2
−3
R1 3
NewR1 1
4
1
|
−1
|
|
−1
−2
e) Last Resort – Introduce fractions by multiplying by
−5
−9
−4
2
4
6
7
4
2
|
|
|
11
−1
−2
1
⋅ R1
2
1
4
6
−5
2
−9
−4
7
2
4
2
1
k
11
2
−1
−2
|
|
|
These are the “harder” ways to get a 1
To get 0’s :
Use "elimination" step : add a multiple of one row to another row
Row with the
leading 1 in it
Row you want
to replace
The leading 1 is always obtained before getting the zero(s)
Multiply the row with the “leading” 1 by the same # but opposite sign
of the number you would like to be zero.
1
−2
1
|
−1
3
−2
4
|
2
1
3
|
−1 −3R1 + R2 = New R2
1
+
−3R1 −3
6
−3
|
3
1
−2
1
|
R2 3
NewR2 0
−2
4
4
1
|
|
−1
2
0
4
1
|
2
2
1
3
|
1
−1
4
2x
3x
+
−
y
2y
+
+
3z
4z
=
=
1
−1
2x
−
4y
+
2z
=
−2
2
3
2
1
−2
−4
2
3
1
−2
3
4
|
|
1
−1
2
−4
2
|
−2
1
−2
1
|
−1
3
−2
4
|
2
1
3
|
−1 −3 R1 + R2 = New R2
1
1
0
−2
4
2
1
1
1
2
⋅ R3
|
|
|
|
1
−1
−2
2
1
3
|
1
1
−2
1
|
−1
3
1
−2
−2
4
1
|
|
−1
−1
3
−2
4
|
−1
R3 ↔ R1 2
1
3
|
1
−3R1 −3 6 −3
R2 3 −2 4
|
|
3
−1
|
1
2
−2
1
|
−1
0
4
1
|
2
2
1
3
|
1
+
NewR2 0
−1
2
|
|
3
1
3
4
2
−2 R1 −2
−2 R1 + R3 = New R3
1
1
−2
1
|
−1
0
0
4
5
1
1
|
|
2 − R3 + R2 = New R2
3
+
4
4
−2
|
2
2
1
3
|
1
NewR3 0
5
1
|
R3
+
− R3
0
R2
0
NewR2 0
then
× ( − 1)
1
−2
1
|
−1
0
1
0
|
1
0
5
1
|
3 −5 R2 + R3 = New R3
1
1
−2
1
|
−1
x − 2 y + z = −1
0
0
1
0
0
1
|
|
1
−2
y =1
z = −2
3
−2
1
|
−1
0
0
4
5
1
1
|
|
2
3
−5 −1
|
−3
4
1
|
2
−1
0
|
−1
1
−2
1
|
−1
0
0
1
5
0
1
|
|
1
3
−5
−5 R2 0
+
1
−5
0
|
0
5
1
|
3
NewR3 0
0
1
|
−2
R3
x − 2 (1) + ( −2 ) = −1
x − 4 = −1
x=3
Solution : ( 3,1, −2 )
5
−
−
+
x
2x
−x
2y
3y
3y
−2
+
z
−
3z
=
=
=
−6
−7
11
|
−6
2 −3 0
−1 3 −3
|
|
−7 −2R1 + R2
11 R1 + R3
1
−2
1
|
−6
x − 2 y + z = −6
0
1
−2
|
5
0
0
0
|
0
y − 2z = 5
z is free
1
1
1
0
0
−2 1
1 −2
1 −2
−6
5
5
|
|
|
− R2 + R3
x = −6 + 10 + 4t − t
x = −6 + 2 y − z
y = 5 + 2t
let z = t
x = 4 + 3t
y = 5 + 2t
z =t
Infinitely many solutions
+
−
−
3x
3x
3x
+
−
6y
6y
2y
=
=
=
6z
3z
3
6
6
|
5
3
3
−6 −3
−2 0
|
|
2
1
5
2
1
1
3
1
2
2
|
0
−12
−9
|
−3
0
−8
−6
|
−4
5
1
2
2
|
5
0
1
3
4
|
1
0
0
0
|
−2
No solution
R1
1
3
3
3
−1
12
R2
2 2
−6 −3
−2 0
|
|
|
5
3
2
1
−3R1 + R2
−3R1 + R3
1
2
2
|
5
0
1
3
|
1
0
−8 −6
|
−4
4
3
4
8R2 + R3
3
4
0 x + 0 y + 0 z = −2
0 = −2
FALSE
Inconsistent System
6
A system of linear equations is said to be homogeneous is each of
its equations has a constant term of 0.
a11 x1
+
a12 x2
+
+
a1n xn
=
0
a21 x1
+
a22 x2
+
+
a2 n xn
am1 x1
+
am 2 x2
+
+
amn xn
=
=
−
0
0
0
x1 = 0, x2 = 0, , xn = 0 is always a solution of a homogeneous system.
This solution is called the trivial solution.
This means that a homogeneous system is always consistent.
For a homogeneous system, there are only two different possible solutions :
• a unique solution (the trivial solution)
• infinitely many solutions
What is more interesting is when there is a solution that has one
or more of the variables not zero. A solution of this type is
called a non-trivial solution.
+
x
+
x
2y
−
z
=
0
2y
+
3z
=
0
4y
+
2z
=
0
1
2
−1
|
0
0
1
2
4
3
2
|
|
0
0
− R1 + R3
1
2
−1
|
0
x + 2y − z = 0
0
0
2
0
3
0
|
|
0
0
2 y + 3z = 0
z is free
1
2
−1
|
0
0
0
2
2
3
3
|
|
0
0
x = z − 2y
y = −3 2 t
let z = t
repeated row
x = 4t
There are infinitely many solutions, one in
particular is (8, -3,2). This is a nontrivial solution
found by letting t be 2.
7
In a homogeneous system of equations, if you have more variables
than equations, you are guaranteed to have nontrivial solutions
x
+
3y
−
2z
=
0
x
+
3y
+
4z
=
0
1
3
−2
|
0
1
3
4
|
0
1
3
−2
|
0
x + 3 y − 2z = 0
0
0
6
|
0
6z = 0
− R1 + R2
z=0
x = −3 y
y is free
let y = t
x = −3t
y=t
z=0
With fewer equations than variables you will always have at least
one free parameter, this leads to infinitely many nontrivial solutions
8
Download