✖️ 1. Differentiating exact arithmetic from numerical approximation and measurement error
🎯 Exact vs. Approximate Numbers
- Exact numbers come from counting or definitions (no rounding needed).
- Approximations come from measurements or rounding (always have some error).
- Calculators and computers use approximations for most decimals.
- is exact as a symbol, but is an approximation.
- Measurement tools (rulers, scales) always give approximate values.
If you count 7 apples, that's exact. If you measure 7.2 cm with a ruler, that's approximate.
💡 Counted = exact, measured = approximate!
1. Differentiating exact arithmetic from numerical approximation and measurement error
Exact Arithmetic vs. Numerical Approximation
Exact arithmetic operates on values with infinite precision (e.g., , , ), yielding results that are mathematically perfect. Numerical approximation represents these values with finite precision (e.g., ), introducing rounding error—the difference between the true value and its representation.
Intuition: Real-world computations and measurements cannot store infinite digits, so we truncate or round, creating small discrepancies.
Core distinctions:
- Exact: (no error)
- Approximation: (error )
- Measurement error arises from instrument limitations (e.g., ruler precision to nearest mm)
- Rounding error arises from finite digit representation
Consequence: Even simple operations accumulate error when repeated, diverging from exact results.
Example: Exact . Using , error is .
A computer program needs to add the exact fraction three times. Instead of exact arithmetic, it uses the numerical approximation for each fraction. What is the total rounding error of this sum compared to the exact mathematical result?
✖️ 2. Absolute vs. relative error and understanding significant figures limits
📏 Absolute vs. Relative Error
- Absolute error = (same units as measurement).
- Relative error = (unitless, often a percentage).
- Significant figures show how many digits are trustworthy in a number.
- More significant figures = smaller relative error.
- A 1 cm error is huge for measuring a phone but tiny for measuring a building.
True length = 100 cm, measured = 98 cm. Absolute error = 2 cm, relative error = 0.02 or 2 percent.
💡 Relative error tells you if the mistake matters for the scale!
2. Absolute vs. relative error and understanding significant figures limits
Absolute vs. Relative Error and Significant Figures
Absolute error is the magnitude of difference between approximate value and true value : . Relative error is the ratio (for ), expressing error as a fraction of the true value.
Intuition: Absolute error measures raw discrepancy; relative error measures proportional accuracy, crucial when comparing scales.
Core rules:
- Absolute error:
- Relative error: (often expressed as percentage)
- Significant figures indicate precision: has 3 sig figs; also has 3
- Trailing zeros after decimal count; leading zeros do not
Consequence: Small absolute errors can be large relative errors for tiny values, and vice versa.
Example: True value , approximation . , . For , : , .
A sensor measures a temperature. The true value is degrees and the approximation is degrees.
Calculate the absolute error of this measurement.
✖️ 3. Light error propagation formulas and error bounds in sums/products
➕✖️ Error Propagation Rules
- When you add or subtract, absolute errors add up.
- When you multiply or divide, relative errors add up.
- Error bound = worst-case total error after operations.
- If and , then .
- Multiplying many approximate numbers makes relative error grow fast.
Add and : result is (errors add).
💡 Addition stacks absolute errors, multiplication stacks relative errors!
3. Light error propagation formulas and error bounds in sums/products
Error Propagation in Sums and Products
Error propagation quantifies how input errors affect computed results. For sums, absolute errors add; for products, relative errors approximately add.
Intuition: Combining approximate values compounds their individual uncertainties according to the operation type.
Core formulas:
- Sum/Difference: If and , then
- Product: If relative errors are , , then has relative error (for small errors)
- Quotient: has relative error
- Absolute error bound for sum:
Consequence: Errors accumulate predictably; additions of values with error yield total error .
Example: , . Sum: . Product: with relative error , so .
Two measurements are given as and .
What is the maximum absolute error of the sum ?
✖️ 4. Catastrophic cancellation when subtracting close approximations
💥 Catastrophic Cancellation
- Subtracting two nearly equal approximate numbers destroys accuracy.
- The result has far fewer significant figures than the original numbers.
- Happens because small rounding errors become huge relative to the tiny difference.
- Avoid by rewriting formulas (e.g., use conjugates or factoring).
- Computers suffer this badly in floating-point subtraction.
Subtract . If each had error , the answer could be off by 40 percent!
💡 Never subtract twins—they cancel the good digits and leave the junk!
4. Catastrophic cancellation when subtracting close approximations
Catastrophic Cancellation
Catastrophic cancellation occurs when subtracting two nearly equal approximate numbers, causing significant digits to cancel and magnifying relative error drastically.
Intuition: If , then is tiny, but rounding errors in and become large relative to the small result.
Core characteristics:
- Loss of precision: Subtracting and (each rounded) yields , but errors dominate
- Relative error explosion: If have error , result can have relative error
- Avoid by reformulation: Use algebraic identities (e.g., rationalize denominators)
- Critical in numerical algorithms: Quadratic formula, derivative approximations
Consequence: Catastrophic cancellation renders results unreliable despite input precision.
Example: Compute with 4-digit precision. , so (wrong). Exact: . Reformulate: .
Based on the theory, which of the following operations is most likely to cause catastrophic cancellation if the numbers are approximations?
✖️ 5. Applications: Floating-point arithmetic errors in computer science and trajectory deviations
💻🚀 Real-World Error Disasters
- Floating-point arithmetic in computers rounds every calculation slightly.
- Millions of tiny errors can accumulate into huge mistakes over time.
- The Patriot missile failure (1991) was caused by time-rounding errors after 100 hours.
- Spacecraft trajectories drift if position errors compound over billions of calculations.
- Financial software must use exact decimal types to avoid cent-rounding bugs.
A rocket calculates position 1000 times per second. Even 0.000001 error per step becomes meters after an hour.
💡 Tiny errors × many steps = mission failure!
5. Applications: Floating-point arithmetic errors in computer science and trajectory deviations
Applications of Rounding Error Accumulation
Floating-point arithmetic in computers represents real numbers with finite bits (e.g., IEEE 754 standard), causing rounding at each operation. Trajectory deviations occur in simulations when iterative calculations accumulate errors, diverging from true paths.
Intuition: Repeated computations magnify small errors, leading to significant discrepancies in long-running processes.
Key applications:
- Floating-point: in binary (yields )
- Iterative algorithms: Numerical integration, differential equations accumulate error per step
- Trajectory simulation: Spacecraft navigation errors compound over millions of calculations
- Financial systems: Rounding cents over billions of transactions creates discrepancies
Consequence: Critical systems require error analysis, higher precision (e.g., double vs. single), or compensated summation algorithms (e.g., Kahan summation).
Example: Summing ten thousand times in floating-point yields instead of exactly , with error .
A programmer writes a simple script to add and . According to the theory of floating-point arithmetic, what is the expected output?