0% found this document useful (0 votes)
1K views19 pages

Gauss Jordan Method

The document describes solving systems of linear equations using Gauss-Jordan elimination. It introduces the concept of representing the system as an augmented matrix and using row operations to put the matrix in reduced row echelon form. This reveals the solution to the system. Pivoting techniques like partial and full pivoting are discussed to improve numerical stability when solving systems.

Uploaded by

marcelita2789
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views19 pages

Gauss Jordan Method

The document describes solving systems of linear equations using Gauss-Jordan elimination. It introduces the concept of representing the system as an augmented matrix and using row operations to put the matrix in reduced row echelon form. This reveals the solution to the system. Pivoting techniques like partial and full pivoting are discussed to improve numerical stability when solving systems.

Uploaded by

marcelita2789
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

a11 x1  a12 x2  a13 x3    b1

a21x1  a22 x2  a23 x3    b2


a31x1  a32 x2  a33 x3    b3

 a11 a12 a13   x1   b1 


    
a21 a22 a23   x2  b2 
a     
a32 a33  x3 b
 31    3 
          
Linear Systems
Solve Ax=b, where A is an nn matrix and
b is an n1 column vector
Can also talk about non-square systems where
A is mn, b is m1, and x is n1
Overdetermined if m>n:
“more equations than unknowns”
Underdetermined if n>m:
“more unknowns than equations”
Can look for best solution using least squares
Singular Systems
A is singular if some row is
linear combination of other rows
Singular systems can be underdetermined:

2 x1  3 x2  5
or inconsistent: 4 x1  6 x2  10

2 x1  3 x2  5
4 x1  6 x2  11
Gauss-Jordan Elimination
 Fundamental operations:
1. Replace one equation with linear combination
of other equations
2. Interchange two equations
3. Re-label two variables
 Combine to reduce to trivial system
 Simplest variant only uses #1 operations,
but get better stability by adding
#2 (partial pivoting) or #2 and #3 (full pivoting)
Gauss-Jordan Elimination
Solve:
2 x1  3 x2  7
4 x1  5 x2  13
Only care about numbers – form “tableau” or
“augmented matrix”:

2 3 7
 
4 5 13
Gauss-Jordan Elimination
Given:
2 3 7
 
4 5 13
Goal: reduce this to trivial system

1 0 ?
 
0 1 ?

and read off answer from right column


Gauss-Jordan Elimination
2 3 7
 
4 5 13

Basic operation 1: replace any row by


linear combination with any other row
Here, replace row1 with 1/2 * row1 + 0 * row2

1 3
2
7 2
 
4 5 13
Gauss-Jordan Elimination
1 3
2
7 2
 
4 5 13
Replace row2 with row2 – 4 * row1

1 3
2
7 
2
 
Negate row2 0 1  1

1 3
2
7 2
 
0 1 1 
Gauss-Jordan Elimination
1 3
2
7 2
 
0 1 1 
Replace row1 with row1 – 3/2 * row2

1 0 2
 
0 1 1 

Read off solution: x1 = 2, x2 = 1


Gauss-Jordan Elimination
For each row i:
Multiply row i by 1/aii
For each other row j:
 Add –aji times row i to row j
At the end, left part of matrix is identity,
answer in right part
Can solve any number of R.H.S. simultaneously
Recall that we'd like to use row operations on an
augmented matrix to get it into the following form:
1 0 0  0 0 b1 
 
0 1 0 0 0 b2 
0 0 1 0 0 b3 
 
   
 
 
0 0 0  1 0 bn 1 
0 0 0  0 1 bn 

This is not always possible though. The following are
matrices that cannot be put into this form.
1 2 3 7 
  1 0 5 2 
 0 0 0 0   
 0 1 6 3 
0 0 0 0 
Recognize that if we can’t get our matrix to the desired
form, then it won’t be as easy to see what the solution to
the system of equations will be.

For example, this matrix has a solution that is easy


to see, (1, 3, 5), because the matrix is in the final
form that we want.

1 0 0 1 
 
 0 1 0 3
 0 0 1 5 
This matrix (on the right) has a solution but
is not as clear what the solution is. What we 1 2 3 7 
can conclude about the solution, (x, y, z), is  
that the components x, y, and z must obey 0 0 0 0 
the equation x + 2y + 3z = 7. 0 0 0 0 

This matrix (on the right) has a solution, but


again it is not as clear what it is. What we 1 0 5 2 
can conclude about the solution, (x, y, z), is  
that the components x, y, and z must obey
the two equations x + 5z = 2 and y + 6z = 3.
0 1 6 3 
These last two matrices represent systems that do not have a
unique solution. Whenever a matrix does not have a unique
solution (if it has infinitely many solutions or no solution at
all) we will not be able to get our augmented matrix into the
form that we really want. When this happens, we want to at
least get our matrix as close as possible to this form that we
would really like it to be in. When it is as close as it can
possibly get, we say it is in reduced row echelon form.
1 0 0  0 0 b1 
 
0 1 0 0 0 b2 
0 0 1 0 0 b3 
 
   
 
 
0 0 0  1 0 bn 1 
0 0 0  0 1 bn 

PIVOTING
Consider this system:
0 1 2
 
2 3 8 
Immediately run into problem:
algorithm wants us to divide by zero!
More subtle version:

0.001 1 2
 
 2 3 8 
Partial Pivoting
0 1 2
 
2 3 8 
Swap rows 1 and 2:

2 3 8
 
Now continue: 0 1 2

1 3
2 4 1 0 1
   
0 1 2 0 1 2
Full Pivoting
0 1 2
 
2 3 8 

Swap largest element onto diagonal by swapping rows


1 and 2 and columns 1 and 2:
3 2 8
 
1 0 2
Critical: when swapping columns, must remember to
swap results!
Full Pivoting
3 2 8
 
1 0 2

1 2
3
8 
3
 
0  23  3 
2

1 0 2
 
0 1 1 

Full pivoting more stable, but only slightly

You might also like