TactivergeLite

Lite / Independent Engineering Research / Week 5

Conditioning: when small errors become big ones

Your solver is perfect, your sensors are 0.1% accurate, and your answer is 50% wrong. Who is to blame?

About 45 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Calibration matrices, least-squares fits with similar inputs, and robot poses near singularities can all be ill-conditioned. Knowing κ tells you how many digits of your answer you can trust, regardless of how good the code is.

Predict

Two equations describe nearly parallel lines. You nudge one line very slightly. What happens to their intersection?

  1. It barely moves
  2. It can slide a long way along the lines
  3. It disappears
Guess first, then reveal

Nearly parallel lines cross at a shallow angle, so a tiny shift moves the crossing point far along them. That is ill-conditioning, made visible.

Discover

Set ε = 1 and nudge b₂. Then slide ε down to 10⁻⁴. For each, record κ, the relative change in b and the relative change in x. Does the amplification ever exceed κ?

What the interactive shows (text version)

The condition explorer draws two lines whose intersection is the solution, plus a dashed nudged line and the new intersection. Sliders set ε and the nudge. Text reports κ, both solutions and the relative changes in b and x.

You can also open the interactive on the full site when you have a faster connection.

Understand

A property of the problem

κ(A) ≥ 1 measures how sensitive the solution of Ax = b is to changes in b (and in A). κ ≈ 1 is perfect (rotations, orthogonal matrices); κ = 10⁶ means relative data errors may be magnified up to a million times. It is a property of the problem itself, so no algorithm can beat it.

Determinant is not the test

det(0.01·I) in 10 dimensions is 10⁻²⁰, yet κ = 1: it is perfectly conditioned, just scaled. [[1, 1], [1, 1.0001]] has det 10⁻⁴ and κ ≈ 4×10⁴. Use κ, not det, to judge closeness to singularity.

Problem versus algorithm

Conditioning is about the problem; stability is about the algorithm. Elimination without pivoting on the tiny-pivot example is an unstable algorithm on a well-conditioned problem (κ ≈ 2.6). Pivoting fixes the algorithm. For an ill-conditioned problem, the fix is to change the problem: better sensor placement, rescaling, or more independent measurements.

Explain it another way

Intuitive

Locating a point from two compass bearings works well when the bearings cross at a right angle, badly when they are nearly parallel. κ measures how shallow the crossing is.

Technical

σᵢ are the square roots of the eigenvalues of AᵀA. For symmetric positive definite A, κ = λmax/λmin.

Mathematical

For A = [[1, 1], [1, 1 + ε]], κ ≈ 4/ε for small ε.

Applied

In GPS, poor satellite geometry gives a large 'dilution of precision', which is a condition number: the same range errors produce much larger position errors.

Derivation: The error-amplification bound
  1. Exact: Ax = b. Perturbed data: A(x + δx) = b + δb. Subtract: A·δx = δb, so δx = A⁻¹δb.

  2. Take norms: ‖δx‖ ≤ ‖A⁻¹‖·‖δb‖. Also ‖b‖ = ‖Ax‖ ≤ ‖A‖·‖x‖, so 1/‖x‖ ≤ ‖A‖/‖b‖.

  3. Multiply: ‖δx‖/‖x‖ ≤ ‖A‖·‖A⁻¹‖·‖δb‖/‖b‖.

  4. Define κ(A) = ‖A‖·‖A⁻¹‖. In the 2-norm this is σmax/σmin, the ratio of the largest to smallest singular value.

  5. Rule of thumb: you can lose about log₁₀ κ significant digits. With double precision (about 16 digits) and κ = 10¹⁰, expect about 6 good digits.

Worked example 1

κ(A) = 10⁴ and the measurements in b have 0.01% relative error. What is the worst-case relative error in x?

‖δx‖/‖x‖ ≤ 10⁴ × 10⁻⁴ = 1, i.e. up to 100%. The answer may have no correct digits.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 3. Which matrix is closest to singular in the sense that matters numerically?

Practice 5. A calibration matrix has κ = 10⁷. What actually helps?

Apply it

Two strain gauges are mounted at angles α and β to a beam's axis to measure two strain components. Write the 2×2 measurement matrix, plot κ against β − α in the Code Lab, and recommend a mounting angle.

Reflect

Name a measurement you rely on whose geometry might make it ill-conditioned.

Write your answer on paper or in your own notes. Lite never stores what you write.

← Stability of x[k+1] = A·x[k]Power iteration: eigenvalues by repetition →