Given an n×n matrix A and n×1 right-hand side b, write a function that carries out q iterations of the Gauss elimination outer loop (without pivoting), where q is an integer between 1 and n, and returns the resulting augmented matrix with all below-diagonal elements transformed to zero in the left-most q columns. ##The code format given below may help # def gaussq (A, b, q):
IN PYTHON!
Given an n×n matrix A and n×1 right-hand side b, write a function that carries out q iterations of the Gauss elimination outer loop (without pivoting), where q is an integer between 1 and n, and returns the resulting augmented matrix with all below-diagonal elements transformed to zero in the left-most q columns.
##The code format given below may help
# def gaussq (A, b, q):
'''Apply Gauss elimination (without pivoting) to first q columns of a given linear system
Inputs: A, coefficient matrix, size n by n
b,
q, number of columns to apply Gauss elimination to, an integer between 1 and n
Output: Aa, augmented matrix with all below-diagonal elements transformed to zero in the left-most q columns, n by n+1
#to check the work

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images









