Projects: from a model to a defensible decision

Three connected cases with full worked reasoning, assumptions, transfer exercises and solution checks

How to use these projects

Attempt each model before opening the worked route. Identify what is measured, what is chosen, what is uncertain and what “safe” means. All numbers are constructed teaching data. Each conclusion is conditional on the displayed assumptions; the exercises ask what happens when those assumptions change.

Projects
1. Measured tank and robust action filtering2. Safe controller tuning with bounded observations3. Learned decisions: robustness and calibrationWrite a complete engineering argument

1. Measured tank and robust action filtering

Background: norms and intervals, state updates, action filters. A tank contains volume $x_k$ litres and must stay in $[0,10]$. During one sample, a bidirectional pump changes volume by $u_k\in[-1,1]$ litres. An unknown net inflow $w_k\in[-0.2,0.2]$ gives $x_{k+1}=x_k+u_k+w_k$. The measurement is $y_k=x_k+v_k$ with $|v_k|\le0.1$. The sample period is fixed; the bounds describe changes per sample, not litres per second.

A learned policy suggests a pump action. We want to retain that preference when possible while making the next volume safe for every state consistent with the measurement and every allowed inflow. Assume the current true state is safe and the measurement and inflow bounds remain valid. No probability model is required for this robust calculation.

Worked route — construct, filter and audit the action

Step 1: derive both sides. A conservative interval for the current state is $[y_k-0.1,y_k+0.1]$. The smallest next volume is bounded below by $y_k-0.1+u_k-0.2$; the largest is bounded above by $y_k+0.1+u_k+0.2$. Requiring these to lie in $[0,10]$ gives

$$0.3-y_k\le u_k\le9.7-y_k,\qquad u_k\in[-1,1].$$

Intersecting the measurement interval with the known safe set could reduce conservatism near its boundary. The wider interval used here remains a valid sufficient certificate. It is important that both inequalities include sensor error and inflow; accounting for one while forgetting the other changes the guarantee.

Step 2: make a particular decision. At $y_k=0.4$, the safety interval is $[-0.1,9.3]$ and the actuator intersection is $[-0.1,1]$. If the learned policy asks for $u_{\rm nom}=-1$, the nearest feasible input is $u^\star=-0.1$. The extreme combinations give next volume between $0.4-0.1-0.1-0.2=0$ and $0.4+0.1-0.1+0.2=0.6$. The correction is 0.9 litres of commanded change.

Step 3: check that the design can keep operating. A true state in $[0,10]$ produces a valid measurement in $[-0.1,10.1]$. Throughout this measurement range, the lower safety endpoint is at most 0.4, the upper endpoint is at least $-0.4$, and the safety interval has width 9.4. Consequently it intersects $[-1,1]$. For each allowed measurement there is an action, and any selected action in the intersection preserves the safe interval for the next step. Starting from a safe state, induction gives safety for every finite sequence of allowed errors and inflows.

Step 4: say what the proof did not establish. It does not prove that the learned policy is efficient, that the bounds describe a real pump, or that a volume remains safe between sampling instants. The discrete model would need an intersample argument for that last claim. A stuck pump, delayed measurement or larger inflow is outside this certificate.

Exercise P1.B1 — Medium: The upper boundary needs its own filter

At $y=9.8$, a nominal input asks for 0.7. Find the feasible action interval, nearest filtered action and extreme next volumes.

Show hint

Compute the two safety endpoints before intersecting the actuator limits.

Show solution

1. Include both sources of uncertainty. At $y=9.8$ litres, sensor error at most $0.1$ places the current volume in $[9.7,9.9]$ litres. Disturbance in $[-0.2,0.2]$ then places the next volume in $[9.5+u,10.1+u]$ litres. Requiring the lower endpoint to be at least zero gives $u\ge-9.5$; requiring the upper endpoint to be at most ten gives $u\le-0.1$.

2. Intersect with actuator limits and minimize the correction. The safety interval is $[-9.5,-0.1]$, and intersecting it with $[-1,1]$ gives $[-1,-0.1]$. The requested action $0.7$ lies above this interval. Every feasible action is therefore below the request, and the closest one is the interval's largest endpoint, $u^\star=-0.1$ litres per sample. Its correction from the request has magnitude $0.7-(-0.1)=0.8$ litres.

3. Audit both extremes. The smallest next volume is $9.7-0.1-0.2=9.4$ litres, and the largest is $9.9-0.1+0.2=10$ litres. Both extreme states and disturbances are allowed and attain those endpoints; all intermediate combinations lie between them. A filter checking only the lower boundary would overlook the upper-volume requirement.

Exercise P1.B2 — Hard: A larger inflow can destroy recursive feasibility

Increase the disturbance bound to $|w|\le1.2$ while retaining sensor error 0.1 and actuator limit 1. Derive the new sufficient action interval. Show that a valid state/measurement at the lower boundary can make it empty after actuator intersection.

Show hint

Replace the combined uncertainty 0.3 by 1.3, then take $x=0$, $y=-0.1$.

Show solution

1. Recompute the sufficient interval. The current-state interval remains $[y-0.1,y+0.1]$, while the disturbance is now $[-1.2,1.2]$. Hence the next volume lies within $[y-1.3+u,y+1.3+u]$. The two safety inequalities are $y-1.3+u\ge0$ and $y+1.3+u\le10$. Solving them for $u$ gives $[1.3-y,8.7-y]$ before imposing the actuator bound.

2. Test an allowed boundary measurement. Take true state $x=0$ and sensor error $v=-0.1$. They satisfy the safe-state and sensor assumptions and produce $y=x+v=-0.1$. The sufficient interval becomes $[1.4,8.8]$. Its intersection with $[-1,1]$ is empty because every required action is greater than the largest available action, $1$.

3. Distinguish a conservative failure from a real obstruction. Even if $x=0$ were known exactly, the allowed disturbance $w=-1.2$ would give $x^+=u-1.2$. Safety would require $u\ge1.2$, still impossible with $u\le1$. Thus better sensing alone cannot preserve the whole safe interval under this disturbance model. In particular the state at its lower boundary has no action that is safe against every allowed disturbance, so the previous recursive-feasibility argument fails.

Exercise P1.B3 — Hard: Write the quantifiers in the right order

For the original model, write the filtering requirement using “for every measurement, there exists an action, for every compatible state and disturbance.” Explain why one fixed input need not work for all tank volumes.

Show hint

An action may depend on the observed measurement. Compare the requirements at the true lower and upper boundaries.

Show solution

Plan of attack. Write down what the controller knows when it acts, turn the inner “for every state and disturbance” into two endpoint inequalities, show those inequalities can be met for every possible measurement, and finally show why one input shared by all volumes cannot meet them.

Step 1 — State what information the controller can use. A safe true state satisfies $x\in[0,10]$ and a valid sensor error satisfies $v\in[-0.1,0.1]$. The measurement $y=x+v$ is therefore at least $0+(-0.1)$ and at most $10+0.1$, so every measurement that can occur lies in

$$Y=[-0.1,\,10.1].$$

For a given $y$, the states that could have produced it are the safe states within sensor error of it, $X(y)=\{x\in[0,10]:|x-y|\le0.1\}$. The requirement is

$$\begin{aligned}&\forall y\in Y,\quad\exists u(y)\in[-1,1]\quad\text{such that}\\&\forall x\in X(y),\quad\forall w\in[-0.2,0.2],\quad 0\le x+u(y)+w\le10.\end{aligned}$$

The action may depend on the observed measurement, but it is chosen before the hidden compatible state and disturbance are resolved. It must work for all of them, rather than choosing a different action after learning the disturbance.

Step 2 — Replace “for every $x$ and $w$” by two endpoint inequalities. For fixed $u$, the next volume $x+u+w$ increases when $x$ increases and when $w$ increases. Every $x\in X(y)$ satisfies $y-0.1\le x\le y+0.1$, and every allowed $w$ satisfies $-0.2\le w\le0.2$. Adding these inequalities to $u$ gives

$$y-0.3+u\;\le\;x+u+w\;\le\;y+0.3+u .$$

So it suffices that the left end is at least $0$ and the right end at most $10$:

$$\begin{aligned}y-0.3+u\ge0&\iff u\ge0.3-y,\\ y+0.3+u\le10&\iff u\le9.7-y.\end{aligned}$$

This is the original sufficient safety interval $[0.3-y,\,9.7-y]$. Any $u$ in it satisfies the inner “for all” statement.

Step 3 — Show that this interval meets the actuator interval for every $y\in Y$. Two nonempty closed intervals $[\ell_1,h_1]$ and $[\ell_2,h_2]$ share a point exactly when $\ell_1\le h_2$ and $\ell_2\le h_1$; the common points are then $[\max(\ell_1,\ell_2),\,\min(h_1,h_2)]$. The safety interval is nonempty because its width is $(9.7-y)-(0.3-y)=9.4\gt0$. Using $y\ge-0.1$ and $y\le10.1$:

$$\begin{aligned}0.3-y&\le0.3-(-0.1)=0.4\le1,\\ 9.7-y&\ge9.7-10.1=-0.4\ge-1.\end{aligned}$$

Both conditions hold, so for every $y\in Y$ the set of admissible actions

$$\bigl[\max(0.3-y,\,-1),\ \min(9.7-y,\,1)\bigr]$$

is nonempty, and choosing $u(y)$ from it satisfies the displayed requirement. The next volume is then in $[0,10]$, so the next measurement is again in $Y$ and the same argument applies at the next step.

Step 4 — Show why a constant input is too restrictive. Suppose one number $u$ had to work for all safe volumes. The state $x=0$ is safe and $w=-0.2$ is allowed, so we need $0+u-0.2\ge0$. The state $x=10$ is safe and $w=0.2$ is allowed, so we need $10+u+0.2\le10$:

$$u\ge0.2\qquad\text{and}\qquad u\le-0.2 .$$

No real number meets both requirements. The order “there exists one input for every state” therefore fails, while “for every measurement there exists an input” permits feedback and succeeds under the original model.

Check. At the extreme measurement $y=-0.1$, the only compatible safe state is $x=0$, and Step 3 allows $u\in[0.4,1]$; taking $u=0.4$ gives next volume $0.4+w\in[0.2,0.6]\subset[0,10]$. At $y=10.1$, the only compatible state is $x=10$, Step 3 allows $u\in[-1,-0.4]$, and $u=-0.4$ gives $9.6+w\in[9.4,9.8]$. The two admissible actions have opposite signs, exactly as Step 4 predicts.

Interpretation. Safety is possible only because the action is allowed to react to the measurement: near the bottom the filter must pump in, near the top it must pump out. Putting “there exists $u$” before “for every $y$” would ask for an open-loop input, which this tank cannot have.

2. Safe controller tuning with bounded observations

Background: Lipschitz continuity, safe exploration, bounded-noise safety. A scalar controller parameter is $a\in[0,1]$. An unknown steady-operation safety margin $g(a)$ must satisfy $g(a)\ge0$. Assume a valid global Lipschitz bound $|g(a)-g(b)|\le0.5|a-b|$ and observation errors bounded by 0.02. These assumptions describe the margin of a completed experiment; any transient safety requirement needs to be part of the margin definition or handled separately.

A previously safe experiment at $a_0=0.2$ produced $y_0=0.18$. The performance model favors $a=0.6$. Can the next experiment use that parameter, or must exploration first build a larger certified region?

Worked route — expand a certificate without confusing it with an objective

Step 1: lower-bound the unknown margin. At the observed point, $g(a_0)\ge0.18-0.02=0.16$. At any other parameter, $g(a)\ge0.16-0.5|a-0.2|$. This lower bound is nonnegative when $|a-0.2|\le0.32$, certifying $[0,0.52]$ after intersecting the parameter domain.

Step 2: test the proposed decision. At 0.6, the lower bound is $0.16-0.5(0.4)=-0.04$. This does not prove that 0.6 is unsafe; it means the current data and assumptions do not certify it. At 0.5 the lower bound is 0.01, so that query is admissible within the stated model.

Step 3: incorporate a second observation. Suppose the admissible query at 0.5 produces $y_1=0.14$. Its lower margin is 0.12 and its certification radius is $0.12/0.5=0.24$, giving interval $[0.26,0.74]$. The union with the first certificate is $[0,0.74]$, which now includes 0.6. The decision to query 0.5 was safe from previous information; using its favorable result to justify the earlier query would have been circular.

Step 4: separate safety and performance. A Gaussian-process model may rank admissible candidates by predicted productivity or uncertainty. The bounded-error Lipschitz argument supplies the safety certificate in this example. A wide performance confidence interval need not make an already certified point unsafe. Conversely, an attractive predicted mean cannot create a missing safety certificate.

The whole argument relies on the margin’s valid Lipschitz and observation bounds. An empirical slope computed between a few observed pairs is generally a lower bound on the required global Lipschitz constant, not an upper certificate. The project therefore begins by stating a bound as an assumption rather than pretending that two measurements establish it.

Exercise P2.B1 — Medium: A noisier observation changes the first experiment

Increase the error bound to 0.05. Use only the first observation at 0.2. Find the certified interval and decide whether 0.5 can still be queried. Propose a largest certified point to the right.

Show hint

The lower observed margin is now 0.13.

Show solution

1. Lower-bound the observed safety margin. The first observation is still $y_0=0.18$ at $a_0=0.2$, but the error bound is $E=0.05$. Thus $g(0.2)\ge y_0-E=0.13$. The assumed Lipschitz bound gives $g(a)\ge0.13-0.5|a-0.2|$.

2. Solve the nonnegative-lower-bound test. The inequality $0.13-0.5|a-0.2|\ge0$ is equivalent to $|a-0.2|\le0.13/0.5=0.26$. Before intersecting the parameter domain the interval is $[-0.06,0.46]$; its intersection with $[0,1]$ is $[0,0.46]$.

3. Decide the next query. At $a=0.5$, the distance from $0.2$ is $0.3$, giving lower margin $0.13-0.5(0.3)=-0.02$. This query is uncertified from the available observation; it is not proved unsafe. The largest rightward point passing the nonnegative test is $a=0.46$, where the bound is exactly zero. If the experiment requires a strictly positive certified margin, choose a point below $0.46$ rather than this endpoint.

Exercise P2.B2 — Hard: Safety data need not certify optimal performance

After the second observation in the worked route, can the data establish that 0.6 is the productivity-maximizing safe parameter? What additional mathematical object would be needed even to pose that optimization problem?

Show hint

The function $g$ is a safety margin, not a performance score.

Show solution

1. Identify what the observations establish. They bound the safety-margin function $g$ and, after the second observation, certify $[0,0.74]$. This interval contains $0.6$, so that parameter is admissible under the stated assumptions. Admissibility does not compare its productivity with other admissible parameters.

2. Supply the missing object before optimizing. One needs a performance function, say $p(a)$, and a direction such as maximizing $p$. The full mathematical problem would be $\max\{p(a):a\in[0,1],\ g(a)\ge0\}$, together with enough observations, model assumptions or bounds on $p$ to compare candidates. A preference for $0.6$ alone is not a measured or proved objective function.

3. See why the safety readings cannot settle the ranking. The same safety data are compatible with a performance function $p_1(a)=a$ and with $p_2(a)=-a$. Within the currently certified interval their maxima occur at $0.74$ and $0$, respectively; neither chooses $0.6$. Thus the safety information alone cannot prove the proposed productivity optimum. Even with performance information, the optimum over the certified set can differ from the optimum over the entire truly safe set, because the certificate may exclude safe points that have not yet been established.

Exercise P2.B3 — Hard: Handle a zero Lipschitz constant honestly

If a valid bound is $L=0$, explain the safe-set update without dividing a margin by $L$. Apply your reasoning first to $y_0-E=0.16$, then to a negative lower margin.

Show hint

A zero Lipschitz bound forces $g$ to be constant throughout the domain.

Show solution

1. Use the defining inequality rather than a radius formula. With $L=0$, every $a,b\in[0,1]$ satisfy $0\le|g(a)-g(b)|\le0\,|a-b|=0$. Therefore $g(a)=g(b)$: the function is constant across the domain.

2. Transfer the supplied lower margin. At the measured point, $g(a_0)\ge y_0-E=0.16$. Constancy then gives $g(a)=g(a_0)\ge0.16\gt0$ for every $a\in[0,1]$. The entire parameter domain is certified by that one valid observation.

3. Treat a negative lower margin honestly. If instead the only available lower bound is $\ell=y_0-E\lt0$, the same argument gives $g(a)\ge\ell$ everywhere, which is insufficient to prove $g(a)\ge0$ anywhere. A lower bound below zero can be consistent with either a positive or a negative true constant, so it proves no unsafety. The lower-bound update adds no new point from this information alone. Computing $\ell/L$ is undefined at $L=0$ and unnecessary in both cases.

3. Learned decisions: robustness and calibration

Background: dual norms, network sensitivity, calibration. A classifier or decision system selects a positive action when the difference between two scores is positive. At one input $x_0$, suppose a certified analysis gives score gap $m(x_0)=0.6$ and the exact affine change $m(x_0+\delta)-m(x_0)=a^\top\delta$, with $a=(2,-1)$, for every perturbation satisfying $\|\delta\|_\infty\le0.3$. This uniform identity covers the balls and boxes used below; a linear approximation at one point would not establish it. Coordinates are normalized features; converting a physical sensor error into these coordinates is part of the model.

Worked route — separate a pointwise certificate from a distributional statement

Step 1: name the perturbation set. For $\|\delta\|_2\le0.2$, Cauchy–Schwarz gives $|a^\top\delta|\le\sqrt5(0.2)$. The gap lower bound is $0.6-0.2\sqrt5\approx0.1528\gt0$, so the decision is preserved throughout that Euclidean ball. For coordinate-wise bounds $\|\delta\|_\infty\le0.2$, the dual 1-norm gives $|a^\top\delta|\le3(0.2)=0.6$. The lower bound is zero, attained by $\delta=(-0.2,0.2)$, so a strictly positive gap is not certified on the closed box.

Step 2: interpret a strict boundary. Every Euclidean radius $r\lt0.6/\sqrt5\approx0.2683$ gives a strict positive certificate. There is no largest such radius for a closed ball; their supremum is $0.6/\sqrt5$. At equality an adversarial point can tie the two scores. Whether a tie changes the chosen label depends on a tie rule; positivity is a clean sufficient condition independent of that rule. A radius is meaningful only after the norm and feature scaling have been specified.

Step 3: calibrate a different quantity. Separately, suppose a fixed prediction model has absolute residual scores 0.1,0.2,…,1.9 on 19 exchangeable calibration cases. For target miscoverage $\alpha=0.1$, the split-conformal rank is $\lceil(19+1)(1-0.1)\rceil=18$, so the threshold is 1.8. Under exchangeability of these cases together with a new test case, the usual marginal coverage statement is at least 90%. It concerns a future residual under a sampling model, not every perturbation around $x_0$.

Step 4: make the comparison. Pointwise robustness answers whether a particular decision survives every allowed input perturbation. Calibration answers how often a prediction set covers an exchangeable new outcome. Neither implies the other. A shifted operating distribution may invalidate exchangeability while leaving the deterministic local algebra unchanged. A locally fragile classifier may still have good average calibration. State the operational requirement before selecting the evidence.

Exercise P3.B1 — Medium: Feature units change the perturbation geometry

Suppose physical errors are $|e_1|\le0.1$ and $|e_2|\le0.4$, and normalization uses $\delta_1=e_1/0.5$, $\delta_2=e_2/2$. Find the normalized box and score-gap lower bound. Would applying the radius 0.2 directly to the unnormalized feature vector be justified?

Show hint

Convert each coordinate before computing $a^\top\delta$.

Show solution

Plan of attack. Convert the physical error bounds into the normalized coordinates in which $a$ is defined, bound the score gap over that box term by term, confirm the same result in physical units, and then compare with what the raw radius $0.2$ would describe.

Step 1 — Normalize each coordinate using its own scale. Divide each physical bound by that coordinate's scale:

$$\begin{aligned}|\delta_1|&=\frac{|e_1|}{0.5}\le\frac{0.1}{0.5}=0.2,\\ |\delta_2|&=\frac{|e_2|}{2}\le\frac{0.4}{2}=0.2 .\end{aligned}$$

Thus the normalized uncertainty set is the box $[-0.2,0.2]^2$, equivalently $\|\delta\|_\infty\le0.2$. Since $0.2\le0.3$, this box lies inside the region $\|\delta\|_\infty\le0.3$ where the stated affine score identity is valid, so we may use $m(x_0+\delta)=m(x_0)+a^\top\delta$.

Step 2 — Bound the smallest gap term by term. With $a=(2,-1)$ and central gap $0.6$, $m(x_0+\delta)=0.6+2\delta_1-\delta_2$. Every real number satisfies $t\ge-|t|$, so $2\delta_1\ge-2|\delta_1|\ge-2(0.2)$ and $-\delta_2\ge-|\delta_2|\ge-0.2$. Adding:

$$\begin{aligned}m(x_0+\delta)&=0.6+2\delta_1-\delta_2\\&\ge0.6-2(0.2)-0.2\\&=0.6-0.4-0.2=0.\end{aligned}$$

Step 3 — Show the bound is attained by an allowed error. Both inequalities in Step 2 become equalities when $\delta_1=-0.2$ and $\delta_2=0.2$. Then $m=0.6+2(-0.2)-0.2=0$. Converting back with $e_1=0.5\,\delta_1$ and $e_2=2\,\delta_2$ gives $e=(-0.1,0.4)$, which satisfies both physical bounds. Hence the lower bound is exactly $0$: a strictly positive gap is not certified on the closed box, because an extreme perturbation can tie the scores.

Step 4 — Redo the calculation in physical units. Substituting $\delta_1=e_1/0.5$ and $\delta_2=e_2/2$ into $a^\top\delta$ transforms the coefficients as well as the set:

$$2\,\frac{e_1}{0.5}-\frac{e_2}{2}=4e_1-\tfrac12e_2 .$$

Over the rectangle $[-0.1,0.1]\times[-0.4,0.4]$ the smallest value is $4(-0.1)-\tfrac12(0.4)=-0.4-0.2=-0.6$, so the gap is at least $0.6-0.6=0$, the same answer as Step 2.

Step 5 — Judge the raw radius $0.2$. Applying the number $0.2$ directly to the raw errors would describe the box $|e_1|\le0.2$, $|e_2|\le0.2$. That box is not the stipulated rectangle $[-0.1,0.1]\times[-0.4,0.4]$: it includes values $e_1\in(0.1,0.2]$ that cannot occur, and it excludes allowed values $e_2\in(0.2,0.4]$, including the worst-case error $e=(-0.1,0.4)$ from Step 3. A certificate over that box would therefore say nothing about some allowed errors, and using $a=(2,-1)$ on raw errors would also apply coefficients defined for different units. It is not justified. Both the set and its linear coefficients must be transformed; the scales and feature units are part of the uncertainty model.

Check. An affine function on a box takes its minimum at a corner. Evaluating $0.6+4e_1-\tfrac12e_2$ at the four physical corners $(\pm0.1,\pm0.4)$ gives $0.4$ at $(-0.1,-0.4)$, $0$ at $(-0.1,0.4)$, $1.2$ at $(0.1,-0.4)$ and $0.8$ at $(0.1,0.4)$. The minimum is $0$, at the corner found in Step 3.

Interpretation. In correctly normalized coordinates the decision survives every allowed error but only with zero margin, so the positive label is not strictly certified. The numerical “radius” of a certificate means nothing until it is stated in the units and scaling of the model.

Exercise P3.B2 — Hard: A calibration rank can exceed the data

With 19 calibration cases, change $\alpha$ to 0.01. Compute the required rank. Explain the conservative convention when that order statistic is unavailable, rather than replacing it silently by the largest finite score.

Show hint

Evaluate $\lceil20(0.99)\rceil$.

Show solution

Plan of attack. Evaluate the split-conformal rank formula, notice that it asks for more order statistics than the data contain, apply the convention that keeps the guarantee, and then compute exactly how much coverage is lost if the rank is silently clipped to the sample maximum.

Step 1 — Compute the required rank. With $n=19$ calibration cases and $\alpha=0.01$, the split-conformal rank is

$$r=\lceil(n+1)(1-\alpha)\rceil=\lceil20(0.99)\rceil=\lceil19.8\rceil=20 .$$

The ceiling rounds up because rounding down would select a smaller threshold and weaken coverage. The data contain only the order statistics numbered $1$ through $19$, and $20\gt19$, so this rank is unavailable among the finite scores.

Step 2 — Apply the conservative convention. Append an additional score $+\infty$ to the ordered calibration list. The $19$ finite scores occupy ranks $1$ to $19$, so the twentieth order statistic is $+\infty$. The residual threshold is infinite, and the prediction set $\{y:|y-\hat y|\le+\infty\}$ contains every real number. A new residual is always at most $+\infty$, so coverage holds with probability $1\ge0.99$. The requested coverage is satisfied by imposing no finite residual restriction; the result is honest but vacuous at this calibration size.

Step 3 — Compute the coverage of the clipped threshold. Replacing rank $20$ by $19$ would use the sample maximum, $1.9$ in the displayed data. Write $S_1,\dots,S_{19}$ for the calibration scores and $S_{20}$ for the new test score, and assume they are exchangeable and continuous, so ties have probability zero. Let $A_i$ be the event “$S_i$ is the largest of the twenty scores.” Then:

(a) the events $A_1,\dots,A_{20}$ are disjoint, because without ties only one score can be largest; (b) exactly one of them occurs, so $\sum_{i=1}^{20}\Pr(A_i)=1$; (c) exchangeability means that swapping the labels $i$ and $20$ does not change the joint distribution, and this swap turns $A_i$ into $A_{20}$, so all twenty probabilities are equal. Combining (b) and (c):

$$20\,\Pr(A_{20})=1\quad\Longrightarrow\quad\Pr(A_{20})=\frac1{20}=0.05 .$$

The calibration maximum covers the test score exactly when the test score is not the largest, which has probability

$$1-\Pr(A_{20})=1-\frac1{20}=\frac{19}{20}=0.95\;\lt\;0.99 .$$

This allowed sampling example is enough to show that clipping does not inherit a distribution-free 99 percent guarantee.

Check. The same counting says that the $r$-th smallest of $n$ calibration scores covers a new exchangeable score with probability at least $r/(n+1)$. For the worked route, $r=18$ gives $18/20=0.90$, matching $\alpha=0.1$; for the clipped rank here, $r=19$ gives $19/20=0.95$, matching Step 3. To make rank $\lceil(n+1)(0.99)\rceil$ available one needs $\lceil(n+1)(0.99)\rceil\le n$. Because $n$ is an integer, the ceiling of a number is at most $n$ exactly when the number itself is at most $n$, so the condition is

$$\begin{aligned}(n+1)(0.99)\le n&\iff n+1-0.01(n+1)\le n\\&\iff 1\le0.01(n+1)\\&\iff n\ge99 .\end{aligned}$$

For example, at $n=98$ the rank is $\lceil98.01\rceil=99\gt98$, while at $n=99$ it is $\lceil99\rceil=99$. So at least $99$ calibration cases are required.

Interpretation. With $19$ cases, the only distribution-free way to promise $99$ percent coverage is the vacuous infinite threshold. More calibration data, or an explicitly vacuous threshold, is needed for the stated procedure at that level; quietly using the maximum delivers only $95$ percent.

Exercise P3.B3 — Hard: Joint decisions need a joint guarantee

Suppose four future predictions each have marginal failure probability at most 0.1 under their valid sampling assumptions. Give a dependence-free lower bound on all four succeeding, and explain why multiplying 0.9 four times needs another assumption. What per-prediction bound would suffice for a joint failure budget 0.1 by the union bound?

Show hint

Bound the probability of the union of failure events.

Show solution

1. Express joint failure as a union. Let $F_i$ be failure of prediction $i$, with $\Pr(F_i)\le0.1$ for $i=1,2,3,4$. At least one failure is the event $\bigcup_{i=1}^4F_i$. The union bound requires no independence and gives $\Pr(\bigcup_iF_i)\le\sum_i\Pr(F_i)\le4(0.1)=0.4$.

2. Take the complementary success event. All four succeed exactly when no $F_i$ occurs, so its probability is at least $1-0.4=0.6$. Under mutual independence of the success events, their joint probability is the product of the four success probabilities and is at least $0.9^4=0.6561$; it equals this product of $0.9$ factors when all four marginal success probabilities equal $0.9$. Marginal bounds alone do not justify the independence calculation.

3. Allocate the smaller joint failure budget. If each prediction has failure probability at most $q$, the same union bound gives joint failure at most $4q$. Requiring $4q\le0.1$ gives $q\le0.025$. Thus failure at most $0.025$ per prediction suffices for joint success at least $0.9$, even with dependence. Constructing prediction sets that truly satisfy these marginal bounds still requires their calibration assumptions and adequate data.

Write a complete engineering argument

For any project, finish with a short report containing the requirement in words, the model with units, the uncertainty set or sampling assumptions, the decision rule, a worked calculation and the exact conclusion. Then describe one concrete model change that invalidates the conclusion. Include a failed candidate as well as a successful one: explaining why a certificate cannot establish safety is part of understanding what it can establish.

A strong report separates “the model proves the property,” “the numerical procedure found this candidate,” and “the assumptions describe the application.” These statements need different evidence. Return to the book contents for the supporting chapters or use the glossary to reconstruct the terms.