关于「飞宫四化:有向图与三层叠忌」,《多模态历法张量与谐波拨盘》给出的定量结论是什么?

结论:第三章构造全部 43,200 种紫微命盘:飞宫化忌的单条边接近随机(每盘 1.0078 个自化忌宫),但十二条忌边平均只到达 7.458 个宫;双重叠忌出现在 0.4137 的命盘中,农历日差一天使 0.4735 的命盘改变叠忌宫位。

数据口径:书中以标注框区分证据、16 段可运行的 Python 程序、原典与假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 与结论吻合的打印值: 1.0078, 43200, 7.458

   charts: 43,200
   self-ji palaces per chart 1.0078; charts with one or more 0.7223
   birth-year ji in the ming palace: 0.0867 (1/12 = 0.0833)
   ming palace's ji by role: min 0.0822, max 0.0850
   distinct palaces hit by the 12 ji edges: 7.458
   (a random map of 12 palaces would hit 7.776)
Reading: one by one, the edges look random: about one self-ji
per chart and every role about equally likely. Together they
are not: zi and chou repeat the stems of yin and mao, so their
ji always fly together and the twelve edges reach fewer palaces.
查看完整验算程序
# Chapter 3. [p05] Zi Wei charts and the directed graph of flying ji.
# Branches zi = 0 .. hai = 11. Ming palace: (2 + month - 1 - hour) mod 12.
# Palace stems by the "five tigers" rule from the year stem. Bureau from
# the nayin element of the ming palace (shui 2, mu 3, jin 4, tu 5,
# huo 6). Ziwei from lunar day and bureau; the other 13 main stars by
# fixed offsets; wenchang, wenqu by hour, zuofu, youbi by month. Each
# palace's stem turns one star into ji; an edge runs from the palace to
# where that star sits (a self-loop is "self ji"). All 10 x 12 x 30 x 12
# = 43,200 combinations of year stem, month, day and hour.
NAYIN = ("jin", "huo", "mu", "tu", "jin", "huo", "shui", "tu", "jin",
         "mu", "shui", "tu", "huo", "mu", "shui", "jin", "huo", "mu", "tu",
         "jin", "huo", "shui", "tu", "jin", "mu", "shui", "tu", "huo", "mu",
         "shui")
BUREAU = {"shui": 2, "mu": 3, "jin": 4, "tu": 5, "huo": 6}
# lu, quan, ke, ji for stems jia .. gui
SIHUA = (("lianzhen", "pojun", "wuqu", "taiyang"),
         ("tianji", "tianliang", "ziwei", "taiyin"),
         ("tiantong", "tianji", "wenchang", "lianzhen"),
         ("taiyin", "tiantong", "tianji", "jumen"),
         ("tanlang", "taiyin", "youbi", "tianji"),
         ("wuqu", "tanlang", "tianliang", "wenqu"),
         ("taiyang", "wuqu", "taiyin", "tiantong"),
         ("jumen", "taiyang", "wenqu", "wenchang"),
         ("tianliang", "ziwei", "zuofu", "wuqu"),
         ("pojun", "jumen", "taiyin", "tanlang"))

def palace_stem(ys, b):
    return (2 * (ys % 5) + 2 + (b - 2) % 12) % 10

def sexagenary(s, b):
    return next(i for i in range(60) if i % 10 == s and i % 12 == b)

def chart(ys, m, d, h):
    ming = (2 + m - 1 - h) % 12
    n = BUREAU[NAYIN[sexagenary(palace_stem(ys, ming), ming) // 2]]
    k = next(k for k in range(n) if (d + k) % n == 0)
    q = (d + k) // n
    z = (2 + q - 1 + (-k if k % 2 else k)) % 12
    f = (4 - z) % 12
    pos = {"ziwei": z, "tianji": z - 1, "taiyang": z - 3, "wuqu": z - 4,
           "tiantong": z - 5, "lianzhen": z - 8, "tianfu": f,
           "taiyin": f + 1, "tanlang": f + 2, "jumen": f + 3,
           "tianxiang": f + 4, "tianliang": f + 5, "qisha": f + 6,
           "pojun": f + 10, "wenchang": 10 - h, "wenqu": 4 + h,
           "zuofu": 4 + m - 1, "youbi": 10 - (m - 1)}
    return ming, {s: p % 12 for s, p in pos.items()}

def ji_edges(ys, pos, table=SIHUA):
    return [pos[table[palace_stem(ys, b)][3]] for b in range(12)]

def all_charts():
    for ys in range(10):
        for m in range(1, 13):
            for d in range(1, 31):
                for h in range(12):
                    yield ys, m, d, h

if __name__ == "__main__":
    n = selfs = any_self = birth_in_ming = distinct = 0
    role = [0] * 12
    for ys, m, d, h in all_charts():
        ming, pos = chart(ys, m, d, h)
        e = ji_edges(ys, pos)
        n += 1
        k = sum(e[b] == b for b in range(12))
        selfs += k
        any_self += k > 0
        birth_in_ming += pos[SIHUA[ys][3]] == ming
        role[(ming - e[ming]) % 12] += 1
        distinct += len(set(e))
    rand_distinct = 12 * (1 - (11 / 12) ** 12)
    print("   charts: {:,d}".format(n))
    print("   self-ji palaces per chart {:.4f}; charts with one or more"
          " {:.4f}".format(selfs / n, any_self / n))
    print("   birth-year ji in the ming palace: {:.4f} (1/12 = {:.4f})"
          .format(birth_in_ming / n, 1 / 12))
    print("   ming palace's ji by role: min {:.4f}, max {:.4f}".format(
        min(role) / n, max(role) / n))
    print("   distinct palaces hit by the 12 ji edges: {:.3f}".format(
        distinct / n))
    print("   (a random map of 12 palaces would hit {:.3f})".format(
        rand_distinct))
    print("\nReading: one by one, the edges look random: about one self-ji")
    print("per chart and every role about equally likely. Together they")
    print("are not: zi and chou repeat the stems of yin and mao, so their")
    print("ji always fly together and the twelve edges reach fewer palaces.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《多模态历法张量融合、模九十谐波拨盘与跨系统共振诊断》第 3 章「飞宫四化:有向图与三层叠忌」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090189

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

BibTeX
@book{fan2026070,
  author    = {Fan, Yafu},
  title     = {Multimodal Calendrical Tensor Fusion, Modulo-90 Harmonic Dials and Cross-System Resonance Diagnostics},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090189},
  url       = {https://doi.org/10.5281/zenodo.24090189}
}

本书其他章节结论