Matrices.org

Matrix Condition Number Calculator

Calculate the 2-norm condition number of a square matrix and examine its sensitivity to numerical errors. Compare the 1-norm and infinity-norm condition numbers when the inverse can be computed reliably.

Calculate a Condition Number

Enter a square matrix. This calculator supports dimensions from 1 × 1 to 8 × 8. Use real numbers, decimals, or scientific notation.

What Is a Condition Number?

A condition number describes the sensitivity of a problem to small changes in its input. For a nonsingular square matrix A, the condition number in a chosen matrix norm is:

κ(A) = ‖A‖ ‖A−1‖

The 2-norm condition number has a particularly useful expression in terms of singular values:

κ₂(A) = σmax(A) / σmin(A)

A condition number is always at least 1 for a nonsingular matrix in a consistent induced norm. A value close to 1 indicates relatively low sensitivity. A large value indicates that perturbations may be amplified.

Condition Number and Numerical Stability

When solving a linear system Ax = b, the condition number helps explain how much the solution may change when A or b changes slightly. A poorly conditioned system can be sensitive even when the numerical algorithm is implemented correctly.

Conditioning and algorithmic stability are not the same thing. Conditioning is a property of the mathematical problem. Stability describes how an algorithm behaves under finite-precision arithmetic. A stable algorithm cannot remove the inherent sensitivity of a poorly conditioned problem.

  • Well-conditioned: small input changes generally cause relatively small changes in the result.
  • Ill-conditioned: small changes can cause much larger relative changes in the solution.
  • Singular: the matrix has no inverse; its usual condition number is infinite.
  • Near singular: the matrix may be invertible but have a very small minimum singular value.

Worked Example

Consider the diagonal matrix:

A = [ 1   0 ]
    [ 0   0.01 ]

Its singular values are 1 and 0.01. Therefore:

κ₂(A) = 1 / 0.01 = 100

The matrix has a condition number of 100. In a worst-case sensitivity interpretation, relative perturbations can be amplified by a factor on the order of 100, subject to the perturbation model and the assumptions of the problem.

If the second diagonal entry were zero, the matrix would be singular and its condition number would be infinite.

How to Interpret the Result

The ranges below are practical rules of thumb, not universal mathematical boundaries. The significance of a condition number depends on the problem, the data accuracy, and the precision used for calculations.

Condition numberGeneral interpretation
Near 1Relatively well-conditioned
10 to 1,000Potentially moderate sensitivity
1,000 to 100 millionPotentially significant sensitivity
Extremely largeSevere sensitivity; results may lose accuracy
InfinitySingular or numerically unresolved matrix

Frequently Asked Questions

1. What is a matrix condition number?

It measures sensitivity to input perturbations. For an invertible matrix, it is the product of the matrix norm and the norm of its inverse.

2. What is the 2-norm condition number?

It is the ratio of the largest singular value to the smallest singular value. It is a standard measure of matrix sensitivity in Euclidean geometry.

3. What does a condition number of 1 mean?

It represents the minimum possible condition number for an invertible matrix under an induced norm. In the 2-norm, matrices with all singular values equal have condition number 1.

4. Can the condition number be less than 1?

Not for a nonsingular square matrix when using the usual induced matrix norm definition. Such a result would suggest a calculation or interpretation error.

5. Why is the condition number of a singular matrix infinite?

A singular matrix has no inverse, and its smallest singular value is zero. The ratio of the largest singular value to the smallest is therefore unbounded.

6. Does a large condition number guarantee an inaccurate answer?

No. It indicates potential sensitivity, not certain failure. Accuracy also depends on the actual perturbations, the algorithm, the data, and the required tolerance.

7. How can I improve a poorly conditioned problem?

Depending on the application, you may improve data quality, rescale variables, reformulate the equations, use regularization, or use higher precision. These techniques do not all change the underlying conditioning in the same way.

8. Is the condition number the same as numerical stability?

No. Conditioning describes sensitivity of the problem, while numerical stability describes the behavior of the algorithm used to solve it.