Gaussjordan
Gaussjordan
a11x + a12y = b1
a21x + a22y = b2
Step 1:
A a11 a12 b1
B a21 a22 b2
Step 2:
Obtain a 1 where a11 is. This requires a multiplication or division step; or, if there is a 1
directly below a11, an exchange of rows. So, multiply all the entries in row A by 1/a11 or
divide all the entries in row A by a11.
a12 b1
A 1
a11 a11
B a21 a22 b2
Now, our matrix is looking pretty ugly, so we‘ll improve its looks by re-labeling the entries:
A 1 c12 d1
B a21 a22 b2
Step 3:
We now need to get a 0 where a21 is. This requires an addition or subtraction step (similar
to our foolproof method). So, working column by column, replace row B with
A 1 c12 d1
B ( a21 ) - ( a21 ) (1) ( a22 ) - ( a21 ) ( c12 ) ( b2 ) œ ( a21 ) (d1 )
A 1 c12 d1
B 0 c22 d2
Step 4:
We now need to get a 1 where c22 is. This requires a multiplication or division step. So,
multiply all the entries in row B by 1/c22 or divide all the entries in row B by c22.
A 1 c12 d1
d2
B 0 1
c 22
A 1 c12 d1
B 0 1 f2
7/8/2005
Page 2 of 2
Step 5:
We now need to get a 0 where c12 is. We must not mess up the first column. This requires
an addition or subtraction step. So, working column by column, replace row A by
B 0 1 f2
A 1 0 f1
B 0 1 f2
Step 6:
Interpret the matrix.
x = f1
y = f2
EXAMPLE 1
Solve: 3x + 2y = 13
4x + 3y = 18
Step 1:
Write the augmented matrix:
A 3 2 13
B 4 3 18
7/8/2005
Page 3 of 3
Step 2:
Divide the entries in row A by 3.
A 1 2/3 13/3
B 4 3 18
Step 3:
Replace row B by (the entry from row B ) - (4) (the entry from row A )
A 1 2/3 13/3
A 1 2/3 13/3
B 0 1/3 2/3
Step 4:
Multiply all the entries in row B by 3.
A 1 2/3 13/3
B 0 1 2
Step 5:
Replace row A by (the entry from row A ) - (2/3) ( the entry from Row B)
B 0 1 2
7/8/2005
Page 4 of 4
Perform the calculations.
A 1 0 3
B 0 1 2
Step 6:
Interpret the matrix.
x = 3
y = 2
WILL BE SHORTENED TO
A - 2B
EXAMPLE 2
Solve: 5x - 2y = 16
4x + 3y = -1
Step 1:
Make the matrix
A 5 -2 16
B 4 3 -1
7/8/2005
Page 5 of 5
Step 2:
Multiply each entry in row A by 1/5
A 1 -2/5 16/5
B 4 3 -1
Step 3:
Column by column, replace row B by B - 4A
A 1 -2/5 16/5
A 1 -2/5 16/5
B 0 23/5 -69/5
Step 4:
Multiply each entry in row B by 5/23
A 1 -2/5 16/5
B 0 1 -3
Step 5:
Column by column, replace row A by A œ ( -2/5 ) B or A + ( 2/5 ) B
B 0 1 -3
7/8/2005
Page 6 of 6
Perform the calculations.
A 1 0 2
B 0 1 -3
Step 6:
Interpret the matrix.
x = 2
y = -3
EXAMPLE 3
Solve: 7x - 5y = -70
x + 3y = 16
Step 1:
Write the matrix.
A 7 -5 -70
B 1 3 16
Step 2:
Exchange rows A and B.
A 1 3 16
B 7 -5 -70
7/8/2005
Page 7 of 7
Step 3:
Column by column, replace row B by B - 7A
A 1 3 16
B ( 7 ) - ( 7 ) (1) ( -5 ) - ( 7 ) ( 3 ) ( -70 ) œ ( 7 ) ( 16 )
A 1 3 16
B 0 -26 -182
Step 4:
Multiply each entry in row B by -1/26
A 1 3 16
B 0 1 7
Step 5:
Column by column, replace row A by A - 3B
A ( 1 ) - ( 3 ) (0) ( 3 ) - ( 3) ( 1 ) ( 16 ) - ( 3 ) ( 7 )
B 0 1 7
A 1 0 -5
B 0 1 7
7/8/2005
Page 8 of 8
Step 6:
Interpret the matrix.
x = -5
y = 7
EXAMPLE 4
Solve: x + 5y + 7z = 20
2x - 3y + 4z = 4
3x + y - 2z = 9
Step 1:
Write the matix.
A 1 5 7 20
B 7 -3 4 4
C 3 1 -2 9
Step 2:
It is already accomplished since we have a 1 in the first column of row A.
7/8/2005
Page 9 of 9
Step 3:
To get zeros in the first column of rows B and C, do the following replacements
Row B is replaced by B - 2A
and
Row C is replaced by C - 3A
A 1 5 7 20
A 1 5 7 20
C 0 -1 -23 -51
Step 4:
To get a 1 in the second column of row B, multiply each entry in row B by -1/13.
A 1 5 7 20
B 0 1 10/13 36/13
7/8/2005
Page 10 of 10
Step 5:
To get zeros in the second column of row A and C, do the following replacements
Row A is replaced by A - 5B
and
Row C is replaced by C - ( -14 ) B = C + 14B
A (1) - (5) (0) (5) - (5) (1) (7) - (5) (10/13) (20) - (5) (36/13)
B 0 1 10/13 36/13
C (0) + (14) (0) (-14) + (14) (1) (-23) + (14) (10/13) (-51) + (14) (36/13)
A 1 0 41/13 80/13
B 0 1 10/13 36/13
C 0 0 -159/13 -159/13
Step 6:
To get a 1 in the third column of row C, multiply row C by -13/159
A 1 0 41/13 80/13
B 0 1 10/13 36/13
C 0 0 1 1
7/8/2005
Page 11 of 11
Step 7:
To get zeros in the third column of rows A and B, do the following replacements
Row A by A - (41/13) C
and
Row B by B - (10/13) C
A ( 1 ) - ( 41/13 ) ( 0) (0) - (41/13) (0) ( 41/13 ) - ( 41/13) (1) (80/13) - (41/13) (1)
B (0) - (10/13) (0) (1) - (10/13) (0) (10/13) - (10/13) (1) (36/13) - (10/13)(1)
C 0 0 1 1
A 1 0 0 3
B 0 1 0 2
C 0 0 1 1
Step 8:
Interpret the matrix.
x = 3
y = 2
z = 1
7/8/2005
Page 12 of 12
EXAMPLE 5
Solve: 3x + 7y - 2z = 2
x - 5y + z = 13
2x + 3y - 10z = -23
Step 1:
Write the matrix.
A 3 7 -2 2
B 1 -5 1 13
C 2 3 -10 -23
Step 2:
Exchange rows A and B.
A 1 -5 1 13
B 3 7 -2 2
C 2 3 -10 -23
Step 3:
Replace row B by B - 3A
and
Row C by C - 2A
A 1 -5 1 13
B ( 3) - ( 3) ( 1 ) ( 7 ) - ( 3 ) ( -5 ) ( -2 ) - ( 3 ) ( 1 ) ( 2 ) - ( 3 ) ( 13 )
7/8/2005
Page 13 of 13
Perform the calculations.
A 1 -5 7 13
B 0 22 -5 -37
C 0 13 -12 -49
Step 4:
Multiply row B by 1/22
A 1 -5 1 13
B 0 1 -5/22 -37/22
C 0 13 -12 -49
Step 5:
Replace row A by A - (-5) B = A + 5B
and
Row C by C - 13B
B 0 1 -5/22 -37/22
A 1 0 -3/22 101/22
B 0 1 -5/22 -37/22
C 0 0 -199/22 -597/22
7/8/2005
Page 14 of 14
Step 6:
Multiply row C by -22/199
A 1 0 -3/22 101/22
B 0 1 -5/22 -37/22
C 0 0 1 3
Step 7:
Replace row A by A - (-3/22) C = A + ( 3/22 ) C
and
Row B by B - (-5/22)C = B + (5/22)C
A ( 1 ) + ( 3/22 ) ( 0) (0) + (3/22) (0) ( -3/22 ) + ( 3/22) (1) (101/22) + (3/22) (3)
B (0) + (5/22) (0) (1) + (5/22) (0) (-5/22) + (5/22) (1) (-37/22) + (5/22) (3)
C 0 0 1 3
A 1 0 0 5
B 0 1 0 -1
C 0 0 1 3
Step 8:
Interpret the matrix
x = 5
y = -1
z = 3
7/8/2005
Page 15 of 15
EXAMPLE 6
Solve: x + 3y - 7z = -51
2x + y + 4z = 5
3x - 4y + z = 26
Step 1:
Write the matrix.
A 1 3 -7 -51
B 2 1 4 5
C 3 -4 1 26
Step 2:
Not necessary in this problem
Step 3:
Replace row B by B - 2A
and
Row C by C - 3A
A 1 3 -7 -51
B ( 2) - ( 2) ( 1 ) ( 1 ) - ( 2) ( 3 ) ( 4 ) - ( 2 ) ( -7 ) ( 5) - ( 2 ) ( -51 )
A 1 3 -7 -51
B 0 -5 18 107
C 0 -13 22 179
7/8/2005
Page 16 of 16
Step 4:
Multiply row B by -1/5
A 1 3 -7 -51
B 0 1 -18/5 -107/5
C 0 -13 22 179
Step 5:
Replace row A by A - 3B
and
Row C by C - (-13)B = C + 13B
B 0 1 -18/5 -107/5
C (0) + (13) (0) (-13) + (13) (1) (22) + ( 13) (-18/5) (179) + (13)(-107/5)
A 1 0 19/5 66/5
B 0 1 -18/5 -107/5
C 0 0 -124/5 -496/5
Step 6:
Multiply row C by -5/124
A 1 0 19/5 66/5
B 0 1 -18/5 -107/5
C 0 0 1 4
7/8/2005
Page 17 of 17
Step 7:
Replaced row A by A - (19/5)C
and
Row B by B - (-18/5)C = B + (18/5) C
A ( 1 ) - ( 19/5 ) ( 0) (0) - (19/5) (0) ( 19/5 ) - ( 19/5) (1) (66/5) - (19/5) (4)
B (0) + (18/5) (0) (1) + (18/5) (0) (-18/5) + (18/5) (1) (-107/5) + (18/5) (4)
C 0 0 1 4
A 1 0 0 -2
B 0 1 0 -7
C 0 0 1 4
Step 8:
Interpret the matrix
x = -2
y = -7
z = 4
7/8/2005
Page 18 of 18