关于「卦变的马尔可夫链与谱隙」,《卦变与星宫的数学》给出的定量结论是什么?

结论:第三章把本卦到之卦写成立方体上的乘积马尔可夫链:两种方法的谱隙都是 1/2,三步之内遗忘出发点,一次只变一爻的游走则需要 8 步;蓍草法的链不对称,乾变坤是坤变乾的 729 倍。

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

English version

对照数据表

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

   yarrow: rows sum to 1: True; eigenfunctions verified: True
      second eigenvalue 1/2 -> spectral gap 1/2; stationary yang share 1/4
      P(Qian -> Kun) = 729/262144, P(Kun -> Qian) = 1/262144
      matrix symmetric: False
   coins: rows sum to 1: True; eigenfunctions verified: True
      second eigenvalue 1/2 -> spectral gap 1/2; stationary yang share 1/2
      P(Qian -> Kun) = 1/4096, P(Kun -> Qian) = 1/4096
      matrix symmetric: True
Reading: both methods give a chain with the same spectral gap,
1/2: every pattern of lines loses half its weight per step. The
coin chain is symmetric and drifts to all 64 hexagrams equally.
The yarrow chain is not: Qian turns into Kun 729 times as often
as Kun turns into Qian, and the chain drifts to a yin-heavy
state in which a line is yang only a quarter of the time.
查看完整验算程序
# Chapter 3. From a hexagram to its changed hexagram: a Markov chain.
# Cast a hexagram and let its moving lines flip: given the cast's yin/yang
# pattern x, the changed hexagram y is random. Per line, a yang line
# flips with a = P(9) / P(yang) and a yin line with b = P(6) / P(yin):
#   yarrow  a = 3/8, b = 1/8        coins  a = b = 1/4
# Lines flip independently, so P(x -> y) is a product of six 2 x 2 steps.
# Repeating "take the changed hexagram as the next cast pattern" defines a
# Markov chain on the 64 vertices of the cube. Its eigenfunctions are the
# products chi_S(x) = prod over i in S of (x_i - pi), pi = b / (a + b)
# the stationary share of yang, with eigenvalues (1 - a - b)^|S|. The
# program builds the 64 x 64 matrix exactly and checks all of this.
from fractions import Fraction as F
from itertools import combinations

def chain(a, b):
    states = [tuple((n >> i) & 1 for i in range(6)) for n in range(64)]
    def step(u, v):
        if u == 1:
            return a if v == 0 else 1 - a
        return b if v == 1 else 1 - b
    p = {}
    for x in states:
        for y in states:
            pr = F(1)
            for u, v in zip(x, y):
                pr *= step(u, v)
            p[x, y] = pr
    return states, p

def check(a, b):
    states, p = chain(a, b)
    rows_ok = all(sum(p[x, y] for y in states) == 1 for x in states)
    pi = b / (a + b)
    lam = 1 - a - b
    ok = True
    for k in range(7):
        for s in combinations(range(6), k):
            def chi(x):
                out = F(1)
                for i in s:
                    out *= x[i] - pi
                return out
            for x in states:
                lhs = sum(p[x, y] * chi(y) for y in states)
                ok &= lhs == lam ** k * chi(x)
    qian, kun = (1,) * 6, (0,) * 6
    return rows_ok, ok, pi, lam, p[qian, kun], p[kun, qian], states, p

if __name__ == "__main__":
    for label, a, b in (("yarrow", F(3, 8), F(1, 8)),
                        ("coins", F(1, 4), F(1, 4))):
        rows_ok, ok, pi, lam, qk, kq, states, p = check(a, b)
        sym = all(p[x, y] == p[y, x] for x in states for y in states)
        print("   {}: rows sum to 1: {}; eigenfunctions verified: {}"
              .format(label, rows_ok, ok))
        print("      second eigenvalue {} -> spectral gap {};"
              " stationary yang share {}".format(lam, 1 - lam, pi))
        print("      P(Qian -> Kun) = {}, P(Kun -> Qian) = {}".format(qk, kq))
        print("      matrix symmetric: {}".format(sym))
    print("\nReading: both methods give a chain with the same spectral gap,")
    print("1/2: every pattern of lines loses half its weight per step. The")
    print("coin chain is symmetric and drifts to all 64 hexagrams equally.")
    print("The yarrow chain is not: Qian turns into Kun 729 times as often")
    print("as Kun turns into Qian, and the chain drifts to a yin-heavy")
    print("state in which a line is yang only a quarter of the time.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《六维超立方体游走、卦变马尔可夫链与模运算星宫晶格》第 3 章「卦变的马尔可夫链与谱隙」(版本 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}
}

本书其他章节结论