Suppose you can halve, double and add, but you have no multiplication table. Can you still find 13 times 27? Write 13 and 27 side by side, keep halving the left number and doubling the right one, then add some of the right-hand numbers. This page explains which rows to add, why the total is always the exact product, and how the rows that survive spell out the first number in binary.
Key terms
Russian peasant multiplication
Definition Russian peasant multiplication finds the product of a nonnegative whole number and a whole number . Write and as the first row of a two-column table. To make each new row, halve the left entry and discard any fractional part, so that 13 becomes 6, and double the right entry. Stop after the row whose left entry is 1. Then cross out every row whose left entry is even, and add the right entries of the rows that remain, the rows whose left entry is odd. The sum equals for every such and . When no row has left entry 1, and the table is the single row with entries 0 and . That row is crossed out, so nothing is added and the product is 0. The halved number must be a nonnegative whole number. The doubled number may be any number, because the method only doubles it and adds, and a product with a negative first factor is found by multiplying the absolute value of that factor by and changing the sign of the result.
In plain words Halve on the left, double on the right, and keep the rows where the left number is odd. An odd left entry marks a group that cannot be paired up and is set aside, and the answer is the total of everything set aside.
Example For 13 times 27 the table is the following.
| Halved | Doubled | Row |
|---|---|---|
| 13 | 27 | kept |
| 6 | 54 | crossed out |
| 3 | 108 | kept |
| 1 | 216 | kept |
The kept rows add up to , and indeed . The number 13 was never multiplied by 27 directly.
Halving and doubling
Definition Halving and doubling rest on two identities, which hold for every whole number and every number .
Halving here is integer halving. A whole number is either even, , or odd, , and in both cases its integer half is , where is the largest whole number not exceeding . Let be the sum of the right entries kept so far. One step of the method goes from a row with entries and to the row with entries and , first adding to when is odd. By the identities the quantity is an invariant, a quantity that is the same after every step. It starts as . Each step makes a positive left entry smaller, so the left entry eventually becomes 0, one step after the row with left entry 1, and at that point . Hence the kept entries add up to exactly .
In plain words Think of groups with objects in each. An even number of groups pairs off into half as many groups of twice the size, with nothing left over. An odd number of groups leaves one group unpaired, so that group is set aside first and the rest are paired. No object is ever lost or counted twice, so in the end the groups set aside hold all objects.
Example Track the saved total for 13 times 27. In each row, is the total saved from the rows above it, and the last line shows the state one step after the row with left entry 1.
| Groups | Size | Saved | |
|---|---|---|---|
| 13 | 27 | 0 | 351 |
| 6 | 54 | 27 | 351 |
| 3 | 108 | 27 | 351 |
| 1 | 216 | 135 | 351 |
| 0 | 432 | 351 | 351 |
Thirteen groups of 27 become one saved group of 27 and six groups of 54. Six groups pair off exactly into three groups of 108, which is why the row starting with 6 adds nothing. Its objects are not lost but carried into the next row in bigger groups, and counting that row as well would count them twice.
Powers of two
Definition The powers of two are the numbers for whole numbers , namely 1, 2, 4, 8, 16, 32 and so on, where and each power is twice the one before. For every the powers below add up to one less than it,
In the multiplication table for and , the row numbered , counting the first row as row 0, holds on the left and on the right. For the table has rows, where is the largest power of two not exceeding .
In plain words Powers of two are what you get by doubling 1 again and again. The doubled column lists 1, 2, 4, 8 and so on copies of the second number, and each power of two is larger than all the smaller ones put together.
Example The first four powers add up to , one less than 16. For a first factor of 1000 the largest power of two not exceeding it is , so the table has only 10 rows. For 1000 times 3 the kept right entries are 24, 96, 192, 384, 768 and 1536, which add up to 3000.
Binary representation
Definition Every positive whole number can be written in exactly one way as a sum of distinct powers of two. Taking the largest power that does not exceed and repeating with what is left produces such a sum. That largest power must appear in every such sum for , because all smaller powers together add up to 1 less than it, and repeating this argument with what is left shows that the sum is unique. The binary representation of lists, from the largest power used down to , the digit 1 for each power in the sum and 0 for each power not in it. The number 0 is written 0. Integer halving reads these digits from the right. A whole number is odd exactly when its last binary digit is 1, and halving with the fractional part discarded deletes the last binary digit. So in the multiplication table the left entry of row is odd exactly when binary digit of , counted from the right starting at 0, is 1. The kept rows therefore hold for exactly the powers that make up , and they add up to .
In plain words Binary writes a number using only the place values 1, 2, 4, 8 and so on, each used once or not at all. Halving peels these place values off from the smallest up, and an odd row says that the current place value is used.
Example Since , the binary representation of 13 is 1101. In the table for 13 times 27 the right entries 27, 54, 108 and 216 are 1, 2, 4 and 8 copies of 27, and the left entries 13, 6, 3 and 1 are odd, even, odd and odd, which matches the digits of 1101 read from right to left. So
An even first factor works the same way. For 18 times 23 the rows are 18 and 23, 9 and 46, 4 and 92, 2 and 184, and 1 and 368. Only the left entries 9 and 1 are odd, matching , which is 10010 in binary, and the product is .
Ancient Egyptian multiplication
Definition Ancient Egyptian multiplication finds the product for a positive whole number by doubling alone. Make a table whose rows are 1 and , then 2 and , then 4 and and so on, doubling both entries each time, and stop at the last row whose left entry does not exceed . Then mark the rows whose left entries add up to exactly , using each row at most once. Working from the last row up, mark a row whenever its left entry is no more than what is still needed, and subtract it. The marked rows are the powers of two in the binary representation of , so the marked right entries add up to . They are the same right entries that Russian peasant multiplication keeps, found from the other end. The method appears in the Rhind papyrus, an Egyptian mathematical text from about 1550 BC.
In plain words Double the second number until the doubling counts are about to pass the first number, then pick the doublings that make up the first number exactly. Halving does the same picking automatically, one binary digit at a time.
Example For 13 times 27 the doubling table has rows 1 and 27, 2 and 54, 4 and 108, and 8 and 216, and it stops there because the next left entry, 16, would exceed 13. From the last row up, 8 fits into 13 and leaves 5, then 4 fits and leaves 1, then 2 does not fit, and 1 fits and leaves 0. So , and
the same three numbers the halving table kept.
Check yourself
- Use halving and doubling to compute 21 times 34. Which rows are kept, and how do they match the binary representation of 21?
Show the answer
The table is the following.
| Halved | Doubled | Row |
|---|---|---|
| 21 | 34 | kept |
| 10 | 68 | crossed out |
| 5 | 136 | kept |
| 2 | 272 | crossed out |
| 1 | 544 | kept |
The kept rows give , and . They are rows 0, 2 and 4, holding 1, 4 and 16 copies of 34, and indeed , which is 10101 in binary.
- Someone halves 13 by rounding up instead of discarding the fractional part, so the left column reads 13, 7, 4, 2 and 1. Keeping the odd rows as before, what total do they get, and where does the method break?
Show the answer
The right column is still 27, 54, 108, 216 and 432. The odd left entries are 13, 7 and 1, so the total is instead of 351. The method needs an odd count to become , so that one group is saved and the remaining groups pair off exactly. Thirteen groups of 27 hold 351 objects, and after one group of 27 is saved, 324 objects remain. Rounding up claims seven groups of 54, which would hold 378 objects, so the table has gained 54 objects that do not exist. The next rounding up, from 7 to 4, gains another 108 in the same way, and . Halving has to discard the fractional part.
- Extend the pattern. Replace halving by dividing by 3 with the remainder discarded, and doubling by tripling. How much of each right entry should be kept? Test your rule on 23 times 4.
Show the answer
Write each left entry as with remainder equal to 0, 1 or 2. Then groups of objects become groups of objects and leftover groups, because
So keep times the right entry, and stop when the left entry becomes 0. For 23 times 4 the table is the following.
| Left | Right | Remainder | Kept |
|---|---|---|---|
| 23 | 4 | 2 | 8 |
| 7 | 12 | 1 | 12 |
| 2 | 36 | 2 | 72 |
The next left entry would be 0, so the table ends, and . The remainders read from the last row up are 2, 1 and 2, and indeed , which is 212 in base 3. Halving is the base 2 case, where every remainder is 0 or 1, so each row is either crossed out or kept whole.