Starting from:

$30

MATH366- Homework 2 Solved

Problem 1: Write a code called pivot.above(A,row,col) which does the pivoting procedure but rather it fills 0 above the 1.

Problem 2: Sometimes a different type of row reduction is more

useful. Usually our pivots are all equal to 1. It is possible to row reduce the matrix by leaving the pivots alone. Here is a worked out example with a 3 × 3 matrix that illustrates the procedure. Suppose we wish to row reduce the following matrix,


Usually we begin by replacing  so that the pivot in the upper-left corner, i.e. 2, turns into 1. But we can leave the pivot alone and proceed to pivot below that 2 and turn the 5 and 8 into 0’s. In this case we do the row operations,

                                       and − 4R1 + R3 7→R3

The resulting matrix becomes,


So on and so forth until the matrix is row reduced.

Write a code in R for a function called row.reduce.no.division(A) by modifying the code for pivot.below(A,r,c). There will only be a few changes. It is okay in this exercise to only do half the row-reduction and leaving it as an upper triangular matrix.

More products