1 | initial version |
I think your 'expected answer' is not the expected answer.
The definition of the echelon form of a matrix requires (amongst others) that the first non-zero element on each row be a 1. So, from your results the next step is to multiply the last row by 1/(-b1-b2+b3) which leads to
[[1,1,2, b1]
[0,1,1,b1-b2]
[0,0,0, 1]]
and then, you can subtract the last row times (b1-b2) and times b1 from the 2nd and the 1st row, leading to
[[1,1,2,0]
[0,1,1,0]
[0,0,0,1]]
finally you can subtract the 2nd from the 1st row leading to
[[1,0,1,0]
[0,1,1,0]
[0,0,0,1]]
So, everything is ok.
B.t.w.: the reason why you can completely wipe out your 'variables' b1...b3 is because the cols/rows of the rest of the matrix are linearly dependent. You will experience the same thing for any other case where this holds because one of the rows of your matrix will contain only zeros up to the row which contains the variables.