C1W4 Programming Assignment - Exercise 2 - Is this a bug?

Hi, I’m taking Course 1 Week 4 Programming Assignment. At exercise 2: I’m not sure if I’m wrong or it’s a bug. I see a topic with similar problem.

Is my input correct? Or it’s really a bug?

1 Like

Hello @SquareAtom
I probably think the problem is with your input.

Can you help me with the correct answer? I have passed that exam (expect that question).
Maybe I misunderstanding the question?

Thank you

Hi @rmwkwok, can you please help what’s wrong with it?

Have you tried manually transforming the vectors listed in the hints section? What happens to the vector [1 0] when transforming it using your shear matrix? And to vector [0 1]?

1 Like

Hi @Muhammad-Kalim-Ullah,

Please consult M4ML mentors.


1 Like

Like I used a general shear_x matrix [[1, 0], [0.5, 1]], but it does not work.

@SquareAtom @Muhammad-Kalim-Ullah sorry this thread got buried by other notifications.
Did you all get help?

Had the same issue doing the exam today, i could actually pass the test by setting the shear matrix with the wrong input (A_shear_x = np.array([[1,0.5],[0,1]])).

I also had a bunch of other issues with on exercise 3 getting the workbook to recognize the shape of the matrix P as a 5x5, finally i solved it but it was very annoying as i had to rewrite part of the coding that was not supposed to be touched by the user.

An error that i still cannot solve is with the creation of X0 vector, i believe my input is right but i would appreciate any help!

The excercise asks for: *

𝑋0 is a vector with a single entry equal to one, and all other entries equal to zero


so i coded: X0 = np.array([[1], [0], [0], [0], [0]])

and i get the following message on the checks:

Wrong array X0.
Check element 1 in the vector X0.
6 Tests passed
1 Tests failed

thanks for your help!

1 Like

@Isaak_Kamau could you feedback on the above?
Many thanks!



No sir, I haven’t solved it

@Matteo_Egidi & @SquareAtom I am yet to go through that assignment but DM me your notebooks and your specific issue.

hello, I also get full marks when I answer the question incorrectly as above. How can we speak to the mentors on this course?

Hi, this link really explains shear well: https://alevelmathsrevision.com/downloads/Lesson%20Notes/Year%201/Further%20Pure%20Core/Shears%20Lesson%20Notes.pdf

You can then apply what you learn from it to the exercise.

You need to think of the e1, e2 vectors/xy coordinates not as rows in a numpy array but as columns in the number array.

Mentors please correct me if I have stated anything incorrectly.

Regards from a fellow student

1 Like