What is “Casting Out Nines”? Part 3
Learn the magic behind this amazing mathematical tool.
In the past few articles, we’ve learned all about an amazing technique called “casting out nines” that you can use to check whether or not you’ve made errors in your arithmetic. So far we’ve learned what check digits are, how they’re used with casting out nines to check addition problems, and how casting out nines can be used to check subtraction, multiplication, and division problems, too.
But up until now we’ve sidestepped the question of why this seemingly magical trick works—it’s got to be something complicated, right? Well, as you’ll see today, casting out nines is indeed a great magic trick. But, like all magic tricks, it isn’t actually magic. In this case, it’s some fantastic math. And, just like all good magic tricks, once the trick is revealed, the idea behind casting out nines is simple enough that everybody can understand and appreciate it—which is exactly what we’re going to do today.
Why Does Casting Out Nines Work?
Without a doubt, the most important thing to know about casting out nines is how to use it. So if any of the things I mentioned earlier—stuff like check digits and using casting out nines to check addition, subtraction, multiplication, and division—are unfamiliar to you, I encourage you to go back and take a look at the two earlier articles in this series.
Once you know how to use casting out nines, it’s hard not to be left a little dumbfounded by the fact that it works. It’s weird, right? We just add up all the digits in numbers and compare them and somehow that tells us if the answer can be correct…kind of crazy! Which inevitably leads us wonder: Why does casting out nines work?
Sum of Remainders = Remainder of Sum
To find out, let’s start by thinking about adding two numbers: 10+11.For reasons that will become clear in a minute, let’s now divide both of these numbers by some number—let’s say 9—and find the two remainders. Well, 10÷9 is equal to 1 with a remainder of 1 and 11÷9 is equal to 1 with a remainder of 2. If we add up those two remainders—does anything seem familiar yet?—we get 1+2=3. Okay, now let’s take a look at what we know to be the answer to 10+11…namely 21. If we divide 21 by 9 like we did to the numbers before, we get 21÷9 is equal to 2 remainder 3 (since 2x 9 is equal to 18…which is 3 less than 21). Interestingly, you’ll notice that the remainder here, 3,is the same as the sum of the remainders from before. Again, does anything seem familiar about this?
So what have we found? Well, we’ve discovered that the sum of a group of remainders must equal the remainder of the sum (this is really just the distributive property that we’ve talked about before in action). We’ve seen that this is true when we use 9 as the number we divide by, but it doesn’t actually matter what number we divide by to find our remainders. For example, let’s take the same problem from before—10+11=21—but this time let’s divide by 8. So 10÷8 is equal to 1 remainder 2, 11÷8 is equal to 1 remainder 3, and 21÷8 is equal to 2 remainder 5. Which means that the sum of the remainders of the numbers we’re adding—that is 2+3=5—is equal the remainder of the sum!
Web Bonus Tip: Is This Always True?
If you’re curious and decide to see if this also works when dividing by 7, you’ll find that 10÷7 is equal to 1 remainder 3, 11÷7 is equal to 1 remainder 4, and 21÷7 is equal to 3 remainder 0. So, in this case, the sum of the remainders—3+4=7—is not equal to the remainder of the sum. What happened?! Well, actually, nothing happened and everything still works out just fine…once you know that 7 is the same as 0 when you’re dividing by 7, 8 is the same as 0 when you’re dividing by 8, 9 is the same as 0 when you’re dividing by 9, and so on. The reason is that we aren’t actually doing normal remainder division here, we’re actually doing modular arithmetic and, as you’ll see if you look back at the earlier articles on modular arithmetic, that’s how things work. But for our purposes of understanding how casting out nines works, thinking about things in the simpler terms of normal remainder division works just fine—so we’ll stick to that.
Why Do We Use Nine?
So we’ve now seen that if we divide an addition problem by any number we like, then the sum of the remainders will always equal the remainder of the sum. If we choose to use the number 9 as the number we divide the addition problem by, this interesting little property we’ve discovered is actually what we’ve come to know as casting out nines. But why 9? And why haven’t we been finding remainders when we’ve been doing casting out nines? Because, as it turns out, if you divide any number by 9 you can always find the remainder simply by adding up the digits of the number. In other words, finding the check digit of a number is equivalent to finding its remainder when dividing by 9. Pretty amazing, right? Go ahead and test it for yourself with some numbers and you’ll see that it always works.
So, as you can see, the casting out nines technique of checking that the sum of a group of check digits is equal to the check digit of the sum really is the same thing as checking that the sum of a group of remainders is equal to the remainder of the sum—that’s the magic behind casting out nines!
Number of the Week
Before we finish up for today, it’s time for this week’s featured number, conversion, or tip from my post on QDT’s blog The Quick and Dirty. This week’s tip will help you cast out nines even faster. It’s easiest to see how it works with an example, so let’s say you’re finding the check digit of the number 525,829. One way is to simply add the numbers from left to right: 5+2+5+8+2+9. So that’s 5+2=7, then 7+5=12, then 12+8=20, then 20+2=22, then 22+9=31, and finally we turn this into a check digit by finding that 3+1=4.
This works, but the numbers you’re adding can start to get big. So the trick is to know that you don’t actually have to add all the numbers before finding a check digit—you can find check digits along the way to keep the numbers small, like this: 5+2=7, then 7+5=12 which has a check digit of 3, then we’re back to 3+8=11 which has a check digit of 2, then 2+2=4, and finally 4+9=13 which has a check digit of 4. Of course the answer is the same either way, but the beauty of this second method is that you’re always dealing with adding small numbers—even when finding check digits of huge numbers—so it’s almost always going to be a lot faster.
Wrap Up
Okay, that’s all the math we have time for today. Remember to become a fan of the Math Dude on Facebook where you’ll find a new featured number or math puzzle posted every weekday. And if you’re on Twitter, please follow me there too. Finally, if you have math questions, feel free to send them my way via Facebook, Twitter, or by email at mathdude@quickanddirtytips.com.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!