It is a pity that the selected matrix repeated here again is either singular or poorly conditioned:
A = matrix( [[1,2,3],[11,12,13],[21,22,23]])
By definition, the inverse of A when multiplied by the matrix A should give the identity matrix. And, chosen in a highly praised explanation, it does not. In fact, just looking at inversion gives the key to conclude that inversion does not work correctly. Look at the magnitude of the individual terms - they are very, very large compared to the terms of the original matrix A ...
Itβs great that people, when choosing an example of a matrix, can so often choose a particular matrix!
I had a problem with the solution, so I examined it further. On the ubuntu-kubuntu platform, the numian package of the debian package has no linalg matrix and subpackages, so in addition to importing numpy, you also need to import scipy.
If the diagonal terms of A are multiplied by a sufficiently large coefficient, say 2, the matrix will most likely cease to be singular or almost singular. So,
A = matrix( [[2,2,3],[11,24,13],[21,22,46]])
does not become either singular or almost singular, and the example gives significant results ... When working with floating numbers, it is necessary to monitor the consequences of the inevitable rounding errors.
Thanks for your input,
OldAl.