Wednesday 22 June 2016

Stack Multiplication

This post is dedicated to all my beloved one's.
Note : Sign of multiplication is donated by 'x' in this post.

Since our primary classes, we have been performing one of the basic operation in maths : Multiplication i.e. an another form of addition.

We memorize the basic multiplication of the type a x b and then we move onto multiplying big numbers of type ( ab x cd ) or may be larger like ( abc x de ).

Whenever we have to multiply two big numbers , we place them one over the another and carry out the operation like :
                                                                   ab
                                                                x cd 
                       
If we are two multiply three numbers ( like ab x cd x ef ) ,then we simply multiply any of the two numbers first and then multiply the result with the remaining third number. So we carry out this process in two phases.
The question is can't we carry out this process in this way :
                                                                   ab
                                                                   cd
                                                                x ef      
in the same way we carry out addition of three numbers like :
                                                                   ab
                                                                   cd
                                                                + ef  

What do you think about its possibility?

The answer is YES. No need to scratch your head too hard.(When this question struck my mind first, I became restless....It was difficult for me to sleep too!!! Hopefully I worked out a way)
How??Just continue reading :

First, to your astonishment, this operation is not only limited to three numbers, we can multiply any number of large numbers by placing them in the stack this way.



Before going to this concept, lets have a review of what we have been doing since our primary classes. Consider multiplication of any two numbers, say 23 and 15. Lets multiply these :
                                                                  23
                                                                x15 
                                                                115
                                                                23X          
                                                                345  
That's how we carry out this operation.

In the above operation what does 'X' implies?Why it is there?
Basically, this 'X' is nothing but 0 (Yes you read correctly, its zero). Wonder how?For this we carry out the same operation using distributing property :

23 x 15 = 23 x (5 + 10) = (23 x 5) + (23 x 10) = 115 + 230 = 345.

So when we were multiplying 23 with 1 in the stack, we were basically multiplying 23 with 10 and its obvious that the one's place in such an operation would always be 0. So, we usually hide it with X for the simplicity.

Hence basically, when we multiply the numbers in stack, the duty of 'X' is take care of the place value (one's/ten's and so on) in decimal system.Hence, when we multiply a number with one's place digit, we don't need any X.

Similarly when we multiply the number with hundred's place digit, we use two X because in this operation, ten's and one's place would always be 0 like the one below ( 23 with 2):
                                                                   23
                                                               x215
                                                                 115
                                                                 23X
                                                               46XX
                                                                4945  



Now we proceed to multiply 3 numbers by placing them in stack.
Consider ( ab x cd x ef ) = ( ab x cd x (10e + f ) )
                                        = (ab x cd x f ) + (ab x cd x e)x10
                                        = (ab x (10c + d) x f) + (ab x (10c + d) x e)x10
                                        = (ab x d x f ) + (ab x c x f)x10 + (ab x d x e)x10 + (ab x c x e)x10x10
Now we will simply replace the 10 with 'X' when place in stack.
                                                                  ab
                                                                  cd
                                                                xef 
                                                             (abxdxf)
                                                           (abxcxf)X
                                                           (abxdxe)X
                                                        (abxcxe)XX 
                                                       Σ                   

Feeling awkward??
                                                     
Don't Worry??Its simple.
Consider an example:
Lets take the numbers to be 23,15,64 and multiply these :
                                                           
                                                             23
                                                             15
                                                           x64

Step1 :

  • Multiply 4 with 5 and then with 3. The result comes out to be 60. 6 is carried.

                                                            6
                                                             23
                                                             15
                                                           x64                                                
                                                               0

  • Now again multiply 4 with 5 and then with 2 and add 6 carried from previous operation, we get 46.

                                                             23
                                                             15
                                                           x64                                                
                                                           460

  • Similarly, multiply 4 with 1 and then with 23, we get 92.This can be done in 2 steps as we did previously. Note that 1 is a tens place digit so we need to consider one 'X'.

                                                             23
                                                             15
                                                           x64                                                
                                                           460
                                                           92X

  • Now, we mutiply 6 with 5 and then with 23, we get 690.Here 6 is a tens place digit so as in the previous step, consider one X.

                                                             23
                                                             15
                                                           x64                                                
                                                           460
                                                           92X
                                                         690X

  • Now nultiply 6 with 1 and then with 23, we get 138. Here both 1 and 6 are tens place digits, so we consider two X here. Lastly sum up the numbers.

                                                             23
                                                             15
                                                           x64                                                
                                                           460
                                                           92X
                                                         690X
                                                       138XX 
                                                        22080  

Similarly we multiply 23,15,164 as :

                                                             23
                                                             15
                                                         x164                                                
                                                           460
                                                           92X
                                                         690X
                                                       138XX
                                                       115XX     (1x5x23)
                                                      23XXX     (1x1x23)    (Note 6 patterns : 3C1 x 2C1)        
                                                       56580  

Easy!!!Wasn't it??

Similarly you can place more numbers in the stack and continue multiplying them but that would certainly increase the complexity of the system.

If you really wanna go for it, then you may use combinations concept to decide the number and path of pattern you will need to tackle with since every digit in a number multiplies once with every other digit in another number taking care of their places in decimal system (one's, ten's and so on). Choice of using combinations is yours, you can also go straight without using it.I avoided it for the simplicity of the post. However, for your keenness I mention below a multiplication operation with 12,23,14,25 in stack :

                                                             12
                                                             23
                                                             14
                                                           x25 
                                                           720    (5x4x3x12)
                                                         480X    (5x4x2x12)
                                                         180X    (5x1x3x12)
                                                       120XX    (5x1x2x12)
                                                         288X    (2x4x3x12)
                                                       192XX    (2x4x2x12)
                                                         72XX    (2x1x3x12)
                                                       48XXX    (2x1x2x12)   (Note 8 patterns : 2C1 x 2C1 x 2C1)
                                                        96600  

It would be certainly good to stick with what we have learnt and have been using since our primary classes. I wrote this post for the sake of intuition. Hope you guys liked it!!!



No comments:

Post a Comment