Home
Archives
About us...
Advertising
Contacts
Site Map
 

ruby in steel

 

Wilf Hey's Mathematical Digressions

Download source: Euclid.bas and Greedy.bas. You will need the free Just BASIC interpreter to run these. Download from www.justbasic.com.

Friction over Fractions

I have always loved so much of mathematics, and delighted to know that around the next corner I can always discover a new mathematical discipline. In fact, I think of mathematics as a wide landscape full of counties, towns and cities, inhabited by dozens of cultures. You may be deep in study of Geometry, but in the village over the way you’ll find Trigonometry. If you rest a while in the environs of Spherical Geometry you will see denizens of the land of Differential Calculus in the middle distance.

"The trouble with fractions is that they sit there and do nothing. They hardly convey any meaning except as an alternative way of indicating division..."

This is perhaps the saving grace for Fractions, a rather ugly (to my mind) stretch of mathematical landscape; but at least it’s fairly close to brighter, more interesting spots.

The trouble with fractions is that they sit there and do nothing. They hardly convey any meaning except as an alternative way of indicating division. Fractions are stubborn, too. You can add two fractions, but only with several extra calculations. (Remember them from schooldays? Find a new denominator by multiplying; cross-multiply the numerators and add their products; finally reduce both denominator and resulting new numerator to lowest terms). After this, what are you left with for all your work? Only another fraction! Where has all that work got you? Even their appearance is unclear. Consider 9/17: do you have any idea of what it means? No – not without performing mental calculations to see it is close to ½.

Happily, in many respects fractions are already passé. The more we use computers and calculators, the more we find we are relying on decimals in place of fractions. You can add decimals together, getting a result that likewise is a decimal, and easily understood: 0.52941 is nearly the same as 9/17, except that you can grasp the idea of its relative size without further calculation.

So why did we ever suffer fractions in the first place? The answer is that having fractions is an easy way to suspend a necessary division temporarily. If I came across the need to divide 9 by 17, I can represent the result as a fraction 9/17 or as a decimal (0.052941..). But suppose I came across the need to divide 9 by (X+4) I would be at a loss to state the result as a decimal: instead I represent that result, temporarily at least, as 9/(X+4). I can manipulate this unknown result, a fraction, along with other numbers. I can hold off doing the division for a later time, when I know the value X. So when it is used in algebra, the fraction serves a useful purpose. But don’t give me 9/17: it’s lazy and unhelpful.

Wisdom of the Ancients

In the British Museum there are many famous scrolls and parchments from ancient times, particularly from “Middle Kingdom” Egypt in the 17th century B.C. One of the better preserved is the “Ahmes Papyrus” – also known as the “Rhind” papyrus because it was found (in Thebes) and donated to the museum by Henry Rhind in 1858. Its scribe (known only as Ahmes) had copied it from a school text which, he reported, had been a standard for nearly 400 years before his own time. It has tables to help a student with multiplication and division, showing methods that are very different from ours, but fascinating and (dare I say it?) useful even today.


Part of the Ahmes (Rhind) Papyrus. Still useful after all these years!

In an earlier Digression (Waves on the Shore) we looked at an easy way to convert a number to binary notation: this is actually derived from the multiplication method known to the Egyptians and recorded on the Ahmes Papyrus. Suppose you wanted to multiply two numbers: 493 and 621. Write these two numbers at the top of two columns on a page; under one of them write the number that is one half its value, but ignore any fraction, and round only downward. (So under 493 you write 246). In the other column, write under the first number its double. (So under 621 write 1242). Repeat this halving/doubling process until the number in the left column is whittled down to 1.

Now pay attention to the numbers in the second column, selecting those that are alongside an odd number in the first column. (This rule applies to the very first number as well). Now add together all the selected numbers. In the example below we have put an asterisk beside the selected numbers in the second column.

493 odd 621 *
246   1242  
123 odd 2484 *
61 odd 4968 *
30   9936  
15 odd 19872 *
7 odd 39744 *
3 odd 79488 *
1 odd 158976 *
    306153  

What we have done here is:

  1. converted one number to binary
  2. added together products of the second number

From several other papyri we know that the ancient Egyptians performed division using a similar method. When division left a remainder, they dealt with it appropriately, ending up with fractions like ½, ¼ and 1/8. They didn’t mind that remainders resolved into more than one of these simple fractions. The main problem they saw was that very common remainders led to several binary fractions when a single simple answer was available. If they were dividing 4 by 3, Egyptian mathematicians would represent the answer as 1 + ¼ + 1/16 + .. This is all too common a result, so they developed the scheme a little further so that they could express all numbers and their reciprocals. In case you haven’t come across the term in mathematics, the “reciprocal of N” is (1/N). The division of two integers results in an integer plus a remainder; we often convert the remainder into a further division (by the same divisor) and express it as an integer. For us, 61 divided by 7 gives 8 + 5/7. The orderly Egyptian mind, finding 5/7 repellent, would use various methods to change this to ½ +1/5 +1/70. With just two exceptions (namely 2/3 and ¾) all Egyptian fractions have a “1” as their numerator – they are reciprocals.

There are interesting ways to convert our form of fractions to Egyptian fractions, but it should be remembered that Egyptians did not need to use these conversions: their whole methodology led to several simple (reciprocal) fractions instead of the one “complex” fraction form we use, and they didn’t need to change back and forth between the two different styles of fraction.


If you plan on doing Egyptian maths, you'll need to learn the hieroglyphs. Here's a simple guide to get you started...

Modern archaeology hasn’t yet decoded enough papyri (there are literally tons of pages yet untranslated) to be sure, but we think that Egyptian children may have recited by rote tables to help them use fractions in reciprocal forms. For no known reason, they felt that 1/N + 1/N should be forbidden, since each of the reciprocal fractions in a group had to be different. It appears that they knew a little trick:

(1/N) + (1/N) = (1/P) + (1/N*P)

where P = (N+1)/2

For example: 1/3 + 1/3 = ½ + 1/6

Another trick, little more complicated, but essentially the same:

(1/N) + (1/N) = (1/R*T) + (1/S*T)

where N = R*S and T = (R+S)/2

The first trick works well when N is odd, and the second works well when N has pairs of odd factors; for example, 15 = 3 x 5; so using these formulae, we can covert 2/15 to two forms:

(1/8 + 1/120) using R=1 and S=15, and (1/12 + 1/20) using R=3 and S=5.

You may ask, “Can any fraction be converted into Egyptian form?” The answer is YES: the fact of the matter is that any division can be done “our” way or the Egyptian way; the first generates fractions with numerators that can be any integer, and the second generates only a reciprocal fraction – or a series of reciprocal fractions.

From the demonstration of converting 2/N to two reciprocal fractions, you may have become suspicious that behind any common fraction, there may be several possible series of reciprocal fractions. You would be right: the binary series we used at the beginning is always one of the possibilities. Different methods produce different series, and the Egyptians favoured certain reciprocals over others, often because they had sacks of certain sizes to accommodate grain, for instance: they had 1/5 unit sacks, but not 1/7, so when sharing grain they might use the method that avoids producing 1/7 as one of the reciprocal fractions.

The Fibonacci Code

Anybody with a liking for play with mathematics is likely to know the name Leonardo “Fibonacci” Pisano (1170 – 1250). His “Fibonacci series” (1, 2, 3, 5, 8, 13.. where each term is the sum of the two previous) provides a rich harvest for art, science and recreational maths. Signore Pisano sported the nickname “Fibonacci”, which literally means “son from the Bonacci family” – in his day a “respectable” rumour for a young Italian man. He explained one of the methods Egyptians used to convert a remainder into reciprocal fractions. It will be familiar to you: it is in reality a variant of the famous Euclid algorithm for finding the highest common factor of two integers.

Fibonacci’s method would find the biggest reciprocal fraction that is less than the remainder; the leftover bit would be a new remainder, and the method would be applied again, over and over as desired. The benefit of this method is that the fractions get smaller and smaller very quickly. If you stopped after creating one reciprocal, you had a fair estimate of the value of the remainder. If you made a second reciprocal, their sum gave you an even better approximation. You could take the calculation to its end, and establish the true value of the remainder. Or you could stop short after a few reciprocals, knowing that you still had a good approximation.

Suppose we have a remainder of 401 after a division by 743. The modern way would be to represent this as (401/743) but the Egyptians wanted only reciprocal fractions. If there were only one term, it would be 1/X where X = 743/401. This would make X greater than 1 but less than 2. As an estimate of the value 1/X, 1/1 is too large, and ½ is too small. Fibonacci says, use ½ and then deal with what remains (which is 59/1486). Repeating the process, we establish that the nearest reciprocal less than 59/1486 is 1/26. The small difference left over is 12/9659 – very small indeed. Taking the process one step further, the nearest reciprocal less than that small difference is 1/805. The leftover portion is now a reciprocal itself – 1/7775495 – so the conversion is finished. Specifically,

( 401/743) = (½) + (1/26) + (1/805) + (1/7775495)

The beauty of this method is that you don’t have to go all the way: the sum of the first two reciprocals is very close to the exact result; the sum of the first three reciprocals is incredibly close, and the fourth reciprocal makes it perfect. This kind of algorithm is called “greedy”, because it packs all the value into getting a good approximation in just a few iterations. Compare this algorithm to Euclid’s to see how close it is.

In Euclid’s algorithm the first step is to divide the smaller number into the larger, discarding the result but retaining the remainder: 743/401 yields a remainder of 342. The next step is to evaluate 401/342, which yields a remainder of 59. This process is repeated until the remainder is either one or zero: if it is one, the two original numbers are relatively prime (that is, they share no whole-number divisor above one). If the final remainder is zero, the penultimate remainder is itself the highest common factor. In this case, the next step is 342/59, yielding a remainder of 47; then 59/47 gives a remainder of 12; 47/12 gives a remainder of 11; 12/11 gives a remainder of 1. For another example, try 270 and 150: remainders in each step are 120, 30 and zero, so 30 is the HCF of 270 and 150.

Note that the principle difference between these algorithms is that you add one to the result at each step of the Fibonacci algorithm (to produce a new denominator).


Try out the programs using Just BASIC

You can download the source of programs that illustrate the working of both these algorithms, written in simple commands in the freeware language “Just BASIC”:

Download source: Euclid.bas and Greedy.bas

You can download the interpreter and tools for this Windows-based language at no cost or obligation at http://www.justbasic.com.

I leave you with a little problem to test your skills with Egyptian fractions: please supply five reciprocals that together total exactly 1/3. An answer (with working out) next time!

The Egyptians used two measurements to establish the approximate area of a circle – one was a quick-and-dirty method that implied that pi was 3.106 – not the most brilliant of estimates. But the educated among them knew a second method that gives a good estimate of pi to four digits: 3 plus the reciprocals of 13, 17 and 171. So let’s not talk down the Egyptians’ mathematical accomplishments...

 

February 2006


Having earned two degrees in Canada, a BA in Science/Philosophy and a Mus,Bach, Wilf Hey achieved a prize from the American Mathematical Association and went into computer programming. He figured in the development of RPG "decision tree sorter" that graduated into a high level language. In the 80s he moved into computer journalism and has written "Wilf's Workshop" for PC Plus ever since.

 


Home | Archives | Contacts

Copyright © 2006 Dark Neon Ltd. :: not to be reproduced without permission