Question: In Python/Jupyter, ***TEST CASES MUST RETURN TRUE*** keep same format as provided below please Question 6: Matrix Madness! (8 pts) Matrix Operations are essential to

In Python/Jupyter, ***TEST CASES MUST RETURN TRUE*** keep same format as provided below please

In Python/Jupyter, ***TEST CASES MUST RETURN TRUE*** keep same format as providedbelow please Question 6: Matrix Madness! (8 pts) Matrix Operations are essential

Question 6: Matrix Madness! (8 pts) Matrix Operations are essential to many scientific applications. Assuming you are provided with matrix A: 20,0 20,1 20.n-1 ro 01.0 01.1 ri Amn = 21.n-1 : : : : am-1,0 am-1,1 am-1,1-1 m-1 where r; = ( 21,0 21,1 2i,n-1 You are tasked with writing a function for relative row difference, relDiffRow(A) which takes a matrix A and returns a list of the relative differences between the zeroth row and each row. Ilro-roll Ilroll : Tro-rall Ilroll : Tiro-rm-111 || || denotes magnitude, so, ||ro-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 lists, 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 due to some error, return False . I am not going to name a specific type of error that has to do with one of the operations in this calculation, and don't ask about it on the forums either because I told the TAs not to tell you either. You will need to identify the specific error in the calculation that could cause a problem yourself. In [69]: def relDiffRow(A) : pass In [ ]: A = [[1,1,1,1],[2,2,2,2],[1,3,3,2]] answer [0,1,1.5] x = relDiffRow (A) for i in range(3): print("Test "+str(i+1) + + str(abs (x[i] 11 . answer[i])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!