```埃及分数```
Egyptian Fractions (2006)

原始链接: https://blog.plover.com/math/egyptian-fractions.html

阿梅斯纸草文书是一份古埃及数学文献,其中包含了一张详尽的单位分数和表,用于表示 $\frac{2}{n}$($n$ 为奇数)的形式。由于古埃及人将分数限制为互不相同的单位分数之和(即“埃及分数”表示法),因此表达任意有理数变得十分复杂。 尽管“贪心算法”可以生成这些表示法,但往往会产生繁琐的结果。作者认为,$\frac{2}{n}$ 表是解决所有除法问题的万能钥匙。通过采用类似于埃及乘法运算的二进制分解法,并利用 $\frac{2}{n}$ 表来处理重复的单位分数,任何分数都可以通过系统化的机械过程计算出来。 这种方法解释了为什么该纸草文书只侧重于 $\frac{2}{n}$ 表而非其他表格:一旦抄写员掌握了这张特定的表,他们就能将任何除法问题简化为一系列可控的迭代步骤。这种方法反映了埃及人通过倍增和二进制分解的实践,将复杂的除法转变为一种可靠但枯燥的算法任务。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 埃及分数 (plover.com) 63 点,由 luu 发布于 8 小时前 | 隐藏 | 过往 | 收藏 | 1 条评论 帮助 hilsdev 39 分钟前 | 下一条 [–] 很酷,这也是我一直很好奇的事情(关于早期表示法中涉及的土木工程和数学)。但我想要了解这种记号背后的逻辑。我假设这背后存在一套将绳子折叠成等分段的系统,从而衍生出了这套分数数学,我很希望能得到相关的 YouTube 视频或其他推荐。 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文

Egyptian Fractions
The Ahmes papyrus is one of the very oldest extant mathematical documents. It was written around 3800 years ago. As I mentioned recently, a large part of it is a table of the values of fractions of the form !!\frac 2n!! for odd integers !!n!!. The Egyptians, at least at that time, did not have a generalized fraction notation. They would write fractions of the form !!\frac 1n!!, and they could write sums of these. But convention dictated that they could not use the same unit fraction more than once. So to express !!\frac 35!! they would have needed to write something like !!\frac 12 + \frac{1}{10}!!, which from now on I will abbreviate as !![2, 10]!!. (They also had a special notation for !!\frac 23!!, but I will ignore that for a while.) Expressing arbitrary fractions in this form can be done, but it is non-trivial.

A simple algorithm for calculating this so-called "Egyptian fraction representation" is the greedy algorithm: To represent !!\frac nd!!, find the largest unit fraction !!\frac 1a!! that is less than !!\frac nd!!. Calculate a representation for !!\frac nd -\frac 1a!!, and append !!\frac 1a!!. This always works, but it doesn't always work well. For example, let's use the greedy algorithm to find a representation for !!\frac 29!!. The largest unit fraction less than !!\frac 29!! is !!\frac 15!!, and !!\frac 29 - \frac 15 = \frac{1}{45}!!, so we get !!\frac 29 = \frac 15 + \frac{1}{45} = [5, 45]!!. But it also happens that !!\frac 29 = [6, 18]!!, which is much more convenient to calculate with because the numbers are smaller. Similarly, for !!\frac{19}{20}!! the greedy algorithm produces $$\begin{align} \frac{19}{20} & = [2] + \frac{9}{20}\\\\ & = [2, 3] + \frac{7}{60} \\\\ & = [2, 3, 9, 180]. \end{align}$$ But even !!\frac{7}{60}!! can be more simply written than as !![9, 180]!!; it's also !![10, 60], [12, 30]!!, and, best of all, !![15, 20]!!.

So similarly, for !!\frac 37!! this time, the greedy methods gives us !!\frac 37 = \frac 13 + \frac{2}{21}!!, and that !!\frac{2}{21}!! can be expanded by the greedy method as !![11, 231]!!, so !!\frac 37 = [3, 11, 231]!!. But even !!\frac{2}{21}!! has better expansions: it's also !![12, 84], [14, 42],!! and, best of all, !![15, 35],!! so !!\frac 37 = [3, 15, 35]!!. But better than all of these is !!\frac 37 = [4, 7, 28]!!, which is optimal.

Anyway, while I was tinkering with all this, I got an answer to a question I had been wondering about for years, which is: why did Ahmes come up with a table of representations of fractions of the form !!\frac 2n!!, rather than the representations of all possible quotients? Was there a table somewhere else, now lost, of representations of fractions of the form !!\frac 3n!!?

The answer, I think, is "probably not"; here's why I think so.

Suppose you want !!\frac 37!!. But !!\frac 37 = \frac 27 + \frac 17!!. You look up !!\frac 27!! in the table and find that !!\frac 27 = [4, 28]!!. So !!\frac 37 = [4, 7, 28]!!. Done.

OK, suppose you want !!\frac 47!!. You look up !!\frac 27!! in the table and find that !!\frac 27 = [4, 28]!!. So !!\frac 47 = [4, 4, 28, 28] = [2, 14]!!. Done.

Similarly, !!\frac 57 = [2, 7, 14]!!. Done.

To calculate !!\frac 67!!, you first calculate !!\frac 37!!, which is !![4, 7, 28]!!. Then you double !!\frac 37!!, and get !!\frac 67 = \frac 12 + \frac 27 + \frac{1}{14}!!. Now you look up !!\frac 27!! in the table and get !!\frac 27 = [4, 28]!!, so !!\frac 67 = [2, 4, 14, 28]!!. Whether this is optimal or not is open to argument. It's longer than !![2, 3, 42]!!, but on the other hand the denominators are smaller.

Anyway, the table of !!\frac 2n!! is all you need to produce Egyptian representations of arbitrary rational numbers. The algorithm in general is:

  • To sum up two Egyptian fractions, just concatenate their representations. There may now be unit fractions that appear twice, which is illegal. If a pair of such fractions have an even denominator, they can be eliminated using the rule that !!\frac 1{2n} + \frac 1{2n} = \frac 1n!!. Otherwise, the denominator is odd, and you can look the numbers up in the !!\frac 2n!! table and replace the matched pair with the result from the table lookup. Repeat until no pairs remain.
  • To double an Egyptian fraction, add it to itself as per the previous.
  • To calculate !!\frac ab!!, when !!a = 2k!!, first calculate !!\frac kb!! and then double it as per the previous.
  • To calculate !!\frac ab!! when !!a!! is odd, first calculate !!\frac{a-1}{b}!! as per the previous; then add !!\frac 1b!!.
So let's calculate the Egyptian fraction representation of !!\frac{19}{20}!! by this method:
  • !!\frac{19}{20} = \frac{18}{20} + \frac{1}{20}!!
  • !!\frac{19}{20} = \frac{9}{10} + \frac{1}{20}!!
    • !!\frac{9}{10} = \frac{8}{10} + \frac{1}{10}!!
    • !!\frac{9}{10} = \frac 45 + \frac{1}{10}!!
      • !!\frac 45 = \frac 25 + \frac 25!!
        • !!\frac 25 = [3, 15]!! (from the table)
      • !!\frac 45 = [3, 3, 15, 15]!!
      • !!\frac 45 = \frac 23 + \frac{2}{15}!!
        • !!\frac 23 = [2, 6]!! (from the table)
        • !!\frac{2}{15} = [12, 20]!! (from the table)
      • !!\frac 45 = [2, 6, 12, 20]!!
    • !!\frac{9}{10} = [2, 6, 10, 12, 20] !!
  • !!\frac{19}{20} = [2, 6, 10, 12, 20, 20] !!
  • !!\frac{19}{20} = [2, 6, 10, 10, 12] !!
  • !!\frac{19}{20} = [2, 5, 6, 12] !!
(The Egyptians would have been happy with !!\frac 23!! in the middle step there, and would have ended up with !!\frac{19}{20} = \frac 23 + [5, 12]!!.) Our final result is suboptimal; to fix it, we need to notice that !![6, 12] = [4]!! and get !!\frac{19}{20} = [2, 4, 5]!!. But even without this, the final result is pretty good, and required no understanding or tricky reasoning; just a lot of grinding.

An alternative algorithm is to expand the numerator as a sum of powers of !!2!!, which the Egyptians certainly knew how to do. For !!\frac{19}{20}!! this gives us $$\frac{19}{20} = \frac{16}{20} + \frac{2}{20} + \frac{1}{20} = \frac 45 + [10, 20].$$ Now we need to figure out !!\frac 45!!, which we do as above, getting !!\frac 45 = [2, 6, 12, 20]!!, or !!\frac 45 = \frac 23 + [12, 20]!! if we are Egyptian, or !!\frac 45 = [2, 4, 20]!! if we are clever. Supposing we are neither, we have $$\begin{align} \frac{19}{20} & = [2, 6, 12, 20, 10, 20] \\\\ & = [2, 6, 12, 10, 10] \\\\ &= [2, 6, 12, 5] \\\\ \end{align}$$ as before.

(It is not clear to me, by the way, that either of these algorithms is guaranteed to terminate. I need to think about it some more.)

Getting the table of good-quality representations of !!\frac 2n!! is not trivial, and requires searching, number theory, and some trial and error. It's not at all clear that !!\frac{2}{105} = [90, 126]!!.

Once you have the table of !!\frac 2n!!, however, you can grind out the answer to any division problem. This might be time-consuming, but it's nevertheless trivial. So Ahmes needed a table of !!\frac 2n!!, but once he had it, he didn't need any other tables.

20260317

More about this.

20260617

I didn't realize it at the time, but the algorithm I hypothesized above really is very much like how the Egyptians did multiplication! I suggested, essentially, that for something like !!\frac{19}{20}!! they would expand the !!19!! in binary and then use doubling and adding !!1!! to build up the result from even multiples of !!\frac1{20}!!. And actually, the Egyptians normally multiplied using binary! To do !!21\times23!! they would expand !!19=16+4 + 1!! and then compute !!16\times 23 + 4\times 23 + 23!!.

I wrote this up in some detail in a new article.

[Other articles in category /math] permanent link


联系我们 contact @ memedata.com