Robustness Examples: 41 Problems with Answers

Worked examples of Robustness to try before you open each solution, then practice problems with answers.

Worked Examples

Example 1

easy
You estimate π≈3.14 instead of 3.14159… in the formula A=πr2 with r=5 cm. Compute the relative error.
Show solution

Answer

Relative error≈0.05%

First step

1.
Exact: A=π(25)≈78.5398 cm².

Full solution

  1. 2.
    Approximate: A≈3.14×25=78.5 cm².
  2. 3.
    Absolute error: ∣78.5398−78.5∣=0.0398 cm².
  3. 4.
    Relative error: 0.039878.5398≈0.051%.
Robustness measures how sensitive a result is to approximations in its inputs. A tiny relative error in π produces an equally tiny error in the computed area — the formula is robust to this approximation.

Example 2

medium
Show that the median is more robust than the mean as a measure of centre when outliers are present. Use the data set {2,3,4,5,100}.

Example 3

medium
Given {4,5,6,7,8}, compute the mean. Then replace 8 with 80 and recompute. By how much did the mean shift?

Example 4

medium
Algorithm A solves a problem in 0.1 s on clean input but 30 s when input is noisy. Algorithm B takes 0.5 s on clean input and 0.6 s on noisy. Which is more robust?

Example 5

medium
Round π=3.14159… to 3.14 and compute the relative error.

Example 6

hard
The dataset {1,2,3,4,5,6,7,8,9,10} has mean 5.5 and median 5.5. Replace the value 10 with 1000. Compute the new mean and median.

Example 7

hard
In computer arithmetic, computing (a+b)+c vs a+(b+c) can give different results due to rounding. What property does this break, and what makes the algorithm 'non-robust'?

Example 8

hard
Compare the breakdown points of the mean and median: roughly what fraction of contaminated data values can each tolerate before producing arbitrary results?

Example 9

challenge
The condition number of a matrix measures how much output error can amplify input error in solving Ax=b. If the condition number is 106, by what factor can a relative input error be amplified in the worst case?

Practice Problems

Try each one, then open the solution to compare your method.

Example 1

easy
If an input x=10 has a measurement error of ±1, find the range of f(x)=2x+3 and assess whether f is robust to this error.

Example 2

medium
Prove that the statement 'n2>n for all n>1' is robust to replacing > with ≥: does 'n2≥n for all n≥1' still hold?

Example 3

easy
The data set 4, 5, 6, 7, 8 has a mean of 6. Replace 8 with 100. Which is more robust to this outlier, the mean or the median?

Example 4

easy
A bridge is designed to hold exactly the expected load with no margin. Is this design robust to small overloads?

Example 5

easy
A sorting algorithm gives correct results even if a few input values are duplicated or out of expected range. What property does this describe?

Example 6

easy
Two thermometers: one reads 20.0 C reliably within +/-0.5 C in any weather; another is perfectly accurate only at sea level. For field use, which is more robust?

Example 7

easy
A formula assumes friction is exactly zero. Real surfaces have small friction. A robust result would still be approximately correct. True or false?

Example 8

easy
A poll of 5 people predicts an election; a poll of 5000 predicts the same election. Which prediction is more robust to a few unusual respondents?

Example 9

easy
Estimating a sum, you round 4.9 to 5 and 3.1 to 3. The estimate 8 is close to 8.0. Is rounding here a robust shortcut?

Example 10

easy
A recipe still tastes good whether you use 1.9 or 2.1 cups of flour. Is the recipe robust to small measurement errors?

Example 11

medium
To estimate a typical income, dataset incomes (in thousands) are 30, 35, 40, 45, 5000. Compute mean and median, and state which is the robust estimate of 'typical'.

Example 12

medium
Method A solves a problem with error proportional to input noise (error = noise). Method B has error proportional to (noise)^2. For small noise = 0.01, which method is more robust, and by what factor smaller is its error?

Example 13

medium
A control system stays stable if a parameter k is in [2, 8]. The current design uses k = 5. By how much can k drift in either direction before instability, and is k = 5 a robust choice?

Example 14

medium
A least-squares fit and a least-absolute-deviations fit both model points, but one point is a gross outlier. Which fit is more robust to that outlier and why?

Example 15

medium
A formula divides by (x - 3). Tested only at x = 10 it works. Why might this not be robust, and at what input does it fail?

Example 16

medium
Two route-planning algorithms: A is optimal on perfectly known travel times; B is within 10% of optimal but unaffected by traffic surprises. In real, uncertain traffic, which is the robust choice?

Example 17

challenge
A quadratic root computation x = (-b + sqrt(b^2 - 4ac))/(2a) suffers catastrophic cancellation when b > 0 and 4ac is tiny. Give a robust algebraically-equivalent formula for that root and explain why it is robust.

Example 18

challenge
A model's prediction p(x) = 1/(1 + (x - 2)^2) is evaluated near x = 2. Show whether the prediction is robust (insensitive) to a small input change there, using the derivative.

Example 19

challenge
A voting rule must elect the same winner even if up to 1 of 5 ballots is corrupted. Candidate X has 4 votes, Y has 1. Show the rule's outcome is robust to one corrupted ballot, and find the smallest X-lead that guarantees robustness.

Example 20

medium
A measurement process gives 10.0 whether the room is 18 C or 25 C, but drifts badly outside 15-30 C. Within what range is the process robust, and is a lab kept at 22 C safe?

Example 21

medium
An estimate uses the approximation (1+x) approx 1 + x for small x. For x = 0.02 the true (1+x)^1 is exact, but for (1+x)^10 the approximation 1+10x ignores higher terms. Is the linear approximation robust at x = 0.02 for the 10th power (true value approx 1.219)?

Example 22

medium
A clustering algorithm gives the same groups whether you start from random seed A or seed B. What robustness property does this demonstrate?

Example 23

easy
Which is more robust to a single huge outlier: the mean or the median?

Example 24

easy
Estimating π≈3.14 vs the true value 3.14159…: is the small error a robust approximation for computing the area of a moderate circle?

Example 25

easy
Which is more robust to outliers, the standard deviation or the interquartile range (IQR)?

Example 26

easy
A weather-prediction model is accurate to within ±2 °C in 90% of cases but is off by 10 °C on rare extreme days. Is it robust to extremes?

Example 27

medium
If f(x)=2x+1 and x=5±0.1, find the resulting range of f(x) and assess robustness.

Example 28

medium
In statistics, a trimmed mean drops the top and bottom 10% of values before averaging. Why is this more robust than the ordinary mean?

Example 29

medium
A formula assumes inputs are positive integers. Is using it for x=0 a robust extension?

Example 30

hard
A function f(x)=1/(x−3) is asked to predict outputs near x=3. Is it robust to small input errors there?

Example 31

hard
A theorem assumes the input function is continuous. The proof goes through if 'continuous' is weakened to 'piecewise continuous'. Is the theorem robust under this weakening?

Example 32

hard
A recipe calls for 2 cups of flour. Cooks A measure 1.95 and 2.05. Both cakes turn out fine. Is the recipe robust to this variation?

What to focus on

Core idea: Robustness is whether a result stays approximately correct when its assumptions are slightly violated.

Common stuck point: The procedure for robustness is the easy part; the trap is calling a method robust because it's accurate on clean data. Asking "If the assumptions are slightly violated, does the result stay approximately correct?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Ask yourself: If the assumptions are slightly violated, does the result stay approximately correct?

Concept recap

The property of a result, algorithm, or model remaining valid or approximately correct even when its assumptions are slightly violated.

A robust method is a four-legged table on an uneven floor: one short leg makes it rock a little, but it stays up. A fragile one is a plate balanced on a pencil, perfect only while everything is exactly right. Unlike a table, robustness is always against a particular kind of trouble: the median shrugs off outliers but not a biased sample.

Read the full lesson on Robustness

Related concepts

Background knowledge

These ideas may be useful before you work through the harder examples.

sensitivity