AI Wiki中文/EN

Conditioning and ill-posed problems

条件数与病态问题

Measure sensitivity with a specified norm and perturbation, derive a linear-system bound, and separate poor conditioning from failure of existence or uniqueness.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

A tiny input change can be a large answer change

Solve two equations: x1=b1x_1=b_1 and 10−6x2=b210^{-6}x_2=b_2. With b=(1,0)b=(1,0) the answer is (1,0)(1,0). Change only the second input from zero to 10−610^{-6} and the answer becomes (1,1)(1,1). The input changed by one part in a million relative to its norm; the solution changed by 100 percent relative to its original norm.

This is not evidence that the solver is broken. Even exact arithmetic gives that change. A condition number quantifies how strongly the problem can amplify perturbations, after specifying what counts as input, what norm measures size, and whether errors are relative or absolute. Higham, What Is a Condition Number?

Name the perturbation before quoting a number

For a differentiable map f, nonzero x and f(x), and compatible induced norms, the local normwise relative condition number is

cond⁡(f,x)=∥x∥ ∥Jf(x)∥∥f(x)∥.\operatorname{cond}(f,x)=\frac{\|x\|\,\|J_f(x)\|}{\|f(x)\|}.

It comes from maximizing the first-order change Jf(x)ΔxJ_f(x)\Delta x over small input perturbations of bounded norm. For a scalar function it reduces to ∣xf′(x)/f(x)∣|xf'(x)/f(x)|. If an input or output norm vanishes, the relative expression is not defined; switch to an absolute or mixed measure. This local derivative-based definition does not promise the same bound for large perturbations.

For an invertible real square A, the spectral-norm matrix condition number is

κ2(A)=∥A∥2∥A−1∥2=σmax⁡(A)σmin⁡(A).\kappa_2(A)=\|A\|_2\|A^{-1}\|_2=\frac{\sigma_{\max}(A)}{\sigma_{\min}(A)}.

It is at least one. Orthogonal transformations of either coordinate system preserve it, and multiplying A by a nonzero scalar leaves it unchanged. For a fixed A and nonzero b, set x=A−1bx=A^{-1}b. Perturb only b. Then Δx=A−1Δb\Delta x=A^{-1}\Delta b, and

∥Δx∥2∥x∥2≤κ2(A)∥Δb∥2∥b∥2.\frac{\|\Delta x\|_2}{\|x\|_2}\leq\kappa_2(A)\frac{\|\Delta b\|_2}{\|b\|_2}.

To derive this, bound ∥Δx∥2\|\Delta x\|_2 by ∥A−1∥2∥Δb∥2\|A^{-1}\|_2\|\Delta b\|_2 and use ∥b∥2=∥Ax∥2≤∥A∥2∥x∥2\|b\|_2=\|Ax\|_2\leq\|A\|_2\|x\|_2. This is an exact inequality for right-hand-side perturbations. It is a worst-case bound across directions; the local condition number at a particular b is ∥A−1∥2∥b∥2/∥x∥2\|A^{-1}\|_2\|b\|_2/\|x\|_2, which can be smaller. Convex Optimization, Appendix A.5.4

If A changes too, the analysis includes the perturbed inverse. For η=∥ΔA∥2/∥A∥2\eta=\|\Delta A\|_2/\|A\|_2 and κ2(A)η<1\kappa_2(A)\eta<1, factor A+ΔA=A(I+A−1ΔA)A+\Delta A=A(I+A^{-1}\Delta A) and bound the inverse using its geometric series. The resulting bound is

∥Δx∥2∥x∥2≤κ2(A)1−κ2(A)η(η+∥Δb∥2∥b∥2).\frac{\|\Delta x\|_2}{\|x\|_2}\leq\frac{\kappa_2(A)}{1-\kappa_2(A)\eta}\left(\eta+\frac{\|\Delta b\|_2}{\|b\|_2}\right).

The condition prevents the perturbation bound from reaching a singular system; omitting that denominator or assumption can make an assurance meaningless.

Change the data in two different directions

The complete program specializes to nonsingular diagonal systems, where singular values are known exactly as absolute diagonal entries. It computes the change from the perturbation equation directly, avoiding subtraction of nearly equal solved vectors. This is a sensitivity demonstration, not a general matrix condition estimator.

import math

def diagonal_sensitivity(diagonal, b, delta):
    n = len(diagonal)
    if not n or len(b)!=n or len(delta)!=n:
        raise ValueError("matching nonempty vectors required")
    if not all(math.isfinite(t) for t in list(diagonal)+list(b)+list(delta)) or any(t==0 for t in diagonal):
        raise ValueError("finite vectors and nonzero diagonal entries required")
    if math.hypot(*b)==0:
        raise ValueError("nonzero right-hand side required")
    x = [y/d for y,d in zip(b,diagonal)]
    dx = [y/d for y,d in zip(delta,diagonal)]
    magnitudes = [abs(d) for d in diagonal]
    kappa = max(magnitudes)/min(magnitudes)
    relative_input = math.hypot(*delta)/math.hypot(*b)
    relative_output = math.hypot(*dx)/math.hypot(*x)
    values = [kappa,relative_input,relative_output]+x+dx
    if not all(math.isfinite(t) for t in values):
        raise ArithmeticError("nonfinite sensitivity computation")
    return kappa, relative_input, relative_output

k,ri,ro = diagonal_sensitivity([1.,1e-6],[1.,0.],[0.,1e-6])
assert abs(k-1e6)<1e-8 and ri==1e-6 and ro==1.
assert ro <= k*ri*(1+1e-14)
k,ri,ro = diagonal_sensitivity([1.,1e-6],[1.,0.],[1e-6,0.])
assert ro==1e-6
# Equal scaling changes size but not this relative condition number.
assert diagonal_sensitivity([1e-12,1e-12],[1.,0.],[0.,1e-6])[0] == 1.
# A triangular nonsymmetric example: both eigenvalues are 1,
# but the maximum/minimum singular-value ratio is much larger.
k = (102+math.sqrt(102**2-4))/2
assert 101.99 < k < 102.

The diagonal computation takes O(n)O(n) arithmetic operations and storage. It measures normwise relative sensitivity; one input coordinate starts at zero, so a componentwise relative percentage for that coordinate would be undefined. The total vector norm remains nonzero. Computing a general dense SVD-based condition number costs substantially more, typically O(n3)O(n^3) arithmetic for a square matrix.

Eigenvalues do not generally substitute for singular values

Take A=[11001]A=\begin{bmatrix}1&10\\0&1\end{bmatrix}. Both eigenvalues equal one, but the matrix stretches some directions far more than others. Its Gram matrix has trace 102 and determinant one. Its larger eigenvalue is (102+1022−4)/2(102+\sqrt{102^2-4})/2; the smaller is its reciprocal. Taking their square roots and dividing gives κ2(A)≈101.9902\kappa_2(A)\approx101.9902, not one.

For a real symmetric invertible matrix, singular values are absolute eigenvalues, so the ratio shortcut works there. A tiny determinant alone is also insufficient: 10−12I10^{-12}I has a tiny determinant and condition number one. Absolute amplification and relative conditioning are different measurements.

Poorly conditioned and ill-posed are not synonyms. A well-posed problem has an existing, unique solution that varies continuously with the specified data. A fixed nonsingular finite-dimensional linear system is well posed even if its finite condition number is enormous. A singular system can lose existence or uniqueness. Regularization selects a modified problem to reduce sensitivity or resolve nonuniqueness; it introduces assumptions or bias rather than revealing information absent from the data.

For a computed solution x^\widehat x, its residual is r=b−Ax^r=b-A\widehat x. With only b perturbed, it is the exact solution for b−rb-r. A small relative residual is a small backward error in b, but forward error can be magnified by conditioning. Reporting residual alone can therefore overstate solution accuracy.

Distinguish a bound from a prediction

  1. In the opening system, change b by (10−6,0)(10^{-6},0). What is the relative solution change? Answer: 10−610^{-6}, not one. The worst-case amplification is not realized in every direction.
  2. What is κ2(cI)\kappa_2(cI) for nonzero c? Answer: one, although the absolute response of its inverse depends on ∣c∣|c|.
  3. If κ2=106\kappa_2=10^6 and relative right-hand-side uncertainty is 10−610^{-6}, what does the bound allow? Answer: relative solution error as large as one. It does not assert every instance attains that error.
  4. Does more arithmetic precision remove uncertainty in measured b? Answer: no. It reduces computational error, not the original measurement uncertainty.

Choose what accuracy matters

Scaling coordinates changes the units in which perturbations are judged. Preconditioning can improve an iterative method’s working system, but the final answer must still be assessed in the original variables and data model. A condition estimate, a residual, and a known input-error scale together say more than any of them alone. The pseudoinverse shows how truncating small singular modes changes the problem; numerical stability asks how much extra error the algorithm introduces.

Make a prediction, then check

If a nonsymmetric matrix has only eigenvalues one, must its 2-norm condition number be one?

Choose one answer

Learning objectives

  • Derive conditioning and solution-error bounds for specified perturbations and norms.
  • Distinguish singular-value ratios, eigenvalue ratios, small residuals, and actual solution error.

Prerequisites & connections

Explore related knowledge →

References

  1. What Is a Condition Number?
    Nicholas J. Higham · 2020
  2. Convex Optimization
    Stephen Boyd; Lieven Vandenberghe · 2004

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-05 · Codex technical check: specified-source comparison, derivation checks, independent numerical checks, and paragraph-level bilingual comparison; no independent human peer review.

  • Compared perturbation equations with independently solved changes for 100 diagonal systems and checked RHS bounds; used an exact 2×2 solve for the joint A/b perturbation bound.
  • Recomputed Gram invariants and condition approximately 101.9902 for a nonsymmetric triangular matrix; separated singular values, eigenvalues, relative scaling, and well-posedness.
  • Compared bilingual assumptions, claims, numbers, exercise answers and citations; structural checks additionally compare formulas, code, main anchors and source IDs.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.