5D Library › Six-Dimensional Hypercube Walks, Hexagram Mutation Markov Chains and Modular Star-Palace Lattices · 中文

Chapter 8. A Four-Step Check and a Pre-Registered Matching Test

Four questions before trusting casting or charting software

This chapter turns the book into four questions that can be put to any six-line or Zi Wei Dou Shu software — the author’s own included. They are not advice on any decision.

One: which casting method does it simulate? Yarrow and coins give the same number of moving lines but differ in which kind of line moves, and the distributions of the text read differ by about a fifth (Chapters 2 and 4). Software should say which it uses, and the claim should be checkable against its record of casts.

Two: which version of the rules? The rules for nuclear hexagrams, moving lines, star placement and flowing months all exist in versions (Chapters 1, 4, 5 and 6). Software should state the rules it uses, and they should be checkable against known placement tables.

Three: which conventions does a score depend on? The structure of good-or-bad judgements and matter-by-matter scores is exact; the results depend on values and weights (Chapters 4 and 6). Software should publish its conventions and report how much the results change under another reasonable set.

Four: whom does it describe? Book 63 showed that being judged accurate is not the same as telling people apart. A blind matching test measures whether a reading belongs to its owner.

Testing casting software

The first question can be tested directly. The program below imagines software that claims to use the coin method but actually casts with the yarrow odds, and asks how many records of casts it takes to find out.

Calculation

# Chapter 8. Checking a casting device: is it really coins, or yarrow?
# A reading app may claim to reproduce the coin method or the yarrow
# method. Its log of line values (6, 7, 8, 9) can be tested against the
# claimed distribution with a chi-square goodness-of-fit test (3 degrees
# of freedom, critical value 7.815 at alpha = 0.05). Here the app is
# claimed to use coins but actually follows the yarrow odds; for several
# numbers of six-line casts, 4,000 simulated logs give the power of the
# test. (A test of whether the 64 cast hexagrams come up equally often
# cannot separate the methods: under both, each line is yang with
# probability 1/2, as p03 showed.)
import random

COINS = {6: 1 / 8, 7: 3 / 8, 8: 3 / 8, 9: 1 / 8}
YARROW = {6: 1 / 16, 7: 5 / 16, 8: 7 / 16, 9: 3 / 16}
CRIT = 7.815

def draw(dist, rng):
    u, acc = rng.random(), 0.0
    for v, p in dist.items():
        acc += p
        if u <= acc:
            return v
    return 9

def chi2(counts, dist, n):
    return sum((counts[v] - n * p) ** 2 / (n * p) for v, p in dist.items())

if __name__ == "__main__":
    rng = random.Random(64015)
    print("   six-line casts   lines   power to reject 'coins'")
    for casts in (5, 10, 20, 40, 80):
        n = 6 * casts
        hits = 0
        for _ in range(4000):
            c = {6: 0, 7: 0, 8: 0, 9: 0}
            for _ in range(n):
                c[draw(YARROW, rng)] += 1
            hits += chi2(c, COINS, n) > CRIT
        print("        {:3d}          {:4d}         {:.3f}".format(
            casts, n, hits / 4000))
    print("\nReading: a log of some 20 to 40 casts is enough to tell yarrow")
    print("odds from coin odds with good power - consistent with the")
    print("divergence of Chapter 2. Counting the 64 cast hexagrams alone")
    print("could never tell them apart: both methods are fair on the cast")
    print("hexagram and differ only in the moving lines.")
#    six-line casts   lines   power to reject 'coins'
#           5            30         0.210
#          10            60         0.434
#          20           120         0.773
#          40           240         0.982
#          80           480         1.000
#
# Reading: a log of some 20 to 40 casts is enough to tell yarrow
# odds from coin odds with good power - consistent with the
# divergence of Chapter 2. Counting the 64 cast hexagrams alone
# could never tell them apart: both methods are fair on the cast
# hexagram and differ only in the moving lines.

With 5 six-line casts (30 lines) a chi-square test detects the problem with power of only 0.210; with 20 casts, 0.773; with 40, 0.982. Counting how often each cast hexagram appears can never find the difference, because the cast hexagram is half yin and half yang under both methods; the difference lies only in which moving lines are yin or yang.

A pre-registered matching test

Hypothesis · not established

Protocol (after Carlson’s double-blind test of astrology (Carlson 1985)). One reading rule (the casting or charting method, the rule for choosing texts, every value and weight, and the code) is registered publicly before recruitment and not changed afterwards. Each participant gives birth data (Zi Wei) or casts on the spot (six lines); the software writes one reading per person; each participant sees their own reading and the readings of two other participants, in random order and without names, and picks the one that fits best. Primary outcome: the share who pick their own reading; with no information it is 1/3. Test: one-sided exact binomial, α=0.05\alpha = 0.05. Decision: only reaching the critical number of hits counts as support for “the readings carry information about their owners”. An independent analyst with no financial relationship with the author, who does not know where the readings came from, runs the test, and the results are published whether positive or negative.

Calculation

# Chapter 8. A pre-registered matching test of a chart reading.
# Design (after Carlson's double-blind test of astrology): each
# participant gives birth data; the software, using ONE scoring convention
# fixed and published in advance, writes a reading; the participant sees
# their own reading and two readings written for other participants, in
# random order and without names, and picks the one that fits best. With
# no information in the readings the hit rate is 1/3. The claim tested is
# a hit rate of at least 0.40. One-sided exact binomial test, alpha 0.05,
# power 80 %. The program finds the sample size, checks it by
# simulation, and prints the decision rule.
import math
import random

def tail(n, p, k):
    return sum(math.comb(n, j) * p ** j * (1 - p) ** (n - j)
               for j in range(k, n + 1))

def critical(n, p0=1 / 3, alpha=0.05):
    lo, hi = 0, n + 1
    while lo < hi:
        mid = (lo + hi) // 2
        if tail(n, p0, mid) <= alpha:
            hi = mid
        else:
            lo = mid + 1
    return lo

def needed(p1=0.40, power=0.8):
    n = 50
    while tail(n, p1, critical(n)) < power:
        n += 10
    while n > 1 and tail(n - 1, p1, critical(n - 1)) >= power:
        n -= 1
    return n

def decide(hits, n):
    k = critical(n)
    if hits >= k:
        return "readings carry information about their owners"
    if hits <= n / 3:
        return "no sign of information: at or below chance"
    return "above chance but not significant: no claim"

if __name__ == "__main__":
    n = needed()
    k = critical(n)
    print("   participants needed: {:,}; reject 'chance' at {} hits or more"
          .format(n, k))
    rng = random.Random(64016)
    sims = [sum(rng.random() < 0.40 for _ in range(n)) for _ in range(4000)]
    print("   simulated power at a true hit rate of 0.40: {:.3f}".format(
        sum(s >= k for s in sims) / 4000))
    sims0 = [sum(rng.random() < 1 / 3 for _ in range(n)) for _ in range(4000)]
    print("   simulated false-positive rate at chance: {:.3f}".format(
        sum(s >= k for s in sims0) / 4000))
    print("\n   decision rule, one line per branch:")
    for hits in (k, k - 1, n // 3):
        print("   {} hits of {:,}: {}".format(hits, n, decide(hits, n)))
#    participants needed: 349; reject 'chance' at 132 hits or more
#    simulated power at a true hit rate of 0.40: 0.820
#    simulated false-positive rate at chance: 0.043
#
#    decision rule, one line per branch:
#    132 hits of 349: readings carry information about their owners
#    131 hits of 349: above chance but not significant: no claim
#    116 hits of 349: no sign of information: at or below chance

Seeing a hit rate of 0.40 (against chance at one third) with 80 % power needs 349 participants, with “chance” rejected at 132 hits or more. The simulation gives power of 0.820 and a false-positive rate of 0.043. The decision rule prints one line per branch. In Carlson’s test of 1985 the astrologers’ hit rate did not differ from chance (Carlson 1985); Book 37 discussed this result.

Note

What the result would and would not mean. A negative result says that this one registered rule has no detectable power to tell people apart in this population, and nothing about other rules; a positive result says that the readings carry information about their owners, not that the information comes from the chart rather than from other cues — so information other than birth data must be excluded by the design. Whatever the result, re-analysing with another rule afterwards cannot be reported as the result of this test.

Summary

Four questions sum up the book: which casting method software simulates, which version of the rules it uses, which conventions its scores depend on, and whether its readings really tell people apart. Software that claims coins but casts with yarrow odds is caught with 0.982 power after about 40 casts. A pre-registered blind matching test with 349 participants tests whether the hit rate exceeds the chance level of one third, and its results are published whether positive or negative.

References

Carlson, Shawn. 1985. “A Double-Blind Test of Astrology.” Nature 318: 419–25.

Fan, Y. (2026). Six-Dimensional Hypercube Walks, Hexagram Mutation Markov Chains and Modular Star-Palace Lattices: Boolean Cube Spectral Gaps, Yarrow-versus-Coin Probability Biases and Twelve-Palace Dihedral Projections [六维超立方体游走、卦变马尔可夫链与模运算星宫晶格] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090176 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).