Algorithm for multiplying numbers

1.2k Views Asked by At

Background

Today I had to explain to some kid how to multiply numbers with multiple digits in them. Then I recalled, that some other day I answered this question describing one of the numerous so-called vedic math methods.

Essentially, the method sets up a scheme for multiplying digits by drawing crossing lines so that for instance $2\cdot 3$ would be represented by two lines crossing three lines and then you count the number of intersections. Naturally there would be $2\cdot 3=6$ points of intersection - no magic in that!

But there I indicated, that maybe that algorithm was not so relevant for multiplying large numbers or numbers with larger digits in them, since for instance counting the $56$ points of intersection for $7$ and $8$ lines respectively one-by-one would seem a tedious task. Then rather learn or recreate a table of multiples of $8$ and apply that.

Then I reckoned, that maybe skipping the line-drawing thing and rotating the scheme a bit would render the method a nice way of structuring the steps of a multiplication:

Method

Take as an example $517\cdot 238$. Then the method can be carried out via the following table: $$ \newcommand{\blue}{\color{blue}} \newcommand{\grey}{\color{grey}} \newcommand{\red}{\color{red}} \newcommand{\green}{\color{green}} \begin{array}{c|c:c:c|c} \cdot&\bf2&\bf3&\bf8&\\ \hline \bf7&\red{14}&\blue{21}&56&\\ \hdashline \bf1&\green{2}&\red{3}&\blue{8}&\grey{56}\\ \hdashline \bf5&10&\green{15}&\red{40}&\grey{29}\\ \hline &&\grey{10}&\grey{17}&\grey{57} \end{array} $$

where the gray numbers are diagonal sums so that numbers of the same color are summed. Then we can fill in an appropriate number of zeros to each sum and then add them together

      111                    111
    --------               --------
     100000                 10
      17000    or even       17
       5700    skipping       57
        290    zeros for       29
         56    simplicity       56
    --------               --------
     123046                 123046

which then yields the correct result $517\cdot 238=123046$.

Binary version

In binary we have 517 as $1000000101$ and 238 as $11101110$ so $238\cdot 517$ becomes $$ \begin{array}{c|c:c:c:c:c:c:c:c:c:c|c} \cdot&\bf1&\bf0&\bf0&\bf0&\bf0&\bf0&\bf0&\bf1&\bf0&\bf1&\\ \hline \bf0&\red0&0&\green0&\blue0&\red0&0&\green0&\blue0&\red0&0&\\ \hdashline \bf1&\blue1&\red0&0&\green0&\blue0&\red0&0&\green1&\blue0&\red1&\grey{0}\\ \hdashline \bf1&\green1&\blue0&\red0&0&\green0&\blue0&\red0&1&\green0&\blue1&\grey{1}\\ \hdashline \bf1&1&\green0&\blue0&\red0&0&\green0&\blue0&\red1&0&\green1&\grey{1}\\ \hline \bf0&\red0&0&\green0&\blue0&\red0&0&\green0&\blue0&\red0&0&\grey{10}\\ \hdashline \bf1&\blue1&\red0&0&\green0&\blue0&\red0&0&\green1&\blue0&\red1&\grey{1}\\ \hdashline \bf1&\green1&\blue0&\red0&0&\green0&\blue0&\red0&1&\green0&\blue1&\grey{10}\\ \hdashline \bf1&1&\green0&\blue0&\red0&0&\green0&\blue0&\red1&0&\green1&\grey{1}\\ \hline &&\grey{1}&\grey{1}&\grey{1}&\grey{0}&\grey{1}&\grey{1}&\grey{1}&\grey{1}&\grey{1}&\grey{10} \end{array} $$ and therefore we can add them like this:

                  11111 1 1
            -----------------------
               1  .   . . .
                1 .   . . .
                 1.   . . .
                  0   . . .
                  .1  . . .
                  . 1 . . .
                  .  1. . .
                  .   1 . .
                  .    1. .
                  .    10 .
                  .      1.
                  .      10
                  .        1
                  .        10
                  .          1
                  .           1
                  .            0
            -----------------------
               11110000010100110

to get the result of the multiplication. You can check that 123046 has binary representation $11110000010100110$. So it worked out well!

Questions

  1. What are possible advantages or disadvantages of this method?
  2. What are the best methods you know of for the task of multiplication, and what make them particularly good/practical?

NB: This question received a close vote. I tried to clarify what I am asking in order to prevent the question from being closed. I ask for qualified arguments, not just opinions. Answerers must back up their claims by arguing why specific method are practical or impractical.

3

There are 3 best solutions below

2
On BEST ANSWER

I've seen and use a similar notation:

   5  1  7
 +--+--+--+
 |1/| /|1/|
1|/0|/2|/4|2
 +--+--+--+
 |1/| /|2/|
2|/5|/3|/1|3
 +--+--+--+
 |4/| /|5/|
3|/0|/8|/6|8
 +--+--+--+
   0  4  6

This improves on the design in two ways:

  • You are only adding single-digit numbers down the diagonals. It's easy enough to just add everything (complete with carries) right there in place.
  • You read/write numbers left to right and top to bottom, which, in my opinion, is more natural (at least for an English speaker)
8
On

May I ask what the purpose of a method like this is? I looked at the original post including the video and I have looked over your question, but I can't figure out why one would use this. It is clever and I can appreciate what goes on to make it work, but I can't figure out of what use it may be.

By the way, I apologize for having to ask this as an answer, but I don't have enough reputation to comment yet.

0
On

Thanks again to Patrick A. for so generously sharing his thoughts on this! Here are some thoughts I have:

Regarding this "new" method

Disadvantages of the method

  1. It takes up a lot of space on a sheet of paper
  2. It can be hard to keep track when adding diagonally. When doing it with pencil and paper I draw a frame around every second diagonal to keep track of it
  3. While adding diagonally you will have to keep track of the running sum mentally - unless maybe you want to use even more space on your paper and do a separate calculation for each diagonal
  4. When adding at the end the uppermost numbers seem to hover

Advantages of the method

I just did $3527\cdot412357$ and it worked really well. In that I found a few major advantages of the method:

  1. Each step is so extremely simple that I hardly felt that I was making any effort to get there. My brain was merely idle while doing it
  2. If you get the diagonals right, the risk of making an error is relatively small
  3. Errors can be fixed with almost surgical precision since the steps are so explicit

Possible improvements

Maybe one could stack the partial sums in a more convenient manner. The partial sums for the $517\cdot 238$ example were 10, 17, 57, 29, 56 and could have been added as follows:

                111
              --------
                07796
               11525
              --------
               123046

to save space and avoid the hovering.

Regarding traditional long multiplication

Disadvantages of the method

  1. It can be complicated to spot and correct an error since when you multiply a number by one digit of the other number you are doing multiple multiplications and additions without explicitly writing everything down
  2. Even in version where you write some steps down the space for notes is so limited that you hardly have any
  3. The shifting by one digit for each row may be confusing at times

Advantages of the method

  1. It is very compact on a sheet of paper
  2. The logic behind the steps is very apparent

Possible improvements Well, some may not find this an improvement, but if I were to multiply the example alluded to earlier in this answer, namely $3527\cdot412357$, I would consider writing down a table of multiples $1,2,...,7$ of $412357$ first (the highest digit of $3527$ being $7$). This could be done by repeated adding which rarely goes wrong.

I hope this can contribute to an informed debate!