关于「洛书、八门与置换群」,《双人耦合与网格博弈》给出的定量结论是什么?
结论:第五章证明三阶幻方在对称意义下唯一,飞宫与转盘两种动作生成全部 362,880 种排列,其中只有 8 种保持幻方。
数据口径:本书只研究这些数学结构本身,不主张、也不检验任何术数意义上的预测;全部数据为程序生成的合成数据,物理与博弈概念用于人际关系之处一律标为类比。 第七章与咸、恒两卦的《彖传》、《烟波钓叟赋》与杨辉纵横图并读;咸卦颠倒即为恒卦,被读作矩阵的转置,并标为诠释。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 362880
magic squares among 362,880 arrangements: 8 centre value in every one: [5] all 8 are D4 images of one square: True semi-magic (rows and columns only): 72 Yang Hui's rule gives 4 9 2 / 3 5 7 / 8 1 6 magic: True (nine on top, one below, three left, seven right) Reading: up to the eight symmetries of the square there is exactly one 3 x 3 magic square, and its centre is forced to be 5 (the four lines through the centre use every number once plus the centre three more times: 4 x 15 = 45 + 3c). Yang Hui's four moves produce it directly.
查看完整验算程序
# Chapter 5. The Luoshu square: enumeration and Yang Hui's rule.
# A 3 x 3 normal magic square holds 1..9 with every row, column and both
# diagonals summing to 15. The program (1) checks all 9! = 362,880
# arrangements, (2) shows that the solutions are the 8 images of one square
# under the symmetries of the square (4 rotations, 4 reflections: the
# dihedral group D4), (3) counts the "semi-magic" arrangements (rows and
# columns only), and (4) carries out Yang Hui's rule of 1275 on a diamond:
# "nine numbers in slanting rows; exchange top and bottom; exchange left and
# right; the four corners step out".
from itertools import permutations
LINES = [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8),
(0, 4, 8), (2, 4, 6)]
def magic(sq, lines=LINES):
return all(sq[a] + sq[b] + sq[c] == 15 for a, b, c in lines)
def rot(sq):
return tuple(sq[i] for i in (6, 3, 0, 7, 4, 1, 8, 5, 2))
def flip(sq):
return tuple(sq[i] for i in (2, 1, 0, 5, 4, 3, 8, 7, 6))
def d4(sq):
out, s = set(), sq
for _ in range(4):
out.add(s)
out.add(flip(s))
s = rot(s)
return out
def show(sq):
return " / ".join(" ".join(str(v) for v in sq[r * 3:r * 3 + 3])
for r in range(3))
if __name__ == "__main__":
sols = [p for p in permutations(range(1, 10)) if magic(p)]
semi = sum(magic(p, LINES[:6]) for p in permutations(range(1, 10)))
print(" magic squares among 362,880 arrangements: {}".format(len(sols)))
print(" centre value in every one: {}".format(
sorted({s[4] for s in sols})))
print(" all 8 are D4 images of one square: {}".format(
set(sols) == d4(sols[0])))
print(" semi-magic (rows and columns only): {}".format(semi))
# Yang Hui on a 5 x 5 board, (row, col) -> number
board = {(0, 2): 1, (1, 1): 4, (1, 3): 2, (2, 0): 7, (2, 2): 5,
(2, 4): 3, (3, 1): 8, (3, 3): 6, (4, 2): 9}
board[(0, 2)], board[(4, 2)] = board[(4, 2)], board[(0, 2)]
board[(2, 0)], board[(2, 4)] = board[(2, 4)], board[(2, 0)]
moved = {(1, 2): board.pop((0, 2)), (3, 2): board.pop((4, 2)),
(2, 1): board.pop((2, 0)), (2, 3): board.pop((2, 4))}
board.update(moved)
yang = tuple(board[(r, c)] for r in (1, 2, 3) for c in (1, 2, 3))
print(" Yang Hui's rule gives {} magic: {}".format(
show(yang), magic(yang)))
print(" (nine on top, one below, three left, seven right)")
print("\nReading: up to the eight symmetries of the square there is")
print("exactly one 3 x 3 magic square, and its centre is forced to be 5")
print("(the four lines through the centre use every number once plus the")
print("centre three more times: 4 x 15 = 45 + 3c). Yang Hui's four moves")
print("produce it directly.")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《双人相位耦合、双线性相容张量与时空网格博弈》第 5 章「洛书、八门与置换群」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090172
DOI: 10.5281/zenodo.24090172 · 阅读本章所在专著 · 5DL-B-062 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026062,
author = {Fan, Yafu},
title = {Dyadic Phase Coupling, Bilinear Compatibility Tensors and Spatiotemporal Grid Games},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090172},
url = {https://doi.org/10.5281/zenodo.24090172}
}