5D Library › Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology · 中文

Chapter 6. The Royal Cubit, Canons of Proportion and Evidence

Body units and canons of proportion

The cubit, elbow to fingertip, is among the oldest body units. Egypt standardised it as the “royal cubit” of seven palms of four fingers, 28 fingers in all; the common cubit had six palms, 24 fingers. Surviving royal cubit rods are about 523.5 to 529.2 mm long (Wikipedia contributors, n.d.). The Roman Vitruvius, in his Ten Books on Architecture, explained the proportions of a temple by those of the human body (Vitruvius, n.d.). A canon of proportion is a set of ideal ratios. How does it relate to a person’s body?

Calculation

# 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.

Taking 52.4 cm as an illustrative royal cubit, a palm is 7.486 cm and a finger 1.871 cm. If the log of height over cubit has a standard deviation of 0.03, only 0.4908 of people are within 2% of the canonical ratio, and only 0.02848 meet five canonical ratios at once. A wall of 100 cubits measured with one person’s forearm has a standard deviation of 230.0 cm; measured by twenty workers five cubits each, 51.4 cm; with a standard rod of 0.2% error, only 10.5 cm. A canon of proportion describes a convention, not any real body; a unit is useful precisely because it is the same for everyone, which a body is not.

What satisfied clients prove

“Clients say it was accurate” is the commonest evidence for divinatory services. The program measures it with a Bayes factor: a vague prediction (“a change at work this year”) comes true with chance 0.75 even if the method is invalid and 0.80 if valid; a specific one (“a move of home between March and May”) with chance 0.10 if invalid and 0.40 if valid.

Calculation

# 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.

Each vague hit has a Bayes factor of only 1.0667; from even prior odds, twenty vague hits in a row raise the probability that the method is valid only to 0.7843. Each specific hit has a Bayes factor of 4.0, and five in a row reach 0.9990. Testimonials pass a second filter: if clients with a hit write a review with chance 0.6 and others with chance 0.2, a method with a true hit rate of 0.75 appears in testimonials at 0.9000, and one with 0.10 at 0.2500.

A “configuration effect” made by the street grid

Chapter 2 showed that a configuration is fixed by the flight directions of the mountain and facing stars, and so is tied to orientation; and orientation in a city is not random. The program takes a city on a north-south grid: houses sitting at zi (facing south) make up 0.4, those sitting at wu, mao and you 0.2 each; the outcome has nothing to do with flying stars, but south-facing houses score 0.2 standard deviations higher for reasons of light and street layout. In period 9, zi and mao sittings give double stars at the sitting, wu and you double stars at the facing.

Calculation

# 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.

A naive comparison finds “double stars at the sitting” ahead of “double stars at the facing” by 0.1012 standard deviations, z=7.02z = 7.02, overwhelmingly significant; compared among houses that do not face south, the difference vanishes (z=−1.42z = -1.42). Even a true effect of 0.1 standard deviations would need 3,271 houses; and if 4 classes × 5 outcomes × 9 periods are all tested, 180 tests in all, the Bonferroni level is 0.000278. A fair test must stratify by orientation and fix its single comparison in advance.

Hypothesis · not established

Testable consequence. If flying-star configurations affect residents, then between houses matched on orientation, city and build year, the member of each pair with the better configuration should show a systematic difference on pre-registered outcomes. What would show this wrong: if the difference disappears after matching, the “configuration effect” comes from orientation and what goes with it, not from the flying stars.

Summary

Canons of proportion are conventions rather than descriptions of real bodies, and the point of a standard unit is that it does not depend on a body. Vague predictions that come true are almost no evidence; specific, dated predictions carry weight. In a city where orientation is not random, any comparison of configurations must be stratified by orientation.

References

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).