Condition number of a matrix is 1 but determinant is almost 0

Click For Summary
SUMMARY

The discussion centers on the apparent contradiction between a matrix's condition number and its determinant. A matrix with elements -0.0053 and -0.0031 has a condition number of 1, indicating it is well-conditioned, while its determinant calculated using MATLAB's det() function is 3.7700e-005, suggesting it is almost singular. The key takeaway is that conditioning is influenced by the relative sizes of matrix elements rather than their absolute values, and combinations of small and normal-sized numbers can lead to conditioning errors.

PREREQUISITES
  • Understanding of matrix conditioning and its significance in numerical analysis
  • Familiarity with MATLAB commands, specifically cond() and det()
  • Knowledge of floating-point precision and its implications in calculations
  • Basic concepts of linear algebra, particularly determinants and matrix properties
NEXT STEPS
  • Explore MATLAB's cond() function in detail to understand its behavior with different matrices
  • Investigate the effects of scaling on determinants in linear algebra
  • Learn about floating-point arithmetic and precision issues in numerical computing
  • Experiment with various matrix configurations in MATLAB to observe changes in condition numbers and determinants
USEFUL FOR

Mathematicians, data scientists, and engineers who work with numerical methods, particularly those using MATLAB for matrix computations and seeking to understand the implications of conditioning on numerical stability.

hermano
Messages
38
Reaction score
0
Hello,

I want to calculate the conditioning of a matrix, therefore I use the cond() commando in Matlab. A problem with a low condition number is said to be well-conditioned, while a problem with a high condition number is said to be ill-conditioned.

If I calculate the condition number of the matrix:

-0.0053 -0.0031
0.0031 -0.0053

the condition number is equal to 1. This means that the matrix is well-conditioned. However if I calculate the determinant of this matrix with the command det() the result is 3.7700e-005. Thus almost zero what means that the matrix is almost singular, thus ill-conditioned. Why is the condition number 1 while the matrix is ill-conditioned?

Steven
 
Physics news on Phys.org
hermano said:
However if I calculate the determinant of this matrix with the command det() the result is 3.7700e-005. Thus almost zero what means that the matrix is almost singular, thus ill-conditioned.

Well not really, not in relation to the size of the elements in the matrix. If you scale the elements in a 2x2 matrix by some factor then the determinant scales by that factor squared (that factor cubed for a 3x3 matrix and so on).

Your matrix elements are all down around 1E-3 so you have to expect the determinant to be down around 1E-6, even if the matrix is well conditioned.
 
Further, conditioning is not just about the numbers being small. Did you know that the double precision FP used by MATLAB (and most other scientific software these days) can handle numbers bigger than 1E300 and smaller than 1E-300.

So strictly speaking it's not really small numbers that cause the problem, it's more specifically where you have certain combinations of really small numbers and more normal sized numbers together in a calculation, and particularly where you have the difference of numbers that are nearly the same, for example 2.0 and 2.0000000000001. This is the type of situation where you get conditioning errors, not from small numbers alone.

Try for example A=[1, 2; 2, 4.0000001] and see what cond(A) tells you. You'll find det(A) is not all that different to that of your original matrix, but you'll find cond(A) is quite different.
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K