Sunday, December 20, 2009

Casting out Nines

How many times while multiplying two large numbers, we had to check whether the result is right. No. You need not multiply to check for the correctness. You just need to cast out nines. Justread on.

Casting out nines is a sanity check to ensure that hand computations of sums, differences, products, and quotients of integers are correct. By looking at the digital roots of the inputs and outputs, the casting-out-nines method can help one check arithmetic calculations. The method is so simple that most schoolchildren can apply it without understanding its mathematical underpinnings.

After applying an arithmetic operation to two operands and getting a result, you can use this procedure to improve your confidence that the result is correct.

1. Sum the digits of the first operand; any 9s (or sets of digits that add to 9) can be counted as 0.
2. If the resulting sum has two or more digits, sum those digits as in step one; repeat this step until the resulting sum has only one digit.
3. Repeat steps one and two with the second operand. You now have two one-digit numbers, one condensed from the first operand and the other condensed from the second operand. (These one-digit numbers are also the remainders you would end up with if you divided the original operands by 9; mathematically speaking, they're the original operands modulo 9.)
4. Apply the originally specified operation to the two condensed operands, and then apply the summing-of-digits procedure to the result of the operation.
5. Sum the digits of the result you originally obtained for the original calculation.
6. If the result of step 4 does not equal the result of step 5, then the original answer is wrong. If the two results match, then the original answer may be right, though it isn't guaranteed to be.

Example * Say we've calculated that 6338 × 79 equals 500702

1. Sum the digits of 6338: (6 + 3 = 9, so count that as 0) + 3 + 8 = 11
2. Iterate as needed: 1 + 1 = 2
3. Sum the digits of 79: 7 + (9 counted as 0) = 7
4. Perform the original operation on the condensed operands, and sum digits: 2 × 7 = 14; 1 + 4 = 5
5. Sum the digits of 500702: 5 + 0 + 0 + (7 + 0 + 2 = 9, which counts as 0) = 5
6. 5 = 5, so there's a good chance that we were right that 6338 × 79 equals 500702.

You can use the same procedure with multiple operands; just repeat steps 1 and 2 for each operand.


This technique works even for addition, subraction and division.

souce: Wikipedia

When all things return to the One, even gold loses its value. But when the One returns to all things, even the pebbles sparkle - Zen Proverb

No comments:

Post a Comment