From my understanding, we are to fill in values for the P matrix where “All elements on the main diagonal should be equal to 0, and the entries in each column must add to one”. I performed this and got 1 error on the test “Wrong vector X1. Check if matrix multiplication was performed correctly.”. Looking through the unit test script I found where this test case is and it seems that it is expecting a vector that is within a very small tolerance of what is written in the test script. Once I changed column 4 of the P matrix to match the test case it passed.

I believe this is an error since the question prompt did not mention criteria for the values in P except that all diagonals are 0 and each column should sum to 1.

I have encountered the same error. In my case, the unit test fails saying type of X0 variable is not numpy.ndarray. I checked the type via a simple print statement. It shows the type is what is expected.

However, in the Unit Test, it fails and says “Wrong Vector X1. Check if the matrix multiplication was performed correctly.”

I did not receive the error that you mentioned “X0 variable is not numpy.ndarray”. So I am not sure why you are receiving that.

As for the other error that my post is about. If you look through the test file, you should be able to read what and how they are testing your code. That is how I figured out that there might be an error.

Totally agree. I’ve just came up with the error and did the same thing. If we pick a 5x5 matrix that is too different from their test case, result is an error.

Hey @lucas.coutinho, I tried refreshing the workspace and opened the latest version. I tried changing the values of matrix P but unfortunately it didn’t work.

Could you tell whether we can use any matrix P satisfying the given condition or not?

Yes, you can use any matrix given the conditions, so the test should be able to handle those cases. Can you send me, via DM, the matrix you’re trying to input? So I can investigate what is going on.

For grading this does nto seem to be a problem since i got the full 100% from grader, but unittest still outputs Wrong vector X1. Check if matrix multiplication was performed correctly. 6 Tests passed 1 Tests failed

the problem is within w4_unittest.py since in line 385 you there calculate the expected X1 to be your “expected P” @ “expected X0” and in the assrertion in line 404 you compare the target_t1 to expected_t1 with allclose so unless the user has collum 4 in his P matrix within 1e-5 of the ones in the expected p in the unittest this test will fail

I am receiving the same error as described in this post. Has it been fixed?? Should I continue hoping the grader will give me full credit? My P Matrix is:
P = np.array([
[0.00, 0.70, 0.35, 0.00, 0.35],
[0.10, 0.00, 0.25, 0.35, 0.20],
[0.30, 0.20, 0.00, 0.35, 0.15],
[0.55, 0.05, 0.30, 0.00, 0.30],
[0.05, 0.05, 0.10, 0.30, 0.00]
])