Open In App

Absolute, Relative and Percentage errors in Numerical Analysis

Last Updated : 27 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Let’s first know some basics about numbers used in floating-point arithmetic or in other words Numerical analysis and how they are calculated. Basically, all the numbers that we use in Numerical Analysis are of two types as follows.

  • Exact Numbers - Numbers that have their exact quantity, means their value isn’t going to change. For example- 3, 2, 5, 7, 1/3, 4/5, or √2 etc.
  • Approximate Numbers - These numbers are represented in decimal numbers. They have certain degrees of accuracy. Like the value of π is 3.1416 if we want a more precise value, we can write 3.14159265, but we can’t write the exact value of π. These digits that we use in any approximate value, or in other ways digits that represent the numbers are called Significant Digits.

How To Count Significant Digits in a Given Number?

For example - In the normal value of π (3.1416), there are 5, significant digits and when we write the more precise value of it (3.14159265) we get 9 significant digits. Let’s say we have numbers: 0.0123, 1.2300, and 0.10234. Now we have 4, 3, and 5 significant digits respectively.

In the Scientific Representation of Numbers:

2.345×10
7,
8.7456 ×10
4,
5.4×10
6 have 4, 5 and 2 significant digits respectively.

Introduction to Errors in Numerical Analysis

Numerical analysis involves developing algorithms to solve mathematical problems approximately rather than exactly. When dealing with real-world problems, exact solutions are often impossible due to the complexity of the equations involved, the limitations of computational resources, or inherent approximations in the model. These approximations lead to errors.

Absolute Error

Absolute Error is used to measure the accuracy of a measurement by comparing it to the true or exact value. It shows how far off a measurement is from the actual value, without considering whether the measured value is greater or less than the true value. It is always non-negative. The absolute error has the same units as the measured and true values. Absolute error does not tell us just how much significant the error is relative to the true value.

Definition: Absolute error is the absolute difference between the measured value and the true value.

Absolute Error Formula

The formula to calculate absolute error is:

Absolute Error = Ea = | Xtrue - Xapprox |

  • Xtrue is the true or exact value.
  • Xapprox is the approximate or measured value.
  • The vertical bars "| |" denote the absolute value, ensuring error is always non-negative.

Calculation of Absolute Error

  1. Identify the True Value: Determine the exact value of the quantity. This might be a known constant, a value from a theoretical model, or the most accurate measurement available.
  2. Identify the Approximate Value: Determine the approximate or measured value. This could be a value obtained through experimentation, estimation, or numerical approximation.
  3. Subtract the Approximate Value from the True Value: Find the difference between the true value and the approximate value.
  4. Take the Absolute Value: Ensure the error is expressed as a non-negative quantity by taking the absolute value of the difference.

Relative Error

Relative error is a measure of the accuracy of an approximation in relation to the true value. It expresses the absolute error as a fraction of the true value, providing the error's significance compared to the magnitude of the quantity being measured. Relative error is particularly useful when comparing errors across different units because it is a dimensionless quantity.

Definition: Relative Error is the ratio of the Absolute Error to the true or exact value.

Relative Error Formula

The relative error Er = Ea / | Xtrue | = | Xtrue - Xapprox | / | Xtrue |

Calculation of Relative Error

  1. Determine the Absolute Error: Calculate the absolute error using the formula.
  2. Divide by the True Value: Divide the absolute error by the true value to obtain the relative error.
  3. Express as a Fraction or Percentage: The result can be left as a fraction or multiplied by 100 to express it as a percentage.

Percentage Error

Percentage error quantifies the accuracy of a measured or estimated value by expressing the error as a percentage of the true or exact value. It provides a way to compare the error relative to the magnitude of the true value, making it easier to understand the significance of the error in context. A small percentage error means the measurement is close to the true value while a large percentage error indicates that the measurement is far from the true value.

Definition: Percentage Error is the ratio of the Absolute Error to the true value multiplied by 100, it can also be defined as Relative Error multiplied by 100.

Percentage Error Formula

Percentage Error (Ep) = Er x 100% = ( | Xtrue - Xapprox | x 100% ) / | Xtrue |

Calculation of Percentage Error

  1. Determine the Absolute Error: Calculate the absolute error using the formula.
  2. Divide by the True Value: Divide the absolute error by the true value to obtain the relative error.
  3. Multiply by 100: Convert the relative error to a percentage by multiplying the result by 100.

Comparison of Absolute, Relative, and Percentage Errors

Absolute Error

  • It is the absolute difference between the true value and the approximate value.
  • Has same unit as the true value.
  • Provides measure of the magnitude of the error.
  • Useful when the scale of measurement is consistent and when comparing errors of the same unit.
  • Tells you how far off a measurement is from the true value, without considering the size of the true value.

Relative Error

  • It is the ratio of the absolute error to the true value, providing a measure of the error relative to the size of the true value.
  • It is dimensionless.
  • Useful for comparing errors across different scales, as it normalizes the error by the size of the true value.
  • Helps put the absolute error into context by showing how large the error is compared to the true value.

Percentage Error

  • It is the relative error expressed as a percentage.
  • Expressed as a percentage (%).
  • Provides a clear understanding of the error's magnitude relative to the true value.
  • Commonly used in reporting to provide an easy to understand figure that represents the error's size relative to the true value.
  • Converts the relative error into a more familiar and interpretable percentage, making it easy to compare the accuracy of different measurements.

Solved Examples

Example 1: Calculating Absolute, Relative, and Percentage Errors

Problem: We are given an approximate value of π as 22/7 = 3.1428571 and the true value as 3.1415926. Calculate the absolute, relative, and percentage errors.

Solution:

  • True Value (X): 3.1415926
  • Approximate Value (X1): 3.1428571

Absolute Error (EA): EA = |X - X1| = |3.1415926 - 3.1428571| = 0.0012645

Relative Error (ER): ER = EA / |X| = 0.0012645 / 3.1415926 = 0.000402

Percentage Error (EP): EP = ER × 100% = 0.000402 × 100% = 0.0402%

Example 2: Finding the Best Approximation

Problem: Given approximate values of 1/3 as 0.30, 0.33, and 0.34, find out the best approximation.

Solution: True Value (X): 1/3 ≈ 0.333333

Absolute Errors:

  • |0.333333 - 0.30| = 0.033333
  • |0.333333 - 0.33| = 0.003333
  • |0.333333 - 0.34| = 0.006667

The value 0.33 has the smallest absolute error, so it is the best approximation.

Example 3: Finding the Difference

Problem: Compute the difference between √5.35 and √4.35.

Solution:

  • √5.35 ≈ 2.31300
  • √4.35 ≈ 2.08566

Difference: 2.31300 - 2.08566 = 0.22734

Example 4: Comparing Errors in Numerical Approximations

Problem: Given the true value of a physical quantity as 8.76 and approximate values as 8.70, 8.80, and 8.75, find and compare the absolute, relative, and percentage errors.

Solution:

  • True Value (X): 8.76

Approximate Values:

  1. For 8.70:
    • Absolute Error = |8.76 - 8.70| = 0.06
    • Relative Error = 0.06 / 8.76 = 0.00685
    • Percentage Error = 0.00685 × 100% = 0.685%
  2. For 8.80:
    • Absolute Error = |8.76 - 8.80| = 0.04
    • Relative Error = 0.04 / 8.76 = 0.00456
    • Percentage Error = 0.00456 × 100% = 0.456%
  3. For 8.75:
    • Absolute Error = |8.76 - 8.75| = 0.01
    • Relative Error = 0.01 / 8.76 = 0.00114
    • Percentage Error = 0.00114 × 100% = 0.114%

Best Approximation: 8.75, having the smallest errors in all cases.

Example 5: Significant Digits in Scientific Notation

Problem: Determine the number of significant digits in the following scientific notations:

  • 2.345 × 10^7
  • 8.7456 × 10^4
  • 5.4 × 10^6

Solution:

  • 2.345 × 10^7: 4 significant digits
  • 8.7456 × 10^4: 5 significant digits
  • 5.4 × 10^6: 2 significant digits

Practice Problems (Unsolved)

  1. Calculate Absolute, Relative, and Percentage Errors:
    • Approximate value of e (Euler's number) is 2.718 and the true value is 2.71828.
  2. Find the Best Approximation:
    • Given approximate values of √2 as 1.41, 1.414, and 1.415, determine which is the best approximation.
  3. Find the Difference:
    • Compute the difference between √7 and √6.
  4. Compare Errors in Numerical Approximations:
    • Given a true value of 50.0, find and compare the errors for approximate values of 49.9, 50.1, and 50.05.
  5. Significant Digits in Scientific Notation:
    • Determine the number of significant digits in 4.500 × 10^3, 9.00 × 10^2, and 1.003 × 10^5.
  6. Determine Absolute and Relative Errors:
    • Approximate value of log10(100) is 2.01, with the true value being 2.00.
  7. Percentage Error Calculation:
    • For a true value of 12.345 and an approximate value of 12.30, calculate the percentage error.
  8. Absolute Error in Measurements:
    • True value of a length is 15.76 cm, and the measured length is 15.80 cm. Calculate the absolute error.
  9. Best Approximation of 1/7:
    • Approximate values of 1/7 are 0.142, 0.143, and 0.140. Find the best approximation.
  10. Difference Calculation:
    • Compute the difference between 3.5 × 10^2 and 3.4 × 10^2.

Summary / Conclusion

In numerical analysis, understanding errors is crucial for evaluating the accuracy of approximations. Exact numbers are rare in real-world computations, so approximate values often come with errors. Absolute error measures the raw difference between true and approximate values, while relative error normalizes this difference relative to the true value. Percentage error provides a clearer understanding by expressing relative error as a percentage. By comparing these errors, one can assess the quality of numerical approximations and select the most accurate results.

  1. How to Find the Slope of a Line From Its Graph
  2. Coordinate Geometry

Next Article

Similar Reads