关于「读哪一段文字:变占规则与吉凶判别函数」,《卦变与星宫的数学》给出的定量结论是什么?

结论:第四章计算朱熹变占规则下 450 段文字被读到的概率:两种方法的主读文字分布相差 0.178;以爻位为基础的吉凶分数是低阶布尔函数,本卦与之卦分数的相关系数恰为 0.4167。

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

English version

对照数据表

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

   moving lines:        0    1    2    3    4    5    6
   rule share yarrow  .178 .356 .297 .132 .033 .004 .000
   rule share coins   .178 .356 .297 .132 .033 .004 .000
   yarrow: 450 possible main texts, entropy 8.481 bits, most likely 0.0074
           'use nine' 4.35e-05, 'use six' 5.96e-08
   coins : 450 possible main texts, entropy 8.642 bits, most likely 0.0048
           'use nine' 3.81e-06, 'use six' 3.81e-06
   distance between the two methods' main-text distributions: 0.178
Reading: the rule used has the same chance under both methods,
and every one of the 450 texts can come up. But which text comes
up differs: the methods disagree on about a fifth of the
probability, and 'use nine' is 729 times as likely as 'use six'
with yarrow, while coins make them equal.
查看完整验算程序
# Chapter 4. Which text is read: Zhu Xi's rules for moving lines.
# Zhu Xi's "Examining the changes" (as usually summarised) picks the text
# to read from the number of moving lines:
#   0  the judgement of the cast hexagram        (ben gua)
#   1  that moving line of the cast hexagram
#   2  the upper of the two moving lines, cast hexagram
#   3  the judgement of the cast hexagram (with the changed one beside it)
#   4  the lower of the two unmoving lines of the changed hexagram
#   5  the one unmoving line of the changed hexagram
#   6  Qian: "use nine"; Kun: "use six"; otherwise the changed judgement
# The program enumerates all 4^6 = 4,096 casts of line values with their
# probabilities under each method and reports the chance of each rule,
# the number of different texts that can be the main text (of the 64
# judgements, 384 line texts and 2 special texts), the entropy of the
# main text in bits, and the total-variation distance between methods.
import math
from itertools import product

METHODS = {"yarrow": {6: 1 / 16, 7: 5 / 16, 8: 7 / 16, 9: 3 / 16},
           "coins": {6: 1 / 8, 7: 3 / 8, 8: 3 / 8, 9: 1 / 8}}

def main_text(cast):
    ben = tuple(1 if v in (7, 9) else 0 for v in cast)
    moving = [i for i, v in enumerate(cast) if v in (6, 9)]
    zhi = tuple(1 - b if i in moving else b for i, b in enumerate(ben))
    still = [i for i in range(6) if i not in moving]
    k = len(moving)
    if k == 0 or k == 3:
        return k, ("judgement", ben)
    if k in (1, 2):
        return k, ("line", ben, max(moving))
    if k in (4, 5):
        return k, ("line", zhi, min(still))
    if ben == (1,) * 6:
        return k, ("use nine",)
    if ben == (0,) * 6:
        return k, ("use six",)
    return k, ("judgement", zhi)

if __name__ == "__main__":
    dists, rules = {}, {}
    for name, pv in METHODS.items():
        texts, rule = {}, [0.0] * 7
        for cast in product((6, 7, 8, 9), repeat=6):
            p = math.prod(pv[v] for v in cast)
            k, t = main_text(cast)
            rule[k] += p
            texts[t] = texts.get(t, 0.0) + p
        dists[name], rules[name] = texts, rule
    print("   moving lines:     " + " ".join("{:>4}".format(k)
                                          for k in range(7)))
    for name in METHODS:
        print("   rule share {:6s}  ".format(name) + " ".join(
            "{:.3f}".format(x)[1:] for x in rules[name]))
    keys = set(dists["yarrow"]) | set(dists["coins"])
    for name, d in dists.items():
        h = -sum(p * math.log2(p) for p in d.values() if p > 0)
        print("   {:6s}: {} possible main texts, entropy {:.3f} bits,"
              " most likely {:.4f}".format(name, len(d), h,
                                           max(d.values())))
        print("           'use nine' {:.2e}, 'use six' {:.2e}".format(
            d.get(("use nine",), 0), d.get(("use six",), 0)))
    tvd = sum(abs(dists["yarrow"].get(k, 0) - dists["coins"].get(k, 0))
              for k in keys) / 2
    print("   distance between the two methods' main-text distributions:"
          " {:.3f}".format(tvd))
    print("\nReading: the rule used has the same chance under both methods,")
    print("and every one of the 450 texts can come up. But which text comes")
    print("up differs: the methods disagree on about a fifth of the")
    print("probability, and 'use nine' is 729 times as likely as 'use six'")
    print("with yarrow, while coins make them equal.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《六维超立方体游走、卦变马尔可夫链与模运算星宫晶格》第 4 章「读哪一段文字:变占规则与吉凶判别函数」(版本 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}
}

本书其他章节结论