V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
est
V2EX  ›  分享发现

Donald Knuth 从巴比伦泥板 锲形文字里发现了一个古老的算法

  •  
  •   est · 2018-06-05 07:25:27 +08:00 · 2207 次点击
    这是一个创建于 2184 天前的主题,其中的信息可能已经有所发展或是发生改变。
    http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf


    A (rectangular) cistern.
    The height is 3,20, and a volume of 27,46,40 has been
    excavated.
    The length exceeds the width by 50. (The object is to find the
    length and the width.)
    You should take the reciprocal of the height, 3,20, obtaining 18.
    Multiply this by the volume, 27,46,40, obtaining 8,20. (This
    is the length times the width; the problem has been reduced
    to finding x and y, given that x -- y = 50 and xy = 8,20.
    A standard procedure for solving such equations, which
    occurs repeatedly in Babylonian manuscripts, is now used.)
    Take half of 50 and square it, obtaining 10, 25.
    Add 8,20, and you get 8,30, 25. (Remember that the radix point
    position always needs to be supplied. In this case, 50 stands
    for 5/6 and 8,20 stands for 8], taking into account the
    sizes of typical cisterns!)
    The square root is 2,55.
    Make two copies of this, adding (25) to the one and subtracting
    from the other.
    You find that 3,20 (namely 3-~) is the length and 2,30 (namely
    2½) is the width.
    This is the procedure.


    简单翻译一下,注意古巴比伦用的是 60 进制。这里每位数之间用半角逗号分隔。

    一个装水的容器,高 3,20,一共装了 27,46,40 这么多水。
    已知长 比 宽 多出 50,求长宽各是多少。。。
    9 条回复    2018-06-06 10:07:04 +08:00
    wjm2038
        1
    wjm2038  
       2018-06-05 08:08:26 +08:00 via Android
    这答案都不对啊
    jjianwen68
        2
    jjianwen68  
       2018-06-05 08:10:43 +08:00 via Android
    60 进制?是不是太蛋疼了
    wjm2038
        3
    wjm2038  
       2018-06-05 08:11:29 +08:00
    如果是 60 进制 200*150*200=60000
    27*3600+46*60+40=100000
    xiaket
        4
    xiaket  
       2018-06-05 08:15:56 +08:00
    aka 一元二次方程在特殊条件下的解:

    ( (x - y) / 2 ) ** 2 + x*y == ( (x + y) / 2 ) ** 2, 算出 x 和 y 的平均值后就简单了
    xiaket
        5
    xiaket  
       2018-06-05 08:17:04 +08:00
    `base10 = lambda x: sum((60**(x.count(",") - i) * int(d)) for i,d in enumerate(x.split(",")))`

    方便熟悉 py 的同学玩, 不过真的不需要
    est
        6
    est  
    OP
       2018-06-05 08:38:44 +08:00
    @wjm2038 怎么不对。。。

    长宽高:
    250 x 200 x 200 == 100000
    3,20 x 2,30 x 3,20 == 27,46,40
    wjm2038
        7
    wjm2038  
       2018-06-05 08:42:09 +08:00
    @est #6 哪里来的 250... 3*60+20 不是 200 么
    est
        8
    est  
    OP
       2018-06-05 09:54:39 +08:00
    @wjm2038 啊哈哈,的确算错了。
    iceheart
        9
    iceheart  
       2018-06-06 10:07:04 +08:00 via Android
    x*(x+50)*3,20=27,46,40
    x*(x+50)=27,46,40/3,20
    x*(x+50)=100000/200
    x*(x+50)=500
    (x+25)^2=500+625
    x=sqrt(1125)-25
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5224 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:46 · PVG 16:46 · LAX 01:46 · JFK 04:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.