Question: Question 6: Matrix Madness! (8 pts) Matrix Operations are essential to many scientific applications. Assuming you are provided with matrix 40,1 d-1 ro Am. =
Question 6: Matrix Madness! (8 pts) Matrix Operations are essential to many scientific applications. Assuming you are provided with matrix 40,1 d-1 ro Am. = 60,0 010 : -10 -1.1 where You are tasked with writing a function for relative row difference, relDiffRow(A) which takes a matrx A and returns a list of the relative differences between the zeroth row and each row Troll : In all Troll ] Troll | || denotes magnitude, so Iro-rill is the magnitude of the vector resulting from subtracting the ith row from the zeroth row. This is vector subtraction, just like in geometry where you subtract each of the elements in order to get the difference. You can assume the matrix provided is a list of tists, where each sub-list represents one row in the matrix You may assume the matrix is at least a 2x2 matrix, but you may not assume that the matrix is square. If your calculation would fail because of a specific type of error that has to do with one of the operations in this calculation that I'm not going to tell you and don't ask about it on the forums either because I told the TAs not to tell you either return false def relDiffRow(A) : pass # YOUR CODE HERE raise Not ImplementedError() A - [[1,1,1,1),(2,2,2,2],[1,3,3,2]] answer = [0,1,1.51 * - relDiffRow(A) for i in range(3): print("Test "str(111)+":str(abs(x1 - answer141) >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
