Mathwords logoMathwords

Condition Number — Definition, Formula & Examples

The condition number of a matrix measures how sensitive its output is to small changes in input. A large condition number means even tiny errors in data can produce large errors in the solution, making the system ill-conditioned.

For a nonsingular matrix AA and a given matrix norm \|\cdot\|, the condition number is defined as κ(A)=AA1\kappa(A) = \|A\|\,\|A^{-1}\|. It satisfies κ(A)1\kappa(A) \geq 1, with κ(A)=1\kappa(A) = 1 for orthogonal (or unitary) matrices. When κ(A)\kappa(A) is large, the linear system Ax=bAx = b is ill-conditioned, meaning the relative error in xx can be amplified by a factor of κ(A)\kappa(A) relative to the perturbation in bb or AA.

Key Formula

κ(A)=AA1\kappa(A) = \|A\|\,\|A^{-1}\|
Where:
  • AA = A nonsingular (invertible) square matrix
  • \|\cdot\| = A consistent matrix norm (e.g., 2-norm, Frobenius norm)
  • κ(A)\kappa(A) = The condition number of A with respect to the chosen norm

How It Works

When you solve Ax=bAx = b numerically, rounding errors and measurement noise perturb bb by some small relative amount δbb\frac{\|\delta b\|}{\|b\|}. The condition number bounds the worst-case amplification: δxxκ(A)δbb\frac{\|\delta x\|}{\|x\|} \leq \kappa(A)\,\frac{\|\delta b\|}{\|b\|}. If κ(A)=10k\kappa(A) = 10^k, you can lose roughly kk digits of accuracy in your solution. A system with κ(A)\kappa(A) near 1 is called well-conditioned; one with κ(A)1\kappa(A) \gg 1 is ill-conditioned. Checking the condition number before solving a linear system is standard practice in scientific computing.

Worked Example

Problem: Find the 2-norm condition number of the matrix A=(1000.001)A = \begin{pmatrix} 1 & 0 \\ 0 & 0.001 \end{pmatrix}.
Step 1: For the 2-norm, the condition number equals the ratio of the largest singular value to the smallest. Since AA is diagonal, its singular values are the absolute values of the diagonal entries: σ1=1\sigma_1 = 1 and σ2=0.001\sigma_2 = 0.001.
σmax=1,σmin=0.001\sigma_{\max} = 1, \quad \sigma_{\min} = 0.001
Step 2: Compute the condition number as the ratio of these singular values.
κ2(A)=σmaxσmin=10.001=1000\kappa_2(A) = \frac{\sigma_{\max}}{\sigma_{\min}} = \frac{1}{0.001} = 1000
Answer: κ2(A)=1000\kappa_2(A) = 1000. This means perturbations in bb can be amplified by up to a factor of 1000 in the solution xx, so roughly 3 digits of accuracy could be lost.

Why It Matters

In engineering simulations, weather modeling, and machine learning, you routinely solve large linear systems. Checking the condition number tells you whether your computed answer can be trusted or whether you need techniques like preconditioning, regularization, or higher-precision arithmetic to obtain reliable results.

Common Mistakes

Mistake: Assuming a large determinant means the matrix is well-conditioned.
Correction: Determinant magnitude and condition number are unrelated. A matrix can have a large determinant yet be extremely ill-conditioned (e.g., a large diagonal matrix with entries of vastly different magnitudes). Always compute κ(A)\kappa(A) directly.