Problem 2 Implement a helper function called _rref(A, b) that…
Question Problem 2 Implement a helper function called _rref(A, b) that… Problem 2Implement a helper function called _rref(A, b) that applies Gaussian Elimination without pivoting to return the Reduced-Row Echelon Form of the augmented matrix formed from Matrix object A and Vec object b. The output must be of the type Matrix.Implement the function solve_np(A, b) that uses _rref(A) to solve the system ?????=???Ax?=b?. The input A is of the type Matrix and b is of the type Vec.If the system has a unique solution, it returns the solution as a Vec object.If the system has no solution, it returns None.If the system has infinitely many solutions, it returns the number of free variables (int) in the solution.Image transcription textIn [ ]: def _rref (A, b) : # todo pass def solve_np(A, b) : #todo pass In [ ] : “TESTER CELL #1 FORGENP”””I A = Matrix ( [ [0, 1, 2] , [3, 4, 5], [6, 7, 8]]) b = Vec. Vec( [9, 10, 11]) sol = solve_np(A, b)print(“Result:”, sol) print (“Expected: 1”) In [ ] : “TESTER CELL #2 FOR… Show more… Show more Computer Science Engineering & Technology Python Programming CECS 229 Share QuestionEmailCopy link Comments (0)


