Question: PYTHON In a system of linear equations, you can pick a row multiply it with an arbitrary scalar and add it to any other row

PYTHON

In a system of linear equations, you can pick a row multiply it with an arbitrary scalar and add it to any other row without changing the solution of the system. For example the system of linear equations 3x+3y=2, 5x+3y=8 has the same solution as the x+y=2/3, 2x=8 since the first equation can be obtained by dividing 3x+3y=2 by 3 and the second equation can be obtained by multiplying 3x+3y=2 by -1 and then adding it to 5x+3y=8.

Write a function lineadder(i,j,a) that takes two integer inputs i and j and a matrix (list of lists) of float variables that represent a system of linear equations. The function should modify the input matrix by multiplying row i of the input with a proper scalar and then adding it to row j such that the ith element in row j will be equal to zero.

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!