

Math ~ You're doing it wrong - catcalls
http://litaos.com/litaos_wordpress/?p=223

======
ColinWright
OK, so it's incredibly badly written, poorly expressed, and not using the
usual conventions, but it's using the "casting out nines" method of checking
arithmetic.

That's equivalent to checking your sums modulo 9.

Let's work through the second example in a more conventional manner.

The sum in question is this:

    
    
        12 * 13 = 156.
    

We want to do a quick check. We can do that by doing all the sums modulo 9. A
neat trick is that a number mod 9 is unchanged by adding up the digits (and
equating 0 with 9).

Therefore 12 (mod 9) is also equal to (1+2) (mod 9) and 1+2 is simply3. You
can check, 12 mod 9 really is three.

Likewise 13 (mod 9) is (1+3) (mod 9) which is 4. And when you divide 13 by 9
you do indeed get a remainder of 4.

You should also check this with bigger numbers. What's 34857345 (mod 9) ?? Add
up the digits. lather, rinse, repeat, see what you get. Then compute 34857345
% 9.

Back to the sum. 12 * 13 (mod 9) reduces to (3 * 4) (mod 9) which is 12 (mod
9) which is (1+2) which is 3.

That's the LHS. What about the RHS?

156 (mod 9) is 1+5+6 (mod 9) which is 12 (mod 9) which is 3, the same as the
LHS. So this passes our "Modulo 9" test.

This is like a parity check, but more powerful.

Just wish the website said it better.

------
catcalls
Hey, it's just a bit of fun.

