Modifying a Gaussian Elimination Algorithm to Perform Gauss-Jordan E.

Click For Summary
SUMMARY

The discussion focuses on modifying an existing Gaussian elimination algorithm to implement Gauss-Jordan elimination, specifically to achieve reduced row-echelon form. The algorithm currently processes a matrix A and a column vector b, producing an upper triangular matrix. The user seeks guidance on adjusting loop indices to eliminate non-diagonal entries and ensure that all diagonal entries equal one, thereby completing the transformation to reduced row-echelon form.

PREREQUISITES
  • Understanding of Gaussian elimination and its algorithmic structure
  • Familiarity with matrix operations and row reduction techniques
  • Knowledge of programming constructs such as loops and conditionals
  • Experience with matrix representation in programming languages
NEXT STEPS
  • Research the specifics of Gauss-Jordan elimination algorithms
  • Learn about matrix row operations and their implementation in code
  • Explore programming techniques for modifying loop indices in algorithms
  • Study examples of reduced row-echelon form transformations
USEFUL FOR

Students in linear algebra, computer science majors working on algorithm design, and anyone interested in numerical methods for solving systems of equations.

Illania
Messages
26
Reaction score
0

Homework Statement



I have an algorithm that implements Gaussian elimination. According to the text, with some modification of the indices and their in the loops, I should be able to have this algorithm perform Gauss-Jordan elimination. I also have to reduce the matrix to reduced row-echelon form, but for now I cannot figure out how I would go about modifying the indices to perform Gauss-Jordan elimination.

Homework Equations


The input is a matrix A[1...n, 1...n] and column vector b[1...n]
The output is an upper triangular matrix.
Code:
for i←1 to n do A[i, n+1]←b[i]
for i←1 to n−1 do
     pivot ← i
     for j←i+1 to n do
           if |A[j, i]| > |A[pivot, i]|, pivot←j
     for k←i to n+1 do
           swap(A[i, k],A[pivot, k])
     for j←i+1 to n do
           scale←A[j, i]/A[i, i]
     for k←i to n+1 do
           A[j, k]←A[j, k]−A[i, k]∗scale

The Attempt at a Solution



I have performed Gaussian Elimination on a maxtrix with 3 rows and 4 columns. This leaves a matrix with the form:
Code:
x[SUB]1[/SUB] y[SUB]1[/SUB] z[SUB]1[/SUB] b[SUB]1[/SUB]
0  y[SUB]2[/SUB] z[SUB]2[/SUB] b[SUB]2[/SUB]
0  0  z[SUB]3[/SUB] b[SUB]3[/SUB]

I understand that y1, z1, and z2 also need to be eliminated, but I can't see how to do this with the current algorithm. Could someone kindly give me a push in the right direction here?
 
Physics news on Phys.org
Once the matrix is in upper triangular form, the entries on the main diagonal need to be modified so that they all equal 1.

After the main diagonal is all 1's, then one can repeat the elimination procedure to eliminate the entries above the main diagonal, leaving the main diagonal as the only non-zero entries (with the exception of the augmentation columns).
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
34K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
14
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 26 ·
Replies
26
Views
5K