um of the numbers is 6395 + 1259 ------ 7654 --> 7 + 6 + 5 + 4 = 22 --> 2 + 2 = 4 with check digit 4, and the sum of their check digits is 5 + 8 --- 13 --> 1 + 3 = 4 So the check digit of the sum is 4, and the check digit of the sum of the check digits 5 and 8 is also 4. If they didn't agree, we'd know something was wrong. Here's my diagram: 6395 -------> 5 1259 -------> 8 | check | | |add | | | V |add 13 -------> 4 | check | | |equal? yes! | | V check V 7654 ------------------> 4 Similarly, for multiplication, the product of the numbers is 6395 x 1259 ------- 8051305 --> 8 + 0 + 5 + 1 + 3 + 0 + 5 = 22 --> 2 + 2 = 4 and the product of the check digits is 5 x 8 --- 40 --> 4 + 0 = 4 which agrees with our product: 6395 -------> 5 1259 -------> 8 | check | | |mult | | | V |mult 40 -------> 4 | check | | |equal? yes! | | V check V 8051305 ----------------> 4 (You wouldn't normally get the same check digit for the result of the sum and the products; I just picked a weird example.) You can also apply the process to subtraction and division, but because of some special cases you have to deal with, it's easier to transform the problem to an addition or multiplication. For example, to check the subtraction: 7654 - 6395 ------ 1259 you would transform it to the addition I did above. To check this division: _____6395_rem 342 1259 ) 8051647 you would transform it to the multiplication I did above, by adding the check digit of the remainder to the product of the check digits of the quotient and the divisor, and checking whether this is equal to the dividend: 6395 --> 5 x 1259 --> x 8 ------- --- 8051305 40 --> 4 + 342 ----------> + 9 ------- --- 8051647 ---> 4 <--- 13 In other words, you apply casting out nines not to the subtraction or division itself, but to the standard check, in which you reverse the problem by adding the subtrahend to the difference or multiplying the quotient by the divisor. If the check digits don't come out right, you must have made a mistake in your arithmetic (either in the problem you're checking, or in calculating the check digit); but if the check digits agree, your work could still be wrong, such as if you switched two digits when you were copying. In fact, I use a variant of this method when I balance my checkbook. If I get the wrong balance, I know my calculator didn't add wrong, but I may have entered something wrong. If the check digit for my balance is the same as what the bank says, I can guess that I reversed two digits somewhere; if they are different, it's more likely that I dropped a digit, or perhaps a whole transaction. If you want to know what this has to do with nines, or why it works, check out the other answers I referred to above. The basic idea is that the check digit is essentially the remainder after you divide by 9. (A slightly more advanced way of working with these check digits is to treat a result of 9 as a zero, so that check digits are always between 0 and 8 rather than 1 and 9, making it a genuine remainder.) You may notice that when you add the digits of 6395, if you just ignore the 9, and the 6+3 = 9, you still end up with 5 as your check digit. This is because any 9's make no difference in the result. That's why the process is called "casting out" nines. Also, at any step in the process, you can add digits, not just at the end: to do 8051647, I can say 8 + 5 = 13, which gives 4; plus 1 is 5, plus 6 is 11, which gives 2, plus 4 is 6, plus 7 is 13 which gives 4. I never have to work with numbers bigger than 18. I hope this clarifies what you're doing. It takes a lot of words to explain, but it's really easy to do. Keep at it and you'll get the idea. If you want a simpler explanation of WHY the method works than we have in our archives, write back and I can send that to you too. - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/
Date: 03/23/2003 at 13:28:21 From: Sarah Dodge Subject: Casting out nines Dear Dr. Math, I don't understand casting out nines. Can you help me? Here is an example 3942 - 1581 ------- I know that it equals 2361 I think that you would add the