What does Najia and Qimen Combinatorics conclude, in numbers, about “Six Relatives, Six Spirits and the Void Branches”?

Answer: Chapter 2 computes how the six relatives fall on the 384 lines: 44 of the 64 hexagrams lack at least one relative, so hidden spirits are routine; the six spirits start by the day stem's element, with earth split between wu and ji, not by the stem modulo 6; the void branches are the two residues outside a decade's ten consecutive branches, and the six decades' void pairs share out all twelve branches.

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. printed values that match the answer: 384, 44, 64

relative XD ZS QC GG FM
on all 384 lines92 58 74 78 82
on the 64 world lines14 12 15 13 10
hexagrams lacking it6 16 16 8 10
hexagrams with all five relatives20 of 64
lacking one or more44
number of distinct relatives per hexagram3: 12, 4: 32, 5: 20
Reading: the 384 lines are not shared evenly among the five
relatives (offspring 58, brothers 92), and 44 of the 64
hexagrams lack at least one, so the hidden-spirit rule is not
an exception but the usual case.
Show the full program
# Chapter 2. Six relatives: the palace element against each line.
# Palaces and najia branches as in p01 and p02 (repeated here, since the
# programs do not import one another). The relative of a line is the
# relation of its branch's element to the palace's element in Z_5
# (wood 0, fire 1, earth 2, metal 3, water 4; "generates" is +1):
#   0 brothers (XD), +1 offspring (ZS), +2 wife-wealth (QC),
#   +3 officer-ghost (GG), +4 parents (FM).
# A hexagram that lacks a relative must borrow it as a "hidden spirit"
# (fu shen) from the pure hexagram of its palace.
TRIGRAMS = {"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)}
ELEMENT = {"Qian": 3, "Dui": 3, "Li": 1, "Zhen": 0, "Xun": 0, "Kan": 4,
           "Gen": 2, "Kun": 2}
MASKS = ((), (1,), (1, 2), (1, 2, 3), (1, 2, 3, 4), (1, 2, 3, 4, 5),
         (1, 2, 3, 5), (5,))
SHI = (6, 1, 2, 3, 4, 5, 4, 3)
START = {"Qian": 0, "Zhen": 0, "Kan": 2, "Gen": 4,
         "Kun": 7, "Xun": 1, "Li": 3, "Dui": 5}
YANG = {"Qian", "Zhen", "Kan", "Gen"}
BRANCH_ELEMENT = (4, 2, 0, 0, 2, 1, 1, 2, 3, 3, 2, 4)
CODES = ("XD", "ZS", "QC", "GG", "FM")
NAME = {v: k for k, v in TRIGRAMS.items()}

def branches(lower, upper):
    def run(t, base):
        step = 2 if t in YANG else -2
        return [(base + step * k) % 12 for k in range(3)]
    return run(lower, START[lower]) + run(upper, START[upper] + 6)

def all_hexagrams():
    for t, bits in TRIGRAMS.items():
        for g, m in enumerate(MASKS):
            h = tuple(b ^ (i + 1 in m) for i, b in enumerate(bits + bits))
            yield h, t, g

def relatives(h, palace):
    bs = branches(NAME[h[:3]], NAME[h[3:]])
    return [CODES[(BRANCH_ELEMENT[b] - ELEMENT[palace]) % 5] for b in bs]

if __name__ == "__main__":
    lines, missing, at_shi, n_kinds = {}, {}, {}, {}
    lacking = 0
    for h, palace, g in all_hexagrams():
        rel = relatives(h, palace)
        for r in rel:
            lines[r] = lines.get(r, 0) + 1
        absent = [c for c in CODES if c not in rel]
        lacking += bool(absent)
        for c in absent:
            missing[c] = missing.get(c, 0) + 1
        n_kinds[5 - len(absent)] = n_kinds.get(5 - len(absent), 0) + 1
        r = rel[SHI[g] - 1]
        at_shi[r] = at_shi.get(r, 0) + 1
    print("   {:24s}".format("relative") + "".join("{:>5s}".format(c)
                                               for c in CODES))
    for label, d in (("on all 384 lines", lines),
                     ("on the 64 world lines", at_shi),
                     ("hexagrams lacking it", missing)):
        print("   {:24s}".format(label) + "".join(
            "{:5d}".format(d.get(c, 0)) for c in CODES))
    print("   hexagrams with all five relatives: {} of 64".format(
        n_kinds.get(5, 0)))
    print("   lacking one or more: {}".format(lacking))
    print("   number of distinct relatives per hexagram: " + ", ".join(
        "{}: {}".format(k, v) for k, v in sorted(n_kinds.items())))
    print("\nReading: the 384 lines are not shared evenly among the five")
    print("relatives (offspring 58, brothers 92), and 44 of the 64")
    print("hexagrams lack at least one, so the hidden-spirit rule is not")
    print("an exception but the usual case.")

Single source and citation

Fan, Y. (2026). Najia Hexagram Encoding and Qimen Dunjia Combinatorial Engines (Version 1.0.0), Chapter 2: Six Relatives, Six Spirits and the Void Branches. 5D Library. https://doi.org/10.5281/zenodo.24090182

DOI: 10.5281/zenodo.24090182 · Read the monograph · 5DL-B-067 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026067,
  author    = {Fan, Yafu},
  title     = {Najia Hexagram Encoding and Qimen Dunjia Combinatorial Engines},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090182},
  url       = {https://doi.org/10.5281/zenodo.24090182}
}

Other chapter answers in this book