method of long division based on 10s complement

499 Views Asked by At

There are two ways of performing subtraction using ten's complement, using an algorithm similar to two's complement on most (practically all?) CPUs. Is there a good way to structure a division problem so it's convenient to use this algorithm?

Here's a sample of the first way:

   145
 -  67
-------- complement of minuend
   854
 +  67
-------- addition
   921
-------- complement of result
   078

Here's a sample of the second way, as a bonus it demonstrates what happens when the minuend has fewer digits than the subtrahend and how carries are resolved.

   145
 -  67
--------- complement of subtrahend
   145
 + 932
--------- addition
  1077
--------- "complement" of result (subtract 1000 and add 1).
    78

Despite the vertical space they consume here, these methods are fairly convenient for pencil and paper use, with one glaring exception.

Used as a "subroutine" in long division, the constant need to swap digits with difference-from-9 counterparts is very impractical, as is the fact that the "implicit zeroes" to the right of the current partial quotient need to be complemented and changed into 9s.

      28r8
   _______
31 ) 876      0     #1    start
     62      20     #2    partial quotient
     876            #3    dup #1
     379            #4    complement #2
    1255            #5    add #4, #5
     256            #6    complement #5
     248      8     #7    partial quotient
     256            #8    dup #6
     751            #9    complement of #7
    1007           #10    add #8, #9
       8           #11    complement of #10

Is there a way of doing long division with this method of subtraction that doesn't involve repeating digits so many times?

1

There are 1 best solutions below

0
On BEST ANSWER

The method you are inquiring about is very similar to the one used for pencil and paper division in the ShiFengShou Rapid Calculation (SFSRC) method. This is a complete system of mental arithmetic assembled by Shi Fengshou (in part borrowed from Vedic and Ancient Chinese techniques). Unfortunately, there is little information in English about the method. Search for the book "史豐收速算法" for a full description. It is in Mandarin, but most of the math can be understood without reading the text. If you manage to get a digital copy, try using an OCR translator to make sense of the text.

With that being said, I have already done what I recommended, so I will summarize the most relevant details here in order to answer your question.

Complements and Vinculum Numbers

The method of "all from 9, last from 10" will be used below for taking complements, so here is a brief review. In order to take the complement of a positive real number with respect to the next highest power of 10, take the 9s complement for all digits except the rightmost non-zero digit. Take the 10s complement for that remaining nonzero digit.

Let $\mathbf{C}(x)$ be the "all from 9, last from 10" operation on some $x\in\mathbb{R}\geq0$.

Examples:

$\mathbf{C}(1234567890)=8765432110$ (The 9 is 10s complemented into 1; trailing 0 is unchanged)

$\mathbf{C}(674.32)=325.68$ (The 2 is 10s complemented into 8)

Any real number in base 10 can be represented as the linear combination of the powers of 10. For example,

$674.32=(6\times10^2)+(7\times10^1)+(4\times10^0)+(3\times10^{-1})+(2\times10^{-2})$.

The same number, 674.32, can be represented as

$(7\times10^2)-\mathbf{C}\left((7\times10^1)+(4\times10^0)+(3\times10^{-1})+(2\times10^{-2})\right)=700-25.68$.

For shorthand, it is common in Vedic mathematics to write a vinculum (over-line) above the digits that are subtracted. So, $674.32=700-25.68=7\overline{25.68}$.

Subtraction/Addition

Because subtraction is the goal, consider the negative: $-674.32=\overline{7}25.68$. It is numbers of this form that can replace the subtrahend. To quickly get such a number, simply increment the leftmost digit by 1, put a vinculum over it, and apply $\mathbf{C}(x)$ to the remaining digits.

Example:

$957.17-674.32$ becomes

$ 957.17\\ \underline{\overline{7}25.68}\\ 282.85 $

The problem is now mostly addition. Only the leftmost digit of the subtrahend is subtracted from the leftmost digit of the minuend. The rest of the digits are added. Computing the sum can be done from left-to-right with a mental running-total as follows:

$9-7=2\to[2]5+2=27\to[27]7+5=282\to[282].1+0.6=282.7\to[282.7]7+0.08=282.85$.

Note that the current total (denoted by square brackets) is prepended onto the first digit of the next column.

Saying the above in the mind allows for the running-total to be remembered until the end. The answer is written only at the end of the mental calculation. If the numbers are too large to remember the answer, the intermediate results can be written down as they are calculated. Carries are then indicated as a subscript to the right of the previous column. Thus, the above example's answer would look like $27_{1}2.7_{1}5$. It is only necessary to convert the $7_1$ to an 8 in the final answer. In intermediate results, as with division, you can mentally treat it as an 8 to save space.

It is often aids the solution to a problem to prepend 1 or more zeros to the beginning of a number before converting it to a vinculum number. Whether to prepend zeros or not is up to the discretion of whomever is doing the calculating. With practice, it is not too difficult to tell by eye which variation will provide an easier subtraction/addition.

Example:

$1000-37$ becomes $1000-0037$ becomes $1000+\overline{1}963=963$.

You might have noticed that this example is just briefer way of doing the second subtraction method you mentioned in your question.

Multiplication

Multiplication during division is always 1 or more digits multiplied by a single digit. Learning to multiply a multi-digit number of any size times a single digit left-to-right will increase speed and efficiency when performing trial division. This is because multiplication initially only needs to be carried out with enough digits to confirm the new partial quotient.

After the partial quotient is confirmed, multiply the divisor by the partial quotient one digit at a time left-to-right taking the carry into account. Do the conversion in your head from the product to the vinculum number while you are computing the multiplication. Write down the vinculum number as you go. This saves the need to write the product before taking the complement. However, if the multiplication method you use requires you write down the product, you can do so in a column under the divisor.

So, how can multiplication be done digit-by-digit left-to-right? There are probably several methods that fit this bill. The SFSRC method accomplishes this by dropping the ten's place in the products of the 9x9 times table, so only the unit's place of the product are computed for 1 digit times 1 digit. To the "unit product" is added the carry from the digits to the right of the current digit. This is calculated according to some rules by referencing the digits after the current digit being multiplied. For more details, see the link above or try to find and translate the book I mentioned above. Because the focus of this question is on subtraction and division, I will not go into details here.

Another method to consider is the Trachtenberg method. However, this method calculates right-to-left, which is less ideal. Of course, traditional multiplication can be used, too (especially if done left-to-right).

Division

Let's try your example.

$ \quad\;\;\, 28 \; \text{R}8 \\ 31 \overline{)876} \\ \quad\, \underline{\overline{7}8} \qquad \text{#1: } 87 \div 31\approx2 \to 2\times31=62 \to \overline{7}8 \\ \quad\, 256 \quad\;\; \text{#2: } 8-7=1\to17+8=25\to256 \\ \quad\, \underline{\overline{3}52} \quad\;\; \text{#3: } 256 \div 31\approx8 \to 8\times31=248 \to \overline{3}52 \\ \qquad\, 8 \quad\;\, \text{#4: } 2-3=\overline{1}\to\overline{1}5+5=0\to6+2=8 \\ $

Simpler, no? A combination of a more compact complement notation and some mental arithmetic techniques make this method of division much more usable, in my opinion.