Exercise 3: Why More Additions Means More Error — Possible Solution ==================================================================== THE INTUITIVE ARGUMENT ------------------------------ Every single time 0.1 is added to a running total, that particular addition introduces its own small rounding error - the running total gets rounded to the nearest representable floating-point value after the addition, and that rounding either loses or gains a tiny sliver compared to the mathematically exact result. This chapter verified that adding 0.1 ten times already produces a small but nonzero error (0.9999999999999999 instead of 1.0). If one addition can introduce one small error, and each subsequent addition works on a value that already carries the accumulated error from every addition before it, then doing the same kind of addition a million times means a million separate opportunities for a small rounding error to occur, each one adding on top of - not cancelling out - whatever error was already there. There is no built-in mechanism that would make later rounding errors systematically undo earlier ones; on average, they are just as likely to reinforce the existing error as to offset it. WHY THE ERROR DOESN'T STAY FIXED ------------------------------ With only ten additions, there simply isn't much opportunity for error to build up, so the total stays extremely close to the exact answer (off by about 1.1 x 10^-16). With a million additions, the same small per-step rounding effect gets a million chances to compound, so even though each individual step's error is just as tiny as before, the total error after all of them is much larger in absolute terms (about 1.33 x 10^-6) - roughly ten orders of magnitude bigger than the ten-addition case, even though the per-step behavior never actually changed. THE GENERAL PRINCIPLE THIS POINTS TOWARD ------------------------------ This is an intuitive preview of a genuinely important, more formal idea covered in Chapter 6 (Error Propagation & Conditioning): error from repeated floating-point operations doesn't just sit still - it can accumulate as more operations are chained together, and the number of operations performed is itself a real factor in how trustworthy a final floating-point result is, not just the precision of any single step. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation reasons from this chapter's own two verified data points (ten additions vs. one million additions) rather than asserting the conclusion, explains the compounding mechanism in plain terms (more operations = more chances for small errors to add up rather than cancel), and correctly frames this as an intuitive preview of formal error-propagation reasoning still to come, rather than overclaiming a precise formula this early in the course.