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

In summary, The algorithm for Gaussian elimination can be modified to perform Gauss-Jordan elimination by changing the indices and adjusting the steps in the loops. The goal is to reduce the matrix to reduced row-echelon form with all 1's on the main diagonal. This can be achieved by repeating the elimination procedure once the main diagonal is all 1's.
  • #1
Illania
26
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
  • #2
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).
 

1. How does Gaussian Elimination differ from Gauss-Jordan Elimination?

Gaussian Elimination is a method used to solve a system of linear equations, while Gauss-Jordan Elimination is an extension of Gaussian Elimination that aims to find the inverse of a matrix.

2. What modifications are needed to turn a Gaussian Elimination algorithm into a Gauss-Jordan Elimination algorithm?

The main modification is the addition of a backward substitution step after the elimination of the lower triangular matrix. This step involves dividing each row by the pivot element to ensure that the pivot element becomes 1 and all other elements in the same column become 0.

3. Can a Gaussian Elimination algorithm be modified to perform Gauss-Jordan Elimination in-place?

Yes, it is possible to perform Gauss-Jordan Elimination in-place by using the same matrix for both forward and backward elimination steps. However, this may result in a loss of information, so it is generally recommended to use a separate matrix for the backward substitution step.

4. Is there a specific order in which rows should be eliminated in Gauss-Jordan Elimination?

No, the order of elimination does not affect the final result in Gauss-Jordan Elimination. However, it is important to choose a pivot element that is non-zero to avoid any division by zero errors.

5. Can Gauss-Jordan Elimination be used to solve systems of non-linear equations?

No, Gauss-Jordan Elimination is only applicable to systems of linear equations. Non-linear equations require different methods, such as Newton's method, to find solutions.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
1
Views
477
  • Calculus and Beyond Homework Help
Replies
1
Views
644
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
33K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Linear and Abstract Algebra
Replies
26
Views
4K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
Back
Top