4.8.4 · Maths › Numerical Methods
Ek condition number measure karta hai ki kisi problem ka output, input mein ek choti si wiggle ko kitna amplify karta hai . Yeh problem ki khud ki property hai, kisi bhi algorithm ki nahi. Agar data mein ek tiny relative error answer mein ek huge relative error ban jaaye, toh problem ill-conditioned hai — aur koi bhi clever code tumhe bacha nahi sakta.
Intuition Yeh kyun matter karta hai
Jo bhi real number tum computer mein daalte ho, usme error hoti hai: rounding (≈ 1 0 − 16 double precision mein), measurement noise, truncation. Input error se tum bach nahi sakte. Toh honest sawaal yeh nahi hai ki "kya mera answer exact hai?" balki yeh hai:
(error in answer) ≤ (condition number) × (error in input) .
Condition number ek gain knob hai input aur output error ke beech. Isse pata chalta hai ki tumhara answer 10 digits tak trust kiya ja sakta hai ya sirf 2 tak.
Ek problem ko function y = f ( x ) ki tarah socho. "Problem" yeh hai: diya gaya x , f ( x ) produce karo . Hum input ko perturb karte hain x → x + Δ x aur poochte hain ki Δ y = f ( x + Δ x ) − f ( x ) kitna bada hota hai.
Definition Absolute condition number
Absolute condition number measure karta hai ki ek absolute input change kaise ek absolute output change mein map hoti hai:
κ abs = lim Δ x → 0 ∣Δ x ∣ ∣Δ y ∣ = ∣ f ′ ( x ) ∣.
Iske units hote hain (output units per input unit).
Definition Relative condition number
Relative condition number measure karta hai ki ek relative input change kaise ek relative output change mein map hoti hai:
κ rel = lim Δ x → 0 ∣Δ x ∣/∣ x ∣ ∣Δ y ∣/∣ y ∣ = ∣ f ( x ) ∣ ∣ x ∣ ∣ f ′ ( x ) ∣ .
Yeh dimensionless hai — yahi woh hota hai jise log usually "the condition number" kehte hain, kyunki data error naturally relative hoti hai (har number mein 1 0 − 16 relative error).
Definition Ill- vs well-conditioned
Ek problem well-conditioned hai agar κ rel chhota ho (O ( 1 ) se shayad 1 0 3 tak), aur ill-conditioned agar κ rel bada ho (≫ 1 ). Roughly: tum log 10 κ rel digits of accuracy kho dete ho.
Hum memorise nahi karte; hum build karte hain.
Intuition "Digits lost" rule — yeh kahan se aata hai
Agar input relative error ε in hai, toh output relative error ε out ≈ κ rel ε in . log 10 lete hain:
log 10 ε out ≈ log 10 κ rel + log 10 ε in .
Kyunki digits of accuracy ≈ − log 10 ε , tum lagbhag log 10 κ rel decimal digits kho dete ho .
f ( x ) = x — bahut well conditioned
f ′ ( x ) = 2 x 1 , toh
κ rel = x x ⋅ 2 x 1 = 2 x x = 2 1 .
Yeh step kyun? Hum f aur f ′ seedha relative formula mein plug karte hain aur simplify karte hain. Ek relative input error half ho jaati hai — square-rooting beautifully stable hai. (Generally x p ka κ rel = ∣ p ∣ hota hai.)
f ( x ) = tan ( x ) near x = π /2 — ill-conditioned
f ′ ( x ) = sec 2 x . x = π /2 ke paas, tan x → ∞ aur sec 2 x → ∞ aur bhi tezi se:
κ rel = t a n x x s e c 2 x = s i n x c o s x x = s i n 2 x 2 x .
Jaise x → π /2 , sin 2 x → 0 , toh κ rel → ∞ . Yeh step kyun? Humne sec 2 / tan = 1/ ( sin cos ) rewrite kiya sin 2 x ko denominator mein expose karne ke liye jo blow-up drive karta hai.
Worked example 3. Nearly-equal numbers ka subtraction — catastrophic cancellation
Maano f ( x , y ) = x − y (treat karo y fixed, x ko perturb karo). Tab f ′ = 1 aur
κ rel = x − y x .
Agar x = 1.00001 aur y = 1.00000 , toh x − y = 1 0 − 5 lekin ∣ x ∣ ≈ 1 , toh κ rel ≈ 1 0 5 . Yeh step kyun? Denominator x − y tiny hai jabki numerator x nahi — woh ratio hi disaster hai. Tum ~5 digits kho dete ho. Yahi famous cancellation problem hai; problem ill-conditioned hai, toh subtraction se bachne ke liye algebra rearrange karo.
Worked example 4. Linear systems
A x = b (matrix version)
A x = b solve karne ke liye, relevant quantity hai matrix condition number
κ ( A ) = ∥ A ∥ ∥ A − 1 ∥ = σ m i n σ m a x (in 2-norm) ,
jahan σ singular values hain. Derivation: b → b + Δ b perturb karo. Tab A Δ x = Δ b , toh Δ x = A − 1 Δ b , jisse ∥Δ x ∥ ≤ ∥ A − 1 ∥∥Δ b ∥ milta hai. Saath mein ∥ b ∥ ≤ ∥ A ∥∥ x ∥ bhi. Multiply karo:
∥ x ∥ ∥Δ x ∥ ≤ κ ( A ) ∥ A ∥∥ A − 1 ∥ ∥ b ∥ ∥Δ b ∥ .
Yeh step kyun? Humne numerator aur denominator ko alag-alag bound kiya, phir combine kiya — product ∥ A ∥∥ A − 1 ∥ amplification factor ke roop mein nikalta hai. Ek nearly-singular A (σ m i n ≈ 0 ) ill-conditioned hota hai.
Common mistake "Mera answer bura hai, toh mera algorithm bura hai."
Kyun sahi lagta hai: jab results garbage hote hain, code ko blame karna natural lagta hai.
Fix: Conditioning problem ke baare mein hai, stability algorithm ke baare mein. Ek ill-conditioned problem bure answers deta hai chahe perfect algorithm use karo. Pehle κ diagnose karo; tabhi poochho ki tumhara method backward stable hai ya nahi.
Common mistake "Ek bada absolute condition number matlab ill-conditioned."
Kyun sahi lagta hai: "bada number = bura" ek tempting shortcut hai.
Fix: κ abs ke units hote hain aur sirf scaling ki wajah se bada ho sakta hai. Ill-conditioning judge hoti hai dimensionless relative κ rel se. Example: f ( x ) = 1000 x ka κ abs = 1000 hai lekin κ rel = 1 — perfectly conditioned.
det ( A ) ≈ 0 matlab A ill-conditioned hai."
Kyun sahi lagta hai: singular matrices ka determinant zero hota hai.
Fix: Determinant size aur units ke saath scale karta hai; 0.1 I 100 ka determinant 1 0 − 100 hai lekin κ = 1 . κ ( A ) = σ m a x / σ m i n use karo, determinant nahi .
Recall Feynman: ek 12-saal ke bacche ko samjhao
Ek magnifying glass imagine karo. Input error page par ek tiny sa smudge hai. Condition number yeh hai ki magnifying glass kitni strong hai. Ek weak glass (chhota condition number) — smudge chhota rehta hai, tumhara answer clear hai. Ek super-strong glass (huge condition number) — woh tiny smudge ek giant blurry blob ban jaata hai aur tum answer padh nahi sakte. Magnifying glass ki strength problem ki property hai, tumhari aankhon (algorithm) ki nahi. Kuch sawaal naturally "blurry" hote hain — jaise yeh measure karna ki ek see-saw kaise tip karta hai jab woh bilkul edge par perfectly balanced ho: ek tiniest push usse crash kar deta hai.
"CRAB" — C ondition = R elative A mplification of B lunders.
Aur formula ke liye: "x f-prime over f" → κ rel = f x f ′ (upar se neeche padho: input × slope ÷ output).
Condition number kya measure karta hai? Input mein relative (ya absolute) change output mein kitna amplify hota hai — problem ki property hai, algorithm ki nahi.
y = f ( x ) ke liye absolute condition number ka formula?κ abs = ∣ f ′ ( x ) ∣ , Taylor expansion se limit ∣Δ y ∣/∣Δ x ∣ ke roop mein derive hota hai.
Relative condition number ka formula? κ rel = f ( x ) x f ′ ( x ) , dimensionless.
Ill-conditioning decide karne ke liye kaun sa condition number use hota hai, aur kyun? Relative wala — yeh dimensionless hai, toh scaling/units se dhoka nahi khaata.
Condition number κ ke liye kitne digits khoye jaate hain? Lagbhag log 10 κ decimal digits.
f ( x ) = x p ka condition number?κ rel = ∣ p ∣ (jaise
x ka
1/2 hota hai).
Nearly-equal numbers ko subtract karna dangerous kyun hai? κ rel = ∣ x / ( x − y ) ∣ blow up karta hai jab x ≈ y — catastrophic cancellation.
A x = b solve karne ka condition number?κ ( A ) = ∥ A ∥∥ A − 1 ∥ = σ m a x / σ m i n (2-norm).
Conditioning aur stability mein kya fark hai? Conditioning = problem ki sensitivity; stability = algorithm ki quality. Accurate result ke liye dono chahiye.
Kya det ( A ) ≈ 0 ek reliable ill-conditioning test hai? Nahi — determinant size/units ke saath scale karta hai; σ m a x / σ m i n use karo.
dimensionless, usual meaning
large, much bigger than 1
property of problem, not algorithm
Absolute condition number
Relative condition number