How to measure how far a matrix is from being singular? What would be the best mathematical tool/concept to measure how far a matrix is from being singular? Could it be the condition number?
 A: Given a matrix norm induced by a vector norm of your choice, the distance of an invertible matrix $A$ to its nearest singular matrix, i.e. $\min\{\|A-B\|:\ B \text{ is singular}\}$,  is known to be $\|A^{-1}\|^{-1}=\|A\|/\kappa(A)$.
Note that this is a concept different from (but closely related to) the condition number $\kappa(A)=\|A\|\|A^{-1}\|$. What the condition number measures is not how "singular" a matrix is in terms of its nearness to singular matrices, but how singular it is in terms of its effect on the relative error in the solution $x$ of $Ax=b$ (relative to the relative error in the coefficient vector $b$ ). For most purposes, what people concern is the condition number rather than the distance to the nearest singular matrix.
A: I am assuming that your matrix is a $n\times n$ matrix. You could take the rank of the matrix. Its possible values are $0,1,\ldots,n$. The matrix is singular if and only if its rank is smaller than $n$. The rank is $0$ if and only if the matrix is the null matrix, which is the most singular of all matrices.
A: A matrix gets the rank it deserves. Technically only a square matrix can be nonsingular, but any m by n matrix, m>0 and n>0, can have a rank greater than zero if at least one entry is nonzero.
I interpret the question as, "How far a matrix is from losing rank?"
Gaussian elimination with complete pivoting (GECP) is used to reliably factor an m by n matrix that may lack full row and/or column rank. Matrix factorization must stop when the residual matrix is full of zeros because there is nothing left to factor. But when using limited precision, what constitutes zero because it is unlikely the residual terms will be all zero?
Thus, some metric must be used to decide when the remaining residual matrix is or is not "zero". If the decision is that the remaining residual matrix is not zero, the matrix will have a rank at least one unit higher, and the next pivotal element will be the absolutely largest entry of the residual matrix. Obviously that pivotal element will be small if all entries in the residual matrix were small.
Thus, a good measure of how close or far a matrix is from being singular would be to compare the size of the smallest pivotal element to the largest pivotal element, and to compare the size of the smallest pivotal element to zero. For an n by n matrix, if p_1 and p_n represent the 1st and nth pivots, comparing p_n/p_1 to zero may give a good estimate of how close the matrix is to being singular. If p_n/p_1 is substantially away from the roundoff level, the matrix may be considered safely away from being singular, but when the ratio is near the roundoff level, the matrix may be considered nearly singular.
