5D Library › 玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量 · English

第六章 王室腕尺、比例法则与证据

身体单位与比例法则

腕尺是从肘到指尖的长度,是最古老的身体单位之一。古埃及把它标准化为「王室腕尺」:七掌,每掌四指,共 28 指;普通腕尺为六掌、24 指。现存的王室腕尺尺杆长约 523.5 至 529.2 毫米 (Wikipedia contributors, n.d.)。罗马的维特鲁威在《建筑十书》中以人体比例说明神庙各部分的比例 (Vitruvius, n.d.)。比例法则是一组理想比值,它与个人身体的关系是什么?

推导

# Chapter 6. p11: Body units, the royal cubit and canons of proportion.
# A cubit is a body-derived unit: elbow to fingertip. Illustrative
# population: forearm cubit mean 46.0 cm, coefficient of variation
# 0.05. Egypt standardised a "royal cubit" of 7 palms of 4 fingers
# (28 fingers); surviving rods range from 523.5 to 529.2 mm, and we
# take 52.4 cm as an illustrative standard length.
# A canon of proportion states ideal ratios, for example height equal
# to four cubits. If a person's height / cubit ratio is 4 x exp(e),
# e normal with sd s, the share of people within 2 % of the canon is
# P(|e| < ln 1.02); five independent canonical ratios at once take
# that share to the fifth power. Last, the error of a wall of 100
# cubits measured (a) by one person's forearm, (b) by twenty workers
# five cubits each with their own forearms, (c) by a standard rod
# with 0.2 % error.
import math

def phi(x):
    return 0.5 * (1 + math.erf(x / math.sqrt(2)))

if __name__ == "__main__":
    print("   surviving rods 523.5 to 529.2 mm; taken here as 52.4 cm")
    print("   royal cubit 52.4 cm: palm {:.3f} cm, finger {:.3f} cm".format(
        52.4 / 7, 52.4 / 28))
    print("\n   sd of log ratio   share within 2 %   five ratios at once")
    for s in (0.02, 0.03, 0.05):
        p = 2 * phi(math.log(1.02) / s) - 1
        print("   {:15.2f} {:18.4f} {:21.5f}".format(s, p, p ** 5))
    one = 100 * 46.0 * 0.05
    many = math.sqrt(20) * 5 * 46.0 * 0.05
    rod = 100 * 52.4 * 0.002
    print("\n   wall of 100 cubits, sd of measured length:")
    print("   one person's forearm     {:6.1f} cm".format(one))
    print("   twenty workers' forearms {:6.1f} cm".format(many))
    print("   standard rod             {:6.1f} cm".format(rod))
    print("\nReading: a canon of proportion describes no actual body:")
    print("with ordinary variation, about half the people meet one")
    print("canonical ratio and only a few percent meet five. That is")
    print("why ancient builders replaced the body with a rod: a unit is")
    print("useful because it is the same for everyone, which a body is")
    print("not.")
#    surviving rods 523.5 to 529.2 mm; taken here as 52.4 cm
#    royal cubit 52.4 cm: palm 7.486 cm, finger 1.871 cm
#
#    sd of log ratio   share within 2 %   five ratios at once
#               0.02             0.6779               0.14315
#               0.03             0.4908               0.02848
#               0.05             0.3079               0.00277
#
#    wall of 100 cubits, sd of measured length:
#    one person's forearm      230.0 cm
#    twenty workers' forearms   51.4 cm
#    standard rod               10.5 cm
#
# Reading: a canon of proportion describes no actual body:
# with ordinary variation, about half the people meet one
# canonical ratio and only a few percent meet five. That is
# why ancient builders replaced the body with a rod: a unit is
# useful because it is the same for everyone, which a body is
# not.

本书取 52.4 厘米为王室腕尺的示意长度,一掌为 7.486 厘米,一指为 1.871 厘米。若身高与腕尺之比的对数标准差为 0.03,只有 0.4908 的人在法则比值的 2% 以内,五个比值同时符合的只有 0.02848。用个人前臂量一道 100 腕尺的墙,标准差为 230.0 厘米;二十名工人各量五腕尺,为 51.4 厘米;用误差 0.2% 的标准尺杆,只有 10.5 厘米。比例法则描述的是约定,不是任何一个真实的身体;单位之所以有用,正因为它对每个人都一样,而身体不是。

满意客户能证明多少

「客户说很准」是术数服务最常见的证据。程序用贝叶斯因子计算它的分量:笼统的预测(「今年工作有变化」)即使方法无效也有 0.75 的机会应验,有效时为 0.80;具体的预测(「三月至五月间搬家」)无效时只有 0.10,有效时为 0.40。

推导

# Chapter 6. p12: What do satisfied clients prove? A Bayes factor.
# A reading "hits" if the client later says it came true. Two kinds of
# prediction:
#   vague ("a change at work this year"): a hit with chance 0.80 if the
#     method is valid and 0.75 if it is not (such things happen anyway);
#   specific ("a move of home between March and May"): 0.40 if valid,
#     0.10 if not.
# Starting from even odds, the posterior probability that the method
# is valid after n hits in n readings is computed exactly. Then the
# selection of testimonials: if clients with a hit reply with chance
# 0.6 and others with chance 0.2, the reported hit rate of a method
# with true hit rate h is 0.6 h / (0.6 h + 0.2 (1 - h)).

def posterior(n, pv, pi, prior=0.5):
    odds = prior / (1 - prior) * (pv / pi) ** n
    return odds / (1 + odds)

if __name__ == "__main__":
    print("   hits in a row   vague predictions   specific predictions")
    for n in (1, 5, 10, 20):
        print("   {:13d} {:19.4f} {:22.4f}".format(
            n, posterior(n, 0.80, 0.75), posterior(n, 0.40, 0.10)))
    print("\n   Bayes factor per hit: vague {:.4f}, specific {:.1f}".format(
        0.80 / 0.75, 0.40 / 0.10))
    print("\n   true hit rate   reported in testimonials")
    for h in (0.10, 0.40, 0.75):
        print("   {:13.2f} {:26.4f}".format(
            h, 0.6 * h / (0.6 * h + 0.2 * (1 - h))))
    print("\nReading: twenty vague hits in a row lift even odds only to")
    print("0.7843, because vague events happen anyway; five specific")
    print("hits reach 0.9990. Testimonials add a second filter: a")
    print("method that hits three times in four is reported as hitting")
    print("nine times in ten.")
#    hits in a row   vague predictions   specific predictions
#                1              0.5161                 0.8000
#                5              0.5800                 0.9990
#               10              0.6560                 1.0000
#               20              0.7843                 1.0000
#
#    Bayes factor per hit: vague 1.0667, specific 4.0
#
#    true hit rate   reported in testimonials
#             0.10                     0.2500
#             0.40                     0.6667
#             0.75                     0.9000
#
# Reading: twenty vague hits in a row lift even odds only to
# 0.7843, because vague events happen anyway; five specific
# hits reach 0.9990. Testimonials add a second filter: a
# method that hits three times in four is reported as hitting
# nine times in ten.

每次笼统的应验,贝叶斯因子只有 1.0667;从对等的先验出发,连续 20 次笼统应验也只把方法有效的概率提高到 0.7843。每次具体的应验,贝叶斯因子为 4.0,连续 5 次就达到 0.9990。见证还经过第二道筛选:若应验的客户以 0.6 的概率写评价、未应验者以 0.2 的概率写,真实命中率 0.75 的方法在见证中显示为 0.9000,命中率 0.10 的方法显示为 0.2500。

街道朝向制造的「格局效应」

第二章说明,格局由山星与向星的飞行方向决定,因而与坐向绑在一起;而坐向在城市中并不是随机的。程序设一座南北向棋盘格的城市:坐子(向南)的房子占 0.4,坐午、卯、酉的各占 0.2;结局与飞星完全无关,只是向南的房子因采光与街道条件高出 0.2 个标准差。九运中,坐子与坐卯为双星会坐,坐午与坐酉为双星会向。

推导

# Chapter 6. p13: A chart "effect" made by the street grid.
# Period 9 houses (built from 2024) have only two classes: shuang xing
# hui xiang and shuang xing hui zuo (p02). Take a city on a north-south
# grid, where houses sit at zi (facing south) with share 0.4 and at wu,
# mao and you with 0.2 each. Let the outcome (say, a standardised
# household measure) have NO chart effect at all, but be 0.2 sd higher
# for south-facing houses (light, street layout). The program
#   1. lists the class of each grid mountain in period 9;
#   2. simulates 20,000 houses and compares the two classes naively and
#      within facing (stratified);
#   3. gives the sample size for a true 0.1 sd effect with the classes'
#      shares, and the Bonferroni level when 4 classes x 5 outcomes x
#      9 periods are all tested.
import math
import random

LOSHU = {"SE": 4, "S": 9, "SW": 2, "E": 3, "C": 5, "W": 7,
         "NE": 8, "N": 1, "NW": 6}
PALACE_OF = {v: k for k, v in LOSHU.items()}
PATH = ["C", "NW", "W", "NE", "S", "N", "SW", "E", "SE"]
OPP = {"N": "S", "S": "N", "E": "W", "W": "E", "NE": "SW", "SW": "NE",
       "NW": "SE", "SE": "NW"}
PAL_ORDER = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]
MOUNTAINS = ("ren zi gui chou gen yin jia mao yi chen xun si bing wu "
             "ding wei kun shen geng you xin xu qian hai").split()

def norm(x):
    return (x - 1) % 9 + 1

def fly(c, sign):
    return {p: norm(c + sign * k) for k, p in enumerate(PATH)}

def polarity(number, pos):
    cardinal = number in (1, 3, 7, 9)
    return (1, -1, -1)[pos] if cardinal else (-1, 1, 1)[pos]

def side(base, pal, pos):
    n = base[pal]
    ref = LOSHU[pal] if n == 5 else n
    return fly(n, polarity(ref, pos))

def chart(period, i):
    base = fly(period, 1)
    sit = PAL_ORDER[i // 3]
    face = OPP[sit]
    return base, side(base, sit, i % 3), side(base, face, i % 3), sit, face

def category(period, i):
    base, m, f, sit, face = chart(period, i)
    if m[sit] == period and f[face] == period:
        return "wang shan wang xiang"
    if m[face] == period and f[sit] == period:
        return "shang shan xia shui"
    if m[face] == period and f[face] == period:
        return "shuang xing hui xiang"
    return "shuang xing hui zuo"

def z_two_sided(alpha):
    lo, hi = 0.0, 10.0
    for _ in range(100):
        mid = (lo + hi) / 2
        if math.erfc(mid / math.sqrt(2)) > alpha:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2

def mean(xs):
    return sum(xs) / len(xs)

if __name__ == "__main__":
    grid = [("zi", 0.4, True), ("wu", 0.2, False), ("mao", 0.2, False),
            ("you", 0.2, False)]
    for name, share, s in grid:
        i = MOUNTAINS.index(name)
        print("   sitting {:4s} share {:.1f}  faces south: {:5s}  class: {}"
              .format(name, share, str(s), category(9, i)))
    rng = random.Random(9)
    data = []
    for _ in range(20000):
        u, acc = rng.random(), 0.0
        for name, share, s in grid:
            acc += share
            if u < acc:
                break
        y = rng.gauss(0.2 if s else 0.0, 1.0)
        data.append((category(9, MOUNTAINS.index(name)), s, y))
    a = [y for c, s, y in data if c == "shuang xing hui zuo"]
    b = [y for c, s, y in data if c == "shuang xing hui xiang"]
    d = mean(a) - mean(b)
    z = d / math.sqrt(1 / len(a) + 1 / len(b))
    print("\n   naive: hui zuo minus hui xiang {:.4f} sd, z = {:.2f}".format(
        d, z))
    a2 = [y for c, s, y in data if c == "shuang xing hui zuo" and not s]
    b2 = [y for c, s, y in data if c == "shuang xing hui xiang" and not s]
    d2 = mean(a2) - mean(b2)
    z2 = d2 / math.sqrt(1 / len(a2) + 1 / len(b2))
    print("   within houses not facing south: {:.4f} sd, z = {:.2f}".format(
        d2, z2))
    k = 0.6
    n = (1.96 + 0.8416) ** 2 / (0.1 ** 2 * k * (1 - k))
    print("   houses needed for a true 0.1 sd effect: {:,.0f}".format(
        math.ceil(n)))
    m = 4 * 5 * 9
    print("   {} tests: Bonferroni level {:.6f}, |z| > {:.3f}".format(
        m, 0.05 / m, z_two_sided(0.05 / m)))
    print("\nReading: in a grid city the chart class is tied to facing,")
    print("so a naive comparison finds a highly significant 'hui zuo")
    print("advantage' that is really the value of facing south. Within")
    print("the same facing, the difference vanishes. A fair test")
    print("stratifies by orientation and fixes its single comparison in")
    print("advance.")
#    sitting zi   share 0.4  faces south: True   class: shuang xing hui zuo
#    sitting wu   share 0.2  faces south: False  class: shuang xing hui xiang
#    sitting mao  share 0.2  faces south: False  class: shuang xing hui zuo
#    sitting you  share 0.2  faces south: False  class: shuang xing hui xiang
#
#    naive: hui zuo minus hui xiang 0.1012 sd, z = 7.02
#    within houses not facing south: -0.0276 sd, z = -1.42
#    houses needed for a true 0.1 sd effect: 3,271
#    180 tests: Bonferroni level 0.000278, |z| > 3.635
#
# Reading: in a grid city the chart class is tied to facing,
# so a naive comparison finds a highly significant 'hui zuo
# advantage' that is really the value of facing south. Within
# the same facing, the difference vanishes. A fair test
# stratifies by orientation and fixes its single comparison in
# advance.

朴素的比较发现「双星会坐」比「双星会向」高 0.1012 个标准差,z=7.02z = 7.02,极其显著;但在不向南的房子之间比较,差异消失(z=−1.42z = -1.42)。即使真有 0.1 个标准差的效应,也需要 3,271 座房子;若 4 类格局 × 5 种结局 × 9 个元运全部检验,共 180 次检验,Bonferroni 校正后的显著水平为 0.000278。公平的检验必须按坐向分层,并事先规定唯一的比较。

假说 · 尚未验证

可检验的推论。 若飞星格局对居住者有影响,那么在按坐向、城市与建成年份配对的房子之间,格局不同的一方应在预先登记的结局上有系统性差异。什么会证明这一推论错:若配对之后差异消失,所谓格局效应来自坐向及其相关因素,而不是飞星。

小结

比例法则是约定而不是个人身体的描述,标准化单位的意义正在于不依赖身体。笼统预测的应验几乎不构成证据,具体而有日期的预测才有分量。在朝向非随机的城市里,任何格局比较都必须按坐向分层。

参考文献

Vitruvius. n.d. The Ten Books on Architecture. Translated by Morris Hicky Morgan; Project Gutenberg e-Text No. 20239.
Wikipedia contributors. n.d. Cubit. English Wikipedia Article, Consulted 2026-11-08.

Fan, Y. (2026). Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology: Lo-Shu Orbit Cycles, Magnetic Declination Flip Rates and Landmark Measurement Error Propagation [玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090215 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).