I have a matrix A
that has some rows that are equal to each other. To my understanding, that means that its determinant should be zero. However, when using np.linalg.det(A)
, the resulting value is not zero. How can that be possible?
Minimal reproducible example below.
import numpy as np
A = np.array([[1.000014814814815, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482],
[0.00001481481481481482, 1.000014814814815 , 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 1.000014814814815 , 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 1.000014814814815 , 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 1.000014814814815 , 0.00001481481481481482, 0.00001481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00001481481481481482, 1.000014814814815 , 0.00001481481481481482],
[0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482, 0.00001481481481481482, 0.00001481481481481482, 0.00011481481481481482]])
print(np.linalg.det(A)) # output: 2.1089783600655513e-44
print(A[0][2] == A[0][-1]) # output: True