5.5.26 · D3 · HinglishEmbedded Systems & Real-Time Software

Worked examplesFault tolerance — fail-safe vs fail-operational

3,447 words16 min read↑ Read in English

5.5.26 · D3 · Coding › Embedded Systems & Real-Time Software › Fault tolerance — fail-safe vs fail-operational

Yeh page ek drill sheet hai. Parent note ne tumhe formulas diye the; yahan hum har tarah ke input ko hit karte hain jo woh formulas face kar sakte hain — tiny, huge, "kya ho agar koi number zero ho", aur trick question. Har ek ko pehle khud solve karo phir steps padho.

Har example bilkul teen numbered steps mein todi gayi hai (setup → core computation → finish), aur har step ka apna "Why this step?" hai — taaki rhythm kabhi na badle.


Two names you must not confuse

Matrix se pehle, do acronyms ko pin down karo jo yeh page side by side use karta hai:


The scenario matrix

Kisi bhi number se pehle, chalte hain kya vary ho sakta hai ek fault-tolerance problem mein — taaki koi case aisa na rahe jo humne rehearse na kiya ho.

Is poore topic ke do main engines hain:

Yahan har symbol parent note mein samjhaya gaya tha. Agar koi unfamiliar lage, ruko aur use phir padho — hum ab uske upar build kar rahe hain.

Yeh raha case classes ka grid jo yeh topic tumhare saamne rakh sakta hai:

# Case class Kya stress ho raha hai Covered by
A (almost all failures detected) fail-safe upper limit Ex 1
B (kuch bhi detect nahi) — degenerate poore se division; koi benefit nahi Ex 2
C / middling detection realistic industrial value Ex 3
D TMR early life ( small) jahan redundancy jeetti hai Ex 4
E TMR long run () — limiting value surprising MTTF result Ex 5
F TMR vs single unit crossover jab redundancy kaam karna band kar deti hai Ex 6
G Real-world word problem (strategy choose karo) judgement, arithmetic nahi Ex 7
H Exam twist: "2-out-of-3" ko galat tarike se mix karna sign/counting error pakadna Ex 8

Ab hum A → H chalenge, ek example per cell. Related machinery Redundancy patterns (N+1, TMR, DMR), Safety Integrity Levels (SIL), aur Watchdog timers and health monitoring mein hai — jab koi step unpar lean kare toh link out karo.


[!example] Example 1 — Cell A: near-perfect detection ()

Statement. Ek pressure sensor per hour ki rate se fail hota hai. Diagnostics failures ko catch karke valve ko safe (closed) state mein drive kar deti hain. MTTDf nikalo aur batao yeh kitne saal hai.

Forecast: Pehle guess karo — kya 99% failures detect karna tumhe thodi safety dega ya bahut zyada? Woh number dimag mein rakho.

  1. Failure rate ko split karo. Dangerous slice hai . Why this step? Sirf undetected failures dangerous hoti hain — detected ones ne tumhe already safe steer kar diya. Toh hum ka 99% throw away kar dete hain shuru karne se pehle.

  2. Invert karke mean time nikalo. MTTDf . Why this step? Constant-rate process ke liye, mean-time-to-event exactly rate ka reciprocal hota hai (yeh wahi hai jo parent note se aaya hai).

  3. Years mein convert karo. hours/year se divide karo. Why this step? "Per hour" mein rate hoti hai toh time hours mein milta hai; humans saalon mein sochte hain, isliye hum hours in a year se rescale karte hain taaki "1141-year" safety claim samajh aaye. Unit conversion physics nahi badlata, sirf readout badlata hai.

Verify: Undetected fraction se gayi — mein shrink — isliye MTTDf "detect nothing" baseline h se badha. Units: . ✓ Detection bahut powerful hai — opposite extreme ke liye Ex 2 dekho.


[!example] Example 2 — Cell B: the degenerate case

Statement. Same sensor, /h, lekin diagnostics disconnected hain: . Ab MTTDf kya hai?

Forecast: Zero detection ke saath, kya formula blow up karega, break karega, ya sirf plain number dega?

  1. plug karo. . Why this step? Ab har failure dangerous hai — koi safe branch bilkul nahi hai. System ab "fail-safe" nahi raha; yeh sirf ek bare component hai, isliye MTTDf plain MTTF par collapse ho jaata hai.

  2. Invert karo. Why this step? Ex 1 jaisa hi reciprocal-of-rate rule — lekin ab rate poora hai, kyunki kuch bhi subtract nahi kiya gaya.

  3. Years mein convert karo. . Why this step? Formula divide by zero nahi karta — dangerous sirf tabhi infinite hoti hai jab ho, par nahi. par MTTDf simply raw MTTF ke barabar hota hai, jo ek finite, legible number of years hai.

Verify: Ex 1 se compare karo: detection off karne se MTTDf se ho gayi — exactly woh factor jo pehle gain kiya tha, ab surrender kiya. ✓ Asli blow-up () ka matlab hai "ek system jo kabhi dangerously fail nahi hota" — ek idealisation, isliye math correctly MTTDf ko sirf wahan bhejta hai.


[!example] Example 3 — Cell C: realistic middling detection

Statement. Ek industrial actuator: /h, aur typical self-test coverage . aur MTTDf years mein nikalo.

Forecast: 60% coverage decent lagta hai — kya yeh Ex 1 ka "1000-year" bar clear karega?

  1. Dangerous rate. . Why this step? failures undetected slip hoti hain, isliye hum ka sirf woh hissa rakhte hain.

  2. MTTDf in hours. . Why this step? Phir reciprocal-of-rate — woh single move jo kisi bhi dangerous rate ko mean time mein badal deta hai.

  3. Years mein convert karo. . Why this step? Hours ko years mein rescale karo human-readable safety horizon ke liye, exactly Ex 1 ki tarah.

Verify: Sirf saal — Ex 1 ke se bahut neeche. Lesson: se neeche tum safe game mein barely ho; Safety Integrity Levels (SIL) tables exactly isi liye bahut high demand karte hain. Units check: h. ✓


[!example] Example 4 — Cell D: TMR early life (redundancy ka home turf)

Statement. Teen identical flight computers, /h. par evaluate karo (mission ke early life mein). Single unit ki survival ko TMR survival se compare karo.

Forecast: Ek ki jagah teen copies — failure chance kitna chhota hoga?

Figure — Fault tolerance — fail-safe vs fail-operational
Figure (Ex 4): reliability (vertical, survival probability) versus dimensionless age (horizontal). Chalk-blue curve ek single unit hai; chalk-pink curve TMR system hai. Dashed yellow line evaluation point mark karta hai, jahan pink dot () clearly blue dot () se upar baitha hai — dots ke beech ka vertical gap woh reliability hai jo redundancy early life mein khareedti hai.

  1. Single unit. . Why this step? Ek component bare exponential se survive karta hai — yeh figure mein chalk-blue baseline curve hai, humara yardstick jo beat karna hai.

  2. TMR exact. Master formula use karo ke saath: Why this step? Pehla term = teeno alive; doosra term = exactly ek dead lekin do survivors usse abhi bhi out-vote kar rahe hain. Yeh chalk-pink curve hai jo dashed line par blue se upar baithti hai — woh height difference redundancy ne kharida.

  3. Failure chances read off karo. Single fail hota hai; TMR fail hota hai. Why this step? "Reliability" survival probability hai, isliye failure chance ek minus woh hota hai — woh number jo safety case actually care karta hai. Hum dono compute karte hain taaki win us language mein stated ho ("box lose hone ka chance") jo engineers argue karte hain.

Verify: aur ; ratio improvement. ✓ Yahi to Redundancy patterns (N+1, TMR, DMR) ka pura point hai — bade wins jahan chhota ho.


[!example] Example 5 — Cell E: the long-run limit (the surprise)

Statement. Usi TMR system ke liye, MTTF (poore voted system ki mean time to failure) ke multiple ke roop mein compute karo. Kya yeh single unit se bada hai ya chhota?

Forecast: Teen components — surely average lifetime ek se zyada hoga? Bet lagao, phir padho.

Recall The reliability we are integrating (from Ex 4)

Same curve jo Ex 4 figure mein plot ki gayi — wapas jaane ki zaroorat nahi.

  1. Reliability integrate karo. MTTF ke neeche ka area hai; pehle product ko clean exponentials mein expand karo: Why this step? Mean lifetime = survival curve ke neeche ka area (wahi identity jo MTTDf ke liye Ex 1 mein use hui). Pehle expand karte hain taaki har term ek pure exponential ho jise hum ek rule se integrate kar sakein.

  2. Term by term integrate karo. use karo kisi bhi positive constant ke liye (yahan ): Why this step? Har exponential zero tak decay karta hai, isliye uska total area bas uski decay rate ka reciprocal hai — woh single fact teeno integrals ek saath kar deta hai.

  3. par combine karo. Teeno fractions ko common denominator par rakh ke add karo: Why this step? Teen pieces ke denominators , , hain; unka least common multiple hai, isliye har ek ko par rewrite karne se numerators directly add ho jaate hain aur ek single clean fraction mil jaata hai.

Verify: — TMR ka mean lifetime single unit ke se chhota hai! Kyun? Bina repair ke, TMR mein zyada components hain jo do failures accumulate kar sakte hain jab tak woh use kill na kar dein, aur voter khud late life mein unforgiving hota hai. Redundancy early mein help karta hai (Ex 4), average lifetime par nahi. Crossover point ke liye Ex 6 dekho. ✓


[!example] Example 6 — Cell F: where does TMR stop helping?

Statement. Woh time nikalo (as a multiple of ) jahan TMR reliability single unit ke barabar hoti hai — jiske baad redundancy actually worse ho jaati hai.

Forecast: "Early" aur "forever" ke beech kahin dono curves cross karengi. Guess karo: se pehle ya baad?

Figure — Fault tolerance — fail-safe vs fail-operational
Figure (Ex 6): Ex 4 jaise hi do curves lekin zyada lambe age range par — reliability (vertical) versus (horizontal), chalk-blue = single unit, chalk-pink = TMR. Dashed yellow line crossover ko par mark karta hai, jahan yellow dot dono curves par ek saath baitha hai. Iske left par pink (TMR) curve upar hai (redundancy jeetti hai); iske right par blue (single) curve upar hai (TMR ab worse hai).

  1. Substitution ke saath equal set karo. let karo (toh , mein decreasing), deta hai: Why this step? substitute karne se exponentials ek plain polynomial mein badal jaate hain jo hum haath se solve kar sakte hain — koi calculator nahi chahiye.

  2. Quadratic tak reduce karo. simplify karo, phir se divide karo: Why this step? Har term mein hai, aur kisi bhi finite time ke liye, isliye se divide karna legal hai aur cubic ko quadratic tak drop karta hai jo hum recognise karte hain.

  3. Solve karo aur back-substitute karo. ya . discard karo (woh hai, trivially equal); lo: Why this step? Quadratic dono intersection heights deta hai; sirf meaningful crossover hai, aur natural log ke saath substitution undo karne se actual time milta hai.

Verify: se just pehle (Ex 4 par tha) TMR aage tha — consistent. Figure mein curves exactly par milti hain, phir blue pink ko overtake karta hai. ✓ Real systems "worse" region ko repair/replacement (Real-time scheduling with fault recovery) add karke avoid karte hain taaki woh kabhi ke baad na baithe.


[!example] Example 7 — Cell G: strategy choose karo (word problem)

Statement. Tum ek shipping canal par drawbridge ke liye controller design kar rahe ho. Agar controller fault kare, toh kaunsi strategy — fail-safe ya fail-operational — aur kyun?

Forecast: Socho: kuch na karne vs kuch galat karne ka worst outcome kya hai?

  1. Poochho: kya loss-of-function safe hai ya dangerous? Agar bridge simply move karna band kar de aur wahan ruke, toh na koi ship crush hoga aur na koi car gap mein drive karegi. Why this step? Yeh is poore topic ka single decision rule hai — kisi bhi redundancy math (Common-mode failures and diversity ke alawa) se pehle, tum pehle classify karte ho ki kuch na karna tumhe safe state mein land karta hai ya nahi.

  2. Dono failure costs compare karo. Kuch na karna (bridge frozen) = traffic delay. Kuch galat karna (bridge ek car ke neeche khulja / ek ship par band ho jaye) = catastrophe. Why this step? Fail-safe tab correct hota hai jab no-action wrong-action se sasta ho; yahan dono costs wildly asymmetric hain, jo design decide karta hai.

  3. Fail-safe par commit karo aur mechanism spell out karo. Kisi bhi detected fault par → bridge ko uski current position mein clamp karo, road barriers ko RED kar do, alarm bajao, aur motion resume karne se pehle human reset require karo. Why this step? Hum judgement ko hardware mein turn karte hain: spring-loaded brakes jo power loss par engage hote hain (bilkul parent note ke Example 1 ke railway signal relay ki tarah) guarantee karte hain safe state tab bhi jab software dead ho, isliye koi code defect bridge ko unsafely move nahi kar sakta. Woh physical default hi choice ko trustworthy banata hai, sirf reasoning nahi.

Verify: Aircraft se contrast karo jahan controls freeze karna sab ko maar deta hai — woh must be fail-operational. Same decision rule, opposite answer, kyunki wahan "kuch na karna" catastrophe hai. ✓ Yahan koi arithmetic nahi hai, lekin judgement hi exam ka real target hai.


[!example] Example 8 — Cell H: exam twist (counting galat ki gayi)

Statement. Ek student likhta hai: "TMR tab fail hota hai jab teeno units fail ho jaayein, isliye ." Per-unit failure probability over the mission ke saath, sahi nikalo aur batao student ka shortcut risk ko kitna galat judge karta hai.

Forecast: Kya "all three" sahi count hai, ya "two or more"? Yeh classic slip hai — aage padhne se pehle decide karo.

  1. True failure condition state karo. Ek majority voter tab haarta hai jab woh majority form nahi kar paata — yeh tab hota hai jab 2 ya zyada units fail ho jaayein, 3 nahi. Why this step? Do bad units already ek good unit ko out-vote kar dete hain, isliye system doosri failure land hote hi dead ho jaata hai. Sirf "all 3 bad" count karna "exactly 2 bad" ke har arrangement ko ignore karta hai aur isliye failures ko undercount karta hai.

  2. ke saath evaluate karo. Why this step? Number plug karne se pata chalta hai ki "exactly 2" term () "all 3" term () se teen orders of magnitude bada hai — woh piece jo student ne throw away kiya woh essentially poora answer hai.

  3. Student ke shortcut se compare karo. Student ka , isliye unka estimate hai: Why this step? Error ko quantify karna ek subtle miscount ko ek safety-critical number mein badal deta hai: ek design jo par sign off hua jo actually hai usne apna risk roughly under-budget kiya hai.

Verify: Dominant term swamps , isliye "exactly 2" case ignore karna real risk ka 99.97% throw away kar deta hai. Yeh parent note ke A320 figure ( per flight) se match karta hai. ✓


[!recall]- Rapid self-test

MTTDf aur MTTF mein kya difference hai?
MTTDf = mean time to a dangerous (undetected) failure (fail-safe metric); MTTF = mean time to any failure (reliability metric). Yeh coincide karte hain jab .
MTTDf ko infinity tak blow up kya karta hai — ya ?
(sab failures detected ⇒ zero dangerous rate).
par, MTTDf kiske barabar hota hai?
Sirf MTTF — finite, koi benefit nahi.
TMR MTTF as a multiple of ?
— single unit se chhota.
Kis par TMR aur single-unit reliability curves cross karti hain?
.
Per-unit ke terms mein sahi TMR failure probability?
, nahi.
Drawbridge controller — kaunsi strategy?
Fail-safe (freeze karna galat motion se safe hai).