What does Hexagram and Star-Palace Mathematics conclude, in numbers, about “Which Text Is Read: the Rules for Moving Lines and a Good-or-Bad Function”?

Answer: Chapter 4 computes the chance of reading each of 450 texts under Zhu Xi's rules: the two methods' main-text distributions differ by 0.178; a good-or-bad score built on line positions is a low-degree Boolean function, and the correlation between cast and changed scores is exactly 0.4167.

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: 0.178, 450

   moving lines:        0    1    2    3    4    5    6
   rule share yarrow  .178 .356 .297 .132 .033 .004 .000
   rule share coins   .178 .356 .297 .132 .033 .004 .000
   yarrow: 450 possible main texts, entropy 8.481 bits, most likely 0.0074
           'use nine' 4.35e-05, 'use six' 5.96e-08
   coins : 450 possible main texts, entropy 8.642 bits, most likely 0.0048
           'use nine' 3.81e-06, 'use six' 3.81e-06
   distance between the two methods' main-text distributions: 0.178
Reading: the rule used has the same chance under both methods,
and every one of the 450 texts can come up. But which text comes
up differs: the methods disagree on about a fifth of the
probability, and 'use nine' is 729 times as likely as 'use six'
with yarrow, while coins make them equal.
Show the full program
# Chapter 4. Which text is read: Zhu Xi's rules for moving lines.
# Zhu Xi's "Examining the changes" (as usually summarised) picks the text
# to read from the number of moving lines:
#   0  the judgement of the cast hexagram        (ben gua)
#   1  that moving line of the cast hexagram
#   2  the upper of the two moving lines, cast hexagram
#   3  the judgement of the cast hexagram (with the changed one beside it)
#   4  the lower of the two unmoving lines of the changed hexagram
#   5  the one unmoving line of the changed hexagram
#   6  Qian: "use nine"; Kun: "use six"; otherwise the changed judgement
# The program enumerates all 4^6 = 4,096 casts of line values with their
# probabilities under each method and reports the chance of each rule,
# the number of different texts that can be the main text (of the 64
# judgements, 384 line texts and 2 special texts), the entropy of the
# main text in bits, and the total-variation distance between methods.
import math
from itertools import product

METHODS = {"yarrow": {6: 1 / 16, 7: 5 / 16, 8: 7 / 16, 9: 3 / 16},
           "coins": {6: 1 / 8, 7: 3 / 8, 8: 3 / 8, 9: 1 / 8}}

def main_text(cast):
    ben = tuple(1 if v in (7, 9) else 0 for v in cast)
    moving = [i for i, v in enumerate(cast) if v in (6, 9)]
    zhi = tuple(1 - b if i in moving else b for i, b in enumerate(ben))
    still = [i for i in range(6) if i not in moving]
    k = len(moving)
    if k == 0 or k == 3:
        return k, ("judgement", ben)
    if k in (1, 2):
        return k, ("line", ben, max(moving))
    if k in (4, 5):
        return k, ("line", zhi, min(still))
    if ben == (1,) * 6:
        return k, ("use nine",)
    if ben == (0,) * 6:
        return k, ("use six",)
    return k, ("judgement", zhi)

if __name__ == "__main__":
    dists, rules = {}, {}
    for name, pv in METHODS.items():
        texts, rule = {}, [0.0] * 7
        for cast in product((6, 7, 8, 9), repeat=6):
            p = math.prod(pv[v] for v in cast)
            k, t = main_text(cast)
            rule[k] += p
            texts[t] = texts.get(t, 0.0) + p
        dists[name], rules[name] = texts, rule
    print("   moving lines:     " + " ".join("{:>4}".format(k)
                                          for k in range(7)))
    for name in METHODS:
        print("   rule share {:6s}  ".format(name) + " ".join(
            "{:.3f}".format(x)[1:] for x in rules[name]))
    keys = set(dists["yarrow"]) | set(dists["coins"])
    for name, d in dists.items():
        h = -sum(p * math.log2(p) for p in d.values() if p > 0)
        print("   {:6s}: {} possible main texts, entropy {:.3f} bits,"
              " most likely {:.4f}".format(name, len(d), h,
                                           max(d.values())))
        print("           'use nine' {:.2e}, 'use six' {:.2e}".format(
            d.get(("use nine",), 0), d.get(("use six",), 0)))
    tvd = sum(abs(dists["yarrow"].get(k, 0) - dists["coins"].get(k, 0))
              for k in keys) / 2
    print("   distance between the two methods' main-text distributions:"
          " {:.3f}".format(tvd))
    print("\nReading: the rule used has the same chance under both methods,")
    print("and every one of the 450 texts can come up. But which text comes")
    print("up differs: the methods disagree on about a fifth of the")
    print("probability, and 'use nine' is 729 times as likely as 'use six'")
    print("with yarrow, while coins make them equal.")

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 4: Which Text Is Read: the Rules for Moving Lines and a Good-or-Bad Function. 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