What does Calendrical Tensors and Harmonic Dials conclude, in numbers, about “A Multimodal Tensor: How Much Do the Five Systems Share?”?
Answer: Chapter 5 puts the five systems on one set of births: Qimen bureaus and the Sun's dial sector share 0.585 bits, while Zi Wei is almost independent; for the binary verdicts defined in the book the effective number of independent votes is 5.17, so independence depends on the question.
Scope of the numbers: Marked boxes separate evidence, 16 runnable Python programs, classical sources and 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.585
entropy (bits): BW 5.026 ZP 1.349 ZW 3.585 QM 4.170 UR 2.585
mutual information above the shuffled baseline (bits)
BW ZP ZW QM UR
BW - 0.013 0.008 0.047 0.046
ZP 0.012 - 0.007 0.133 0.056
ZW 0.009 0.007 - 0.013 0.006
QM 0.048 0.133 0.013 - 0.585
UR 0.045 0.056 0.006 0.585 -
Reading: the systems are not independent witnesses. Qimen and
the Sun's dial sector both read the solar year and share most;
Ziping shares with them through the month branch; bone weight
a little, through the lunar month. Zi Wei, built on the lunar
day and hour, is close to independent of the solar systems.Show the full program
# Chapter 5. [p09] Five systems on one birth: how much do they share?
# A simplified calendar: solar longitude uniform; lunar day uniform
# 1..30 (moon phase); lunar month = solar month (yin month = month 1)
# or the one before, depending on whether the new moon fell before the
# solar month began; day sexagenary index and double-hour uniform; year
# index uniform. Features: BW bone-weight total (p01 tables); ZP
# corrective element (p03 model, 70/30); ZW role that receives the ming
# palace's flying ji (p05 model); QM Qimen bureau (split-supplement
# rule: solar term and the yuan of the day); UR the Sun's sector on
# the 90-degree dial (six sectors of 15 degrees). 60,000 births (seed
# 70); pairwise mutual information in bits, minus the value for the same
# columns after shuffling one of them (the small-sample bias).
import math
import random
from collections import Counter
YEAR = (12, 9, 6, 7, 12, 5, 9, 8, 7, 8, 15, 9, 16, 8, 8, 19, 12, 6,
8, 7, 5, 15, 6, 16, 15, 7, 9, 12, 10, 7, 15, 6, 5, 14, 14, 9,
7, 7, 9, 12, 8, 7, 13, 5, 14, 5, 9, 17, 5, 7, 12, 8, 8, 6,
19, 6, 8, 16, 10, 7)
MONTH = (6, 7, 18, 9, 5, 16, 9, 15, 18, 8, 9, 5)
DAY = (5, 10, 8, 15, 16, 15, 8, 16, 8, 16, 9, 17, 8, 17, 10, 8, 9,
18, 5, 15, 10, 9, 8, 9, 15, 18, 7, 8, 16, 6)
HOUR = (16, 6, 7, 10, 9, 16, 10, 8, 8, 9, 6, 6)
STEM_V = ((0.2, 0.3), (0.1, 0.4), (0.9, -0.3), (0.7, -0.2), (0.3, -0.6),
(0.0, 0.5), (-0.3, -0.4), (-0.4, -0.2), (-0.6, 0.7), (-0.5, 0.8))
ELEM = {"mu": (0.2, 0.4), "huo": (1.0, -0.4), "tu": (0.1, -0.2),
"jin": (-0.4, -0.3), "shui": (-0.7, 0.8)}
NAYIN = ("jin", "huo", "mu", "tu", "jin", "huo", "shui", "tu", "jin",
"mu", "shui", "tu", "huo", "mu", "shui", "jin", "huo", "mu", "tu",
"jin", "huo", "shui", "tu", "jin", "mu", "shui", "tu", "huo", "mu",
"shui")
BUREAU = {"shui": 2, "mu": 3, "jin": 4, "tu": 5, "huo": 6}
JI = ("taiyang", "taiyin", "lianzhen", "jumen", "tianji", "wenqu",
"tiantong", "wenchang", "wuqu", "tanlang")
# bureau (upper, middle, lower yuan) for the 24 terms from dongzhi;
# yang dun for the first 12, yin dun for the rest
TERMS = ((1, 7, 4), (2, 8, 5), (3, 9, 6), (8, 5, 2), (9, 6, 3), (1, 7, 4),
(3, 9, 6), (4, 1, 7), (5, 2, 8), (4, 1, 7), (5, 2, 8), (6, 3, 9),
(9, 3, 6), (8, 2, 5), (7, 1, 4), (2, 5, 8), (1, 4, 7), (9, 3, 6),
(7, 1, 4), (6, 9, 3), (5, 8, 2), (6, 9, 3), (5, 8, 2), (4, 7, 1))
def stem_of(ys, b):
return (2 * (ys % 5) + 2 + (b - 2) % 12) % 10
def zw_role(ys, m, d, h):
ming = (2 + m - 1 - h) % 12
s = stem_of(ys, ming)
idx = next(i for i in range(60) if i % 10 == s and i % 12 == ming)
n = BUREAU[NAYIN[idx // 2]]
k = next(k for k in range(n) if (d + k) % n == 0)
z = (2 + (d + k) // n - 1 + (-k if k % 2 else k)) % 12
f = (4 - z) % 12
pos = {"taiyang": z - 3, "wuqu": z - 4, "tiantong": z - 5,
"lianzhen": z - 8, "tianji": z - 1, "taiyin": f + 1,
"tanlang": f + 2, "jumen": f + 3, "wenchang": 10 - h,
"wenqu": 4 + h}
return (ming - pos[JI[s]] % 12) % 12
def zp_elem(stem, branch):
b = (-math.cos(2 * math.pi * branch / 12),
math.cos(2 * math.pi * (branch - 1) / 12))
v = [0.7 * b[i] + 0.3 * STEM_V[stem][i] for i in range(2)]
return min(ELEM, key=lambda e: ELEM[e][0] * v[0] + ELEM[e][1] * v[1])
def birth(rng):
lam = rng.uniform(0, 360)
sm = ((lam - 315) % 360) / 30 # solar months since lichun
ms, frac = int(sm), sm - int(sm)
d = rng.randrange(1, 31)
m = ms + 1 if (d - 1) / 29.53 <= frac else ms
m = 12 if m == 0 else m
y, day, h = rng.randrange(60), rng.randrange(60), rng.randrange(12)
branch = (ms + 2) % 12
term = int(((lam - 270) % 360) // 15) # 0 = dongzhi
yuan = (day // 5) % 3
q = (term, TERMS[term][yuan])
bw = YEAR[y] + MONTH[m - 1] + DAY[d - 1] + HOUR[h]
return {"BW": bw, "ZP": zp_elem(day % 10, branch),
"ZW": zw_role(y % 10, m, d, h),
"QM": (q[0] < 12, q[1]), "UR": int((lam % 90) // 15)}
def mi(xs, ys):
n = len(xs)
cx, cy, cxy = Counter(xs), Counter(ys), Counter(zip(xs, ys))
return sum(c / n * math.log2(c * n / (cx[a] * cy[b]))
for (a, b), c in cxy.items())
if __name__ == "__main__":
rng = random.Random(70)
data = [birth(rng) for _ in range(60000)]
keys = ("BW", "ZP", "ZW", "QM", "UR")
cols = {k: [r[k] for r in data] for k in keys}
print(" entropy (bits): " + " ".join(
"{} {:.3f}".format(k, mi(cols[k], cols[k])) for k in keys))
shuf = {}
for k in keys:
c = cols[k][:]
rng.shuffle(c)
shuf[k] = c
print(" mutual information above the shuffled baseline (bits)")
print(" " + "".join("{:>8s}".format(k) for k in keys))
for a in keys:
print(" {:5s} ".format(a) + "".join(
"{:8.3f}".format(mi(cols[a], cols[b]) - mi(cols[a], shuf[b]))
if a != b else "{:>8s}".format("-") for b in keys))
print("\nReading: the systems are not independent witnesses. Qimen and")
print("the Sun's dial sector both read the solar year and share most;")
print("Ziping shares with them through the month branch; bone weight")
print("a little, through the lunar month. Zi Wei, built on the lunar")
print("day and hour, is close to independent of the solar systems.")Single source and citation
Fan, Y. (2026). Multimodal Calendrical Tensor Fusion, Modulo-90 Harmonic Dials and Cross-System Resonance Diagnostics (Version 1.0.0), Chapter 5: A Multimodal Tensor: How Much Do the Five Systems Share?. 5D Library. https://doi.org/10.5281/zenodo.24090189
DOI: 10.5281/zenodo.24090189 · Read the monograph · 5DL-B-070 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026070,
author = {Fan, Yafu},
title = {Multimodal Calendrical Tensor Fusion, Modulo-90 Harmonic Dials and Cross-System Resonance Diagnostics},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090189},
url = {https://doi.org/10.5281/zenodo.24090189}
}Other chapter answers in this book
- Chapter 1 · Bone Weight: a Sum of Four Lookup Tables
- Chapter 2 · Ziping Climate Balance: Warmth and Moisture as Vectors
- Chapter 3 · Flying Four Transformations: a Directed Graph and Three-Layer Stacked Ji
- Chapter 4 · The Hamburg School's 90-Degree Dial: Midpoints, Pictures and Solar Arcs
- Chapter 6 · The Limits of Combining: Condorcet, a Gaussian Copula and the Base Rate of "Resonance"
- Chapter 7 · The *Qiongtong baojian*, the Common Table of Four Transformations, and Witte's *Rules for Planetary Pictures*
- Chapter 8 · A Convention Budget and a Pre-Registered Test of "Resonance Years"