Take the 2-minute tour ×
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It's 100% free, no registration required.

If I have a square invertible matrix and I take its determinant, and I find that $\det(A) \approx 0$, does this imply that the matrix is poorly conditioned?

Is the converse also true? Does an ill-conditioned matrix have a nearly zero determinant?

Here is something I tried in Octave:

a = rand(4,4);
det(a) %0.008
cond(a)%125
a(:,4) = 1*a(:,1) + 2*a(:,2) = 0.000000001*ones(4,1);
det(a)%1.8E-11
cond(a)%3.46E10
share|improve this question
1  
The determinant shows whether a matrix is regular or singular. It does not show whether it is well- or ill-conditioned. –  Allan P. Engsig-Karup Feb 16 '12 at 10:21
3  
The magnitude of determinant cannot reflect the ill-conditioning: $\kappa(A)=\kappa(A^{-1})$ but $\det (A^{-1})=(\det A)^{-1}$. –  faleichik Feb 16 '12 at 14:39
    
Should there be an $\approx$ or $\ne$ somewhere? –  Inquest Feb 16 '12 at 15:20
2  
If you're interested in learning more about the effects of floating-point math on matrix spectra, you should check out Nick Trefethen's book: Spectra and Pseudospectra: The Behavior of Nonnormal Matrices and Operators and the Pseudospectra Gateway. –  Aron Ahmadia Feb 16 '12 at 21:35
add comment

2 Answers 2

up vote 28 down vote accepted

It's the largeness of the condition number $\kappa(\mathbf A)$ that measures the nearness to singularity, not the tininess of the determinant.

For instance, the diagonal matrix $10^{-50} \mathbf I$ has tiny determinant, but is well-conditioned.

On the flip side, consider the following family of square upper triangular matrices, due to Alexander Ostrowski (and also studied by Jim Wilkinson):

$$\mathbf U=\begin{pmatrix}1&2&\cdots&2\\&1&\ddots&\vdots\\&&\ddots&2\\&&&1\end{pmatrix}$$

The determinant of the $n\times n$ matrix $\mathbf U$ is always $1$, but the ratio of the largest to the smallest singular value (i.e. the 2-norm condition number $\kappa_2(\mathbf U)=\dfrac{\sigma_1}{\sigma_n}$) was shown by Ostrowski to be equal to $\cot^2\dfrac{\pi}{4n}$, which can be seen to increase for increasing $n$.

share|improve this answer
1  
@Nunoxic: most certainly not; before I launch into details, are you already familiar with the singular value decomposition? –  J. M. Feb 16 '12 at 13:40
2  
Very good. That's all you need to know. The idea is that very important information on the conditioning is concentrated in $\mathbf \Sigma$. In particular, you will want to look for the largest and smallest values (remember that the decomposition is defined such that the diagonal entries of $\mathbf \Sigma$ are nonnegative) in that matrix's diagonal. The ratio of the largest to the smallest diagonal entry is the condition number $\kappa$. What size of condition number you should be concerned with depends on the machine your working on... –  J. M. Feb 16 '12 at 13:59
2  
...but in general, when solving linear equations with that matrix, you stand to lose $\approx \log_b \kappa$ base-$b$ digits in your solution. That's a rough rule of thumb for the condition number; so if you're working with only 16 digits, a $\kappa$ of $10^13$ should be cause for concern. –  J. M. Feb 16 '12 at 14:02
1  
Yes, but that is not the recommended method for determining the condition number (an explanation of which is for another question). I presume you know how to invert a diagonal matrix, no? –  J. M. Feb 16 '12 at 14:08
2  
"Regd. the loss of digits, could you give me a reference for this?" - I could, but this really is one of those things that you should be experimenting on your own in a computing environment for reinforcement. –  J. M. Feb 16 '12 at 14:10
show 5 more comments

As $\det(kA)=k^n\det A$, the determinant can be made arbitrarily large or small by simple rescaling (which doesn't change the condition number). Especially in high dimensions, even scaling by an innocent factor of 2 changes the determinant by a huge amount.

Thus never use the determinant to assess condition or closeness to singularity.

On the other hand, for almost all well-posed numerical problems, the condition is closely related to the distance to singularity, in the sense of the smallest relative perturbation needed to make the problem ill-posed. In particular, this holds for linear systems.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.