Question: Question C 2 [ 1 0 marks ] Write your answer in the provided file A 2 Q 2 . py . Fill in your
Question C marks
Write your answer in the provided file AQpy Fill in your name and student ID in the proper section.
Programming often involves implementing mathematical concepts through coding. In this question, you'll work with fundamental linear algebra operations, including matrix addition and multiplication. If you are unfamiliar with these concepts, please refer to resources such as GeeksforGeeks on Matrices before attempting the tasks.
Instructions:
Define a function: splitSID str
Description: This function accepts a string as input and returns a list of integers.
Assumption: The input string will always consist of valid numerical text. No invalid input will be provided.
### Sample Output
x splitSID
printx
### Sample Output
x splitSID
printx
Define a function: factorpairs int
Description: This function accepts an integer and returns a D list nested list containing pairs of factors of the input integer.
### Sample Output
y factorpairs
gg printy
### Sample Output
y factorpairs
printy
### Sample Output
y factorpairs
printy
Note: Reverse pairs are included only if they differ. For instance, if the input is include the pair but exclude if it's a duplicate.
Define a function: reshapelistdtodlst rows, cols
Description: This function converts a D list into a D list essentially a matrix based on the provided number of rows and columns.
Assumption: The provided rows and columns will always be valid and match the total number of elements in the original list.
### Sample Output
z reshapelistdtod
printz
### Sample Output
z reshapelistdtod
printz
Define a function: finddimensionsdlistlstd Define a function: finddimensionsdlistlstd
Description: This function accepts a D list matrix and returns a list with two elements: the number of rows and columns in the matrix.
Assumption: The inner lists in the D list will always have the same number of elements.
### Sample Output
a finddimensionsdlist
printa
### Sample Output
a finddimensionsdlist
printa
### Sample Output
a finddimensionsdlist
printa
Define a function: matrixmultiplicationmatrix matrix
Description: This function multiplies two D lists matrices and returns a new matrix as a D list. If the matrices cannot be multiplied due to incompatible dimensions, the function returns None and prints a simple statement.
Assumption: The inner lists in the D list will always have the same number of elements.
# Note: Matrix multiplication is possible only if the number of columns in the first matrix matches
the number of rows in the second.
# The result will have the number of rows from the first # matrix and columns from the second
matrix.
### Sample Output
b matrixmultiplication
$ printb
### Sample Output
b matrixmultiplication
printb
Invalid. The number of columns in the first matrix must equal the number of rows in the second
matrix.
None
Formulate the rest of your program according to the provided sample output. user inputs are indicated with text highlighted in blue color
### Sample Output: Case
This is the Question C of Assignment
The submitted code is created by Chan Siu Ming. SID:
In submitting this assignment, I understand the AI tools should be used as supporting purposes
instead of direct copyandpaste.
Any suspicious submission may result in a deduction of marks or disqualification in this question.
My SID is and after splitting it into individual integers, it becomes
There are items on the list.
Available reconstruction D sizes rows x columns:
: x
: x
: x
: x
For demonstration, the integers will be hard coded to be reconstructed into a mathbfxmathbf matrix:
What is your student ID
Your SID is and after splitting it into individual integers, it becomes
There are items on the list.
Available reconstruction D sizes rows x columns:
: x
: x
Please choose the option for reconstruction. Enter the integer representing that option:
You selected option ie x The matrix becomes:
Let's try performing matrix multiplication between the two matrices, st x nd
Invalid. The number of columns in the first matrix must equal the number of rows in the second
matrix.
Unfortunately, matrix multiplic
### Sample Output: Case
This is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
