Question: Write code in python for the following problem statement: Row operations are a concept in linear algebra which allow you to solve large systems of

Write code in python for the following problem statement: Row operations are a concept in linear algebra which allow you to solve large systems of equations using matrices. One such row operation is scaling, in which every value in a row is multiplied by a constant.
Scaling is represented by the notation aRb -> Rb, where "a" is the constant you are scaling by, and "b" is the row being scaled. For example, 3R1-> R1 means, "multiply every number in Row 1 by 3". Note that Row 1 corresponds to index 0, Row 2 corresponds to index 1, and so on."a" is guaranteed to be an integer, but can be positive or negative.
You can assume all matrices in this problem will be square matrices, meaning they have the same number of rows and columns.Your first input will be an operation, using the notation described above. The next input will be the size (number of rows and columns) of the matrix. Your last input will be the matrix, with each number separated by a space.
Given the matrix, perform the row operation described and print out the matrix with a space after each number. (Hint: end="" is useful for printing out with a space after each value.)
Input 1
2R3-> R3
3
100
2-11
-314
Output 1
100
2-11
-628
Input 2
-1R1-> R1
2
-21
1-6
Output 2
2-1
1-6

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!