Talk:Greedy algorithm for Egyptian fractions

From Rosetta Code

Still incorrect as is

I added incorrect tags on both REXX and Perl 6 solutions earlier, then RC went offline before I could post in this talk page. Although now the incorrect tags are removed and description changed to allow an integer in front of the expansion, it's still a cop-out. There should not be an integer term, because any rational number, whether larger than 1 or not, can be represented as a proper sum of unit fractions. In fact, it's dubious to even allow 1/1 as a term in the expansion.

The current solutions can be defended as "they match the task description", but it's better to do things right, instead of fudging the task requirement to suit existing examples. --Ledrug (talk) 17:43, 3 April 2014 (UTC)

Any whole number can be expressed as a sum of 1/1 fractions, or even a vary large number of unit fractions, but that would be become voluminous with even moderate integers.   The whole number part of an improper fraction (as noted in the task) are to be expressed as integers, and leave the proper fraction part to be expressed as Egyptian fractions.   Egyptian fractions don't use unity as a denominator in any case, and also, Egyptian fractions must have unique denominators, so that rules out multiple 1/1 unit fractions.   The inclusion of the newest part of the task wasn't meant to be a cop-out, but a practical solution to address improper fractions when expressing them in conjunction with Egyptian fractions.   I read very long ago that this is the manner in which the Egyptians handled improper (or vulgar) fractions, an obvious and necessary preliminary first step.   Whether or not that is thought of as a work-around, it wasn't made up just to suit existing examples, as the programming solutions were in keeping with the task's requirements.   Almost all descriptions of Egyptian fractions today (from what I've viewed online) seem to assume that Egyptian fractions deal with proper fractions, and indeed, every example illustrates that assumption.   Whether or not that's true, I haven't seen an example showing an Egyptian fraction example for an improper fraction.   Furthermore, in all of the online calculators that convert a fraction (in particular, an improper fraction) to an Egyptian fraction, the whole part (integer) of the fraction is just shown as a simple integer followed by the Egyptian fractions, each separated by a plus sign.   One reason I chose to have the whole (integer) part expressed in some manner to distinguish the whole part is that I envisioned somebody rebelling against expression the unit fractions as 1/n;   some people use different notations:   for instance,   8/11   as   [2, 5, 37, 4070]   -- most of the time without the blanks after the commas.   In such a case, the (whole) integer part would need a special notation to make it clearly distinguishable from the other integers. -- Gerard Schildberger (talk) 18:47, 3 April 2014 (UTC)
You are using an "Egyption expansion" that's not an Egyption expansion at all because it's more convenient, which is what "cop-out" is. If nobody talks about using Egyption expansion on numbers greater than 1, then you can simply exclude it in this task; if you still want to see the expansion of larger fractions, then do it right. Let me say it again: any (positive) rational number can be expressed as the sum of a finite set of distinct unit fractions, so you don't need to choose a half solution. I don't care if the integer part is written in a different style or what not, since it's not there to begin with. And making up something to "prevent someone from rebelling" simply sounds narrow-minded. --Ledrug (talk) 19:05, 3 April 2014 (UTC)