0% found this document useful (0 votes)
64 views3 pages

Why Casting Out Elevens Works

Why Casting Out Nines Works

Uploaded by

rickescher
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views3 pages

Why Casting Out Elevens Works

Why Casting Out Nines Works

Uploaded by

rickescher
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Casting Out Nines: Why it Works

If you don't know the methods of casting out nines and casting out elevens, have a look at my page about speed arithmetic. At first glance, these two methods can feel like
magic. The reasons they work are fairly simple, and this page aims to present the mechanics behind the magic.

The Method: Reminder


The method of casting out nines is mainly used to check the results of multiplications, additions and subtractions. Before we look at why it works, let's have a reminder about
how it works. Later, we'll look at the method of casting out elevens.

• Addition. Let's say you want to check whether 44 + 116 is 150. You add the digits of the first number: 4+4 = 8. You add the digits of the second number: 1+1+6 = 8. You
add these two numbers: 8+8 = 16. You also add the digits of that number so you are left with a single number: 1+6=7. Now you do the same with the result, 150. You get
1+5+0 = 6. Now you compare the two numbers. They are not equal (7 and 6), so there is a mistake in the initial operation. Indeed, 44 + 116 = 160.

• Multiplication. With the same two numbers, let's say you want to check whether 44 x 116 = 5064. Again, on the left, you get 4+4=8, and 1+1+6=8. You multiply these
numbers: 8x8=64, you add the digits until they reduce to one number: 6+4=10, 1+0=1. Now let's compare that result with your number on the right side: 5+0+6+4 is 15,
which reduces to 1+5=6. Your results are not equal (1 and 6), so there is a mistake in the initial operation. Indeed, 44 x 116 = 5104.

• Subtraction. Now let's look at 116 - 44 = 72. Is that correct? On the left, after you sum the digits, you can compute 8 - 8 = 0. On the right, you have 7+2 = 9. You "cast out
the nine", so you are also left with zero. Both sides are equal, so this test did not detect an error. This does not mean that the operation is correct, but it gives you a higher
degree of confidence in your result. When casting out nines with subtraction, if you get a negative number, add nine.

• Division. Let's look at 116 / 44. Suppoose you get 2, with a remainder of 29. Is that correct? To apply the method, let's write our result as 116 = 44 x 2 + 29. Now let's cast
out the nines on both sides and see if the left and right agree. We want to find (1+1+6) ⇔ (4+4)x2 + (2+9), i.e. 8 ⇔ 16 +11, i.e. 8 ⇔ 27, i.e. 8 ⇔ 9. The two sides disagree:
the method detects an error. And indeed, the remainder of the division should have been 28.

A Definition: Modulos
To speed up the explanation, I would like to define the word modulo in case you have not come across it before. The word "Modulo" gives you a short way of saying "the
remainder of dividing X by Y". For instance, 15 modulo 7 is 1, because 1 is the remainder of dividing 15 by 7 (15 = 7x2 + 1).

Modulo is often abbreviated to "mod": 12 mod 9 is 3, because 12 = 9x1 + 3. The method of "casting out nines" has to do with modulo 9s, i.e., with the remainder of dividing
numbers by 9. The reason the method is popular is that computing mod 9s is as easy as scratching your nose. For instance, you can tell instantly that 44 mod 9 is 8. How did I
know? You just add the digits of the number whose mod 9 you are taking: 4+4=8. And indeed 44 is 9 times 4 plus a remainder of 8. We'll get back to why this funny property
works in a moment.

Modulos of Sums
The "casting out nines" method relies on the fact that the modulo of a sum is the modulo of the sum of the modulos. That's a mouthful. What does it mean?

To illustrate, let's take modulo 9s. Take two numbers A and B. Regardless what number they are, they can be expressed as A = 9xa + M, and B = 9xb + m, where M and m
are A and B's modulo 9s, i.e., the remainder of dividing them by 9. What is (A+B) mod 9? It is (9x(a+b) + M + m) mod 9. Right away, you can discard the left term, 9x(a+b),
because it is divisible by 9, so plays no part in the remainder of dividing (A+B) by 9. We are left with (M+m) mod 9. So, the modulo of the sum A+B is the modulo of the
sum of M (which is A mod 9) and m (which is B mod 9). In other words, the modulo of a sum is the modulo of the sum of the modulos (QED).

We will be using that property a lot.

Modulos of Products
For multiplication, the "casting out nines" method relies on the fact that the modulo of a product is the modulo of the product of the modulos. Let's look at that.

Again, let's take modulo 9s, and our numbers A and B. Again, regardless of the value of A and B, they can be expressed as A = 9xa + M, and B = 9xb + m, where M and m
are the remainders of dividing A and B by 9, i.e. A mod 9 and B mod 9. What is (AxB) mod 9? It is ( 9x(9ab+am+bM) + mxM) mod 9. Right away, you can discard the left
term, 9x(9ab+am+bM), because it is divisible by 9, so plays no part in the remainder of dividing (AxB) by 9. We are left with (Mxm) mod 9. So, the modulo of the product
AxB is the modulo of the product of M (which is A mod 9) and m (which is B mod 9). In other words, the modulo of a product is the modulo of the product of the modulos
(QED).

Modulo-9s of Powers of Ten (10, 100, 1000…)


First, let's note that:
• 10 can be written as 9+1, which is 9x1 + 1.
• 100 can be written as 99+1, which is 9x11 + 1.
• 1000 can be written as 999+1, which is 9x111 + 1.
• and so on.

In other words, these powers of ten can all be written as "nine times something, plus one". So the remainder of dividing any of these powers of ten by 9 is 1. In other words,
any power of ten, modulo 9, is one. (This also works for 1, which is ten to the power zero, as 1 mod 9 is 1).

Okay, now let's look at a number times a power of ten. For instance, 500, which is 5x100. What is 500 mod 9? According to what we found earlier about the modulo of
products, it is ((5 mod 9) x (100 mod 9)) mod 9. We know that 100 mod 9 is 1, and 5 mod 9 is 5, so 500 mod 9 is (5x1) mod 9, which is 5 mod 9, which is 5. Another way to
see this is that 500 is 5x100 = 5x(9x11+1) = 9x(5x11) + 5. When you take the mod 9, the first term disappears because it is a multiple of 9, and you are left with 5.
So 500 mod 9 is 5. With the exact same reasoning, you can show that 400 mod 9 = 4, that 200 mod 9 = 2, and so on.
And by the same process, you can show that it's true for thousands as well: for instance, 5000 mod 9 is 5, 7000 mod 9 is 7, and so on. Again, that's because 7000 mod 9 = ((7
mod 9)x(1000 mod 9)) mod 9, which is (7x1) mod 9, which is 7.

This result generalizes to (a x 10^b) mod 9 = (a mod 9), where a and b are a positive integer. And when a is between 0 and 9, a mod 9 is a, except for 9, as 9 mod 9 is zero.

The Mod 9 of Any Integer


Now let's take an integer such as 7438.
We can write 7438 = 7000 + 400 + 30 + 8. What's 7438 mod 9? According to what we found earlier, it's the mod 9 of the sum of the mod 9s.
We just saw that 7000 mod 9 = 7, 400 mod 9 = 4, and so on.
So 7438 mod 9 = (7+4+3+8) mod 9. At last, this is the magic addition of the casting-out-nines method!
This reduces to 7438 mod 9 = 22 mod 9.
And what's 22 mod 9? Again, we can write 22 as 20 + 2. So we have the mod 9 of the sums of (20 mod 9) and 2 mod 9, which, again, is 2 + 2.

This shows that to calculate 7438 mod 9, you can just keep adding the digits. If you generalize what we just did, you see that it's the same for any number… except that our
number did not have any nines in it. We said that we're adding the mod 9s, which are the digits themselves. That's true for all numbers except 9, as 9 mod 9 = 0. If we had to
add a number that had 9s, such as 7938, with the method we followed, we would add 7+0+3+8, which is not the same as exactly adding the digits: 7+9+3+8. As it turns out,
you can add the 9 instead of a zero, because the next time you take the mod 9, that 9 will disappear, as it is a multiple of 9.

In conclusion, to find the mod 9 of any integer, just keep adding the digits. And if you ever run across a nine, either keep it or disregard it, as if it were a zero.

Final Step: The Method


So now we've shown that to get the mod 9 of any number, you keep adding the digits.
So let's go back to our initial problem of checking the results of some operations. For that, let's take two numbers, 5471 and 86. First, let's compute the mod 9s: 5471 mod 9 =
8 (short-cut: you can ignore the 5 and the 4 as they sum to 9), and 86 mod 9 = 5.

• Addition. Does 5471 + 86 = 5567? Remember what we found: the modulo of a sum is the modulo of the sum of the modulos. Let's sum the modulos: 8 + 5 = 13. Now let's
take 13 mod 9: that's 1 + 3 = 4. Now let's look at the mod 9 of the result: 5567 mod 9 = (5+5+6+7) mod 9 = 23 mod 9 = 2 + 3 = 5. The numbers (4 and 5) are not equal: the
result is incorrect. Indeed, 5471 + 86 = 5557. We've come full-circle and shown why the casting-out-nines method works when adding.

• Addition. Does 5471 x 86 = 470,706? Remember what we found: the modulo of a product is the modulo of the product of the modulos. Let's multiply the modulos: 8 x 5 =
40. Now let's take 40 mod 9: that's 4. Now let's look at the mod 9 of the result: 470,706 mod 9 = (4+7+7+6) mod 9 = 24 mod 9 = 2 + 4 = 6. The numbers (4 and 6) are not
equal: the result is incorrect. Indeed, 5471 x 86 = 470,506. We've come full-circle and shown why the casting-out-nines method works when multiplying.

Casting Out Elevens


The technique of casting out elevens hinges on the exact same principles we found earlier:
• the modulo of a sum is the modulo of the sum of the modulos, and
• the modulo of a product is the modulo of the product of the modulos.

So here too we take modulos on the left and the right, except that instead of calculating, say, 53 mod 9, we calculate 53 mod 11, that is, the remainder of dividing the number
by 11. In this case, 53 mod 11 = 9, because 53 = 11x4 + 9.

The only difference between the two methods lies in the "trick" or "shortcut" to compute the modulos. For modulo 9s, we added the digits. For modulo 11s, the trick is to
alternately add and subtract digits, starting from the right. For instance, to compute 53 mod 11, you do 3 - 5, which is -2. When a number is negative, you add 11, so that
yields 53 mod 11 = (-2+11) = 9, which is correct.

Likewise, to compute 78542 mod 11, you calculate +2-4+5-8+7 (starting on the right, and alternately adding and subtracting), which yields 2. And indeed, 78,542 =
11x7,140 plus 2.

Why Does Casting Out 11s Work?


The question, at this stage, is actually not "why casting out elevens works", since the answer is the same as for nines, i.e., the modulo of the sum (or product) is the modulo
of the sum (or product) of the modulos.

The question is why this alternating pattern of adding and subtracting produces a number's mod 11.

Let's say you can write your number as abcde, where a, b, c, d and e are digits. For instance, in 98546, a=9, b=5, c=5, d=4, e=6. Your number is the sum of five numbers: a x
10,000 + b x 1000 + c x 100 + d x 10 + e. Let's look at the mod 11 of these five numbers.

— Last number (e). You immediately see that e mod 11 = e (for instance, 6 mod 11 = 6).
— Second to last number (d x 10). We can write 10 = 11 - 1, so our number is 11 d - d. Let's take the mod 11 of that number: (dx10) mod 11 = (11d -d) mod 11. The product
of 11 disappears, the result is -d.
— Next number on the left (cx100). We can write 100 = 11x9 + 1, so our number is 11x9xc + c. Let's take the mod 11 of that number: (cx100) mod 11 = (11x9xc +c) mod 11.
The product of 11 disappears, the result is c.
— Next number on the left (bx1,000). We can write 1,000 = 11x91 - 1, so our number is 11x91xb - b. Let's take the mod 11 of that number: (bx1,000) mod 11 = (11x91xb -
b) mod 11. The product of 11 disappears, the result is -b.
— Next number on the left (ax10,000). We can write 10,000 = 11x909 + 1, so our number is 11x909xa + a. Let's take the mod 11 of that number: (ax10,000) mod 11 =
(11x909xa + a) mod 11. The product of 11 disappears, the result is a.

Okay, we've calculated the mod 11s of ax10,000, bx1,000, cx100, dx10 and e, which sum to our number. What's the sum of these mods? It is +e-d+c-b+a. Here is the magic
of alternately adding and subtracting when casting out elevens. The mod 11 of our number is (+e-d+c-b+a) mod 11. That's exactly what we were looking for.
For longer digits, the pattern continues:
• Ax100,000 = 11x9,091xA -A, so Ax100,000 mod 11 = (11x9,091xA -A) mod11 = -A
• Ax1,000,000 = 11x90,909xA +A, so Ax1,000,000 mod 11 = (11x90,909xA +A) mod11 = +A
• Ax10,000,000 = 11x909,091xA -A, so Ax10,000,000 mod 11 = (11x909,091xA -A) mod11 = -A
• Ax100,000,000 = 11x9,090,909xA +A, so Ax100,000,000 mod 11 = (11x9,090,909xA +A) mod11 = +A
• and so on.

From here, if you haven't already done so, I highly recommend you visit my beautiful page about speed arithmetic.

Smiles,

Andy

Leave a Comment
1-2 of 2 Threads
Joe – Reynoldsburg
February 16, 2020 - 15:12
Subject: Casting out nines & elevens

Your explanation was beautiful: clear & easy to understand for a non mathematician
Betty Eldridge – Renton, Wa
December 15, 2015 - 18:57
Subject: casting out 9's and 11's

Thanks for the explanation, I am not a mathmetician. But I am so glad I have the Internet and people who are willing to share what they know.

© Copyright asiteaboutnothing.net

You might also like