Japanese Multiplication

Everything else that doesn't fall into one of the other PB categories.
User avatar
idle
Always Here
Always Here
Posts: 6150
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Japanese Multiplication

Post by idle »

Some one posted a picture of how the Japanese teach kids to do multiplication on Facebook
and I thought wow that's a great method to teach.

a vid of the method here
http://www.youtube.com/watch?v=zPmrKtIhf_I

and a quick and dirty bit of code to do the same no idea what it's limits are.

Code: Select all

EnableExplicit 

Procedure.s jmul(sa.s,sb.s) 
   Protected lenA,lenb ,lenC,a,b,c,ct,v,r,sout.s   
   lenA = Len(sa)
   lenB = Len(sb) 
   lenC =(lenA+lenB)-1
   Dim mat(LenA,lenB)
   Dim sum((lenA*lenB)-1)
   
   For a = 1 To lenA
      For b = 1 To lenB
         mat(a,b) = Val(Mid(sa,a,1)) * Val(Mid(sb,b,1)) 
         If a > 1 And b < lenb 
            mat(a,b) + mat(a-1,b+1) 
         EndIf  
       Next 
       sum(a) = mat(a,1)   
    Next   
    ct = lenA+1 
    For c = 2 To lenB 
       sum(ct) = mat(lenA,c) 
       ct+1
    Next 
    For c = lenc To 1 Step-1
       v = sum(c) % 10 
       r =( sum(c) - v ) / 10 
       sum(c) = v
       sum(c-1)+r 
    Next     
    For c = 1 To lenc 
        sout + Str(sum(c)) 
    Next 
    ProcedureReturn sout 
 EndProcedure    
 
MessageRequester ("Japanese Multiplication",jmul("10000000000000000000000000000000","10000000000000000000000000000000"))
Windows 11, Manjaro, Raspberry Pi OS
Image
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Japanese Multiplication

Post by davido »

Thanks, idle.

A very nice demonstration coding.

Hardly related but have you seen the virtual abacus method? :)
DE AA EB
User avatar
idle
Always Here
Always Here
Posts: 6150
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Japanese Multiplication

Post by idle »

Thanks, It just struck me as a very interesting method to teach multiplication that's both quick and easy
plus it's probably useful for later on when they introduce linear algebra and tell them they've been doing
it all along since primary school.
The big O of the algorithm isn't that bad either.

No haven't seen the virtual abacus method do you have a link?
Windows 11, Manjaro, Raspberry Pi OS
Image
American Ninja
User
User
Posts: 24
Joined: Mon Jan 14, 2013 8:01 am

Re: Japanese Multiplication

Post by American Ninja »

idle wrote:a vid of the method here
http://www.youtube.com/watch?v=zPmrKtIhf_I
Seems very slow to me, and needs lots of paper space. And what happens if they need to do the math in their heads???
Nituvious
Addict
Addict
Posts: 1031
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Japanese Multiplication

Post by Nituvious »

I understand that method but seems tedious for larger numbers.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
idle
Always Here
Always Here
Posts: 6150
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Japanese Multiplication

Post by idle »

What can I say?
The algorithm has a shorter time complexity with a reduced number of additions and carries
than the method we're commonly taught.

Code: Select all

1     1         1 2 3 4 
2  *  2           2 4 6 8 
3     3              3 6 9 12
       4           1 1 1 1     <-carrys    
                 1 5 1 7 8 2
Windows 11, Manjaro, Raspberry Pi OS
Image
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Japanese Multiplication

Post by davido »

Hi idle,

I mentioned the virtual abacus on the spur of the moment, recalling that I had seen this on the UK news channel some years ago.

The report showed young children from an eastern country, probably China. These children were taught to use the abacus and when they became proficient the abacus was taken away and the calculations done by moving their fingers as if using a real abacus. Later they didn't even have to move their fingers. And they were very quick, even for large numbers.

I expected you might find this easily on You Tube for instance. Hm... not so easy. :oops: This is the nearest I could find:

http://www.youtube.com/watch?v=s-EKxq1oTPw

Thanks again. Nice to learn something new and interesting and a free PB demo coding! :D
DE AA EB
User avatar
idle
Always Here
Always Here
Posts: 6150
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Japanese Multiplication

Post by idle »

that's why I asked you for info on it a search didn't turn up anything significant
Windows 11, Manjaro, Raspberry Pi OS
Image
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Re: Japanese Multiplication

Post by Inf0Byt3 »

I have seen a similar thing in a documentary on TV, some time ago. I think the students were Japanese, and as Davido stated, after some years of training they could use an "imaginary" abacus to do the calculations. We might have seen the same video. Couldn't find the original clip, but this shows something close to it:

http://www.youtube.com/watch?v=hmRXh3ApswM
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
idle
Always Here
Always Here
Posts: 6150
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Japanese Multiplication

Post by idle »

yes that's generally how they do it.

I worked out how to do a div with the method but haven't got time to do it
right now.
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply