Understanding Condition Number

The condition number of a matrix A, denoted κ(A) or cond(A), measures the maximum factor by which small input errors can be amplified in the output. For an invertible square matrix, it is defined as the product of the matrix's norm and the norm of its inverse.

When solving a linear system A·x = b, the condition number acts as an error magnification factor. If b is perturbed by a small amount due to measurement noise or computational rounding, the solution x will shift by roughly κ(A) times that perturbation. A condition number of 1 (achieved by the identity matrix) represents optimal stability—errors pass through unchanged. Larger values indicate increasingly ill-conditioned problems where numerical solutions become unreliable.

If a matrix is singular (non-invertible), its condition number is infinite, signalling that small changes in b may produce no solution or infinitely many solutions.

Condition Number Formula

The condition number is calculated by selecting a matrix norm and computing the product of the norm of the original matrix and the norm of its inverse:

κ(A) = ‖A‖ · ‖A⁻¹‖

where:

‖A‖ = matrix norm of A
‖A⁻¹‖ = matrix norm of the inverse of A

  • κ(A) — Condition number of matrix A
  • ‖A‖ — Norm of the matrix (using your chosen norm type)
  • ‖A⁻¹‖ — Norm of the matrix inverse

Computing the Condition Number Step-by-Step

To find a matrix's condition number:

  • Choose a matrix norm. Common choices are the 1-norm, 2-norm (spectral norm), Frobenius norm, and infinity norm. The 2-norm is standard for stability analysis because it relates directly to the largest singular value.
  • Compute the matrix inverse. Use Gaussian elimination, LU decomposition, or cofactor methods. If the determinant is zero, the matrix is singular and κ(A) = ∞.
  • Calculate both norms. Apply your chosen norm formula to both A and A⁻¹, ensuring consistency throughout.
  • Multiply the results. The product is your condition number.

For small matrices (2×2 and 3×3), hand calculation is feasible; larger systems benefit from numerical libraries that compute condition numbers more efficiently via singular value decomposition.

Common Pitfalls and Considerations

When working with condition numbers, be aware of these practical insights:

  1. Scaling does not change the condition number — Multiplying an entire matrix by a scalar γ does not alter its condition number. Both the matrix and its inverse scale inversely, cancelling out in the product. Thus κ(γA) = κ(A). This property makes condition number a scale-invariant measure of numerical difficulty.
  2. Diagonal matrices have a simple condition number formula — For a diagonal matrix D with non-zero entries, κ(D) = max(|dᵢᵢ|) ÷ min(|dᵢᵢ|) using the 2-norm. This is simply the ratio of the largest to smallest diagonal element. Diagonal matrices with entries of very different magnitudes tend to be ill-conditioned.
  3. Condition numbers below 10 indicate stability — A condition number between 1 and 10 suggests the system is well-conditioned and small input errors will not grossly distort the solution. Values above 100 warrant caution; above 10,000 indicates severe numerical danger and potential loss of significant figures in floating-point arithmetic.
  4. Norm choice matters for interpretation — Different norms can yield different condition numbers for the same matrix. The 2-norm (spectral norm) is most common in theory and practice because it directly relates to singular values and eigenvalues, making it physically meaningful for stability analysis.

Practical Example

Consider the 2×2 system with matrix A = [3.7, 0.9; 7.8, 1.9] and right-hand side b = [7.4; 15.6].

The solution is x = [2; 0]. Now suppose b is measured with a small error: b = [7.4; 15.605]. Using the 2-norm, this matrix has a condition number of approximately 24.6. The error in b is roughly 0.03%, but the relative error in the solution will be magnified by a factor near 24.6, resulting in a solution error of about 0.8%—roughly 25 times larger than the input error. This demonstrates why systems with high condition numbers are prone to numerical difficulty.

Frequently Asked Questions

What does a condition number of 1 mean?

A condition number of exactly 1 represents a perfectly conditioned matrix. The identity matrix achieves this because it leaves any vector unchanged—no error magnification occurs. In practice, no real matrix can do better than κ = 1. A matrix with condition number 1 is as robust as possible to small perturbations in the input vector.

Why is the condition number of a diagonal matrix the ratio of largest to smallest diagonal entries?

For a diagonal matrix D, the eigenvalues are the diagonal elements themselves. Since the 2-norm of a diagonal matrix equals its largest eigenvalue in absolute value, and the same applies to D⁻¹ with reciprocal eigenvalues, the condition number becomes the ratio of largest to smallest absolute diagonal values. This makes diagonal matrices easy to assess: large ratio = bad conditioning.

Can the condition number ever be less than 1?

No, the condition number is always greater than or equal to 1. Mathematically, κ(A) ≥ 1 for any invertible matrix. This follows from the submultiplicative property of norms: ‖A · A⁻¹‖ = ‖I‖ ≤ ‖A‖ · ‖A⁻¹‖. A value of exactly 1 is the theoretical minimum and occurs only for the identity matrix and orthogonal matrices.

Does multiplying a matrix by a scalar change its condition number?

No. If you scale a matrix A by any non-zero scalar γ to get γA, the condition number remains unchanged. This is because κ(γA) = ‖γA‖ · ‖(γA)⁻¹‖ = γ‖A‖ · (1/γ)‖A⁻¹‖ = κ(A). The scaling factors cancel, preserving the condition number. This invariance is why condition number is a fundamental property of the underlying linear system, independent of units or magnitudes.

What should I do if my matrix has a very high condition number?

A high condition number signals numerical instability. Consider: preconditioning the system using matrix transformations to reduce the condition number; using higher-precision arithmetic (double to quadruple precision); reformulating the problem to avoid near-singular configurations; or employing regularization techniques if the matrix arises from an ill-posed problem. For scientific computing, condition number is often the first diagnostic step.

How do different matrix norms affect the condition number?

Different norms (1-norm, 2-norm, Frobenius norm, infinity norm) can produce different numerical condition numbers for the same matrix. However, the norms are all equivalent up to constant factors, so the relative ranking of matrices by conditioning remains consistent. The 2-norm is preferred in theory because it has a direct interpretation via singular values and is the spectral norm used in perturbation analysis.

More math calculators (see all)