Neural Sync Active
Jan 2026 - Python - Week 9 - PPA 14
Registry Synced
Jan 2026 - Python - Week 9 - PPA 14
549 words
3 min read
PPA 14
Course: Jan 2026 - Python
PPA 14
Due Dec 31, 2026 at 11:59 PM IST
Instructions
Use "Test Run" to verify your code with public test cases.
Press "Submit" to have your assignment evaluated.
You can submit your assignment multiple times up until the deadline.
Make sure to submit your final code by the deadline to receive your score.
Summary
- out of100
Score
Public Tests
0/0 Passed
Private Tests
0/0 Passed
If you have grasped the essence of recursion, then you would see the simplicity of the whole idea when you solve this problem. All those who have done Maths-2, or are doing Maths-2, should be able to appreciate this problem. If you are yet to do Maths-2, you can still try to attempt this problem. But we request learners not to be intimidated by the heavy use of notation. Feel free to skip if this problem if it is perceived to be too hard.
Any square matrix M has a number associated with it called its determinant. The determinant of a 2×2 matrix is defined as follows:
For any n×n square matrix M, its determinant is defined recursively as follows:
det(M)=∑j=0n−1(−1)j⋅M[0][j]⋅Mj
Here, Mj is the determinant of the matrix obtained by removing the 0th row and the jth column of M and 0≤j<n. Here, we have used zero-based indexing.
For example, for a 3×3 matrix, we have:
Write a recursive function named det that accepts a square matrix as argument and returns its determinant. In the process of writing this function, it would be useful to look into GrPA-3 of week-7. A good approach would be to write two functions: det and minor_matrix.
You do not have to accept input from the user or print the output to the console. You just have to write the function definition.
Public Tests ( 0/0 )
Case 1
Input:
textpublic [1, 2, 3], [-1, 2, 4], [0, 1, 3](/viewer?path=1, 2, 3], [-1, 2, 4], [0, 1, 3)
Expected Output:
text5
Case 2
Input:
textpublic [1, 2, 3], [4, 5, 6], [7, 8, 9](/viewer?path=1, 2, 3], [4, 5, 6], [7, 8, 9)
Expected Output:
text0
🔒 Private Tests ( 0/0 )
This test case group is locked and will be revealed after the deadline.
💻 IITM Official Solution
Solution code is currently locked and will be available after the deadline.
💻 My Submitted Code
pythondef det(M): """ A recursive function to compute the determinant of M. Parameters: M: list of lists Return: result: integer """