M4ML C1_W2 Programming Assignment

Hi team,

I am stuck on the Excercise 4. It seems half correct but althought I tried multiple things to resolve I haven’t managed yet. I’ve passed the assignment but I am qurious what is the mistake. I have below the screenshots of the code and the error message.

Thanks,
Alex

(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not)

Hi @Alexandros_Grigorian

First of all, you should not post your answers according to course Honor code. Kindly remove the screenshots. If you face further code related problems, send private message to me or to other mentors.

Secondly, the mistake you’re making is on these type of problems —

# Add row i of the new matrix A_ref to the row j, replacing row j

I will give you a hint about what you’re doing wrong:

you’re scaling row i with j and adding the result to row j.

Mathematically spoken, you’re doing
A_{{ref}_{[j:]}} = j \times A_{{ref}_{[i:]}} + A_{{ref}_{[j:]}}

Whereas, you are supposed to do,
A_{{ref}_{[j:]}} = A_{{ref}_{[i:]}} + A_{{ref}_{[j:]}}

Hope it helps you!


Happy learning…^^