1. Write a function U row-echelon (A, tol), which reduces the input matrix A in
ID: 3801568 • Letter: 1
Question
1. Write a function U row-echelon (A, tol), which reduces the input matrix A in the row echelon form U using the algorithm described in class. Note for this function, you will need to modify Gaussian elimination for the rectangular case; see pg 43 in MAALA. 2. Using the above function, write another function B, C1 find-basis A, tol). This function takes a matrix A as input, and outputs a basis for the null space and a basis for the range space of A. Columns of B and C should represent the basis for the null space and range space respectively. For this function, use (4.2.8) on pg 172 in MAALA (the definition of basic columns is in the blue box on page 45). For both of these functions, you will also need to input a tolerance param eter tol so that?s 0? if sl S tol in order to decide when a row/column is to be considered 0.Explanation / Answer
function RowEchelon(Matrix M) is
lead := 0
rowCount := the number of rows in M
columnCount := the number of columns in M
for 0 r < rowCount do
if columnCount lead then
stop
end if
i = r
while M[i, lead] = 0 do
i = i + 1
if rowCount = i then
i = r
lead = lead + 1
if columnCount = lead then
stop
end if
end if
end while
Swap rows i and r
If M[r, lead] is not 0 divide row r by M[r, lead]
for 0 i < rowCount do
if i r do
Subtract M[i, lead] multiplied by row r from row i
end if
end for
lead = lead + 1
end for
end function
---------
example
if matrix was
then its row echelon form would be
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.