跳转到内容

传统算盘与珠算/开方

来自维基教科书,开放的书籍,开放的世界
卡吉尔·吉尔顿·诺特

求平方根和立方根是元素算术中最复杂的操作。东方算盘非常适合通过直接有效的方法求平方根,但不幸的是,对于立方根来说,情况并非如此,虽然可能,但需要一个曲折的路径,充满了来回,容易出错。

卡吉尔·吉尔顿·诺特 (1856 - 1922),现代地震学的奠基人之一,是一位苏格兰物理学家和数学家,曾担任东京帝国大学数学、声学和电磁学教授九年;之后,他在 1891 年被明治天皇授予旭日勋章。他在日本期间接触了日本算盘,并对其进行了深入研究,毫无疑问,他将其作为一名教师和研究员在自己的工作中进行了专业运用。这项研究的结果是一篇著名的 55 页文章[1],于 1885 年发表,长期以来一直是英文中最有见地的关于算盘历史和基础的著作,也是必不可少的参考书。本书接下来的两章发展和扩展了诺特对传统开平方根和立方根方法的看法,这是西方科学家和数学家的看法,提供了理论和实践方法,并用几个例子进行说明。

本书的这一部分包含以下章节

检查你的练习

[编辑 | 编辑源代码]

用算盘求平方根和立方根可能是一个相当漫长的过程,在学习阶段,有一个工具可以让我们控制是否做对了,这一点很有趣。

平方根

[编辑 | 编辑源代码]

对于平方根,你可以尝试优秀的村田的用奇偶法求平方根的教程,这是一个 JavaScript 应用程序,你可以直接在你的浏览器中运行,也可以从它的GitHub 存储库下载到你的电脑。你只需要在左侧的小输入框中输入根,然后反复按下屏幕上的“下一步”按钮,就可以看到一步一步的过程发展。

立方根

[编辑 | 编辑源代码]

文件 knott.bc

[编辑 | 编辑源代码]

主要是对于立方根,以下BC 代码可能会有所帮助,复制并粘贴到一个文本文件中,并将其命名为 knott.bc

/*
   Functions to help to learn/verify square and cube roots a la Knott
   with the abacus, soroban, suanpan.

   See: https://jccabacus.blogspot.com/2021/06/roots-la-knott.html
   as a reference.

   Jesús Cabrera, June 2021
   CC0 1.0 Universal (CC0 1.0) Public Domain Dedication

   Use at your oun risk!
*/

define int(x) 
{

# Integer part of x

    auto os,r
    os=scale; scale=0
    r=x/1
    scale= os
    return (r)
}

define cbrt(x)
{

# Cube root of x

    return (e(l(x)/3))
}

define knott2(r0, y0, alpha)
{

/*
    Square root following Cargill G. Knott steps

    See example of use in file sr200703.bc
        use: $ sr200703.bc |bc -l knott.bc
*/
    auto so, div
    
    so = scale; /* Store old scale value */
    scale = 1

    a = 10*y0
    div = 100*r0 + alpha/2
    print "New dividend: ",div/1,"\n"
    b = int(div/(a))
    tf = div -b*a -b^2/2
    if (tf<0){
        b=b-1;print "Revising down, b = ",b, "\n"
        tf = div -b*a -b^2/2
    }
    print "New root: ", a+b,", New half-remainder: ", tf/1
    print "\n==================\n\n"
    scale = so; /* restore old scale value */

    return
}


define knott3(r0, y0, alpha)
{

/*
    Cube root following Cargill G. Knott steps

    See example of use in file cr488931400152.bc
        use: $ cat cr488931400152.bc |bc -l knott.bc

*/
    auto so, div, ta, tb, tc, td, te
    
    so = scale; /* Store old scale value */
    scale = 0

    a = 10*y0
    div = 1000*r0 + alpha
    print "New dividend: ",div,"\n\n"

    ta = div/y0; rem1 = div % y0
    print "a) /a:   ", ta, "   rem1: ", rem1, "\n"
    tb = (10*ta)/3; rem2 = (10*ta) % 3
    print "b) /3:   ", tb, "   rem2: ", rem2, "\n"
    b = tb/(100*a)
    print "     b = ",b,"\n"
    tc = tb - b*(a+b)*100
    print "d)   :   ",tc,"\n"
    b = tb/(100*(a+b))
    print "     b = ",b,"\n"
    tc = tb - b*(a+b)*100
    print "d)   :   ",tc,"\n"
    if(b==10){ 
    /* Trick to avoid some problems */
        b = 9
        print "b: ",b,"\n"
        tc = tb - b*(a+b)*100
        print "d) tc:   ",tc,"\n"
    }
    td = tc*3 +rem2
    print "e) *3:   ",td,"\n"
    te = (td/10)*y0 +rem1
    print "f) *a:   ",te,"\n"
    tf = te - b^3
    print "g) -b^3: ",tf,"\n"
    print "\nNew root: ",(a+b)," New remainder: ",tf,"\n\n"
    print "==================\n\n"
    scale = so; /* restore old scale value */

    return
}

文件: sr200703.bc

[编辑 | 编辑源代码]
/* 
    Example: square root of 200703 
    
        Use:
        $ cat sr200703.bc |bc -l knott.bc
    or
        $ bc -l knott.bc < sr200703.bc
*/

print "\nSquare root of ", 200703, " = ", sqrt(200703), "\n\n"

/* 
    Decompose in pairs of digits (will be alpha): 20, 07, 03 


    Initialize (first step)
*/
alpha = 20
    b = int(sqrt(alpha))
    r0 = alpha - b^2
    a = 0
    tf = r0/2
    print "First root: ", b, ", First half-remainder: ", tf, "\n"
    print "==================\n\n"

/*  
    Main:
        Repeat for each pair of digits (alpha)...
*/

alpha =07
    mute=knott2(tf, a+b, alpha)
alpha =03
    mute=knott2(tf, a+b, alpha)
/*
    For additional digits continue with alpha = 00
*/
alpha =00
    mute=knott2(tf, a+b, alpha)
alpha =00
    mute=knott2(tf, a+b, alpha)
alpha =00
    mute=knott2(tf, a+b, alpha)
alpha =00
    mute=knott2(tf, a+b, alpha)

输出

Square root of 200703 = 447.99888392718122931160

First root: 4, First half-remainder: 2.00000000000000000000
==================

New dividend: 203.5
Revising down, b = 4
New root: 44, New half-remainder: 35.5
==================

New dividend: 3551.5
Revising down, b = 7
New root: 447, New half-remainder: 447.0
==================

New dividend: 44700.0
Revising down, b = 9
New root: 4479, New half-remainder: 4429.5
==================

New dividend: 442950.0
New root: 44799, New half-remainder: 39799.5
==================

New dividend: 3979950.0
New root: 447998, New half-remainder: 395998.0
==================

New dividend: 39599800.0
New root: 4479988, New half-remainder: 3759928.0
==================

文件 cr488931400152.bc

[编辑 | 编辑源代码]
/*
    Example: cube root of 488931400152
    
    Use:
        $ cat cr488931400152.bc |bc -l knott.bc
    or
        $ bc -l knott.bc < cr488931400152.bc
*/

print "\nCube root of ", 488931400152, " = ", cbrt(488931400152), "\n\n"

/*
    Decompose in triplets (will be alpha): #   488, 931, 400, 152 

    Initialize (first step)
*/

alpha = 488
    b = int(cbrt(alpha))
    r0 = alpha - b^3
    a = 0
    tf = r0
    print "First root: ", b, ", First remainder: ", r0, "\n"
    print "==================\n\n"

/*
    Main: 
        Repeat for each triplet (alpha)...
*/

alpha = 931
    mute = knott3(tf, a+b, alpha)
alpha = 400
    mute = knott3(tf, a+b, alpha)
alpha = 152
    mute = knott3(tf, a+b, alpha)

/*
    For additional digits continue with alpha = 000
*/

输出

Cube root of 488931400152 = 7877.99999999999999999871

First root: 7, First remainder: 145
==================

New dividend: 145931

a) /a:   20847   rem1: 2
b) /3:   69490   rem2: 0
     b = 9
d)   :   -1610
     b = 8
d)   :   7090
e) *3:   21270
f) *a:   14891
g) -b^3: 14379

New root: 78 New remainder: 14379

==================

New dividend: 14379400

a) /a:   184351   rem1: 22
b) /3:   614503   rem2: 1
     b = 7
d)   :   63603
     b = 7
d)   :   63603
e) *3:   190810
f) *a:   1488340
g) -b^3: 1487997

New root: 787 New remainder: 1487997

==================

New dividend: 1487997152

a) /a:   1890720   rem1: 512
b) /3:   6302400   rem2: 0
     b = 8
d)   :   0
     b = 8
d)   :   0
e) *3:   0
f) *a:   512
g) -b^3: 0

New root: 7878 New remainder: 0

==================

参考文献

[编辑 | 编辑源代码]
  1. Knott, Cargill G. (1886), "算盘,从历史和科学的角度", 日本亚洲学会会刊, 14: 18–73


下一页: 开方/平方根 | 上一页: 乘法
首页: 传统算盘与珠算
华夏公益教科书