Animation of the GaussJordan Elimination Algorithm Developed by
Animation of the Gauss-Jordan Elimination Algorithm – Developed by James Orlin, MIT and James Orlin © 2003 1
Solving a System of Equations To solve a system of equations, use Gauss-Jordan elimination. MIT and James Orlin © 2003 2
To solve the system of equations: x 1 x 2 x 3 x 4 1 2 4 1 = 0 2 1 -1 -1 = 6 -1 1 2 2 = -3 MIT and James Orlin © 2003 3
Pivot on the element in row 1 column 1 x 2 x 3 x 4 1 2 4 1 = 0 02 -3 1 -1 -9 -1 -3 = 6 -1 0 31 62 32 = -3 Subtract 2 times constraint 1 from constraint 2. Add constraint 1 to constraint 3. MIT and James Orlin © 2003 4
Pivot on the element in Row 2, Column 2 x 1 x 2 x 3 x 4 1 02 -2 4 -1 1 = 40 0 -3 1 -9 3 -3 1 = -2 6 0 03 -3 6 03 = -3 3 Divide constraint 2 by -3. Subtract multiples of constraint 2 from constraints 1 and 3. MIT and James Orlin © 2003 5
Pivot on the element in Row 3, Column 3 x 1 x 2 x 3 x 4 1 0 -2 0 -1 = 24 0 1 03 1 = -2 1 0 0 -3 1 0 = -1 3 Divide constraint 3 by -3. Add multiples of constraint 3 to constraints 1 and 2. MIT and James Orlin © 2003 Suppose x 4 = 0. What are x 1, x 2, x 3? 6
The fundamental operation: pivoting x 1 x 2 x 3 x 4 a 11 a 12 a 13 a 14= b 1 = b 2 = a 21 a 22 a 23 a 24 = a 31 a 32 a 33 a 34 Pivot on a 23 MIT and James Orlin © 2003 = = b 3 7
Pivot on a 23 a 11 =a 11 –a 13(a 21/a 23) x 1 x 2 x 3 x 4 a a 1111 a 12 a 013 a 14= = b 1 a 123 = a 24 a/a 24 23 = = b 2 b/a 2 23 a 033 a 34 a 21 a/a 21 23 a 22 22 23 a 31 a 32 = b 3 What will be the next coefficient of b 1? MIT and James Orlin © 2003 a 32? of aij for i 2? 8
- Slides: 8