The Original I Ching
esenfr
← all experiments
≟ · hypothesis test

Is King Wen random?

The 1013 tie put to the test

See where the real 1013 falls inside the bell of the null and read its p-value.

The experiment on King Wen as a permutation found that the traditional ordering has 1013 inversions against Fu Xi, nearly tied with Mawangdui and Jing Fang (1008) and with the average of any permutation whatsoever (1009). The natural question: is 1013 typical? We turn it into a test. Null hypothesis: King Wen is any shuffle that respects its own pair rule (the 32 fan/dui pairs in any order, and each pair in either of its two orientations).

1013
real inversions
1009
mean under the null
0.05
z-score
0.97
p (two-sided)
The distribution of inversions under the null
real King Wen = 10136369961380inversions against Fu Xi · 20,000 orderings under the null

The real value falls at the exact centre of the bell: z = 0.05, p = 0.97. As far as inversions go, the King Wen ordering is indistinguishable from a shuffle that respects its pair rule. And this is not a failure: it is a legitimate finding. Under the inversion statistic, the pair rule is the only detectable global structure; beyond it, the arrangement behaves like chance (with an important nuance under other statistics: see the dialogue with Chan (2026)). Walsh spectrum confirms it by an independent route: the even interaction orders concentrate 77.4% of the energy (a random ordering would spread 48%), exactly the fingerprint of that pair rule and nothing more.

And the cost in lines? The second metric
MetricRealNull meanσzp (2-sided)
inversions10131009.180.30.050.97
cost in lines211214.16.5−0.470.65

In the cost in lines too (how far it jumps from one hexagram to the next) King Wen is typical: z = −0.47, p = 0.65. Neither in the disorder nor in the jumps does it depart from chance. The honest conclusion: under its own pair rule, the King Wen ordering is statistically indistinguishable from random. Computed with 20,000 orderings and a fixed seed, verified by the suite.

The dialogue with Chan (2026)

Chan (2026) published a Monte Carlo analysis of King Wen against 100,000 free shuffles and found 4 significant properties. It does not contradict our test: it complements it. The question we add is how much of that survives our null, the one that respects the pair rule. The answer: almost nothing. Three of the four are corollaries of that rule.

Chan's propertyKing Wenfree-shuffle pct.pair-null pct.verdict
mean transition distance3.34997.529.4corollary of the pair rule
lag-1 autocorrelation (alternation)−0.2473.86.2marginal, not significant
groups of 4 with 12 yang799.289.8mostly a corollary
within/between-pair asymmetry3.7599.9invariantinvariant by construction

Note on reproduction: our mean Hamming distance within the 32 pairs is 3.75 (and between pairs 2.94, which does agree with Chan). Chan's 3.56 does not reproduce under the natural convention, and the theorem of Radisic (2026), verified in Lean 4, confirms it by a third route: the total Hamming cost of the King Wen matching is exactly the optimum, and divided among the 32 pairs it gives that same mean. Chan's qualitative conclusion is identical in both.

The turn is clean: properties that under free shuffling sit at the highest percentiles fall, under the pair null, to the centre (the mean distance to 29) or vanish (the within-pair asymmetry is invariant by construction: it cannot be shuffled). Only the autocorrelation of distances stays at percentile 6, suggestive but not significant. Chan proves that King Wen is not free chance; we prove that, conditioned on the pair rule, almost nothing remains. Both results are true and complementary. Conditional analysis with 20,000 shuffles and a fixed seed, verified by the suite.