Ch20 Discussion
Discussion Guide
Warm-up (think–pair–share, 5 min). "Before today: what did you think 0.1 + 0.2 equalled on a
computer, and would you have bet money on it?" Surfaces the real-number intuition the chapter overturns.
Main discussion (15–20 min).
1. The honest tolerance. Put if (x == 0.3_dp) on the board and ask the class to replace it with
something correct. Push past abs(x-0.3) < 1e-15 (often too tight) to a scaled tolerance, and connect
to the ULP. Teaches that "how close is close enough" is a modeling decision, not a constant.
2. Rewrite or accept? Pose the one-pass variance (CS-02). Poll: "add more precision" vs "change the
algorithm." Have each side argue, then reveal that quad hides the instability while the two-pass
removes it — the §20.5 lesson made visceral.
3. Whose fault is the bad answer? Give two scenarios — (a) solving a nearly-singular linear system, (b)
the naive quadratic formula on a well-separated-roots problem — and have students classify each as
ill-conditioned (problem) or unstable (algorithm), and prescribe the fix. Ensures they can act on the
distinction, not just recite it.
Group activity (10 min). In pairs, students take one "should be zero / should be one" identity
(e.g. (a + b) - a - b, or summing 0.1 ten times and comparing to 1.0), predict the double-precision
result by hand using epsilon/ULP reasoning, then compile to check. Collect a few predictions-vs-results;
the misses are the teaching moments.
Exit ticket. "In one sentence each: (1) why is 0.1_dp + 0.2_dp == 0.3_dp false, and (2) what is the
difference between an ill-conditioned problem and an unstable algorithm?" Checks the two threshold concepts.