Casting out Nines
Last Up date:
2005 November 12
Recent changes:
Mention of "Casting out Elevens" and link to a table, with answers.
Casting out Nines is an old technique used to check for arithmetic
errors. By and large since machines do most arithmetic today, it has all
but been forgotten. I think it has enough use and novelty appeal to be
worth the effort to learn.
(This web page started on 2004
September 30.)
Casting out Nines is basically just finding the remainder of a number
when divided by nine, and using it as a "check digit". Because nine is
just one less than ten, the base of the decimal number system, there are
many short cuts to finding that remainder; which will be a single digit
zero through 8. I will list some of these "short cuts" as "Rules":
- Simply, add the digits together. If you get a number 10 or greater add
those digits together and continue.
- You can replace the digit nine, or any combination of digits that
add to nine, with zero (effectively ignoring 9's). This is probably
the reason for the name "Casting out nines".
- You can subtract one instead of adding eight, also you can subtract 2
instead of adding seven.
- If you keep all the digits you can in general ignore decimal points.
|
Now, before I show you how to use the "check digits" we need some
practice in calculating the check digits.
The following is the first 100 decimal places of the mathematical
constant "e", blocked in groups of four digits. We will use these for
"typical" numbers to practice casting out 9's. I suggest you to copy
these to a work sheet. If you want to work on the CRT you could cut
and and paste them into something like: Notepad; and work there.
| Numbers | Check |
2.7182
8182
8459
0452
3536
0287
4713
5266
2497
7572
4709
3699
9595
7496
6967
6277
| |
I will explain my thought process for calculating the check digits for
the first three lines above:
- 1st line: 2 + 7 add to nine so I ignore them, likewise for 1 + 8 thus the
check digit for the first line is 2. If you have printed or copied
these numbers, write the check digit to the right
of the number.
- 2nd line: again I ignore the first two digits, the last two add to 10 so
I add the 1 and 0 getting 1 for the check digit for the 2nd line.
- 3rd line: I immediately see the 4 + 5 in the middle and the 9 at the end
and ignore them leaving the check digit as 8.
Now you need the practice. Calculate the check digits for the remaining
lines.
Checking arithmetic by Casting Out 9's
Use the check digits. You have calculated for each number.
- For the arithmetic operations of addition, subtraction and
multiplications. Do the same operations on the check digits. (If that
results in a check value greater than eight apply the above rules to
reduce it to a value less than 9.) If the result is 9 replace it with
zero, in the world of Casting out 9's, nine is equivalent to zero;
and visa versa.
- If you add the first two lines, then add the check digits: The
correct answer is 3.5364 and the sum of the check digits is 3. I
calculate the check digit for the sum by seeing the 3 + 6 and the 5 + 4
thus I can ignore all four so the check digit is 3; which agrees!
If it don't, you have made an arithmetic error somewhere!
- Multiply the first two lines, and multiply the check digits getting 2.
The check digit for the product better be 2.
Practice by adding several of the numbers and their check digits.
Also try subtraction and multiplication doing the same operation with
the check digits. With a bit of
practice you will find the mental effort in calculating check digits and
using them is almost trivial.
Fortunately, Casting Out 9's will never tell you there
is an error when no error exists!
Casting out 9's works for Addition, Subtraction,
and Multiplication but not Division.
To check division you do it the same as you were taught in
school: You multiply the divisor by the result and add the remainder.
Simply do that with the check digits.
Checking arithmetic by Casting Out 9's ain't perfect!
It will not catch all arithmetic errors.
Obviously, any single digit error in the answer will produce a check
digit that does not agree. But a simple transposition of digits in the
answer will not be caught; multiple digit errors will be caught 90% of
the time. So checking by "casting out nines" is not perfect, but it is
so easy you will probably want to use it for hand done arithmetic. Also
with non-printing calculators a 90% check for keyboard entry errors is
better than no check at all.
I should point out there are better arithmetic checks based on
Congruence Arithmetic, but they are a bit more involved. One is "Casting
Out Elevens" which involves: Starting on the right and alternately
adding then subtracting digits, and if you don't like negative values at
any time you can add eleven to the check digit. Casting out Elevens
will detect simple transposition of digits.
Finally, for those who want much more practice I have a
table
much larger than the one above, with the check values for both (mod 9) and
(mod 11).
Contact me at:
For comments call, or
e-mail me.
Go to
My Home Page
or
TOP
of this page.