Stuck in the Gaussian elimination assignment

Hello,

I am finding myself stuck in the Gaussian elimination assignment. i am able to enter a lot of the values correctly and there are only few placeholders I dont know exactly how to fill in the first 2 exercises. Yet i am unable to get any feedback from the autograder as it gives me 0/100 for both exercises even with partial grading and even though some of the unit tests are working fine. How do i progress in this as I feel stuck? I admit i am not the most experienced programmer but I did complete a python course that was recommended in the pre reqs of this mathematics course.

labs will give 0 grades if you submit only few exercises and submit assignment for grading, recommend you to complete all the exercises with subsequent unittest need to be passed for getting successful 100/100 grades

I understand. But what if i am stuck with one of the blanks and i dont know what to fill? Or whatever i am filling is incorrect. I cant go and re watch one of the lectures since the programming assignment is different. Should i use AI or YT for help? I am not sure what to do since I am passing the other graded assignments easily but only stuck in the programming one as I am a beginner, though i have familiarity with python as I mentioned in the original comment

post screenshot of your failed unittest without posting any part of grade function codes as it’s against community guidelines to post any grade function codes.

your failed unittest must have given a test result output or any error, post screenshot of that

hi @TQK

I am sending you DM about the assignment. Most of the learners have got stuck in this exercise, so it is understandable for you to get stuck, don’t worry we will get through. please check your DM for my message.

usually the issue in these exercises comes with how you have indexed

Thank you so much. Sent.

hi @TQK

Thank you for the images, you have written codes neatly and precisely, there are few errors in codes which I will try to provide hint, so correct yourself and enjoying coding.

Exercise 1

  1. For code line instruction

The first pivot candidate is always in the main diagonal, let’s get it.
# Remember that the diagonal elements in a matrix has the same index for row and column.
# You may access a matrix value by typing M[row, column]. In this case, column = row.
pivot_candidate = Here codes need correction remember you are not suppose to index with 0 but as the diagonal elements in a matrix has same index for row and column, The M[row, column] here column becomes row -read the instruction carefully, your subsequent code had the same code line but with variable function recall which you have used and is correct and same needs to be used here for M[row, column].

Exercise 2

  1. your substitution_row code mentions just row as the substitution row, but remember back substitution moves backward and then move upwards, so substitution row becomes M[row, :]

  2. for code instruction

Get the row to be reduced. The indexing here is similar as above, with the row variable replaced by the j variable.
row_to_reduce = Here you again used the variable function to reduce the first non-zero element where as instructions points you to row to be reduced similar as above (that doesn’t mean same element, instruction clearly mentions here row variable replaced by j variable. So you had to just M[j, :], no variable function recall need to used here.

  1. For code instruction

the value of the element at the found index in the row to reduce
value = here you have reduce row for value where as instruction mentions you to reduce row for the index

Exercise 3
For code instruction

Since the system is non-singular (by our assumptions), then perform back substitution to get the result.
solution = here you applied solution to matrix M and the column position where here you needed to use the exercise 2 back_substitution function and apply to the row_echelon_M

Regards
Dr. Deepti

provided hint resolved learners issue, so closing this thread