Showing posts with label Egyptian multiplication. Show all posts
Showing posts with label Egyptian multiplication. Show all posts

Monday, July 4, 2011

A morning at the Farmer’s Market

A morning at the Farmer’s Market

By Bobby Neal Winters
While I am not a fitness nut by any means, I do habitually take a daily walk. I am also an early riser even on Saturday mornings. Sometimes, when all of the stars are aligned correctly, I can make these two things work together and get over to my town’s Farmer’s Market which is only a stroll of ten blocks from my house.
That is the way it was on one particular Saturday morning that I am going to tell you about. I got up, dressed, and went immediately outside. It was not the cool weather one gets on spring mornings, but neither was it as hot as it was destined to get later in the day.
The first part of my walk was in the shade of the trees, but out Farmer’s Market is in the middle of town where trees are indeed scare. I missed the trees as it appeared to be getting warm rapidly. Indeed, as I came to Broadway, which is the principal north-south thoroughfare in my town, I saw heat rising from it.
Looking across Broadway, the Farmer’s Market looked busy and the heat waves rising from the street obscured it. As I crossed the street, there was a gust of wind that carried sand along with it. The sun seemed to jump in the sky and it became noticeably warmer. As I finished crossing the street and entered the Farmer’s Market, it seemed different.
I didn’t see the usual mix of yuppies and would-be-hippies that typically populate the Market. The vendors seemed to be of a more middle-easterly mix than usual. I thought that perhaps today they had a special international theme and that maybe some kids at the university were involved--or there parents as some of the vendors seemed a little too old for school.
The impression that it was a special day was reinforced by the palm trees that surrounded the square. And then there were the tents which seemed to be made from natural fibers rather than synthetic and were a good deal dirtier than usual.
The offerings at the various booths were different as well. There were the booths that offered the usual fresh vegetables, of course, but whereas there is usually a booth that sells breakfast burritos (yum), there was instead a booth that sold goat meat roasted on a skewer. You could see the whole skinned goats hanging by their heels with varying amounts of flies.
And instead of the booth of the fellow that sells homemade bread while touting its health benefits, there was a fellow with a brick oven selling freshly baked bread in flat, round loaves. I wondered how they got that brick oven in during the week. Someone had spent a lot of money on this.
Then there were the smells. In addition to the roasting meat and the baking bread, I caught the smell of spice. Cumin? Curry? I couldn’t tell, but it was over-powering to me. It hooked my nostrils and dragged me the length of the Farmer’s Market to a booth that was surrounded by bags of spice that were hip-high and two feet across.
Within the booth was an olive-skinned man with wrinkles as deep as the Grand Canyon in his weathered face. He was busy about the business of selling spice, and he was using a simple, but ingenious, device that deserves description.
At first glance, it looked like Justice’s Scales. There was a horizontal stick, hanging from a fulcrum with conical containers on either side of the fulcrum. When I say conical, you might think snow cone, but I want you to rethink that slightly. The were pointy end down because they were being used to hold measured amounts of spice, but they much wider and flatter like the hats worn by farmers in southeast Asia.
I saw there was more to it than just a balance when I saw a customer buying spice. The customer pointed at a particular bag and said something to the merchant. I could not hear him above the din, but he clearly held up five fingers. The merchant then took a nondescript cup, plunged it into the back of spice, and retrieved it. Then he carefully--and in full view of his customer--scraped off the top of the cup until the spice was level. He then carefully poured it into one of the conical pans on the balance. It was then I noticed that the stick between the two pans was filled with equally-spaced notches.
The pan in which he put the cup of spice was one notch away from the fulcrum. He then did something that surprised me. He moved the other pan to a notch that was four notches away from the fulcrum on the other side. I thought that I knew what was happening and expected that he would move it five notches. I watched expectantly.
After getting the pan in the right spot, he measured in cups until it balanced. There were exactly four times the amount of spice in pan on one side than in the other. He then poured all of the spice from each pan into a bag that was proffered by the customer. In return, he accepted some coins offered by the customer. The coins looked pretty cool. I wondered if they were tokens that were being sold in another booth somewhere.
Putting his second pan four notches from the fulcrum made sense to me now. It was the most efficient way to perform the transaction. Four plus one is five after all.
I was about to leave to find the booth that sold those tokens, when another customer came. He also said something that couldn’t be heard above the din as he flashed both hands twice and then followed that with a peace-sign.
I took this to mean that he wanted twenty-two measures of the spice. This was confirmed when I saw the vendor reach down into a bucket that I’d not noticed up until that point and draw out some tokens and lay them out carefully in two lines of eleven. The tokens were disks like coins, but they had slots cut mysteriously into one side.
As I was counting to eleven, he was scooping out exactly one measure of spice as before and putting it into one of the pans. He then moved the pan on the other side of the fulcrum to another notch and surprised me again. I was prepared for him to move it to the twenty-first notch from the fulcrum, but then I noticed there were only seven notches on that side. He didn’t move it to the seventh notch either. He put it in the second notch.
I was confused, but I was also intrigued. I continued to watch.
He then put spice in the two notch side until it balanced. That side now had double the spice as the first. Then he then turned his attention back to the two lines of slotted tokens. He deftly swept one of the lines back into his token bucket and then laid out his tokens into two lines again. This time, as there were eleven tokens left, there was one line of five and one line of six. He removed the extra token from the line of six and fitted its slot onto the double pan.
He then slid it back to being one slot from the fulcrum. Then he put spice in the other side until it balanced. Then he took the pan that had the token on it and dumped the spice in it into his customer’s bag and put the token back into the token bucket.
He then placed the now empty bucket back into the doubling notch, as I was now beginning to call it. It looked a bit more well worn than the others. He fill it until it balanced against the other side. I was keeping track. The other side had two measures in it, so that meant the doubled side had four. He took the five tokens that he had left and lay them out in two rows; one with two tokens and one with three. He took the extra one from the line with three and fitted its notch onto the doubled side.
As before he moved it from the doubling notch to single notch and added spice to the other side until it too had four measures. He took the pan with the token and dumped its spice into the bag and put the token back into the token bucket.
Again, he put the empty bucket back into the doubling notch, and filled it with spice until it contained eight measures. He then swept one of the lines of two tokens back into the bucket and lay out the remaining two side by side. There was no extra token, so he didn’t fit it on the edge of the pan. Neither did he dump the spice from the double pan into the customer’s spice sack. He did, however, put the pan containing eight measures to be a single notch from the fulcrum and balance the pan on the other side to contain eight measures.
He took his two remaining slotted tokens and fitted one to each of the pans. He then dumped each in turn into his customer’s waiting spice sack, adding a total of sixteen measures of spice to the sack.
As I said, I’d been keeping track of the spice dumped into the sack. He’d dumped in two measures and then four and then sixteen, making a total of twenty-measures, just as the customer had requested.
I was fascinated--and I just had to get some of that spice because the smell was driving me crazy. I decided that I would get some of those coins that everyone seemed to be using to buy the wares, so I started looking around for a booth that sold them. I tried asking the people, but they didn’t understand me.
One thing I need to mention is that the Farmer’s Market abuts the south side of a bank parking lot so I figured they must be selling the coins at the bank. In order to pursue this theory, I headed north.
It was then there was another gust of wind and sand, and the sun seemed to jump in the sky again. I went to the bank, but it closed, and when I went to the Farmer’s Market again, it seemed like it always had before. I couldn’t find any of the thematic booths.
I walked back home and took a nap.
Waking back up, it had all become clear to me. The man in the spice booth had been using a method called the Russian Peasant Algorithm or Egyptian multiplication. While it can be used as multiplication, it is really a method for representing a number as a sum of powers of two. You can try it yourself by using two different kinds of coins.
In the table below, I duplicate the process by using #-signs for my number, which was represented by slotted tokens in the Market, and &-signs for the measures of spice. I mark the times that dividing by two left a remainder by putting a $-sign in the far right column.



##### ##### #
##### ##### #
&
#####
##### #
&
&
$
##
###
&&
            &&
$
#
#
&&&&
&&&&
#
&&&& &&&&
&&&& &&&&
$


Notice that if you a count all of the &-signs whose column is marked with a $-sign you will get twenty-two, the original number. Now let me modify this table to illustrate another principal. I will replace the original & by the weight of an amount of spice, say 213 grams.


##### ##### #
##### ##### #
213
#####
##### #
426
$
##
###
852
$
#
#
1704
#
3408
$


Notice, each of the numbers is just the double of the one above it. If I add up the numbers in the rows marked with $-signs, the sum is 4686. Note that this is equal to 22 time 213.
While it is a perfectly legitimate way to do multiplication, it seems magical because it eschews the notation that we use in the decimal system. The Russian Peasants who used a similar method didn’t know the decimal system because they were illiterate. The Egyptians didn’t because it hadn’t been invented yet.

Thursday, June 23, 2011

Summing it up

Summing it up

By Bobby Neal Winters
Being a mathematician is a special thing.  We mathematicians have been touched by God--touched at least--but it’s not without its cost.  Part of that cost is being set apart as a separate branch of humanity, considered somewhat strange by one’s fellow man.  Another is spending a large part of your life distracted by one problem or another.
This was the case with me the other day as I was coming home from a neighboring state.  I was set apart because I was driving alone, but mainly I was distracted by a problem.  The maddening thing is that now I can’t even remember what the problem was.  This is another one of those things which sets us apart from humanity, a certain forgetfulness in the simple matters of living.
In any case, I was distracted for some extended interval of time, and, as happens so often when we go off on these little mental vacations, the rest of the world keeps going on around us.  In this particular instance, my car kept finding its way along the road, but it didn’t keep going along the right road.  I missed a turn.  When I shook off my distraction, I was off the main highway and in the heart of what we in these parts, in homage to Ned Beatty, refer to as banjo country.
I came to a place where the road widened slightly and to the right side there was an unpainted wooden building with a sign above the door that read “Groceries.”  There was also a sign that said “Cold Pop.”  As it was a warmish day and as I had been riding along with the windows rolled down, the idea of a cold pop appealed to me.
I stepped out of the car onto the gravel and walked to the store.  I couldn’t tell whether the store had ever been painted, but the door, which looked to have been a later addition, had been green at one time. It was a wooden frame with rusted screen wire held to it in a rather haphazard fashion by tacks. When I opened it, it screeched so loudly that the bell above it seemed superfluous.
This was all misleading, however, because when I got inside everything seemed new.  And as I reread that last sentence, I realize it is misleading because it wasn’t new, it was old, but looked new.  The pop machine was an antique, an expertly restored antique, but an antique none the less.  I looked inside and it had been filled with nostalgia brands of soda pop which aren’t available anymore along with currently popular brands in classic packaging.  Before I could extract the pop which and lured me into the store in the first place, I was betrayed by the mathematician in me and became distracted by the rest of the place.
The food shelves had been restored in a fashion similar to the pop machine and were stocked with products in old-style containers.  My eyes ran along them and were drawn immediately to the coffee which was in old-fashioned cans.  I have sorely missed the metal cans that coffee was sold in not so long ago.  My first thought was I wanted to buy some.  My second thought was that in these fancy, classic cans that it would be very expensive.  My third thought was that it wouldn’t hurt to simply see what the price was.
My fourth thought was complete astonishment.  The cans were fairly small but their price was a fraction of what I usually pay.  It don’t remember exactly because the price is not important, but let’s say it was $1.22 for a size I usually pay $5 for.  I must have said “Wow” to myself or something because I heard a voice from the direction of the counter.
“Kin I hep ya, Mister?”
It was an old fellow who was clearly in costume.  He wore a crumpled old felt hat and had a corncob pipe jammed between the jaw teeth on the right side of his mouth.
“Uh...yeah,” I stuttered, “are these prices real?” I asked.
“Yup,” came the answer.
“Is there any limit on the number of cans I can buy?” I asked again, not daring to hope.
“Nope,” was the single syllable reply.
I began to load up my arms.  I don’t know how I managed it, but I got thirteen cans total and, forgetting about the soda pop I’d come in for completely, toted them up to the front.
I sat them down on the counter and he eyed them.
“Thirteen?” he asked.
“Thirteen,” I confirmed.
It was then I noticed that he had several cans in front of him containing different objects.  From two of these he removed numbered disks: one red disk with $1 on it, two green disks each with 10 on them, and two blue disks each with 1 on them.  He laid these out in a row in front of himself and to the right.
He then reached into a can and extracted some black objects that looked like carved scarab beetles.  He laid them out into two rows: one six scarabs long and the other seven, making a total of thirteen.
What happened next happened with a speed that only comes as a result of practice.  I will try my best to explain it to you.  One of the rows of scarab beetles was one longer than the other.  He removed the extra scarab from it and set it my his row of disks.  He then picked up an entire row of scarabs and put them back into their can.
Then he took more of the colored disks from cans and laid out exactly twice as many of each of the different kinds as he had before.
Then he laid out the remaining six scarabs, left over from the first round, into two columns.  Actually, a better way to describe it would be to say he put them into three rows of two.  This was so that he would not have to do any mental activity at all; he just laid out the scarabs mechanically.  As there wasn’t an extra one left over this time, he didn’t set it by the row of disks, but he did take one of the columns and put it back in the scarab can.
He then took numbered disks and doubled the number he’d put down in the previous round, and, as before, laid out his scarabs.  This time there was one row of two and one left over which he put by his pile and put one of the remaining two back in the scarab can.
I could see this process was going to soon stop so I watched carefully.  He doubled the numbered disks one last time and put the lone remaining scarab down next to it pro forma.
Then he put away the numbered disks from the rows without scarabs, counted the remaining ones, and said, “Ya owe me fifteen dollars and eighty-six cents.”
I did a little mental guestimation--as I am lousy at arithmetic--decided it was a fair price in any case, took out the money, and paid the man.
I carried the coffee back out the the car, loaded it and myself up, and drove off.  On the way home, again distracted by what I had seen, it came upon me what the old coot had done.  It is know as the Russian Peasant Algorithm or Egyptian Arithmetic, depending upon whether you are trying to impress Russian peasants or Ancient Egyptians.  
It is a mechanical process which will literally produce the number of objects needed.  In societies that had not yet discovered a way to represent numbers that makes arithmetic convenient, a process such as this one would be quite valuable.  
Lets consider how one could multiply seventeen by thirteen. It is much more fun to do with tokens, of course, but in writing it is more convenient to do it as follows:
17
13 *
8
26
4
52
2
104
1
208 *


Note I’ve used * in place of the scarabs.  The sum of the starred number is 221 which is the product of seventeen and thirteen.
Those of a mathematical bent will, of course, be led to think of binary numbers. One should be aware that the Egyptians where doing this when all the silicon chips in our computers were still sand.
When I ran through all of the cheap coffee I bought that day, I made my way back over to the neighboring state and tried to find that dilapidated old store, but I wasn’t able to.