What does Hexagram and Star-Palace Mathematics conclude, in numbers, about “The Sixty-Four Hexagrams Are a Six-Dimensional Cube”?
Answer: Chapter 1 shows that complement and reversal generate a group of four that divides the hexagrams into 20 orbits, and that the received order pairs them into 32 pairs by reversal and complement; the nuclear hexagram is a sliding window on the middle four lines that folds 64 hexagrams onto 16 and then onto 4, of which Qian and Kun are fixed points and Ji Ji and Wei Ji a 2-cycle, not four attractors.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 20, 32, 64
King Wen list holds 64 distinct hexagrams: True distance k between two hexagrams: share of pairs (= C(6,k) / 64) 0:0.0156 1:0.0938 2:0.2344 3:0.3125 4:0.2344 5:0.0938 6:0.0156 hexagrams fixed: identity 64, cuo 0, zong 8, cuo-zong 8 orbits (Burnside): 80 / 4 = 20 King Wen pairs: 28 by reversal, 4 by complement, 0 other Reading: two hexagrams differ in k lines with probability C(6, k)/64. Complement, reversal and both together split the 64 into 20 orbits. The received order pairs every hexagram with its reversal, and the 8 that read the same upside down with their complement - 28 + 4 = 32 pairs, without exception.
Key formula
Show the full program
# Chapter 1. The sixty-four hexagrams as the six-dimensional cube Z2^6.
# A hexagram is six bits read from the bottom line up (1 = yang, 0 = yin).
# Changing k lines moves k steps on the cube: the Hamming distance.
# cuo (complement) flip every line: x XOR 111111
# zong (reversal) turn the figure over: bits in reverse order
# Together with the identity and cuo-zong they form a group of four
# (the Klein four-group). Burnside's lemma counts its orbits as the
# average number of hexagrams each element fixes. The program also checks
# the received King Wen order: hexagrams 2k-1 and 2k are reversals of each
# other, except where a hexagram equals its own reversal, in which case
# the pair are complements.
from collections import Counter
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",
]
def hexagram(upper, lower):
return TRI[lower] + TRI[upper]
KW = [hexagram(*pair.split()) for pair in KING_WEN]
ALL = [tuple((n >> i) & 1 for i in range(6)) for n in range(64)]
def cuo(h):
return tuple(1 - b for b in h)
def zong(h):
return tuple(reversed(h))
if __name__ == "__main__":
print(" King Wen list holds 64 distinct hexagrams: {}".format(
len(set(KW)) == 64))
dist = Counter(sum(a != b for a, b in zip(x, y))
for x in ALL for y in ALL)
print(" distance k between two hexagrams: share of pairs"
" (= C(6,k) / 64)")
print(" " + " ".join("{}:{:.4f}".format(k, dist[k] / 4096)
for k in range(7)))
group = {"identity": lambda h: h, "cuo": cuo, "zong": zong,
"cuo-zong": lambda h: cuo(zong(h))}
fixed = {name: sum(g(h) == h for h in ALL) for name, g in group.items()}
print(" hexagrams fixed:", ", ".join("{} {}".format(k, v)
for k, v in fixed.items()))
print(" orbits (Burnside): {} / 4 = {}".format(
sum(fixed.values()), sum(fixed.values()) // 4))
by_zong = by_cuo = bad = 0
for i in range(0, 64, 2):
a, b = KW[i], KW[i + 1]
if zong(a) != a and b == zong(a):
by_zong += 1
elif zong(a) == a and b == cuo(a):
by_cuo += 1
else:
bad += 1
print(" King Wen pairs: {} by reversal, {} by complement, {} other"
.format(by_zong, by_cuo, bad))
print("\nReading: two hexagrams differ in k lines with probability")
print("C(6, k)/64. Complement, reversal and both together split the 64")
print("into 20 orbits. The received order pairs every hexagram with its")
print("reversal, and the 8 that read the same upside down with their")
print("complement - 28 + 4 = 32 pairs, without exception.")Single source and citation
Fan, Y. (2026). Six-Dimensional Hypercube Walks, Hexagram Mutation Markov Chains and Modular Star-Palace Lattices (Version 1.0.0), Chapter 1: The Sixty-Four Hexagrams Are a Six-Dimensional Cube. 5D Library. https://doi.org/10.5281/zenodo.24090176
DOI: 10.5281/zenodo.24090176 · Read the monograph · 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}
}Other chapter answers in this book
- Chapter 2 · Yarrow Stalks and Coins: the Exact Odds of the Two Methods
- Chapter 3 · The Markov Chain of Changing Hexagrams and Its Spectral Gap
- Chapter 4 · Which Text Is Read: the Rules for Moving Lines and a Good-or-Bad Function
- Chapter 5 · The Placement Rules of Zi Wei Dou Shu Are Maps Modulo 12
- Chapter 6 · "Three Sides and Four Squares" Is a Convolution on the Ring of Twelve Palaces
- Chapter 7 · The Number of the Great Expansion, the Before-Heaven Diagrams and the Origins of the *Zi Wei Dou Shu*
- Chapter 8 · A Four-Step Check and a Pre-Registered Matching Test