I am trying to understand how computing the determinant works. I have:
b = np.array([ [1,2,3], [2,3,4], [5 6,7] ])
np.linalg.det(b)
>>> 1.7763568394002396e-15
Now, this is how I understood it:
>>>>>>> array([[1, 2, 3],
[2, 3, 4],
[5, 6, 7]])
>>>>>>> |b| = |1 2 3| = 1|3 4| - 2|2 4| + 3|2 3|
|2 3 4| |6 7| |5 7| |5 6|
|5 6 7|
|b| = 1*(3*7 - 4*6) - 2*(2*7 - 4*5) + 3*(2*6 - 3*5)
|b| = 1*( - 3 ) - 2*( - 6 ) + 3*( - 3 )
|b| = ( - 3 ) - ( - 12 ) + ( - 9 )
|b| = -3 +12 - 9 = 0
Haven't I understood it correctly?
Why det()
is returning 1.77
while I am ending up with 0
?
Should it be maybe the following instead?
>>>>>>> |b| = |1 2 5| = 1|3 6| - 2|2 6| + 5|2 3|
|2 3 6| |4 7| |3 7| |3 4|
|3 4 7|
question from:https://stackoverflow.com/questions/65937458/np-linalg-det-different-result-than-my-calculation