On this page
Solve two equations, change one number in its fourth decimal place, and the answer jumps from (1, 1) to (2, 0). Your arithmetic is fine. The system itself is fragile, and the number that measures how fragile is the condition number of its matrix.
What is the condition number of a matrix?
For a linear system Ax = b, the condition number is the maximum ratio of the relative error in x to the relative error in b, as the Wikipedia article on condition numbers defines it. For induced (operator) norms that maximum works out to κ(A) = ‖A‖ ‖A⁻¹‖, and the same formula is used with any consistent matrix norm.
Written as an inequality you can use: ‖Δx‖ / ‖x‖ ≤ κ(A) × ‖Δb‖ / ‖b‖.
A few facts follow from the same condition number article:
κ(A) is never less than 1.
κ near 1 means well-conditioned; a large κ means ill-conditioned.
A singular matrix has infinite κ.
In the 2-norm, κ(A) is the largest singular value divided by the smallest.
Conditioning is a property of the matrix, not of the algorithm or the computer.
If singular values are new to you, our explainer on singular value decomposition with a 2×2 matrix builds them from scratch.
How can a 0.01% change in b move the answer by 100%?
The MATLAB cond page shows the 2×2 matrix [4.1 2.8; 9.7 6.6] with a condition number of about 1,623. A sharper one you can do by hand:
x + y = 2
x + 1.0002y = 2.0002
Subtract the first equation from the second: 0.0002y = 0.0002, so y = 1 and x = 1.
Now change the last number from 2.0002 to 2.0000, a change of 0.0002 in 2.0002, or about 0.01%. Subtract again: 0.0002y = 0, so y = 0 and x = 2. Each unknown has moved by 100%.
The two lines are almost the same line, so a tiny shift slides their crossing point a long way. In matrix terms, det A = 0.0002 and A⁻¹ = [5001 −5000; −5000 5000].
Use the ∞-norm, which for a matrix is the maximum absolute row sum (matrix norm):
‖A‖∞ = 1 + 1.0002 = 2.0002.
‖A⁻¹‖∞ = 5001 + 5000 = 10001.
κ∞(A) = 2.0002 × 10001 ≈ 20,004.
The relative change in b is 0.0002/2.0002 ≈ 0.0001, the relative change in x is 1/1 = 1, so the error grew about 10,000 times: below the ceiling of about 20,000, as promised.
How many digits do you lose to an ill-conditioned matrix?
The rule of thumb in the condition number article, citing Cheney and Kincaid's textbook, is that if κ(A) = 10^k, up to k digits of accuracy may be lost on top of what the method itself loses. IEEE double precision carries about 16 significant decimal digits (double-precision format).
Our example has κ ≈ 2 × 10^4, so expect to lose about 4 digits. Data known to six significant figures may leave only about two trustworthy digits.
Why is the Hilbert matrix so ill-conditioned?
The Hilbert matrix has entries 1/(i + j − 1): its first row is 1, 1/2, 1/3, …, its second 1/2, 1/3, 1/4, …, so neighbouring rows look nearly alike. The Hilbert matrix article calls it a canonical ill-conditioned matrix; it appears when you fit polynomials to a function by least squares.
4×4: κ₂ ≈ 1.55 × 10^4, computed on MATLAB's hilb page.
5×5: κ₂ ≈ 4.8 × 10^5, per the Hilbert matrix article.
Growth: of order (1 + √2)^(4n) / √n, so for large n each extra row and column multiplies κ by roughly 34.
By the digit rule, the 5×5 Hilbert matrix costs about 6 of your 16 digits; keep multiplying by 34 and κ nears 10^16 around n = 12, leaving no reliable digits. Because H is symmetric positive definite, its 2-norm κ is its largest eigenvalue over its smallest, as our post on the spectral theorem for symmetric matrices makes concrete.
What should you do when κ is large?
A checklist before you trust a computed solution:
Compute κ: cond(A) in MATLAB, or ‖A‖∞‖A⁻¹‖∞ by hand for small matrices.
Take log₁₀ κ as your likely digit loss and compare it with the significant figures in your data.
Do not blame the solver first. A backward-stable algorithm can be expected to solve well-conditioned problems accurately (condition number article), but no method returns digits the data never had. Our LU decomposition walkthrough shows what the solver does.
If log₁₀ κ is close to the digits you have, measure the data more precisely or change the model.
To build the ideas behind κ one at a time, the Fermi Concept Library covers every concept in mathematics, and the Fermi Problem Library has a step-by-step solver that explains the reasoning when your working goes astray.



