Real World Arithmetic On The Abacus, Part II: Subtraction, Multiplication
Continuing with the abacus theme yesterday, we move on to subtraction and multiplication today.
Subtraction
Subtraction on the abacus is the mechanical reversal of addition, as can be seen through the subtraction rhymes:
one down one
one up four off five
one borrow one leave nine
two down two
two up three off five
two borrow one leave eight
three down three
three up two off five
three borrow one leave seven
four down four
four up one off five
four borrow one leave six
five off five
five borrow one leave five
six off six
six borrow one leave four
six borrow one down five off one
seven off seven
seven borrow one leave three
seven borrow one down five off two
eight off eight
eight borrow one leave two
eight borrow one down five off three
nine off nine
nine borrow one leave one
nine borrow one down five off four
Addition and subtraction on the abacus are fix point operations. You usually put the first operand on the right most positions of the abacus and the second operand on the left most positions. And you carry out the operation on the right hand side of the abacus. Most people perform the addition or subtraction one digit at the time starting from the most significant digit. You can start from the least significant digit like you are forced to do if you perform the operations in pencil and paper, but that feels unnatural. Here's what it looks like if you do 12345+67890=80235 on the abacus:
12345 67890 12345 77890 12345 79890 12345 80190 12345 80230 12345 80235
When the combined number of digits of the operands is greater than 13, you are forced to keep one of the operands in your mind. One particularly fun exercise is 123456789+876543211=1000000000. Before the last 1 is added, the abacus would show the intermediate result of 999999999. Adding the final one will cause the "one off nine carry one" line to be invoked nine times.
Multiplication
Multiplication on the abacus is more like multiplication on pencil and paper. The multiplication rhymes is just the familiar multiplication table:
one times one is one
etc.
Multiplication and division use floating points. The unit digit will shift positions after the calculation. For multiplication, the unit position shifts to the right by the number of digits of the second operand. One usually put the second operand flush left on the abacus, and the first operand in the middle of the abacus leaving exactly the same number of empty spaces to the right of it as there are digits in the second operand. By the end of the calculation, the result would appear flush right.
You start your multiplication with the least significant digit of the first operand, which is the first digit to the left of the empty spaces on the right side of the abacus. You multiply this digit into the second operand, which is on the left side of the abacus, least significant digit first, and put the result into the empty spaces. When this is done, the digit is erased (there may be an overflow of the result into the space formerly occupied by the digit, but that is OK.) Then you use the second least significant digit of the first operand to do the multiplication, the result is superimposed onto the existing result. Here's an illustration of 123*456=56088:
456 123 | 456 123 18| 456 123168| 456 121368| 456 121488| 456 122488| 456 110488| 456 111088| 456 116088| 456 56088|
Fun exercises include 123456789 * n, where n = 1, 2, 3, 4, 5, 6, 7, 8, 9. This sequence exercises all the entries in the multiplication table. And the results exhibit interesting patterns. This sequence is called the Small Nine of Nines, referring to the multiplication table as nine of nines (nine rows of nine columns.)
A more ambitious sequence is the Big Nine of Nines:
9765625 * 1024 = 10000000000
9765625 * 2048 = 20000000000
9765625 * 3072 = 30000000000
9765625 * 4096 = 40000000000
9765625 * 5120 = 50000000000
9765625 * 6144 = 60000000000
9765625 * 7168 = 70000000000
9765625 * 8192 = 80000000000
9765625 * 9216 = 90000000000
This set of exercises have the property that the result looks very clean. And you can discover any mistakes half way through the calculation—if the result fails to carry to the left. (BTW, this is also the origin of the $10.24, $20.48, ... stock prices that I like to use in my unit tests and functional tests.)
The multiplications 55555 * 975 = 54166125 and 55555 * 957 = 53166135 are called the candle holder exercises because the results look like candle holders on the abacus.
The beauty of abacus arithmetic is the fact that the intrinsic organization of the abacus works as a framework for solving complicated arithmetic problems. At any moment, it farms out a smaller calculation—one that can be solved by invoking one line in the abacus rhymes—to the brain. It also serves as an accumulator of the intermediate results.
Real World Arithmetic On The Abacus, Part I: Addition
Mark C. Chu-Carroll at the Good Math, Bad Math blog is writing a series entries on manual computing devices. He's done with the slide rules and on to the abacus.
As someone who grew up with the abacus, I think I can add some real world feel to Mark's rather dry and algorithmic depiction of abacus arithmetic.
I learned the abacus before I started elementary school, when I was about six or seven. The illiterate nanny of the family in the downstairs apartment taught me the abacus. (You should see the books she kept for the household purchases—it's all pictures and numbers. A milk bottle represents milk, a pig's face is pork, a babies head is a haircut for a child.)
Any way, working the abacus is like playing a music instrument. A normal abacus has thirteen vertical rods, each representing a digit. Each rod is divided into upper and lower decks by a beam. The upper deck houses two beads that can be moved towards or away from the beam. Tow lower deck houses five.
The abacus is a hybrid binary-quintary with per bit carry device that simulates a decimal system. It is normally used as a big-endian device—the left most rod is most significant. For each individual rod, the lower five beads form a quintary digit with carry. It can represent 0 (no beads up to the beam), 1 (one bead to the beam), 2 (two beads), 3 (three beads), and 4 (four beads). The last bead in the lower deck is the carry bit. When it is up (five beads up) all beads should be pushed down (off) and a bead in the upper deck should be pushed down to the beam. The upper two beads form a binary bit with carry. It can represent 0 (no beads down to the beam) and 5 (one bead down to the beam). The other bead in the upper deck is again the carry bit. When it is down (two beads down to the beam), both beads should be pushed up (off) and a bead in the lower deck of the rod to the left of the current rod should be pushed to the beam.
Thus the greatest number that can be represented on each rod without the help of the carry beads is 9, forming a simulated decimal system. However, in a pinch, the carry beads can be used to represent numbers up to 15.
The right hand is used to play the abacus. The thumb and the index finger are used to control the lower beads. The middle finger is used to control the upper beads.
The actual arithmetic operations are carried out by following a set of rhymes that's easy to remember.
Addition
The rhymes for addition is intuitive:
one up one
one down five off four
one off nine carry one
two up two
two down five off three
two off eight carry one
three up three
three down five off two
three off seven carry one
four up four
four down five off one
four off six carry one
five up five
five off five carry one
six up six
six off four carry one
six up one off five carry one
seven up seven
seven off three carry one
seven up two off five carry one
eight up eight
eight off two carry one
eight up three off five carry one
nine up nine
nine off one carry one
nine up one off five carry one
The first number of each line is the addend. The rest of each line is the action to be carried out. Only one line from each group is applied. Which one is selected depends on the addend already present on the rod.
The "n up n" line is used when the addition results in no carry (e.g., 2+2=4, 2+7=9).
The "n down five off (5-n)" line is used when the addition results in the carry bit in the lower deck (e.g, 4+4=8: with four beads up in the lower deck, to add another four, you push down a five in the upper deck and push off one in the lower deck, resulting in five+three, i.e. eight.)
The "n off (10-n) carry one" line is used when the addition results in the carry bit in the lower deck, which when resolved results in the carry bit in the upper deck (e.g, 7+4=11, 9+4=13.)
The "n up (n-5) off five carry one" line is used when the addition results in the carry bit in the upper deck (e.g., 6+7=13: with one bead up in the lower deck and one bead down in the upper deck, to add another seven, you push up two in the lower deck, push off the upper bead and push up a lower deck bead on the rod to the left.)
It takes about fifteen minutes for a six year old to remember the addition rhymes. And with practice, addition of multiple digit numbers is really child's play. Addition can be carried out either from left to right or from right to left.