关于「三方四正是十二宫环上的卷积」,《卦变与星宫的数学》给出的定量结论是什么?

结论:第六章把三方四正写成十二宫环上的卷积:等权三合丢失 12 个谐波中的 8 个;两套都说得通的星曜赋值对 144 种情形排序的秩相关只有 0.606。

数据口径:书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.606, 144

cases scored144; distinct scores A 43, B 41
Spearman rank correlation A vs B0.606
pairs of cases ordered oppositely0.264
top-10 cases shared6 of 10
Reading: two conventions that a practitioner could defend
agree broadly but not in detail: they order a sizeable share of
pairs of months oppositely and share only part of their 'best
months'. A score is exactly as definite as its conventions.

核心公式

\[s_i = \sum_{j} w_j\, v_{(i + j) \bmod 12},\]
查看完整验算程序
# Chapter 6. A numerical score for "seeking wealth this month" - and how
# much it depends on the conventions put into it.
# The score of a matter is a weighted sum of star values over the "three
# sides and four squares" of the matter's palace (kernel of p12: self 1,
# opposite 0.8, trines 0.5). For wealth the matter's palace is the Wealth
# palace, four places back from the flowing-month Life palace. Star
# values are a convention. Two plausible conventions are compared:
#   A  a general good/bad scale
#   B  a wealth-specific scale (Wu Qu and Tan Lang raised, Qi Sha and
#      Po Jun softened, Tian Tong lowered)
# Over all 12 main-star layouts (p11) x 12 flowing-month Life palaces,
# the program scores the 144 cases under each convention and reports
# their Spearman rank correlation, the share of pairs of cases the two
# conventions order differently, and the overlap of their top 10 cases.
import math
from itertools import combinations

ZI = {"Zi Wei": 0, "Tian Ji": -1, "Tai Yang": -3, "Wu Qu": -4,
      "Tian Tong": -5, "Lian Zhen": -8}
FU = {"Tian Fu": 0, "Tai Yin": 1, "Tan Lang": 2, "Ju Men": 3,
      "Tian Xiang": 4, "Tian Liang": 5, "Qi Sha": 6, "Po Jun": 10}
A = {"Zi Wei": 2, "Tian Fu": 2, "Tai Yang": 1, "Tai Yin": 1,
     "Tian Tong": 1, "Tian Liang": 1, "Tian Xiang": 1, "Wu Qu": 1,
     "Tian Ji": 0.5, "Tan Lang": 0, "Lian Zhen": -0.5, "Ju Men": -1,
     "Qi Sha": -1, "Po Jun": -1}
B = dict(A, **{"Wu Qu": 2, "Tan Lang": 1, "Qi Sha": 0, "Po Jun": -0.5,
               "Tian Tong": 0})
KERNEL = {0: 1.0, 6: 0.8, 4: 0.5, 8: 0.5}

def layout(z):
    f = (4 - z) % 12
    out = {s: (z + o) % 12 for s, o in ZI.items()}
    out.update({s: (f + o) % 12 for s, o in FU.items()})
    return out

def score(z, life, values):
    stars = layout(z)
    wealth = (life - 4) % 12
    # rounded, so that equal scores compare equal whatever the order of
    # the terms
    terms = [KERNEL[off] * values[s] for s, pos in stars.items()
             for off in KERNEL if pos == (wealth + off) % 12]
    return round(math.fsum(terms), 9)

def ranks(xs):
    order = sorted(range(len(xs)), key=lambda i: xs[i])
    r = [0.0] * len(xs)
    i = 0
    while i < len(order):
        j = i
        while j + 1 < len(order) and xs[order[j + 1]] == xs[order[i]]:
            j += 1
        for k in range(i, j + 1):
            r[order[k]] = (i + j) / 2 + 1
        i = j + 1
    return r

def pearson(x, y):
    n = len(x)
    mx, my = math.fsum(x) / n, math.fsum(y) / n
    sxy = math.fsum((a - mx) * (b - my) for a, b in zip(x, y))
    sxx = math.fsum((a - mx) ** 2 for a in x)
    syy = math.fsum((b - my) ** 2 for b in y)
    return sxy / (sxx * syy) ** 0.5

if __name__ == "__main__":
    cases = [(z, life) for z in range(12) for life in range(12)]
    sa = [score(z, l, A) for z, l in cases]
    sb = [score(z, l, B) for z, l in cases]
    rho = pearson(ranks(sa), ranks(sb))
    disagree = sum(1 for i, j in combinations(range(len(cases)), 2)
                   if (sa[i] - sa[j]) * (sb[i] - sb[j]) < 0)
    pairs = len(cases) * (len(cases) - 1) // 2
    top_a = set(sorted(range(len(cases)), key=lambda i: -sa[i])[:10])
    top_b = set(sorted(range(len(cases)), key=lambda i: -sb[i])[:10])
    print("   cases scored: {}; distinct scores A {}, B {}".format(
        len(cases), len(set(sa)), len(set(sb))))
    print("   Spearman rank correlation A vs B: {:.3f}".format(rho))
    print("   pairs of cases ordered oppositely: {:.3f}".format(
        disagree / pairs))
    print("   top-10 cases shared: {} of 10".format(len(top_a & top_b)))
    print("\nReading: two conventions that a practitioner could defend")
    print("agree broadly but not in detail: they order a sizeable share of")
    print("pairs of months oppositely and share only part of their 'best")
    print("months'. A score is exactly as definite as its conventions.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《六维超立方体游走、卦变马尔可夫链与模运算星宫晶格》第 6 章「三方四正是十二宫环上的卷积」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090176

DOI: 10.5281/zenodo.24090176 · 阅读本章所在专著 · 5DL-B-064 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026064,
  author    = {Fan, Yafu},
  title     = {Six-Dimensional Hypercube Walks, Hexagram Mutation Markov Chains and Modular Star-Palace Lattices},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090176},
  url       = {https://doi.org/10.5281/zenodo.24090176}
}

本书其他章节结论