A board, some standoffs, and a tall capacitor inside an enclosure. Each part is in spec; the question is whether the stack assembles. Worst-case says it might not. Statistics say 99.96% will. Both are right — and knowing which to believe is the job.
A PCB sits on standoffs inside an enclosure, and the tallest component — an electrolytic cap — has to clear the lid. The gap is the enclosure's inner height minus everything stacked under the lid:
gap = Henclosure − (standoff + PCB + component)Every part carries a tolerance. The requirement is simple — gap ≥ 0, or the lid won't close — but each dimension's ± means the gap is a distribution, not a number. The question isn't “what's the gap”; it's “what fraction of built units assemble.”
Three standard methods, three lines of math, and Claude runs all three: worst-case (add every tolerance the wrong way), RSS (root-sum-square the tolerances, assuming each is 3σ), and a Monte Carlo (sample thousands of virtual assemblies). The trap is picking one method and trusting it blindly — worst-case over-builds, pure RSS can flatter a sloppy process. The skill is making them agree, and reading the gap between them.
Slide the enclosure height and a global tolerance scale. Watch worst-case, RSS, and the Monte Carlo histogram move together. Red is the interference region (gap < 0).
At the defaults the worst-case minimum gap is −0.20 mm — technically, a build could interfere. Yet RSS and Monte Carlo both put the failure rate near 0.04%: about 1 in 2,700 units. Worst-case isn't wrong; it's improbable. It assumes every one of four parts hits its worst limit in the same direction at the same time — which a real process almost never does.
Worst-case sums the tolerances linearly: gap = nominal ± Σ|tol|. Guarantees assembly if the min stays ≥ 0, at the cost of demanding tight (expensive) tolerances. RSS sums them in quadrature: ±√(Σ tol²) at 3σ — far less pessimistic, valid when contributors are independent and roughly normal. Monte Carlo samples each dimension and counts failures directly — the referee that confirms RSS, and the only one that copes with skewed or shifted distributions.
No external answer key. The oracle is internal consistency: three independent methods that have to bracket and confirm one another. When they don't, an assumption broke.
A negative worst-case gap doesn't mean “it won't fit” — it means “there exists a combination that won't.” Whether you care depends on volume and the cost of a reject. For one-off aerospace hardware, honor worst-case. For a million consumer units at 0.04% scrap, RSS is the economic answer.
RSS treats each tolerance as 3σ of an independent, centered, normal distribution. If a vendor runs to one side of tolerance (mean shift), or two dimensions come off the same mold (correlated), RSS is optimistic. That's exactly why you run Monte Carlo with realistic distributions as the check.
In RSS, the term that dominates √(Σtol²) is the largest tolerance, squared. Here the ±0.50 cap height swamps everything: 0.50² = 0.25 out of a 0.285 total. Tightening anything else is wasted money; the cap is the lever.
Two free levers worth setting. Turn the reasoning effort up
for the hard part — Claude Code's /effort (see
Feed it documents for the
model and effort controls); a transcription wants it low, an analysis like
this one wants it high. And end your prompt with an explicit
self-check — “before you finish, confirm worst-case bounds RSS and that RSS matches the Monte Carlo yield”
— which is exactly why the prompt above asks Claude to verify itself.
Naming the oracle is the highest-value line in the prompt. And keep the
expensive model's context light — route transcription and formatting
to cheaper tools (see Spend
tokens well).
Nominal gap = 20.00 − (5.00 + 1.60 + 12.80) = 0.60 mm. Worst-case half-range = Σtol = 0.15 + 0.05 + 0.10 + 0.50 = 0.80 mm, so WC gap ∈ [−0.20, +1.40]: a possible interference. RSS half-range = √(0.15²+0.05²+0.10²+0.50²) = √0.285 = 0.534 mm (3σ), so RSS gap ∈ [0.07, 1.13], all positive — σgap=0.178, and the nominal sits 3.37σ above zero, i.e. ~0.04% interference. A 20,000-run Monte Carlo lands on the same ~0.04%.
The decision: worst-case would push you to a taller enclosure or a tighter cap spec (the ±0.50 dominates, contributing 0.25 of the 0.285 sum). RSS/MC say a 0.04% reject rate may be cheaper to live with. The analysis can't make that call — but it tells you the cap, not the standoff or the PCB, is the only tolerance worth paying to tighten.
Same two moves — see explore in HTML, deliver in PDF.