Gausselim
Gausselim
2
Solving a System of
Equations Using Matrices
(Guassian Elimination)
2x + y + 3z = 1 2 1 3 x 1 2 1 3 | 1
3x − 2y + 4z = −1 3 −2 4 y = −1 3 −2 4 | −1
2x − 4y + 2z = −2 2 −4 2 z −2 2 −4 2 | −2
A x b
• a unique solution
(exactly one solution)
the system is called
consistent
• infinitely many solutions
1
Starting with an augmented matrix, you have two options:
Use row operations to reduce to:
2
3 Permitted Row Operations :
(remember: every row represents an equation)
a) Multiply a row by a number
3 −9 6 | 15 1
3 ⋅ R1 1 −3 2 | 5
5 −2 4 | −1 5 −2 4 | −1
2 −4 2 | −2 2 −4 2 | −2
b) Switch rows
1 7 3 | 1 1 7 3 | 1
0 −2 4 | −1 R2 ↔ R3 0 1 2 | −2
0 1 2 | −2 0 −2 4 | −1
1 −2 1 | −1 − 3 R1 − 3 6 −3 | 3 1 −2 1 | −1
3 −2 4 | −1 −3 R1 + R2 = New R2 + R2 3 −2 4 | −1 0 4 1 | 2
2 1 3 | 1 NewR2 0 4 1 | 2 2 1 3 | 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 1 7 3 | 1
0 −2 4 | −1 R2 ↔ R3 0 1 2 | −2
0 1 2 | −2 0 −2 4 | −1
1
b) If k is the entry in the desired spot, multiply the row by k
if every other entry in the row is divisible by k.
3 −9 6 | 15 1
3 ⋅ R1 1 −3 2 | 5
5 −2 4 | −1 5 −2 4 | −1
2 −4 2 | −2 2 −4 2 | −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 2 1 3 | 1 1 −2 1 | −1
3 −2 4 | −1 3 −2 4 | −1 3 −2 4 | −1
2 −4 2 | −2 1
2 ⋅ R3 1 −2 1 | −1 R3 ↔ R1 2 1 3 | 1
3
To get 1’s : (continued)
d) Use “elimination” step – add one row to a multiple of
another row
3 −2 4 | −1 − R2 + R1 = New R1 − R2 −2 −1 −3 | −1
2 1 3 | 1 + R1 3 −2 4 | −1
2 −4 7 | −2 NewR1 1 −3 1 | −2
1 −3 1 | −2
2 1 3 | 1
2 −4 7 | −2
1
e) Last Resort – Introduce fractions by multiplying by k
2 −5 7 | 11 1 −5 7 11
⋅ R1 1 |
2 2 2 2
4 −9 4 | −1
4 −9 4 | −1
6 −4 2 | −2
6 −4 2 | −2
To get 0’s :
Use "elimination" step : add a multiple of one row to another row
Row with the Row you want
leading 1 in it to replace
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 | −1 −3R1 + R2 = New R2
2 1 3 | 1
−3R1 −3 6 −3 | 3 1 −2 1 | −1
+ R2 3 −2 4 | −1 0 4 1 | 2
NewR2 0 4 1 | 2 2 1 3 | 1
4
2x + y + 3z = 1 2 1 3 | 1
3x − 2y + 4z = −1 3 −2 4 | −1
2x − 4y + 2z = −2 2 −4 2 | −2
2 1 3 | 1 2 1 3 | 1 1 −2 1 | −1
3 −2 4 | −1 3 −2 4 | −1 3 −2 4 | −1
2 −4 2 | −2 1
2 ⋅ R3 1 −2 1 | −1 R3 ↔ R1 2 1 3 | 1
1 −2 1 | −1
−3R1 −3 6 −3 | 3
3 −2 4 | −1 −3 R1 + R2 = New R2 + R2 3 −2 4 | −1
2 1 3 | 1 NewR2 0 4 1 | 2
1 −2 1 | −1
0 4 1 | 2
2 1 3 | 1
1 −2 1 | −1
0 4 1 | 2 −2 R1 −2 4 −2 | 2
2 1 3 | 1 −2 R1 + R3 = New R3 + R3 2 1 3 | 1
NewR3 0 5 1 | 3
1 −2 1 | −1
0 4 1 | 2
0 5 1 | 3
1 −2 1 | −1 − R3 0 −5 −1 | −3
0 4 1 | 2 − R3 + R2 = New R2 + R2 0 4 1 | 2
0 5 1 | 3 NewR2 0 −1 0 | −1
then
× ( − 1)
1 −2 1 | −1
0 1 0 | 1
0 5 1 | 3
1 −2 1 | −1
0 1 0 | 1 −5 R2 0 −5 0 | −5
0 5 1 | 3 −5 R2 + R3 = New R3 + R3 0 5 1 | 3
NewR3 0 0 1 | −2
1 −2 1 | −1 x − 2 y + z = −1 x − 2 (1) + ( −2 ) = −1 x − 4 = −1 x=3
0 1 0 | 1 y =1
0 0 1 | −2 z = −2
Solution : ( 3,1, −2 )
5
x − 2y + z = −6
2x − 3y = −7
−x + 3y − 3z = 11
1 −2 1 | −6 1 −2 1 | −6
2 −3 0 | −7 −2R1 + R2 0 1 −2 | 5
−1 3 −3 | 11 R1 + R3 0 1 −2 | 5 − R2 + R3
1 −2 1 | −6 x − 2 y + z = −6 x = −6 + 2 y − z x = −6 + 10 + 4t − t
0 1 −2 | 5 y − 2z = 5 y = 5 + 2t
0 0 0 | 0 z is free let z = t
x = 4 + 3t
y = 5 + 2t
Infinitely many solutions z =t
3x + 6y + 6z = 5
3x − 6y − 3z = 2
3x − 2y = 1
3 6 6 | 5 1
3 R1 1 2 2 | 5
3
3 −6 −3 | 2 3 −6 −3 | 2 −3R1 + R2
3 −2 0 | 1 3 −2 0 | 1 −3R1 + R3
1 2 2 | 5
3 1 2 2 | 5
3
0 −12 −9 | −3 −1
12 R2 0 1 3
4 | 1
4 8R2 + R3
0 −8 −6 | −4 0 −8 −6 | −4
1 2 2 | 5
3
0 1 3
4 | 1
4
0 0 0 | −2 0 x + 0 y + 0 z = −2
0 = −2
FALSE
No solution 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 = 0
= 0
am1 x1 + am 2 x2 + + amn xn − 0
x + 2y − z = 0
2y + 3z = 0
x + 4y + 2z = 0
1 2 −1 | 0 1 2 −1 | 0
0 2 3 | 0 0 2 3 | 0
1 4 2 | 0 − R1 + R3 0 2 3 | 0 repeated row
1 2 −1 | 0 x + 2y − z = 0 x = z − 2y x = 4t
0 2 3 | 0 2 y + 3z = 0 y = −3 2 t
0 0 0 | 0 z is free let z = t
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 − R1 + R2
x = −3t
1 3 −2 | 0 x + 3 y − 2z = 0 x = −3 y y is free
0 0 6 | 0 6z = 0 z=0 let y = t 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