ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)
Our notes
2 min readWhy errors matter
A computer stores numbers with a fixed number of digits and replaces infinite processes (series, limits) with finite ones, so almost every numerical answer is approximate. Good engineering practice is to know how big the error is.
Number systems
- Binary (base 2): 13 = 8 + 4 + 1 = 1101₂. Fractions: 0.625 = 0.5 + 0.125 = 0.101₂.
- Some simple decimals (0.1) have no exact binary form (0.1 = 0.000110011...₂), so 0.1 + 0.2 in a computer is not exactly 0.3.
- Floating point: a number is stored as sign × mantissa × 2^exponent. Double precision (IEEE 754) keeps about 15 to 16 significant decimal digits; machine epsilon is about 2.2 × 10⁻¹⁶.
Measuring error
- True (absolute) error = true value − approximation.
- Relative error = absolute error ÷ |true value|; often given as a percentage.
Worked example. π ≈ 22/7 = 3.142857; true π = 3.141593. Absolute error = 0.001264; relative error = 0.001264 ÷ 3.141593 = 0.000402 (0.040%).
- When the true value is unknown, iterations use the approximate relative error |new − old| ÷ |new| and stop when it falls below a tolerance.
- An approximation is correct to n significant figures if its relative error is below 0.5 × 10^(1−n) (roughly).
Sources of error
- Round-off error: from storing a limited number of digits. Subtractive cancellation: subtracting nearly equal numbers loses significant digits (1.000123 − 1.000000 = 0.000123 keeps only 3 significant digits).
- Truncation error: from cutting off an infinite process. e^x ≈ 1 + x + x²/2: at x = 0.1 the sum is 1.105000 against e^0.1 = 1.105171, an error of 0.000171, about the next term x³/6 = 0.000167.
- Data and model errors: wrong measurements or simplified physics; no numerical method can remove them.
Error propagation
For a sum or difference, absolute errors add (at worst); for a product or quotient, relative errors add (at worst). A small step size h reduces truncation error but, if too small, round-off grows: there is a best h.
Exams usually ask: convert between binary and decimal; compute absolute and relative errors; distinguish round-off and truncation error with examples; explain subtractive cancellation.
Common mistake: dividing by the approximation instead of the true value when the true value is known. Relative error uses the true value in the denominator.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Kaw, Numerical Methods with Applications: Floating point representation
Textbook chapter (PDF, about 0.3 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Floating point representation, CC BY-NC-ND 4.0 · licence
-
Kaw, Numerical Methods with Applications: Measuring errors
Textbook chapter (PDF, about 0.3 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Measuring errors, CC BY-NC-ND 4.0 · licence
-
Kaw, Numerical Methods with Applications: Binary representation of numbers
Textbook chapter (PDF, about 0.2 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Binary representation of numbers, CC BY-NC-ND 4.0 · licence
-
Floating-point arithmetic
(opens en.wikipedia.org in a new tab)
Wikipedia, Floating-point arithmetic, CC BY-SA 4.0 · licence
-
Round-off error
(opens en.wikipedia.org in a new tab)
Wikipedia, Round-off error, CC BY-SA 4.0 · licence
-
Kaw, Numerical Methods with Applications (the whole free textbook)
Every chapter as a separate PDF (0.2 to 1.5 MB each), with videos and quizzes for each method.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications (the whole free textbook), CC BY-NC-ND 4.0 · licence
Watch
-
Floating Point Representation: Background: Part 1 of 3
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
-
Chapter 01.05: Lesson: Floating Point Representation: Example
7 min · ≈ 32 MB · about ₦18
(opens youtube.com in a new tab)
-
Representations of Floating Point Numbers
14 min · ≈ 63 MB · about ₦35
(opens youtube.com in a new tab)
-
Error Analysis in Numerical Analysis (Part 1).
32 min · ≈ 144 MB · about ₦81
(opens youtube.com in a new tab)
-
ESTIMATING ERRORS IN NUMERICAL SOLUTIONS.
1 h · ≈ 270 MB · about ₦152
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.