052911_Milo_AE fractions_elaborations

30 views
Skip to first unread message

br...@mathorigins.com

unread,
May 29, 2011, 8:47:51 AM5/29/11
to milog...@yahoo.com, mathf...@googlegroups.com, Moose
Good Morning Milo and Maria (and Team):
I was catching up on your emails this morning and began wondering about the mathfuture group's ability to glean meaning from your email (below).
Even with the very good Fibonacci example provided, I expect some of the team may still be mostly lost on this interpreted Ancient Egyptian (AE) equality:

(n/p - 1m) = (mn - p)/mp, with (mn -p) set to unity (1) whenever possible.

*FYI: this should read (n/p - 1/m) = (mn - p)/mp


Myself, I am trying to reformat this equality in such a way as to grasp everyone so they see the flexibility and power AE scribes like Ahmes (who wrote the Rhind Mathematical Papyrus over 3600 years ago) had with this abstract "toolkit".  I have not had much success with any reformat so instead please allow me to restate the equality and elaborate somewhat.

A unit fraction is any fraction with one (unity) in the numerator.

A unit fraction series (or string) is a set of distinct unit fractions shown in order of increasing denominators (or in decreasing order of value).  The sum of the series is shown as n/p in modern terms. For example: 1/2 [+] 1/4 [+] 1/8 = 7/8

n/p represents any fraction and typically a vulgar fraction (or common fraction, see 7/8 above) with a numerator greater than unity.

1/m represents a unit fraction that is to be deducted from n/p in order to simplify further calculations and to facilitate showing a unit fraction series (or string) equal to n/p. Typically (not always) 1/m represents the "lion's share" (or the largest possible unit fraction) of the original n/p quantity.

(mn-p)/mp is the remainder of the original n/p quantity after 1/m is deducted. The careful choice of 1/m interrelates with this remainder as a skilled scribe strove to choose 1/m such that this remainder [(mn-p)/mp] was itself another distinct unit fraction.

There is power in the "method" and its demonstration.

More importantly, I feel that as only a skilled scribe with considerable ability in abstraction and some form of algebra could have developed the "method", we have to remove our ethnocentric blinders and allow for the fact that the Greek culture is not so much the origin of all our modern maths as we have been led to believe.

Hope this helps.

Enjoy the weekend!
Bruce

Ps. for cubit queries see:  "The Ancient Egyptian Cubit and its Subdivision" edited by Michael St. John, 2001.
This text is a side by side English translation of the 1865 work by K. Richard Lepsius (Prussian) and offers some corrections and clarifications.


From: "milo gardner" <milog...@yahoo.com>
Sent: Friday, May 27, 2011 10:57 AM
To: mathf...@googlegroups.com
Subject: Re: [Math 2.0] Re: Do you design games, interactives or videos about multiplication?


Maria,

Ancient cubit and fingers scaling standards have not be decoded in clear ways. Bruce Friedman spent a year on such a product related to the Torah and Old Testament uses of the cubit and so forth.

What we do know about the multiplication side of this cultural issue, Egyptians scaled rational number n/p by LCM m to mn/mp such that the divisors of mp were selected (in red) that best summed to numerator mn thereby created the best unit fraction series.

Greek and/or Arabs modified the older Egyptian multiplication method to a division context by scaling rational number by an LCM m in a subtraction context per"

(n/p - 1m) = (mn - p)/mp, with (mn -p) set to unity (1) whenever possible.

When (mn -p)  could not be set to unity (1), a second subtraction step was connected to the older Egyptian method, ending the calculation.

Example from Fibonacci's Liber Abaci

(4/13 - 1/4) = (16 - 13)/52 such that

(3/52 - 1/18) = (54 - 52)/936 = 1/468

meant 4/13 = 1/4 + 1/18 + 1/468

There were several cubits. Knowing which one was in use at any given times makes the data base at time unreadable.

Yet, we can learn a great deal about the ancient multiplication scaling methods that were used by Egyptians, Greeks, Arabs and medieval scribes by studying this class of text.

Milo




From: Maria Droujkova <drou...@gmail.com>
To: mathf...@googlegroups.com; multiplica...@googlegroups.com
Sent: Fri, May 27, 2011 7:00:06 AM
Subject: Re: [Math 2.0] Re: Do you design games, interactives or videos about multiplication?



On Fri, May 27, 2011 at 9:20 AM, milo gardner <milog...@yahoo.com> wrote:

2. * It may "rescale" the object, keeping it distinct.

Egyptians, Greeks, Arabs and medievals rescaled abstract versions of saleable commodities within weights and measure systems, topics that college students can easily study. In lesseer forms high school and elmentary students can study the same math and business threads. Businss at any time breaks up a large inventory of a given commodity into smaller saleable units while maintaining profit margins for each level of the distribution chain.

Milo,

Some of your examples use multiplication more as a metaphor for general actions. I'd like to pull some of the more direct and literal examples for the multiplication model collection. I think there were some interesting examples in the measure and weight system. The interactive calculator we made for cubits-palms-fingers etc. comes to mind, as well as the rest of the dictionary you put together: http://mathfuture.wikispaces.com/Egypt+Math+Glossary


Cheers,
Maria Droujkova

Make math your own, to make your own math.


kirby urner

unread,
May 29, 2011, 12:38:47 PM5/29/11
to mathf...@googlegroups.com, milog...@yahoo.com, Moose
On Sun, May 29, 2011 at 5:47 AM, br...@mathorigins.com
<br...@mathorigins.com> wrote:
> Good Morning Milo and Maria (and Team):
> I was catching up on your emails this morning and began wondering about the
> mathfuture group's ability to glean meaning from your email (below).

Nice post Moose (bruce):

I've been reading up on so-called Egyptian Fractions pursuant to your
post in hopes of quickly writing a computer program to spit out the
Egyptian fraction for any fraction.

Alas, it's not that easy. The greedy algorithm will do the job sometimes,
but will get caught with its pants down giving solutions an Egyptian
scribe worth his salt (her salt? -- could scribes be women) would only
sneeze at in disgust. "So, you think computers are smarter than
we are?"

One of the Wikipedia articles mentioned "brute force" as an option.

In general my approach is to reacquaint adults with fractions by
"going over them again" this time using some arcane machine
logic that comes with the XO (not that an XO is required for this
kind of study).

The Greeks get mentioned because the algorithm for the GCD we
use is called Euclid's, even though Knuth and others hint that it's
much older. Some more history here might be welcome, as well
as awards for "best Youtube" (Vimeo etc.) giving an animated
explanation for it (perhaps in terms of bricks, wanting walls to
come out even).

Finding the GCD has some commonalities with seeking the best
Egyptian fraction rendition, as both algorithms put downward
pressure and numerators and the number of terms (number of
common factors).

Guido van Rossum expresses it simply thus:

def gcd(a,b):
while b:
a, b = b, a%b
return a

Then:


lambda a,b : (a*b)/gcd(a,b) # lowest common multiple (LCM)

These simple objects then have responsibilities in the
Rational Number we stack up, by building a __rib__ cage
of syntax-invoked methods e.g. __add__ for + and __mul__
for *. By the end of the day, students are experiencing
interactive sessions such as this one:

http://4dsolutions.net/ocn/python/rationals.py

It'd be "hard fun" to add an egyptian method to the Rat
class (the Rationals). We could start with the greedy
algorithm. Do it as a subclass of Rat called Egyptian
why not? Great project.

Kirby

Edward Cherlin

unread,
May 29, 2011, 1:42:55 PM5/29/11
to mathf...@googlegroups.com
On Sun, May 29, 2011 at 12:38, kirby urner <kirby...@gmail.com> wrote:
> On Sun, May 29, 2011 at 5:47 AM, br...@mathorigins.com
> <br...@mathorigins.com> wrote:
>> Good Morning Milo and Maria (and Team):
>> I was catching up on your emails this morning and began wondering about the
>> mathfuture group's ability to glean meaning from your email (below).
>
> Nice post Moose (bruce):
>
> I've been reading up on so-called Egyptian Fractions pursuant to your
> post in hopes of quickly writing a computer program to spit out the
> Egyptian fraction for any fraction.

There are many programming languages that include GCD and LCM as
primitives, and provide rational arithmetic. I have looked at
Mathematica and J in this regard, but there are many other options. I
believe that NumPy has such facilities. I am sure that an Egyptian
math Python library would be welcome.

At the other end of the historical scale, there is very little
software that can handle Conway numbers and games. The basic
arithmetic operations on binary rationals are easily programmed, but
in more complicated cases involving infinite sets (some equivalent to
Dedekind cuts, some defining infinities and infinitesimals) it can be
quite difficult to find the simplest form for the result. This problem
is discussed in Winning Ways for Your Mathematical Plays, by
Berlekamp, Conway, and Guy.

> Alas, it's not that easy.  The greedy algorithm will do the job sometimes,
> but will get caught with its pants down giving solutions an Egyptian
> scribe worth his salt (her salt? -- could scribes be women) would only
> sneeze at in disgust.  "So,  you think computers are smarter than
> we are?"
>
> One of the Wikipedia articles mentioned "brute force" as an option.

It would be trivial to create a table for all denominators up to a
thousand, or a million.

> --
> You received this message because you are subscribed to the Google Groups "MathFuture" group.
> To post to this group, send email to mathf...@googlegroups.com.
> To unsubscribe from this group, send email to mathfuture+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mathfuture?hl=en.
>
>

--
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks

kirby urner

unread,
May 29, 2011, 5:42:07 PM5/29/11
to milo gardner, mathf...@googlegroups.com
On Sun, May 29, 2011 at 9:47 AM, milo gardner <milog...@yahoo.com> wrote:
> Kirby,
> Algorithmic approach do not grasp historical Egyptian fraction methods.
> Egyptian, Greeks and medieval scribes used finite arithmetic. The greedy
> algorithm captures a small number of historical Medieval, Greek and Egyptian
> rational number representations written in unit fraction series.. To capture
> them all ... non-algorithmic approaches are needed ... mathworld (Wolfram)
> has attempted to decode historical Egyptian fraction by algorithms ...
> mixing in a small number of my posts ... yes, the intellectual side of
> Egyptian, Greek and medieval arithmetic offers many challenges to modern
> mathematicians that think in algorithms.

I'd be interested to see how far the algorithms might take us.

It's made clear in the Wikipedia entry that the greedy algorithm often produces
too many fractions with giant-mutant denominators that would be considered
ugly and monstrous per the Egyptian criteria.

Gotta aim for "nice" (similar to lowest terms) and spell that out well enough
so an algorithm switching algorithm might recognize which of three
possible finite fractions expansions was "most Egyptian".

I'm with Sir Roger (Penrose) that non-computable leaps occur, all the
time, every moment (doesn't have to be freakish). I'm not looking for
algorithms under every bed, like some mathematicians. No doubt the
ancient Egyptians were as endowed as anyone, if not more so by their
deities. Will we encounter a diviner who can crack RSA numbers
by some "idiot savant" (aka "black box") technique? Have we already?
Some of these magi leave algorithms in their wake, like Ramanujan,
yet we have no idea where these came from. Bolts from the blue.

Thanks for continuing to bring attention to Egyptian economics, and
all that fine tuning of grain (great for a computer game discrete math
simulation). Fractions come in handy when you're into fine tuning a
distribution network of such sensitivity.

Kirby

> Best Wishes,
> Milo
>

milo gardner

unread,
May 29, 2011, 5:49:57 PM5/29/11
to mathf...@googlegroups.com
Ed,

Mathematica does not contain Egyptian fraction functions that follow the historical patterns.Mathematica uses versions of the greedy algorithm. Egyptians scaled rational number n/p by LCM m to mn/mp. The best divisors of denominator mp were written in red that summed to numerator mn.  Ahmes listed a table of 51 2/n unit fraction series with  3 <  n < 101, a method that does not follow an easy to find algorithm.

For example, Ahmes converted 2/43 by LCM 42 to 84/1806. The divisors of 1806 are 43, 42, 21. 14, 7, 6, 3, 2, 1, such that:

 2/43 = 84/1806 = (43 + 21 + 14 + 6)/1806 = 1/42 + 1/66 + 1/129 + 1/301

and generally solved n/p = (n- 2)/p + 2/p when one LCM m would not solve a given rational number problem (30/53 and 28/97)..

I have seen PASCAL arithmetic functions programmed do this work.

Thanks for the comments,

Milo






From: Edward Cherlin <eche...@gmail.com>
To: mathf...@googlegroups.com
Sent: Sunday, May 29, 2011 10:42 AM
Subject: Re: [Math 2.0] 052911_Milo_AE fractions_elaborations
> To unsubscribe from this group, send email to mathfuture+unsub...@googlegroups.com.

> For more options, visit this group at http://groups.google.com/group/mathfuture?hl=en.
>
>



--
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks

--
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To post to this group, send email to mathf...@googlegroups.com.
To unsubscribe from this group, send email to mathfuture+unsub...@googlegroups.com.

kirby urner

unread,
May 29, 2011, 6:23:29 PM5/29/11
to mathf...@googlegroups.com
On Sun, May 29, 2011 at 10:42 AM, Edward Cherlin <eche...@gmail.com> wrote:

> On Sun, May 29, 2011 at 12:38, kirby urner <kirby...@gmail.com> wrote:
>> On Sun, May 29, 2011 at 5:47 AM, br...@mathorigins.com
>> <br...@mathorigins.com> wrote:
>>> Good Morning Milo and Maria (and Team):
>>> I was catching up on your emails this morning and began wondering about the
>>> mathfuture group's ability to glean meaning from your email (below).
>>
>> Nice post Moose (bruce):
>>
>> I've been reading up on so-called Egyptian Fractions pursuant to your
>> post in hopes of quickly writing a computer program to spit out the
>> Egyptian fraction for any fraction.
>
> There are many programming languages that include GCD and LCM as
> primitives, and provide rational arithmetic. I have looked at
> Mathematica and J in this regard, but there are many other options. I
> believe that NumPy has such facilities. I am sure that an Egyptian
> math Python library would be welcome.

Yeah sure, of course I know this.


But you wouldn't say to a kid: "why wire your own radio when you
can buy one at Radio Shack?"

On the contrary, in a "how things work" approach, you want to
build one from scratch, and so we define a Rational Number class,
even though Python already has one as an importable module
(minus any Egyptian Expansion, which might go off a subclass).

It's like going back to paper and pencil and asking "now how do
we add fractions again?" but then we do it in Python not just
paper and pencil (a shift in tool set), so the content and skills
are somewhat new and "more adult" (TV-14 or higher)... sometimes
demented.

Linking to Permutations (discussions re multiplication), you
get to show the same thing with now two kinds of object:
that division in terms of multiplying with the multiplicative
inverse.

Rationals Q embedded in abstract algebra with operator overloading
(__mul__) in a concrete computer language is the winning formula,
at least with some adults (some of them math teachers).

>
> At the other end of the historical scale, there is very little
> software that can handle Conway numbers and games. The basic
> arithmetic operations on binary rationals are easily programmed, but
> in more complicated cases involving infinite sets (some equivalent to
> Dedekind cuts, some defining infinities and infinitesimals) it can be
> quite difficult to find the simplest form for the result. This problem
> is discussed in Winning Ways for Your Mathematical Plays, by
> Berlekamp, Conway, and Guy.
>

Interesting.

I've been looking over the shoulders of Systems Science students as
they implement a version of Artificial Life as 18-around-1, which is
2 layers of hexagonal cells (see 'Gnomon' by Gazale). I should adapt
those rule for a hexapent (has 12 pentagons), where I've already done
something similar in VPython.

http://4dsolutions.net/ocn/life.html

They're using Ruby, with Google Sketchup the output, so all free software
(free as in beer).

http://www.flickr.com/photos/17157315@N00/5756168820/in/photostream

As for infinity, I tend to leave the Cantor branch to others, having
selected a different branch. Math is a vast tree and I'm realistic in
not being equally far along on every path forward.

I've got this Verboten Math I champion, in large degree because others
don't seem to, but also because students gravitate to subversive subjects,
like to feel inner circle based on shared sources.

>> Alas, it's not that easy.  The greedy algorithm will do the job sometimes,
>> but will get caught with its pants down giving solutions an Egyptian
>> scribe worth his salt (her salt? -- could scribes be women) would only
>> sneeze at in disgust.  "So,  you think computers are smarter than
>> we are?"
>>
>> One of the Wikipedia articles mentioned "brute force" as an option.
>
> It would be trivial to create a table for all denominators up to a
> thousand, or a million.
>

I'm not sure this can all be done with denominators.

Kirby

Maria Droujkova

unread,
May 30, 2011, 1:22:10 PM5/30/11
to mathf...@googlegroups.com
On Sun, May 29, 2011 at 5:49 PM, milo gardner <milog...@yahoo.com> wrote:
Ed,

Mathematica does not contain Egyptian fraction functions that follow the historical patterns.Mathematica uses versions of the greedy algorithm.

Ihor is organizing an event with Mathematica people on July 6th - it will be interesting to bring this issue up and ask what they think!

milo gardner

unread,
May 30, 2011, 4:08:06 PM5/30/11
to mathf...@googlegroups.com
Maria,

I'd be happy to attend. Mathematica, and its on-line quasi-math dictionary Mathworld

http://mathworld.wolfram.com/EgyptianFraction.html

 tends to follow David Eppstein's 1991 " Mathematical,Intelligencer" article that named 10  Egyptian fraction algorithms.

Note that no known algorithm solves the ancient Egyptian problem, a point made in the above Mathworld link per

"No algorithm is known for producing unit fraction representations having either a minimum number of terms or smallest possible denominator (Hoffman 1998, p. 155). However, there are a number of algorithms (including the binary remainder method, continued fraction unit fraction algorithm, generalized remainder method, greedy algorithm, reverse greedy algorithm, small multiple method, and splitting algorithm) for decomposing an arbitrary fraction into unit fractions. In 1202, Fibonacci published an algorithm for constructing unit fraction representations, and this algorithm was subsequently rediscovered by Sylvester (Hoffman 1998, p. 154; Martin 1999).":

It is true that Fibonacci's 1202 AD text includes algorithms, but not in the manner cited by Sylvester and Hoffman.

Around 1995 Kevin Brown

http://www.mathpages.com/home/kmath340/kmath340.htm

and I contacted David Epstein and together we added a small of algorithms.  None of the 15 + algorithms, all modifications of the greedy algorithm, created historical Egyptian fraction series.

What does this algorithm and Egyptian fraction discussion mean to a modern math educator?

I'd be happy to offer evidence, beyond the followings, that Egyptians understood algorithms as statements of problems, and not as solutions to problems. For example the Old Kingdom numeration system was built on a cursive algorithm

1 = 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64

that round-off  a 1/64 term.

By the Middle Kingdom, 2050 BCE the Old Kingdom binary fraction algorithm problem was solved by going outside of  the Old Kingdom numeration system by writing finite arithmetic answers. Exact Egyptian fraction series were created that added back 1/64 and portions of 1/64 as the 1925 AKHMIM WOODEN TABLE  solved a one hekat division problem by scaling it to a unity (64/64), such that an easy to read formula (rro = 320 of a hekat)

(64/64)/n = Q/64 + (5R/n)ro

example

n = 10 was used rather than citing a hin unit, also 1/10 of a hekat

The AWT scribe can be fairly translated as writing

(64/64)/10 hekat =  6/64 hekat + (20/5)ro = (4 + 2)/64 hekat + 4 ro = (1/16 + 1/32)hekat + 4ro

a form of weights and measures that relied on 2/n table conversion methods that were not based in algorithms.

Ahmes used AWT (64/64) scaling method over 60 times in 1650 BCE. A large data base is available to discuss  1/64 < n < 64, and several larger than 64 for those that are interested.

Sometime between 1550 BCE, the end of the Egyptian Middle Kingdom, and for sure after 900 AD, the ancient Egyptian method for writing unit fraction series rational number n/p

n/p(m/m) = mn/mp

was changed to an algorithm friendly context, namely a subtraction context per:

(n/p - 1/m) = (mn -p)/mp, with (mn-p) easily set to unity (1).

When (mn- p) could not be set to unity, ie, 4/13, a second subtraction step was institituted.

Mathworld suggests that J.J. Sylvester in 1891 was on the correct path by identifying a greedy algorithm, per:

"Fibonacci published an algorithm for constructing unit fraction representations, and this algorithm was subsequently rediscovered by Sylvester (Hoffman 1998, p. 154; Martin 1999).":

I'd be pleased to show that Sylvester found several algorithms in Fibonacci's 500 pages ... as translated by L.E. Sigler in 2001 ... but not in the second, third and n-step algorithmic manner, Silger's 7th distinction, that Hoffman accepted that a greedy algorithm was found. only required a second subtraction step. 

Again using 4/13, Fibonacci converted

1. step one (4/13 - 1/4) = (16-13)/52 = 3/52

2. step two (3/52 - 1/18) = (54 - 52)/936 = 1/468

3. step three 4/13 = 1/4  + 1/18 + 1/468

in a longhand style, written from right to left, the same order than Egyptians and Greeks used.

For anyone that wishes offer to Hoffman, Sylvester, and Mathematica's point of view as a valid historical greedy algorithm, please offer an example taken from a Fibonacci text.

I look forward to commenting on such an example.

Best Regards,

Milo Gardner


I


From: Maria Droujkova <drou...@gmail.com>
To: mathf...@googlegroups.com
Sent: Monday, May 30, 2011 10:22 AM

Subject: Re: [Math 2.0] 052911_Milo_AE fractions_elaborations
--
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To post to this group, send email to mathf...@googlegroups.com.
To unsubscribe from this group, send email to mathfuture+...@googlegroups.com.

kirby urner

unread,
May 30, 2011, 5:14:21 PM5/30/11
to mathf...@googlegroups.com, Steve Holden
On Mon, May 30, 2011 at 1:08 PM, milo gardner <milog...@yahoo.com> wrote:

<< snip >>
 
For anyone that wishes offer to Hoffman, Sylvester, and Mathematica's point of view as a valid historical greedy algorithm, please offer an example taken from a Fibonacci text.

I look forward to commenting on such an example.

Best Regards,

Milo Gardner




Hiya Milo, Maria et al --

This thread is fascinating as usual.  I feel like I'm just tuning in, trying to get the back story by dribs and drabs.

I just now read this article and it was helpful:


The author is up front that the greedy algorithm, while a stalwart, is hardly the best, nor is it guaranteed to produce the prettiest answer.

Indeed, the greedy algorithm does some downright ugly work, and to call the results "Egyptian fractions" is like selling BP Gulf Tar as licorice to children.

On the other hand, he thinks Egyptian fractions even the prettiest possible are a pain to work with and he's glad they've fallen by the wayside.

For my part, as a logic coach, mechanized division, I have an investment in students learning how to subclass working types, such as rational numbers, and adding capabilities.

For example, we have a primitive dictionary object, called a dict, that reliably stores key/value pairs, and sometimes we want a similar object, such that we might add a thin veneer of capability, while delegating the bulk of the "dirty work" to this pre-existing and already well understood dict object, a known quantity. [0]

Likewise, I'd like students to subclass a rational number type and doctor a subclass to spit out the greedy algorithm's results.  We could wire this up as egyptian, with the caveat that other engines could be swapped in, and that as Milo points out, we don't have an engine that's up to high Egyptian standards even yet.

>>> from unitfractions import Fraction
>>> p = Fraction(5,121)
>>> type(p)
<class 'unitfractions.Fraction'>
>>> p
Fraction(5, 121)
>>> r = p.egyptian( )  # pseudo-egyptian results of Fibonacci-published algorithm
>>> r 
(Fraction(1,25), Fraction(1,757), Fraction(1,763309), Fraction(1,873960180913), Fraction(1,1527612795642093418846225))
>>> sum(r)
Fraction(5, 121)

What this demonstrates is a pattern of delegation where we put all the stress on an existing object and just add this one method, per Fibonacci's published algorithm.

In the module docstring, we could give the above URL and remind readers that the Egyptians had better taste than to accept such as the above.

Any self respecting Egyptian scribe would have programmed egyptian to have returned:

>>> r = Fraction(5,121)
(Fraction(1, 33), Fraction(1, 121), Fraction(1, 363))

Kirby

milo gardner

unread,
May 30, 2011, 6:23:15 PM5/30/11
to mathf...@googlegroups.com
Kirby,

Thank for the link. I had not read it. It contains a long list of myths. Almost anyone that reads and analyzes the ancient texts and goes beyond transliterations summarized by Clagett in 1999

http://books.google.com/books?id=8c10QYoGa4UC&amp;pg=PA469&amp;dq=Ancient+Egyptian+Science

suspects that Erdos' modern algorithmic point:

"There are a bunch of interesting open problems involving Egyptian fractions: I'll just leave you with one example that I found on Wikipedia. Paul Erdös, the great Hungarian mathematician, tried to prove that for any fraction 4/n, there was an Egyptian fraction containing exactly three terms. Doing brute force tests, it's been shown to be true for every number n smaller than 1014, but no one has been able to figure out how to prove it."

offers a silly limitation. Why limit any rational number conversion to a unit fraction series to only 3-terms?

Historically,  4/n  rational number conversions problems were solved  as the 2/n problems were solved. Sometimes solutions were written in 2-term, 3-term, 4-term, 5-term, and seldom longer series.by finding an LCM m such that:

4/n(m/m = 4m/mn

Id be happy tyo compute 4/13, 4/53 or or 4/n conversion using the 4,000 year old rule ... that to my eyes contains few algorithm elements.

such that the divisors of mn select the best sum to 4m. Sometimes a 3-term series will result. Most often not!

Milo





From: kirby urner <kirby...@gmail.com>
To: mathf...@googlegroups.com; Steve Holden <st...@holdenweb.com>
Sent: Monday, May 30, 2011 2:14 PM

Subject: Re: [Math 2.0] 052911_Milo_AE fractions_elaborations

kirby urner

unread,
May 30, 2011, 7:45:29 PM5/30/11
to mathf...@googlegroups.com
On Mon, May 30, 2011 at 3:23 PM, milo gardner <milog...@yahoo.com> wrote:
Kirby,

Thank for the link. I had not read it. It contains a long list of myths. Almost anyone that reads and analyzes the ancient texts and goes beyond transliterations summarized by Clagett in 1999

http://books.google.com/books?id=8c10QYoGa4UC&amp;pg=PA469&amp;dq=Ancient+Egyptian+Science

suspects that Erdos' modern algorithmic point:

"There are a bunch of interesting open problems involving Egyptian fractions: I'll just leave you with one example that I found on Wikipedia. Paul Erdös, the great Hungarian mathematician, tried to prove that for any fraction 4/n, there was an Egyptian fraction containing exactly three terms. Doing brute force tests, it's been shown to be true for every number n smaller than 1014, but no one has been able to figure out how to prove it."

offers a silly limitation. Why limit any rational number conversion to a unit fraction series to only 3-terms?

Sure it's a silly limitation, but it's also a conjecture (of Erdos, not the Egyptians).  Mathematics is cock-o-block with silly limitations.

The Egyptians likely didn't have time to sit around speculating so idly.  Leisure time is a mother of higher mathematics.
 

Historically,  4/n  rational number conversions problems were solved  as the 2/n problems were solved. Sometimes solutions were written in 2-term, 3-term, 4-term, 5-term, and seldom longer series.by finding an LCM m such that:

4/n(m/m = 4m/mn

Id be happy tyo compute 4/13, 4/53 or or 4/n conversion using the 4,000 year old rule ... that to my eyes contains few algorithm elements.

Here's what the greedy algorithm gives back in these cases:


>>> from unitfractions import greedy; from fractions import Fraction

>>> greedy(Fraction(4,13))
(Fraction(1, 4), Fraction(1, 18), Fraction(1, 468))

>>> greedy(Fraction(4,53))
(Fraction(1, 14), Fraction(1, 248), Fraction(1, 92008))

Wouldn't surprise me if the ancient Egyptians had prettier answers.

What I might dwell on in my presentation of the above is how unnecessary it was to make the greedy function recursive.

Along the branches I frequent, neither "recursion" nor "infinity" have much mesmerizing power.  

We don't go into a trance just because someone says "Aleph Null" or something silly.  

More focus 'Remarks on the Foundations of Mathematics' (Wittgenstein / ethnographic) less worries about "underlying logic" (Russell / ethnocentric).

Kirby


kirby urner

unread,
May 30, 2011, 7:32:47 PM5/30/11
to mathf...@googlegroups.com, Steve Holden
On Mon, May 30, 2011 at 2:14 PM, kirby urner <kirby...@gmail.com> wrote:

Likewise, I'd like students to subclass a rational number type and doctor a subclass to spit out the greedy algorithm's results.  We could wire this up as egyptian, with the caveat that other engines could be swapped in, and that as Milo points out, we don't have an engine that's up to high Egyptian standards even yet.

>>> from unitfractions import Fraction
>>> p = Fraction(5,121)
>>> type(p)
<class 'unitfractions.Fraction'>
>>> p
Fraction(5, 121)
>>> r = p.egyptian( )  # pseudo-egyptian results of Fibonacci-published algorithm
>>> r 
(Fraction(1,25), Fraction(1,757), Fraction(1,763309), Fraction(1,873960180913), Fraction(1,1527612795642093418846225))
>>> sum(r)
Fraction(5, 121)


On second thought, I think subclassing a fractions.Fraction is overkill.  As soon
as said subclass participates in numeric relations with its fellow Fractions
(of the ordinary kind), it's going to spawn ordinary Fractions (ancestor class).  

Maintaining an entirely new type just for this one feature is not worth the effort, 
given likely arithmetic relations with peers.

Also, I'm not a huge fan of recursion where iteration is just as straightforward.
In the case of Fibonacci's greedy algorithm, there's like nothing to it:

"""
OST Skunkworks:
Pseudo-Egyptian Fractions
See:
"""

from fractions import Fraction
from math import ceil

def greedy(q):
    """return unit fraction expansion of fractions.Fraction q,
    using Fibonacci's 'greedy algorithm' -- non-recursive"""

    results = []    

    while q > 0:
        if q.numerator == 1:
            results.append(q)
            break
        x = Fraction(1,ceil(q.denominator / q.numerator))
        q = q - x
        results.append(x)                
    return tuple(results)

def _test( ):
    """
    >>> greedy(Fraction(5,121))
    (Fraction(1, 25), Fraction(1, 757), Fraction(1, 763309), Fraction(1, 873960180913), Fraction(1, 1527612795642093418846225))
    >>> greedy(Fraction(4,5))
    (Fraction(1, 2), Fraction(1, 4), Fraction(1, 20))
    >>> greedy(Fraction(9,31))
    (Fraction(1, 4), Fraction(1, 25), Fraction(1, 3100))
    >>> greedy(Fraction(21,50))
    (Fraction(1, 3), Fraction(1, 12), Fraction(1, 300))
    >>> greedy(Fraction(1023, 1024))
    (Fraction(1, 2), Fraction(1, 3), Fraction(1, 7), Fraction(1, 44), Fraction(1, 9462), Fraction(1, 373029888))
    """
    print("testing complete")

if __name__ == "__main__":
    import doctest
    doctest.testmod()    
    _test()
    
Note that I'm calling these "pseudo Egyptian" -- not claiming there's any simple
algorithmic solution that'll work best in all cases.  Computer scientists and
Milo appear to be on the same side on this one.

Kirby

milo gardner

unread,
May 31, 2011, 3:33:37 PM5/31/11
to mathf...@googlegroups.com
Kirby,

Thanks for the greedy algorithm solutions. Ahmes and other scribes would have converted

1. 4/13 by LCM 4 to 16/52 such that  (13 + 2 + 1)/52 = 1/4 + 1/26 + 1/52

2. and attempted to convert 4/53 by LCM 15 = 60/795 = (53 + 5 +  3)/795 ... a failure ... and solved 4/53 considering

3/53 by LCM 20 + 1/53 = 60/1060 + 1/53 such that (53 + 5 + 2)/1060 + 1/53 = 1/20 + 1/53 + 1/212 + 1/530

Milo


Sent: Monday, May 30, 2011 4:45 PM

Subject: Re: [Math 2.0] 052911_Milo_AE fractions_elaborations
On Mon, May 30, 2011 at 3:23 PM, milo gardner <milog...@yahoo.com> wrote:
Kirby,

Thank for the link. I had not read it. It contains a long list of myths. Almost anyone that reads and analyzes the ancient texts and goes beyond transliterations summarized by C

suspects that Erdos' modern algorithmic point:

"There are a bunch of interesting open problems involving Egyptian fractions: I'll just leave you with one example that I found on Wikipedia. Paul Erdös, the great Hungarian mathematician, tried to prove that for any fraction 4/n, there was an Egyptian fraction containing exactly three terms. Doing brute force tests, it's been shown to be true for every number n smaller than 1014, but no one has been able to figure out how to prove it."

offers a silly limitation. Why limit any rational number conversion to a unit fraction series to only 3-terms?

Sure it's a silly limitation, but it's also a conjecture (of Erdos, not the Egyptians).  Mathematics is cock-o-block with silly limitations.

The Egyptians likely didn't have time to sit around speculating so idly.  Leisure time is a mother of higher mathematics.
 

Historically,  4/n  rational number conversions problems were solved  as the 2/n problems were solved. Sometimes solutions were written in 2-term, 3-term, 4-term, 5-term, and seldom longer series.by finding an LCM m such that:

4/n(m/m = 4m/mn

Id be happy tyo compute 4/13, 4/53 or or 4/n conversion using the 4,000 year old rule ... that to my eyes contains few algorithm elements.

Here's what the greedy algorithm gives back in these cases:


>>> from unitfractions import greedy; from fractions import Fraction

>>> greedy(Fraction(4,13))
(Fraction(1, 4), Fraction(1, 18), Fraction(1, 468))

>>> greedy(Fraction(4,53))
(Fraction(1, 14), Fraction(1, 248), Fraction(1, 92008))

Wouldn't surprise me if the ancient Egyptians had prettier answers.

What I might dwell on in my presentation of the above is how unnecessary it was to make the greedy function recursive.

Along the branches I frequent, neither "recursion" nor "infinity" have much mesmerizing power.  

We don't go into a trance just because someone says "Aleph Null" or something silly.  

More focus 'Remarks on the Foundations of Mathematics' (Wittgenstein / ethnographic) less worries about "underlying logic" (Russell / ethnocentric).

Kirby


kirby urner

unread,
May 31, 2011, 4:38:18 PM5/31/11
to mathf...@googlegroups.com

Definitely much nicer solutions.

The greedy algorithm is guaranteed to produce a unit fractions solution, but it's not thereby "doing what the Egyptians did" just because they produce unit fractions too.

A matter of elementary logic to assert thus and I would think no one could effectively dispute such a point.  Certainly I wouldn't wanna waste my time in that way.

I am also going to stress, regarding the greedy algorithm, that a recursive expression is unnecessary. 

Those bewitched by recursion as somehow the be-all-end-all of anything tend to teach along other tracks, not that I don't use recursion sometimes.

Those seeking the one true foundation of all mathematics lack philosophical maturity in my view.

Kirby


On Tue, May 31, 2011 at 12:33 PM, milo gardner <milog...@yahoo.com> wrote:
Kirby,

milo gardner

unread,
May 31, 2011, 5:11:49 PM5/31/11
to mathf...@googlegroups.com
Kirby,

Agreed. There is not one true mathematics. Each form of math plays a central role in solving one class of ancient or modern problem.

Oh, BTW, Ahmes may have considered

4/53 converted by LCM 14 such that 56/742 such that (53 + 2 + 1)/742 = 1/14 + 1/371 +  1/742

a nice 3-term series ala Erdos ...

with Ahmes likely selecting 4/53 = 1/20 + 1/53 + 1/212 + 1/530

based on the smaller 1/530 last term.

Milo

Sent: Tuesday, May 31, 2011 1:38 PM
Subject: Re: [Math 2.0] 052911_Milo_AE fractions_elaborations, 4/13 and 4/53

Reply all
Reply to author
Forward
0 new messages