Gauss Jordan Elimination
Gauss-Jordan Elimination
The steps of the Gauss-Jordan elimination process are as follows:
- Input augmented matrix A
- Get the reduced echelon form for A using elementary row operations. This is done by first creating leading 1s, then ensuring that columns containing leading 1s have only 0s above and below the leading 1, column by column starting with the first column.
- The matrix in reduced echelon form will either give the solution or demonstrate that there is no solution.
Two matrices A and B are row equivalent if A =>* B by elementary row operations. During the process of Gauss-Jordan elimination all matrices are row equivalent to the original and each other.
Example
x1 + 2x2 + x3 = 1 2x1 + 4x2 - x3 = -1 [ 1 2 1 1 ] [ 1 2 1 1 ] [ 2 4 -1 -1 ] => [ 0 0 -3 -3 ] R2 := R2 - 2R1 [ 1 2 1 1 ] [ 0 0 1 1 ] R2 := R2 / -3 To fix column 3: [ 1 2 0 0 ] R1 := R1 - R2 [ 0 0 1 1 ] (this is in reduced echelon form) So... x1 = -2x2 x2 = anything x3 = 1 The system has many solutions.
In general, any columns without a leading one of them correspond to a variable that can be any value.
The difficult part of Gauss-Jordan elimination is the bit in the middle—deciding which columns to manipulate and how to convert them in to leading 1s. Consider a matrix An x m in the middle of the computation. Some number il of rows have leading 1s in them and some number j of columns have been processed. j ≥ il
[ a1 ... a1m b1 ]
A = [ ... ]
[ an ... anm bn ]
The matrix now looks like this:
j
0 0 ... 0 1 0 ... 0 ...
...
il 0 0 ... 0 0 0 ... 1 ...
...
0 0 ... 0 0 0 ...
Next step: Increment j. Look in column j for aoj ≠ 0, with i > il—now interchange row i and row il + 1 (if nothing found, move on to next columns. Create a leading 1, then reduce column j.
Pseudo code for Gauss-Jordan elimination
il = 0 (number of leading 1s created)
for j = 1 ... m do:
if ∃ i > il such that aij ≠ 0 then:
il = il + 1
interchange row i and row il (this brings the new row
just below the row you have just done)
divide row i by ailj creating a leading 1
Reduce all other entries in the column to 0
Complexity
Suppose A is n x m. We can measure complexity by the number of +, -, *, / operations that are carried out. To do this we look at the pseudo code. If we run the main loop m times:
- The interchange operation takes 2m operations
- Dividing row i by ailj takes m-j operations
- The reduce other entries bit takes nm operations
So the complexity of the operation is O(mnm) or O(nm2)
Additional Resources
- Wikipedia has an excellent explanation of Gauss-Jordan Elimination
- The Gauss-Jordan elimination game is a javascript puzzle
- This page explains the Gauss-Jordan algorithm in a bit more depth
Homogeneous Systems
A system of linera equations is homogeneous if all of the constant terms are 0. For example:
3x1 + 2x2 = 0 x1 - x2 = 0
A homogeneous system in n variables always has the trivial solution x1 = x2 = ... = 0—so there is no chance that the system will have no solutions, reducing the possible outcomes from three to two.
Theorem
A homogeneous system with more unknowns than equations always has many solutions
Proof
Suppose the system has n equations with m unknowns, and m > n.
Let A = the augmented matrix
Find R = reduced echelon form of A using Gauss-Jordan elimination.
m
1 . . . . . . .
0 1 . . . . . .
n 0 0 1 . . . . .
0 0 0 1 . . . .
0 0 0 0 1 . . .
R has ≤ n leading 1s, so at least m-n of the variables can take any value. This shows that there are many solutions.
Example
x1 + 2x2 + x3 = 0
x2 - x3 = 0
This is the intersection of two planes through the origin in 3D space.
Matrix notation for a system of equations
[ a11x1 + ... + a1mxm = b1 ]
[ ... ] can be written as AX = B
[ an1x1 + ... + anmxm = bn ]
[ a1 ... a1m ]
A = [ ... ]
[ an1 ... anm ]
[ x1 ] [ b1 ]
X = [ . ] B = [ ]
[ xn ] [ bn ]
george mouschis - 24th November 2002 23:41 - #
OGUNGBAIGBE - 13th December 2002 01:52 - #
OGUNGBAIGBE - 13th December 2002 02:02 - #
roy - 21st September 2003 18:55 - #
roy - 21st September 2003 18:56 - #
Jilcae - 18th February 2004 08:22 - #
bikesh - 15th September 2004 04:09 - #
Ryan - 2nd November 2004 20:36 - #
Steve Granados - 15th February 2005 03:22 - #
Derek Hodkinson - 21st February 2005 22:48 - #
Abhishek - 30th March 2005 10:37 - #
tirivacho jacha - 17th May 2005 09:11 - #
tirivacho jacha - 17th May 2005 09:14 - #
G.selvendran - 2nd July 2005 17:40 - #
G.selvendran - 2nd July 2005 18:02 - #
Marseille Aranco - 10th September 2005 07:20 - #
Marseille Aranco - 10th September 2005 07:32 - #
carl - 23rd September 2005 01:29 - #
anam - 6th December 2005 11:32 - #
GOD! - 12th December 2005 10:29 - #
Luca - 22nd December 2005 16:25 - #
Luca - 22nd December 2005 16:27 - #
Roosevelt - 24th December 2005 21:19 - #
said badr - 14th March 2006 02:31 - #
rajesh>k - 16th March 2006 10:45 - #
rajesh.k - 16th March 2006 10:53 - #
Anand - 21st March 2006 09:00 - #
neetish - 22nd March 2006 16:58 - #
Ms.Chaxu Vyas - 23rd March 2006 06:29 - #
Arnildo - 3rd April 2006 21:41 - #
Lila - 10th April 2006 22:30 - #
Aysha - 16th April 2006 11:31 - #
ZED - 17th April 2006 15:17 - #
philip - 21st April 2006 18:21 - #
danielsantos - 8th July 2006 17:20 - #
marc miranda - 24th July 2006 06:41 - #
ashish - 4th August 2006 13:08 - #
ashish - 4th August 2006 13:10 - #
Durga Shankar - 6th August 2006 11:14 - #
alan garris - 9th August 2006 05:07 - #
Sanjoy bhowmik - 15th August 2006 21:07 - #
reggie - 22nd August 2006 13:58 - #
Ramya - 30th August 2006 15:56 - #
rofl - 12th September 2006 18:25 - #
jonathan - 18th September 2006 11:01 - #
Phumy - 24th October 2006 16:34 - #