V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
est

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

  •  
  •   est · Jun 5, 2018 · 2598 views
    This topic created in 2889 days ago, the information mentioned may be changed or developed.
    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 replies    2018-06-06 10:07:04 +08:00
    wjm2038
        1
    wjm2038  
       Jun 5, 2018 via Android
    这答案都不对啊
    jjianwen68
        2
    jjianwen68  
       Jun 5, 2018 via Android
    60 进制?是不是太蛋疼了
    wjm2038
        3
    wjm2038  
       Jun 5, 2018
    如果是 60 进制 200*150*200=60000
    27*3600+46*60+40=100000
    xiaket
        4
    xiaket  
       Jun 5, 2018
    aka 一元二次方程在特殊条件下的解:

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

    方便熟悉 py 的同学玩, 不过真的不需要
    est
        6
    est  
    OP
       Jun 5, 2018
    @wjm2038 怎么不对。。。

    长宽高:
    250 x 200 x 200 == 100000
    3,20 x 2,30 x 3,20 == 27,46,40
    wjm2038
        7
    wjm2038  
       Jun 5, 2018
    @est #6 哪里来的 250... 3*60+20 不是 200 么
    est
        8
    est  
    OP
       Jun 5, 2018
    @wjm2038 啊哈哈,的确算错了。
    iceheart
        9
    iceheart  
       Jun 6, 2018 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1281 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 16:52 · PVG 00:52 · LAX 09:52 · JFK 12:52
    ♥ Do have faith in what you're doing.