UNIHIVE

Study Hub UNIPORT ENG 303

ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)

Number systems and error analysis

Binary and floating-point numbers, significant figures, absolute and relative error, round-off and truncation error, and how errors grow.

Our notes

2 min read

Why 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

Watch

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.

All ENG 303 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.