This page contains code to solve a system of equations using the Gauss-Jordan Elimination.
I did this when I was teaching College Algebra at Pima Community College.
I've transcribed the lecture notes I used to explain the manual process.
You'll find them at the bottom of the page.
|Solve a System of Equations
Select the system size:
Then, enter the numbers into the matrix.
Finally, click on the "Solve the System" button and watch the magic happen!
|The Gauss-Jordan Elimination
Solving a matrix is a matter of working the diagonal.
The diagonal of a matrix are the elements starting at Row 1 Col 1 and continuing in a downward and rightward direction.
The object is to work down the diagonal, starting with the first element. For each element, you will
perform a number of row operations. The row that the element is in is the active row for operations.
The row operations are:
For the active row, it helps to put a square around the active element (to indicate it needs to be a one), and a circle around the elements that need to be changed to zero.
- Change the active element to a 1 by multiply the row by the reciprocal of the element.
- Change an element to 0 by adding -1 times the element times the active row to the row you are changing.
- Swap two rows.
For each element on the diagonal:
When you reach the bottom of the diagonal, you are in reduced echelon form. The solution can be read directly from the last column.
- Put a square around the active element, and a circle around all elements in the same column that are above and below the active element.
- If the element is a 0, you may swap this row with any row below it. Resume with the new row as your base row.
- Change the active element to a 1.
- Change each circled element to a 0. Note: the base row does not actually change during this operation.