4.8.4Numerical Methods

Condition number — absolute, relative; ill-conditioned problems

1,721 words8 min readdifficulty · medium6 backlinks

WHY do we even care?


WHAT exactly are we measuring?

Think of a problem as a function y=f(x)y = f(x). The "problem" is: given xx, produce f(x)f(x). We perturb the input xx+Δxx \to x + \Delta x and ask how big Δy=f(x+Δx)f(x)\Delta y = f(x+\Delta x) - f(x) gets.


HOW to derive the formulas (from scratch)

We never memorise; we build.

Figure — Condition number — absolute, relative; ill-conditioned problems

Worked examples


Common mistakes (steel-manned)


Recall Feynman: explain to a 12-year-old

Imagine a magnifying glass. The input error is a tiny smudge on the page. The condition number is how strong the magnifying glass is. A weak glass (small condition number) — the smudge stays small, your answer is clear. A super-strong glass (huge condition number) — that tiny smudge becomes a giant blurry blob and you can't read the answer. The magnifying glass strength belongs to the problem, not to your eyes (the algorithm). Some questions are just naturally "blurry" — like measuring how a see-saw tips when it's balanced perfectly on the edge: the tiniest push sends it crashing.


Flashcards

What does a condition number measure?
How much a relative (or absolute) change in the input is amplified in the output — a property of the problem, not the algorithm.
Formula for absolute condition number of y=f(x)y=f(x)?
κabs=f(x)\kappa_{\text{abs}}=|f'(x)|, derived as the limit Δy/Δx|\Delta y|/|\Delta x| from Taylor expansion.
Formula for relative condition number?
κrel=xf(x)f(x)\kappa_{\text{rel}}=\left|\dfrac{x f'(x)}{f(x)}\right|, dimensionless.
Which condition number decides ill-conditioning, and why?
The relative one — it is dimensionless, so it's not fooled by scaling/units.
How many digits do you lose for condition number κ\kappa?
About log10κ\log_{10}\kappa decimal digits.
Condition number of f(x)=xpf(x)=x^p?
κrel=p\kappa_{\text{rel}}=|p| (e.g. x\sqrt{x} gives 1/21/2).
Why is subtracting nearly-equal numbers dangerous?
κrel=x/(xy)\kappa_{\text{rel}}=|x/(x-y)| blows up when xyx\approx y — catastrophic cancellation.
Condition number of solving Ax=bAx=b?
κ(A)=AA1=σmax/σmin\kappa(A)=\|A\|\|A^{-1}\|=\sigma_{\max}/\sigma_{\min} (2-norm).
Difference between conditioning and stability?
Conditioning = sensitivity of the problem; stability = quality of the algorithm. Both needed for an accurate result.
Is large det(A)0\det(A)\approx 0 a reliable ill-conditioning test?
No — determinant scales with size/units; use σmax/σmin\sigma_{\max}/\sigma_{\min} instead.

Connections

  • Catastrophic cancellation — the classic ill-conditioned subtraction.
  • Floating-point arithmetic — source of the 1016\sim 10^{-16} relative input error.
  • Backward stability — algorithm-side partner to conditioning.
  • Singular Value Decomposition — gives κ(A)=σmax/σmin\kappa(A)=\sigma_{\max}/\sigma_{\min}.
  • Taylor series — the engine behind the derivation of κabs\kappa_{\text{abs}}.
  • Newton-Raphson method — root finding near f=0f'=0 is ill-conditioned.

Concept Map

motivates

perturb x by dx

equals

from

scale by x over y

equals

dimensionless, usual meaning

small O of 1

large, much bigger than 1

lose log10 kappa digits

property of problem, not algorithm

Input error unavoidable

Problem y = f of x

Absolute condition number

abs f prime of x

Taylor expansion

Relative condition number

abs of x f prime over f

Size of kappa rel

Well-conditioned

Ill-conditioned

Accuracy loss

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, condition number ka matlab simple hai: agar tum input me thoda sa error daalo (jo har computer me hota hi hai, kyunki rounding ~101610^{-16} hoti hai), to output me kitna error aayega? Yeh "amplification factor" hi condition number hai. Yaad rakho — yeh problem ki property hai, tumhare code ki nahi. Chahe tum world ka best algorithm likho, agar problem hi ill-conditioned hai to answer kharab hi aayega.

Do flavour hote hain. Absolute condition number =f(x)=|f'(x)| — yeh basically slope hai, lekin iske units hote hain, isliye yeh thoda misleading ho sakta hai. Relative condition number =xf(x)/f(x)=|x f'(x)/f(x)| — yeh dimensionless hai aur yahi asli judge hai ki problem ill-conditioned hai ya nahi. Rule of thumb: tum lagbhag log10κ\log_{10}\kappa decimal digits kho dete ho. Matlab agar κ=105\kappa = 10^5, to 5 accurate digits gaye paani me.

Classic example hai nearly-equal numbers ka subtraction — jaise 1.000011.000001.00001 - 1.00000. Yahan κrel=x/(xy)\kappa_{rel}=|x/(x-y)| huge ho jaata hai, isko "catastrophic cancellation" kehte hain. Matrix wale case me Ax=bAx=b solve karne ka condition number κ(A)=σmax/σmin\kappa(A)=\sigma_{max}/\sigma_{min} hota hai — agar matrix nearly singular hai to ill-conditioned. Important baat: determinant zero hone se ill-conditioned mat samajh lena — woh scaling pe depend karta hai, galat signal deta hai. Hamesha singular values ka ratio dekho.

Test yourself — Numerical Methods

Connections