10.3: Basic Gauss Jordan
( \newcommand{\kernel}{\mathrm{null}\,}\)
The following is implementation of the Basic Gauss-Jordan Elimination Algorithm for Matrix Am×n (Pseudocode):
for i from 1 to m: for j from 1 to m if i ≠ j: Ratio = A[j,i]/A[i,i] #Elementary Row Operation 3 for k from 1 to n: A[j,k] = A[j,k] - Ratio * A[i,k] next k endif next j #Elementary Row Operation 2 Const = A[i,i] for k from 1 to n: A[i,k] = A[i,k]/Const next i
using the Pseudocode provided above, write a basic_gauss_jordan
function which takes a list of lists A as input and returns the modified list of lists:
Lets check your function by applying the basic_gauss_jordan
function and check to see if it matches the answer from matrix A in the pre-class video:
The above psuedocode does not quite work properly for all matrices. For example, consider the following augmented matrix:
B=[01335376694|3090420]
Explain why doesn’t the provided basic_gauss_jordan
function work on the matrix B?
Describe how you could modify matrix B so that it would work with basic_gauss_jordan
AND still give the correct solution?