# What is computed by LinearAlgebraPrivateMatrixConditionNumber?

The following returns 51/7, even though the condition number is actually 9. I'm curious, what does 51/7 correspond to for this matrix?

LinearAlgebraPrivateMatrixConditionNumber[{{7, 0, 0}, {0, 5, 4}, {0, 4, 5}}]


Wolfram Alpha returns the same result for the condition number of this matrix, as mentioned in this Twitter post.

• It's an exact version of the infinity norm condition number estimate used by LUDecomposition: In[292]:= LUDecomposition[{{7, 0, 0}, {0, 5, 4}, {0, 4., 5}}][[3]] - 51/7 Out[292]= 8.88178*10^-16 Jan 5 at 21:34
• The actual value is 9, yes. The estimate is from an iteration, I believe due to N. Higham. It does not compute an inverse or do any other O(n^3) operation, hence saves an order of magnitude in speed. Jan 6 at 4:46
• I believe LAPACK's ?gecond is being used. FORTRAN code may be inspected; it's an iterative approximation as @Daniel mentions. W|A often does math over floating-point even when the input looks like exact integers to Mma users. Not sure the blame should be on W|A, since LAPACK is used widely by many different applications. Jan 6 at 17:53
• Just to compare: MATLAB 1/rcond(A) returns 7.285714285714286. On a 10000 x 10000 matrix, rcond takes 5.2 sec.; cond(mat, 1) and cond(mat, inf) take about 13 sec. while cond(mat) (2-norm) takes nearly 33 sec. Jan 7 at 0:46
• @Goofy why do you think it's gecond? I'm seeing 9 using gecond through scipy lapack wrapper -- import scipy 1/scipy.linalg.lapack.dgecon([[7.,0,0],[0,5,4],[0,4,5]], anorm=9, norm='I')[0] Jan 17 at 22:56

Extrapolating from how Matlab does it in comments, you also get $$51/7$$ from Lapack's dgecon applied to LU factorization of mat (dgetrf)
import scipy