关于「大衍之数、先天图与《紫微斗数》的来历」,《卦变与星宫的数学》给出的定量结论是什么?
结论:第七章与《系辞》大衍之数、朱熹《筮仪》、邵雍先天图与《紫微斗数》的版本问题并读,先天图恰为二进制计数,文王卦序与二进制的秩相关为 −0.004。
数据口径:书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。
values along Shao Yong's sequence: [63, 62, 61, 60, 59, 58] ... [2, 1, 0] sequence is 63, 62, ..., 0: True trigram order values: [7, 6, 5, 4, 3, 2, 1, 0] 8 x 8 square, first row (upper Qian): [63, 55, 47, 39, 31, 23, 15, 7] rank correlation of King Wen order with binary value: -0.004 Reading: Shao Yong's sequence and square are exactly binary counting, read from the bottom line. The received King Wen order is a different principle altogether: pairs by reversal and complement (p01 of Chapter 1), with no trend in binary value.
查看完整验算程序
# Chapter 7. Shao Yong's "Before Heaven" order is counting in binary.
# Shao Yong (1011-1077) arranged the 64 hexagrams in a sequence and in a
# square of 8 x 8, starting from Qian and ending with Kun. Read each
# hexagram as a six-digit binary number with yang = 1, yin = 0 and the
# BOTTOM line as the highest digit: the sequence is then 63, 62, ..., 0,
# and the trigram order Qian Dui Li Zhen Xun Kan Gen Kun is 7, 6, ..., 0.
# This is the observation Bouvet sent to Leibniz in 1701. The program
# checks it from the received sequence (listed by King Wen number) and the
# trigram table, and compares the King Wen order with the binary values.
TRI = {"qian": (1, 1, 1), "dui": (1, 1, 0), "li": (1, 0, 1),
"zhen": (1, 0, 0), "xun": (0, 1, 1), "kan": (0, 1, 0),
"gen": (0, 0, 1), "kun": (0, 0, 0)} # bottom line first
KING_WEN = [ # upper, lower for 1..64
"qian qian", "kun kun", "kan zhen", "gen kan",
"kan qian", "qian kan", "kun kan", "kan kun",
"xun qian", "qian dui", "kun qian", "qian kun",
"qian li", "li qian", "kun gen", "zhen kun",
"dui zhen", "gen xun", "kun dui", "xun kun",
"li zhen", "gen li", "gen kun", "kun zhen",
"qian zhen", "gen qian", "gen zhen", "dui xun",
"kan kan", "li li", "dui gen", "zhen xun",
"qian gen", "zhen qian", "li kun", "kun li",
"xun li", "li dui", "kan gen", "zhen kan",
"gen dui", "xun zhen", "dui qian", "qian xun",
"dui kun", "kun xun", "dui kan", "kan xun",
"dui li", "li xun", "zhen zhen", "gen gen",
"xun gen", "zhen dui", "zhen li", "li gen",
"xun xun", "dui dui", "xun kan", "kan dui",
"xun dui", "zhen gen", "kan li", "li kan",
]
XIANTIAN = [ # King Wen numbers in Shao Yong's order
1, 43, 14, 34, 9, 5, 26, 11, 10, 58, 38, 54, 61, 60, 41, 19,
13, 49, 30, 55, 37, 63, 22, 36, 25, 17, 21, 51, 42, 3, 27, 24,
44, 28, 50, 32, 57, 48, 18, 46, 6, 47, 64, 40, 59, 29, 4, 7,
33, 31, 56, 62, 53, 39, 52, 15, 12, 45, 35, 16, 20, 8, 23, 2,
]
def bits(n):
upper, lower = KING_WEN[n - 1].split()
return TRI[lower] + TRI[upper]
def value(h): # bottom line is the highest digit
return sum(b << (5 - i) for i, b in enumerate(h))
def spearman(x, y):
n = len(x)
rx = {v: i for i, v in enumerate(sorted(x))}
ry = {v: i for i, v in enumerate(sorted(y))}
d = sum((rx[a] - ry[b]) ** 2 for a, b in zip(x, y))
return 1 - 6 * d / (n * (n * n - 1))
if __name__ == "__main__":
vals = [value(bits(n)) for n in XIANTIAN]
print(" values along Shao Yong's sequence: {} ... {}".format(
vals[:6], vals[-3:]))
print(" sequence is 63, 62, ..., 0: {}".format(
vals == list(range(63, -1, -1))))
order = "qian dui li zhen xun kan gen kun".split()
print(" trigram order values: {}".format(
[sum(b << (2 - i) for i, b in enumerate(TRI[t])) for t in order]))
square = [[value(TRI[lo] + TRI[up]) for lo in order] for up in order]
print(" 8 x 8 square, first row (upper Qian): {}".format(square[0]))
kw_vals = [value(bits(n)) for n in range(1, 65)]
print(" rank correlation of King Wen order with binary value:"
" {:+.3f}".format(spearman(list(range(64)), kw_vals)))
print("\nReading: Shao Yong's sequence and square are exactly binary")
print("counting, read from the bottom line. The received King Wen order")
print("is a different principle altogether: pairs by reversal and")
print("complement (p01 of Chapter 1), with no trend in binary value.")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《六维超立方体游走、卦变马尔可夫链与模运算星宫晶格》第 7 章「大衍之数、先天图与《紫微斗数》的来历」(版本 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}
}