5.5.25 · D3Embedded Systems & Real-Time Software

Worked examples — Redundancy — TMR (triple modular redundancy), voting logic

3,844 words17 min readBack to topic

This page lives under the TMR parent topic. Here we stop talking about voting and actually do it — for every kind of input a triple-modular-redundant system can meet. Read the parent first if the words module, voter or majority are new to you; everything else we rebuild from zero.


The scenario matrix

Every cell below is a distinct shape the three inputs can take. Each worked example is tagged with the cell(s) it covers.

Cell Input pattern What tests it Example
A All three exactly equal Fault-free "happy path" Ex 1
B Exactly two equal, one off Single masked fault Ex 1, Ex 2
C All three different (no consensus) Voter fails to decide Ex 3
D Close-but-not-equal (analog noise) Tolerance clustering vs. median Ex 4
E One module silent (no output) Degenerate input, fail-silent Ex 5
F Binary inputs Digital majority gate, all 8 rows Ex 6
G A wild outlier Median beats average Ex 7
H Limiting reliability Boundary of when TMR helps Ex 8
I Real-world word problem Furnace safety cutoff Ex 9
J Exam twist: two modules fail identically Common-cause defeats voting Ex 10
K Plausible liar within tolerance Byzantine/adversarial module Ex 11

Example 1 — Cells A & B: the happy path and one masked fault

Forecast: guess both answers before reading — does run β even have a defined output?

  1. Run α — count agreements. All three bit patterns equal , so . Why this step? The rule only needs two bit-identical; three is even safer. Output .
  2. Run β — pairwise compare. but . The pair is bit-identical, so majority . Why this step? "At least two bit-equal" is satisfied by ; we don't need . The reading is masked.
  3. Name the fault. The lone is a fail-incorrect bias (calibration drift), yet TMR still coped because the other two were healthy. Why this step? Shows cell B: a single wrong-but-plausible value is survivable.

Verify: In α, all equal ⇒ output must equal any input, . ✅ In β, two of three equal ⇒ output , and the outlier's distance never enters the result. ✅


Example 2 — Cell B: sign-flip fault in flight control

Forecast: the wrong value is the negative of the right one — does that fool the voter?

  1. Bit-compare the pairs. The voter checks equality of raw bit patterns, not magnitudes. and share identical bits; differs in exactly the sign bit. Why this step? Bit comparison is a single-cycle XOR-and-NOR — far faster than floating-point compare, which matters at kilohertz control loops. This is the concrete meaning of "byte-for-byte equal" in rule 1.
  2. Majority found. Pair matches, does not ⇒ output . Why this step? Even though would command a violent opposite roll, it is a minority of one and gets discarded.
  3. Aftermath. Aircraft keeps a deflection; ground logs flag module 3 (see Watchdog Timers for how the disagreement is recorded for maintenance).

Verify: Set with : . Two modules give , output ; the flipped is masked. ✅


Example 3 — Cell C: no consensus (the voter must refuse)

Forecast: it's tempting to say "pick the middle, 105." Is that what exact voting does?

  1. Count exact matches for each value. For : one module. For : one. For : one. No value reaches count . Why this step? Exact voting is unforgiving — "close" is not "bit-equal."
  2. Return no-consensus. The voter signals an error rather than guessing. Why this step? Guessing here would fabricate trust that isn't earned. A safety-critical system prefers a known failure over a silent wrong answer (see Safety-Critical Systems Standards).
  3. Escalate. With three-way disagreement, TMR is exhausted; you need higher redundancy (5-modular) or a fallback mode.

Verify: matches ⇒ no majority ⇒ output is the error sentinel (None), not . ✅


Example 4 — Cell D: tolerance clustering (and why we return the cluster median)

Forecast: with a window, how many of the three cluster together — and which single number do we hand back?

The geometry of this vote is a number line with a sliding tolerance window. Look at the figure: the amber bars are the pairwise distances; a cluster forms when readings sit inside one window of width .

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s01 — the three readings 100/105/110 on a number line (cyan dots). Top: with the whole trio fits in one window (cyan band), so all three cluster; the amber tick marks the returned value = median of the cluster = 105. Bottom: with no two readings are within 3, so the windows never overlap and no cluster of size ≥ 2 forms → no-consensus.

  1. Build the agreement test. Two readings agree iff . Pairwise distances: , , . Why this step? Rule 2 clusters by closeness within noise, not exact equality.
  2. Find the largest cluster (). All three distances are , so is one mutually-agreeing cluster of size . Why this step? A cluster of means TMR has consensus.
  3. Return the median of the cluster — this is the fix for order-dependence. The cluster is ; its median is . Why this step? The reviewer's trap: with the old "first value reaching the threshold" rule, both and have three neighbours within , so the answer depended on iteration order. Returning the cluster median is a single, order-independent, symmetric choice — it does not matter whether you scan the list forwards or backwards.
  4. Now shrink the window (). Distances are all , so no pair agrees; no cluster of size exists ⇒ no-consensus. Why this step? Shows the trade-off: too-tight falsely rejects genuine agreement; too-loose would merge a real fault into the cluster.

Verify: With , cluster , its median (order-independent). With , no pair within ⇒ output None. ✅


Example 5 — Cell E: a silent module (degenerate input)

Forecast: with only two live inputs, is a "majority of three" still possible?

  1. Treat missing as "cannot match." A silent module can never be bit-equal to anyone, so it contributes to every match count. Why this step? This is why we prefer fail-silent over fail-incorrect: a missing value can't win a vote.
  2. Count matches among survivors. ⇒ count for value is . Why this step? TMR was designed to survive exactly one lost module; two agreeing survivors still form a majority.
  3. Output ; flag degraded mode. The system now has zero remaining tolerance — a second fault is fatal. A watchdog should raise this alarm.

Verify: live agreeing modules , threshold output ; remaining redundancy after one loss . ✅


Example 6 — Cell F: the digital majority gate, all 8 rows

Forecast: how many of the eight rows should give ? (Count rows with two-or-three ones.)

  1. List all rows and the true majority. With inputs :

    ones majority formula
    0 0 0 0 0 0
    0 0 1 1 0 0
    0 1 0 1 0 0
    0 1 1 2 1 1
    1 0 0 1 0 0
    1 0 1 2 1 1
    1 1 0 2 1 1
    1 1 1 3 1 1

    Why this step? Enumerating every row is the only way to prove a Boolean identity — no case can hide.

  2. Check the formula on one tricky row. Row : . Matches majority. Why this step? The two zeros make two product terms vanish; the surviving pair-term fires. This is why we OR three pair-products.

  3. Confirm the count. Exactly rows have majority , and the formula gives on exactly those .

Verify: formula column equals majority column in all 8 rows; number of s . ✅


Example 7 — Cell G: median beats average on an outlier

Forecast: the outlier is the others — which method ignores it?

The figure shows why: on a number line, the average is a balance point that the far-right outlier tips; the median is a rank position that the outlier cannot budge.

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s02 — the three readings on a number line. Two cyan dots sit at 100, one amber outlier at 1000. The white triangle marks the average (400), dragged rightward toward the outlier; the cyan arrow marks the median (100), the middle element after sorting, unmoved by the outlier's magnitude.

  1. Average. . Why this step? Averaging lets a single huge outlier drag the answer — is wrong for a value that should be .
  2. Median-of-three. Sort: ; the middle element is . Why this step? The median only cares about rank, not magnitude, so one extreme value can never move it past the true cluster.
  3. General guarantee. With three inputs where two are healthy and one is arbitrarily bad, the two healthy values occupy ranks that surround the middle, so the median is always one of the healthy values. Why this step? This is the mathematical reason analog TMR voters use median (rule 3), not mean.

Verify: average , median ; only median matches the two-of-three cluster. ✅


Example 8 — Cell H: the reliability boundary

Forecast: at which do the TMR curve and the line cross?

The figure plots both (single module, dashed white) and (TMR, cyan). Read it left to right: below the crossover the cyan curve dips under the white line (TMR hurts); above it the cyan curve bulges over (TMR helps). The amber dots mark the three crossings we are about to derive.

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s03 — horizontal axis is module reliability from 0 to 1; vertical axis is system reliability. White dashed line = single module. Cyan curve = TMR. Amber dots at are the crossings. Cyan shading marks where TMR is above the line (helps); the label "TMR hurts" sits in the region where the cyan curve is below the white line.

  1. Evaluate the corners.
    • : — TMR worse.
    • : — TMR ties.
    • : — TMR helps.
    • : — perfect stays perfect. Why this step? Numbers first, so the algebra below has something concrete to explain.
  2. Solve the crossover equation explicitly. Set the two curves equal and move everything to one side: Factor out : Factor the quadratic , so Each factor gives one root: Why this step? A strict derivation proves the crossover set is exactly — no guessing from the graph. The only interior crossing is , which is the practical threshold.
  3. Read the limits. At the curve pins to (all dead); at it pins to (all perfect). Between the roots and the cyan curve is below the line; above it is above. Why this step? Confirms the figure's shading is exactly the algebra: TMR helps iff .

Verify: , , , ; factored roots of are . ✅


Example 9 — Cell I: real-world furnace safety cutoff

Forecast: two sensors are above , one below — what's the middle value, and does it exceed the limit?

  1. Median-of-three. Sort ; middle . Why this step? Rule 3 always returns a number (a safety limit-check must never receive "no-consensus" and stall); it is robust to the single low reading (), the likely drifting sensor.
  2. Compare to threshold. trip. Why this step? The trusted value, not any single sensor, drives the safety action — the whole point of a voter.
  3. Sanity on the discarded low reading. Had we (wrongly) used the minimum , we'd miss a genuine over-temperature — a dangerous silent failure. Why this step? Confirms median (not min, not average) is the safe choice for a limit check.

Verify: median; trip True. ✅ (Units: all °C, consistent.)


Example 10 — Cell J: exam twist, identical common-cause fault

Forecast: which value has two votes — and is it the right one?

  1. Count matches. Value appears twice (bit-identical), once. Majority . Why this step? The voter is blind to correctness; it only counts agreement. Two wrong-but-identical outputs win.
  2. Diagnose the failure of the independence assumption. TMR's reliability math assumed modules fail independently. A shared bug is a common-cause failure — it corrupts two modules the same way, so the vote confidently returns garbage. Why this step? This is the exam trap: TMR does not protect against faults common to multiple channels. See Common-Cause Failures and Byzantine Fault Tolerance.
  3. The fix is diversity, not more copies. Use design diversity — different algorithms or teams per channel — so a single bug cannot infect two modules identically. Why this step? Redundancy multiplies hardware; diversity removes shared failure modes.

Verify: matches for is ⇒ voter outputs (wrong), while the truth is ; independence assumption violated. ✅


Example 11 — Cell K: a plausible liar inside the tolerance window

Forecast: the liar is only away from truth. With a generous window it "joins" the honest pair — does it corrupt the returned value?

  1. Tolerance . Distances: , , — all , so all three form one cluster . Why this step? The liar is close enough to be admitted into the cluster; this is exactly what a smart adversary aims for.
  2. Return the cluster median — the honest majority still dominates. Sort ; median . Why this step? Here is the payoff of voting on the median of the cluster (rule 2, from the definition box): even though the liar entered the cluster, the two honest s occupy the lower and middle ranks, so the median is . A single liar within tolerance cannot move the median past the honest pair. Compare this with averaging the cluster, which would give — corrupted by the lie.
  3. Tolerance . Now , so the liar is excluded; the honest pair still clusters (distance ), median . Why this step? A tighter window rejects the liar outright — same correct answer, and now the disagreement is visible to diagnostics.
  4. Where the liar wins. A single within-tolerance liar cannot flip a median-based vote as long as the two honest modules agree. TMR's guarantee ends the moment two channels lie the same way (that is Ex 10's common-cause case, or a coordinated Byzantine attack) — which is exactly why Byzantine Fault Tolerance needs more than three replicas. Why this step? Draws the precise boundary of what one adversary can and cannot do.

Verify: With , cluster median (lie masked); the cluster average would be (corrupted). With , liar excluded, honest median . ✅


Recall Self-test

What does "equality" mean in exact-bit majority (rule 1)? ::: The raw bit patterns are identical (a bit-for-bit XOR is all zeros); numerically-close-but-not-identical does not count. When does tolerance-cluster voting (rule 2) return an error? ::: When no group of at least two readings lies within of each other, e.g. with . Why return the cluster median rather than "the first value found"? ::: The median of the cluster is order-independent and symmetric; "first found" depends arbitrarily on scan direction when several values qualify. Which voter must always output a number with no error branch? ::: Median-of-three (rule 3) — used when a downstream controller cannot stall on "no-consensus" (e.g. the furnace limit check). Can one within-tolerance Byzantine liar corrupt a cluster-median vote? ::: No — as long as the two honest modules agree, the median stays on the honest value; averaging the cluster would be corrupted. At what module reliability does TMR stop helping, and how do we prove it? ::: At ; factor into , giving roots . What kind of fault defeats a majority voter entirely? ::: A common-cause failure that corrupts two modules identically, e.g. returning the wrong .