COMPUTER SCIENCE ILLUMIN.-TEXT
COMPUTER SCIENCE ILLUMIN.-TEXT
6th Edition
ISBN: 2810016866372
Author: Dale
Publisher: JONES+BART
Expert Solution & Answer
Book Icon
Chapter 18, Problem 31E

Explanation of Solution

Representational error:

Representational error is an error which occurs when performing arithmetic operations such that the precision digit produced by the arithmetic calculation is greater than the precision of the machine.

  • The addition of (A+B) with C produces the same result as adding A with (B+C) according to the associative law.
  • But due to the limitation of precision, the result produced by ((A+B)+C) is not same as (A+(B+C))

Example: consider the following equation:

((A+B)+C)        (1)

Substitute the value of A = –5688 × 103B = 5689 × 103, and C = 5648 × 100 in the Equation (1)

Initially, compute the sum of the first two values (A+B):

  – 5688 × 10   5689 × 10_        1 × 103        (2)

Here, the value 1×103 can be written as 1000 × 100.

Then, compute the addition of the above result of Equation (2) with the value of C, ((A+B)+C)

  1000 × 1005648 × 100_6648 × 100        (3)

Consider the following equation:

(A+(B+C))        (4)

Substitute the value of = 5688 × 103, B = 5689 × 103, and C = 5648 × 100 in Equation (4).

Compute the sum of the two values (B+C):

Here, the value 5689 × 103 can be written as 5689000 × 100.

  5689000 × 100    5648 × 1005694648 × 100         (5)

Here, the value 5694648 × 100  can be written as 5694× 103 when truncating four digits.

Then, compute the addition of the above result of the Equation (5) with the value of A, (A+(B+C))

   5694 × 1035688 ×103_         6 ×103        (6)

Here, the value × 103 can be written as 6000 × 100

Thus, when considering the thousands' place alone the result produced by both Equations (3) and (6) are the same, but the result differs when considering together the thousands, hundreds, tens and one’s place.

Therefore, this type of error is called representational error. It is also called as round-off error.

Cancellation error:

Cancellation error is an error that occurs when performing arithmetic operations between numbers that differ in magnitude.

Example: consider the following equation:

(A + B – C)        (1)

Substitute the value of A = 1, B = 0.00008963, and C = 1 in Equation (1).

Here, the value 1 can be written as 100000000 × 10-8 and the value 0.00008963 can be written as 8963 × 10-8

Initially, compute the sum of the first two values (A+B):

  100000000 × 10-8          8963 × 10-8_100008963 × 10-8        (2)

Here, the value 100008963 × 10-8 can be written as 1000 × 10-3.

Then, compute the subtraction of the above result of Equation (2) with the value of C, ((A+B)-C).

  1000 × 10-3 1000 × 10-3_         0

In general, the result produced by (A + B – C) is 0.00008963. But, the result produced by the computer is 0, which is not 0.00008963.

Therefore, this type of error is called cancellation error.

Underflow error:

Underflow error is an error which occurs when the precision digit produced by the arithmetic calculation is too small to represent in the machine.

Example: consider the following equation,

(A+B)        (1)

Substitute the value of A = 5688×10-7  and B = 5689×10-7 in Equation (1).

Compute the sum of the first two values (A+B):

    5688 × 10-7  5689 × 10-7_11377 × 10-14

Here, the value 11377×10-14 can be written as 1137×10-13.

The result of (A+B) is 1137×10-13, which is too small to represent in the machine because the minimum exponent value that can be represented is -9 and the value lesser than the exponent -9 is considered as 0. So the result of A + B is set to 0.

Therefore, this type of error is called underflow error.

Overflow error:

Overflow error is an error which occurs when the precision digit produced by the arithmetic calculation is too large to represent in the machine.

Example: consider the following equation:

(A+B)        (1)

Substitute the value of A = 5688×107  and B = 5689×107 in Equation (1).

Compute the sum of the first two values (A+B):

    5688 × 107 5689 × 107_11377 × 1014

Here, the value 11377×1014 can be written as 1137×1015.

The result of (A+B) is 1137×1015 which is too large to represent in the machine, because the maximum exponent value that can be represented is +9. So an error message can be produced to indicate the error.

Therefore, this type of error is called overflow error.

Explanation of Solution

Interrelated terms:

The above terms, “Representational error”, “Underflow error”, “Overflow error”, “Cancellation error” is interrelated to each other.

  • Because, all the terms represent the error which occurs due to the limitation of representing a number in a computer.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education