Nine and penalty tests
Nines and eleven tests are methods of detecting calculation errors in addition , subtraction or multiplication . The advantage of these samples is that the correctness of the result of a lengthy calculation can be checked for credibility using easier alternative calculation methods or, if necessary, the incorrectness of an invoice can be proven. However, since not all errors are recognized, a success of the nine or eleven test does not mean that the result is correct.
Colloquially , the term nine-test is also generally used for a rough test of results.
method
Nine remainder
To find the nine remainder of a natural number , you first calculate the cross sum of this number, then the cross sum of the cross sum and so on , until finally only a single digit remains. If this results in 9, 9 is replaced by 0.
Example 1: The nine remainder of 5919 is 6 and is calculated as follows:
- 5 + 9 + 1 + 9 = 24 , and 2 + 4 = 6
Example 2: The nine remainder of 81 is 0 and is calculated as follows:
- 8 + 1 = 9 , and 9 becomes 0
Elferrest
The remainder of the penalty is calculated similarly, only that the alternating checksum is calculated here . In this case, the digits of the number , starting with the last digit, are alternately subtracted and added.
Example: The remainder of the penalty of 5919 is 1 and is calculated as follows:
- 9 - 1 + 9 - 5 = 12 , and 2 - 1 = 1
Nine trial
The test of nine for an initial calculation, e.g. B. 12 + 47 = 69, is to perform the corresponding calculation with the respective nines of the numbers involved in the calculation (operands and result), which leads to the equation 3 + 2 = 6 (nine remainder of 12 is 3, nine remainder of 47 is 2, nine remainder of 69 is 6).
- If the sample leads to a wrong statement, as in this example ( 3 + 2 = 5 ≠ 6), the checked calculation contains an error with absolute certainty. In the example, the correct result 59 has been replaced by 69.
- If the sample is correct, it does not necessarily follow that the verified invoice is correct. So changes a transposed digits in the revised bill nothing in the results of nines because plays no role in the checksum (and thus the rest Neuner) the sequence of digits.
In principle, the test of nine cannot reveal any errors in which the wrong result deviates from the correct result by a multiple of 9. Therefore, it can be said that the nine sample 8 of 9 reveals errors, which error detection probability of 88, 8 corresponds%.
Penalty test
The penalty test is analogous to the nine test. The corresponding calculation is carried out with the remainder of the penalty and it is checked whether this sample rises.
The penalty test carried out alone reveals 10 out of 11 errors, which corresponds to an error detection probability of 90, 90 %.
Combination of a nine and a penalty test
A higher level of security is achieved by using both the nine and the eleven tests. If both samples are carried out successfully, the result is correct in 98 out of 99 cases, which means an error detection probability of 98.98 %.
General
The nines and eleven tests can be applied equally to additions, subtractions and multiplications, but not to divisions and powers .
Any negative nine or eleven residues that occur can be converted into positive residues by adding 9 or 11, respectively. For example, the remainder of the eleven of 492 equals 2 - 9 + 4 = -3; adding 11 gives 8.
Sample calculations
addition
invoice | Nine trial | Penalty test | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Both the nine and the eleven test work out here. This means that the example addition is correct with an overall probability . In any case, neither the nine nor the eleven test can prove that the addition result would be wrong.
subtraction
invoice | Nine trial | Penalty test | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
In this example there is a number rotated . The correct answer would be 81; the example incorrectly calculates 18. The nines here is not able to recognize this number Dreher, since it does not change the checksum: . In this example, however, the penalty check can detect the number rotated and proves that the result 18 is definitely wrong.
multiplication
invoice | Nine trial | Penalty test | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Both the nine and the eleven test work out here. This means that the example multiplication has an overall probability of correct. In any case, neither the nine nor the eleven test can prove that the multiplication result is wrong.
Combination of addition, subtraction and multiplication
The following example is intended to illustrate the application of the nines and eleven tests using an initial calculation in which a combination of addition, subtraction and multiplication occurs.
Output calculation
-25198 + 519948 × (18192-717) = 9086066102
Nines
- Nine remainder of 25198 is 7 since 2 + 5 + 1 + 9 + 8 = 25; 2 + 5 = 7
- The nine remainder of 519948 is 0 because 5 + 1 + 9 + 9 + 4 + 8 = 36; 3 + 6 = 9; 9 becomes 0
- Nine remainder of 18192 is 3 because 1 + 8 + 1 + 9 + 2 = 21; 2 + 1 = 3
- 9 remainder of 717 is 6 because 7 + 1 + 7 = 15; 1 + 5 = 6
- Nine remainder of 9086066102 is 2 since 9 + 0 + 8 + 6 + 0 + 6 + 6 + 1 + 0 + 2 = 38; 3 + 8 = 11; 1 + 1 = 2
Nine trial
The initial calculation gives the following equation, replacing the original numbers with their respective nines:
- -7 + 0x (3-6) = 2
Now you solve this equation:
- -7 + 0x (-3) = 2
- -7 + 0 = 2
- -7 = 2
- –7 + 9 = 2… negative nine residues are converted into positive nine residues by adding 9 (repeatedly if necessary)
- 2 = 2
You can see that the equation leads to a true statement, so the test of nine works. Thus the initial calculation is correct with a probability of . In any case, the test of nine cannot prove that the initial calculation was wrong.
Remnants of penalties
- Elfer residue of 25198 is 8 since 8-9 + 1-5 + 2 = -3; -3 + 11 = 8
- Elfer remainder of 519948 is 0, since 8 - 4 + 9 - 9 + 1 - 5 = 0
- Elfer residue of 18192 is 9 since 2-9 + 1-8 + 1 = -13; -13 + 11 = -2; -2 + 11 = 9
- Elfer residue of 717 is 2 since 7 - 1 + 7 = 13; 3 - 1 = 2
- Elfer residue of 9086066102 is 3 since 2-0 + 1-6 + 6-0 + 6-8 + 0-9 = -8; -8 + 11 = 3
Penalty test
Using the initial calculation, the following equation is obtained, whereby the original numbers are replaced by their respective remainder of the penalty:
- -8 + 0x (9-2) = 3
Now you solve this equation:
- -8 + 0x7 = 3
- -8 + 0 = 3
- -8 = 3
- –8 + 11 = 3… negative penalty residues are converted into positive penalty residues by adding 11 (repeatedly if necessary)
- 3 = 3
You can see that the equation leads to a true statement, so the penalty test works. Thus the initial calculation is correct with a probability of . In any case, the penalty test cannot be used to prove that the initial calculation was incorrect.
Nine and penalty tests
Since in this example both the nine and the eleven test work, the initial calculation from this is correct with a probability of . In any case, neither the nine nor the eleven test can prove that the initial calculation was wrong.
origin
In al-Khwarizmi's “Algorism” (9th century) the test of nine is discussed for the first time for doubling and multiplication, but without using the checksums. The factors or the product are divided by 9 and the remainder is written down. The residues determined in this way correspond to the nine residues of the factors or of the product.
The penalty test was probably first discovered by the Persian mathematician Abu Bakr al-Karaji around the year 1010 and written down in the book al-Kāfī fī l-hisāb (Sufficient information about arithmetic). The process has probably been known in Europe since the 12th century through Arab mediation . Leonardo Fibonacci described it in his work Liber abbaci , the second version of which existed around 1227 at the latest.
Math background and other bases
General
The special importance of the nines and eleven samples in the decimal system results from the fact that the nine remainder can be calculated simply as a cross sum and the eleven remainder as an alternating cross sum.
In a ranking system for the basis , because
- and
the samples with the numbers
- and
particularly easy to carry out.
Error detection probabilities
- The ER- sample performed alone, covered by for errors which an error detection probability corresponds.
- The ER- sample performed alone, covered by for errors which an error detection probability corresponds.
- Leads to both samples successfully, the result is in from the right cases, so what fault detection probability means. ( ... smallest common multiple )
Triple rehearsal
In the case of numbers in the dual system, the triple test, which has been implemented for the TR 440 , makes sense . The regular word length was 48 bits, to which 2 bits were added for the sample of three and 2 bits for the type identifier. The checksum of the triple sample was then obtained from the checksum of the 24 binary digit pairs of 2 bits each modulo 3. This enabled not only memory errors to be recognized, but also errors in arithmetic operations.
Example of hexadecimal system
For example, in the hexadecimal system (base = 16), the checksum results in the 15's remainder (also called " F-remainder ") and the alternating checksum gives the 17-remainder . The 15 and 17 samples then look like this for the sample calculation A1F + C02:
invoice | 15 sample | 17 sample | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Both the 15 and 17 samples go up here. This means that the example addition is correct with an overall probability . In any case, neither the 15 nor the 17 sample can be used to prove that the addition result is wrong.
See also
- Checksum
- Division with remainder
- List of operators for the remainder of a division
- Divisibility
- congruence
literature
- Alireza Djafari Naini: History of number theory in the Orient, in the Middle Ages and at the beginning of the modern era with special emphasis on Persian mathematicians. , Verlag Klose & Co, Braunschweig, 1982.
- Kurt Vogel (Hrsg.): Mohammed ibn Musa Alchwarizmi's Algorismus: The earliest textbook for arithmetic with Indian numerals: Based on the single (Latin) manuscript ( Cambridge Un. Lib. Ms. Ii.6.5.) In facsimile with transcription and commentary, Otto Zeller: Aalen, 1963.
Remarks
- ↑ Naini: History of Number Theory in the Orient , pp. 32–33
- ^ Karl Steinbuch and W. Weber: Taschenbuch der Informatik: Volume II Structure and programming of EDP systems . Springer-Verlag, 2013, p. 73 ( limited preview in Google Book search).