You are on page 1of 18

Year 1

LESSON 12 Errors

Common Mistakes

Lose track of the source documents Enter data wrongly Invalid datatype ( e.g. enter alphabets instead of numerical data ) Out of the valid data range ( e.g. enter 23322 while the actual data is 23223 ) Transportation of characters ( e.g. 000100101 is transmitted along a cable and on the way due to voltage surge, the data becomes 101001101

Mistakes are due to human carelessness


CS113/0401/v1 Lesson 12 - 1

Year 1

PARITY BIT CHECK

Example : If B is represented as 100 0010, we can use even parity conversion to produce a parity bit IF odd number of 1s THEN parity bit 1 0

ELSE
parity bit ENDIF

CS113/0401/v1

Lesson 12 - 2

Year 1

CHECK DIGIT PRINCIPLES

Select a weight for each digit in the number Multiply each digit by its weight Sum the results Select and divide by a modulus The modulus less the remainder is the check digit

CS113/0401/v1

Lesson 12 - 3

Year 1

CHECK DIGIT CALCULATION

Example for 831 405 8 x 7 = 56 3 x 6 = 18

1x5=5
4 x 4 = 16 0x3=0 5 x 2 = 10

Total = 105
Divide by modulus (11)= 9 remainder 6 Check digit is 11-6=5 831 405 - 5

CS113/0401/v1

Lesson 12 - 4

Year 1

NCC 1/94

Question 8 c) i) Using mod 11 and weightings of 2, 3 and 4 for the units, tens and hundreds columns, append a check digit to 974. (2m) ii) Show how a transposition error occurring in the number 974 wold be detected. (2m)

CS113/0401/v1

Lesson 12 - 5

Year 1

Answer
I) 9 x 4 = 36 7 x 3 = 21 4x2= 8 65 65 11=5 r 10 [1] 11 - 10 = 1 9741 required answer [1]

ii) Let error give to 9471. Follow through on candidates valid transportation error e.g. 4971 etc. [1] for recognizing what a transportation error is. 9 x 4=36 4 x 3=12 [1] for appropriate method. 7 x 2=14

1 x 1= 1
63 Not exactly divisible by 11 Error in data

CS113/0401/v1

Lesson 12 - 6

Year 1

ERROR

Inherent Error

It is error that already exist by itself in the measurement scale. E.g. Ruler measurement If the length fall between 5.1cm and 5.2cm, the smallest division is 0.1cm, then the reported reading may be 5.15cm and the inherent error is 0.05cm.

CS113/0401/v1

Lesson 12 - 7

Year 1

ERROR

Induced Error

It is error which is brought in from outside due to external factors Example: In a fixed point 8-bit register in computer, the implied point to the right of 5 bits If a data 1010.01110 is to be stored, rounding or truncation is necessary.

Rounding : The above data is stored as

0 1 0 1 0 1 0 0
Thus the error is brought in due to the limitation of computer
CS113/0401/v1 Lesson 12 - 8

Year 1

ABSOLUTE AND RELATIVE ERROR (1)

Absolute Error is:


Value used - True value The difference between the number represented and its true value (value as stored less true value)

Relative Error is:

The proportion of the absolute error to the true value I.e.


absolute error true value

CS113/0401/v1

Lesson 12 - 9

Year 1

ABSOLUTE AND RELATIVE ERROR (2)

From a previous example:

Absolute error is = Value used - True value 0.296875 - 0.3 =-0.003125

Relative error is = Absolute error / True value

-0.003125 / 0.3
=-0.0104166 ( or -1.04166% )

CS113/0401/v1

Lesson 12 - 10

Year 1

NCC 2/94
Question 1(g) Two values are recorded as 8.7 and -4.3, both correct to 1D. What is the MAXIMUM ABSOLUTE ERROR when they are added together? (2m) Answer 8.65 x 8.75 -4.35 y - 4.25 4.3 x 4.5 Recorded value is 4.4 Hence maximum absolute error is 0.1. One mark for maximum individual error 0.05. One mark for correct answer.
CS113/0401/v1 Lesson 12 - 11

Year 1

ERROR PROPAGATION

Inherent errors in data values, may produce further errors as they are operated on arithmetically These errors may be termed as Induced errors This spread of errors is called the Error Propagation

CS113/0401/v1

Lesson 12 - 12

Year 1

WHEN DO TRANSACTION ERRORS OCCUR?

When data is first recorded in a User Department When this data is input to the computer or transcribed into machine readable form

SINGLE TRANSPOSITION ERRORS


237426 1546

234726
CS113/0401/v1

1645
Lesson 12 - 13

Year 1

TRUNCATION ERRORS

Calculate: (a + b) / (c - d) Where:a = 3.62841 c = 8.32174 b = 5.38634 d = 8.31079

If actual values used: 9.01475 / 0.01095 = 823.26484 If values corrected to 3 decimals places: 9.015 / 0.011 = 819.54545

Notice that the resulting error after the division is much larger than the original rounding off
CS113/0401/v1 Lesson 12 - 14

Year 1

CONVERSION ERRORS

Decimal input Binary equivalent Equivalent in 6 bits Which is equivalent

0.3 0.010011001 0.010011 0.296875

CS113/0401/v1

Lesson 12 - 15

Year 1

DEALING WITH ROUNDING ERRORS

Never truncate or round up all the time (round off instead) Always used the maximum space available for sorting intermediate results

CS113/0401/v1

Lesson 12 - 16

Year 1

ADDING IN DESCENDING ORDER OF MAGNITUDE

0.154308 + 0.019276 = 0.173584 = 1.174

0.174000 + 0.003574 = 0.177574


= 0.178 0.178000 + 0.002807 = 0.180807

= 0.181
Exact answer is 0.179965

CS113/0401/v1

Lesson 12 - 17

Year 1

ADDING IN ASCENDING ORDER OF MAGNITUDE

0.002807 + 0.003574 = 0.006381 = 0.00638

0.006380 + 0.019276 = 0.025656


= 0.0257 0.025700 + 0.154308 = 0.180008

= 0.180

Exact answer is 0.179965 Previous answer was 0.181


CS113/0401/v1 Lesson 12 - 18