Front End Design

FrontEnd Design

Russian Peasant Multiplication

One of historically retained and fancy methods of multiplication often called the Russian peasant algorithm. You don’t need multiplication facts to use the Russian peasant algorithm; you only need to double numbers, cut them in half, and add them up. Here are the rules:

  1. Write each number at the head of a column.
  2. Halve the number in the first column, and double the number in the second column.
  3. If the number in the first column is odd, divide it by two and drop the remainder
  4. If the number in the first column is even, cross out that entire row
  5. Keep doubling, halving, and crossing out until the number in the first column is 1
  6. Add up the remaining numbers in the second column. The total is the product of your original numbers

Result

Why does it work? It’s all about binary

Russian Peasant Multiplication is actually a way of simultaneously converting a number to binary and multiplying it by another number. To make it simple we take easy example: 10 x 6.

10 = 1010 in binary (reading the remainders upwards). This means that

10 = 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0 = 2^3 + 2^1 = 8 + 2

Divide by 2 Remainder Power of 2 Double Sum
5 0 1 6 0
2 1 2 12 12
1 0 4 24 0
0 1 8 48 48

This also corresponds to how binary numbers are multiplied, because all we do is multiply 6 by either a one or a zero in each place (which is really just selecting whether to include it in the sum), and shift it one place to the left each time (which is really a doubling):

Custom Code

  • Image Training Vocabulary
    Training new vocabulary online
  • Image Images carousel
    Carousel with parallax
  • Image Info Cards
    Profile and product cards
  • Image Rounded Corners
    Add rounded corners to layers
  • Image Compare Images
    Compare two images
  • Image Images slideshow
    Scalable Images slideshow
  • Image Clip-path
    Animation with clip-paths
  • Image Rotating Heading
    Heading moving in a circle
  • Image Simple Charts
    Simplest Charts Ever
  • Image Curved Divs
    Custom curved divs
  • Image Niper sticks
    Niper Sticks
  • Image Google Charts
    Using Google charts
  • Image Log In Form
    MySQL/PHP authenication
  • Image HTML Post
    Send HTML in you email
  • Image Google Sheets
    Embed Google sheets into web site
  • Image Russian Peasants
    Russian Peasants Algorithm
  • Image Banner ads
    Clickable banner ads
  • Image Json+MySql
    Retrieve Data with Json and MySql
  • Image Calculate Route
    Calculate Route Length on Map
  • Image Online quest
    Online language quest
  • Image Scattered text
    Online language quest
  • Image Map with regions
    Interactive map with regions
  • Image Splitted SVG
    Splitted SVG heading
  • Image Translate Page
    Translate page into user language
  • Image Math on Page
    Display math in html