How do you solve using gaussian elimination or gauss-jordan elimination, 3x-2y-z=7, z=x+2y-5, -x+4y+2z=-4?
1 Answer
(x,y,z) = (2,1/2,-2)
Try setting up a matrix:
[(3,-2,-1,|,7),(1,2,-1,|,5),(-1,4,2,|,-4)]
Do note that your second equation has
To row-reduce this using gaussian elimination, simply row-reduce this using elementary row operations, i.e. any of the following in any combination:
- Scale a row, i.e.
cR_i , wherec is a constant. - Add row
i onto rowj and store in rowj , i.e.R_i + R_j
Hence, if I write
Our process in general will be to get the matrix down to a solvable form. Gauss-Jordan elimination would have gotten it down to reduced-row-echelon form, though that is not necessary to solve this system.
stackrel(R_2 + R_3" ")(->)[(3,-2,-1,|,7),(1,2,-1,|,5),(0,6,1,|,1)]
stackrel(-1/3R_1 + R_2" ")(->)[(3,-2,-1,|,7),(0,8/3,-2/3,|,8/3),(0,6,1,|,1)]
stackrel(3/2R_2" ")(->)[(3,-2,-1,|,7),(0,4,-1,|,4),(0,6,1,|,1)]
stackrel(R_3 + R_2; 1/5R_2" ")(->)[(3,-2,-1,|,7),(0,2,0,|,1),(0,6,1,|,1)]
Good enough; we can solve backwards now. The current system of equations looks like:
3x - 2y - z = 7
0x + 2y + 0 = 1
0x + 6y + 1 = 1
Thus, from the second equation we have:
2y = 1 => color(green)(y = 1/2)
6y + z = 1
=> 6(1/2) + z = 1 => color(green)(z = -2)
3x - 2y - z = 7
=>3x - 2(1/2) - (-2) = 7
=> 3x = 6 => color(green)(x = 2)
Hence, we got
Let's check...
3x - 2y - z
= 3(2) - 2(1/2) - (-2) = 6 - 1 + 2 = 7 color(blue)(sqrt"")
x + 2y - 5
= 2 + 2(1/2) - 5 = 2 + 1 - 5 = -2 color(blue)(sqrt"")
-x + 4y + 2z
= -(2) + 4(1/2) + 2(-2) = -2 + 2 - 4 = -4 color(blue)(sqrt"")