 54
 96
Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
Forum Search
Forum Statistics
UsersTotal Post History
 Posts:
 81446
 Topics:
 18714
7Day Post History
 New Posts:
 0
 New Topics:
 0
 Active Topics:
 0
Our newest member
Other

FAQ
All times are UTC [ DST ]
Google Ads
peasant multiplication
Forum rules
Always post answers in a "Hidecode" tag, so that others have a chance to answer the question too.
Always post answers in a "Hidecode" tag, so that others have a chance to answer the question too.
5 posts • Page 1 of 1
Please wait...
peasant multiplication
so i'd thought i'd add this as a point of interest.
there is an alternate way of multiplying 2 numbers, called peasant multiplication. i'll give an example.
96 * 54 = ?
so write 54 on a column, and 96 on the column below, on the left side.
divide 54 by 2, and record the remainder.
multiply 96 by 2. divide 27 by 2 and record the remainder.
keep multiplying and dividing untill you get 0 for the division.
then, for every row on the left that has a 1 on the right for remainder, add.
this method works for any base, not just 2. here would be the same numbers, in balanced ternary.
there is an alternate way of multiplying 2 numbers, called peasant multiplication. i'll give an example.
96 * 54 = ?
so write 54 on a column, and 96 on the column below, on the left side.
divide 54 by 2, and record the remainder.
 54
 96 27 r 0
multiply 96 by 2. divide 27 by 2 and record the remainder.
 54
 96 27 r 0
 192 13 r 1
keep multiplying and dividing untill you get 0 for the division.
 54
 96 27 r 0
 192 13 r 1
 384 6 r 1
 768 3 r 0
 1536 1 r 1
 3072 0 r 1
then, for every row on the left that has a 1 on the right for remainder, add.
 192
 384
 1536
 +3072
 
 5184
this method works for any base, not just 2. here would be the same numbers, in balanced ternary.
 54
 96 18 r 0
 288 6 r 0
 864 2 r 0
 2592 0 r 2 
 7776 +
 2592
 +7776
 
 5184

phillip1882  Apprentice
 Posts: 19
 Joined: Mon Mar 14, 2011 11:05 pm
 Location: florida
Re: peasant multiplication
so... are you wanting code implementations of this?
Ask three DBAs a question, and you’ll get four different answers.
Brent Ozar

Thirster42  Guru

 Posts: 4646
 Joined: Tue Nov 11, 2008 5:49 pm
 Location: Jefferson City, Mo
Re: peasant multiplication
Thirster42 wrote:so... are you wanting code implementations of this?
Why not write one anyway?
a smile is worth a thousand kind words, so smile, it's easy!
CODE: $5
WORKING CODE: $500
PROPERLY DESIGNED & WORKING CODE: Priceless
CODE: $5
WORKING CODE: $500
PROPERLY DESIGNED & WORKING CODE: Priceless

damber  LTD Admin

 Posts: 3138
 Joined: Tue Oct 09, 2007 1:48 pm
 Location: North Wales, UK
Re: peasant multiplication
damber wrote:Thirster42 wrote:so... are you wanting code implementations of this?
Why not write one anyway?
well fine then!
Code is hidden, SHOW
Ask three DBAs a question, and you’ll get four different answers.
Brent Ozar

Thirster42  Guru

 Posts: 4646
 Joined: Tue Nov 11, 2008 5:49 pm
 Location: Jefferson City, Mo
Re: peasant multiplication
pink fuzzy slippers

chrissie1  Senior Guru

 Posts: 9475
 Joined: Wed Oct 10, 2007 7:18 pm
 Location: Belgium
5 posts • Page 1 of 1
LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.