5D Library › Almanac Auspicious Boolean Lattices, Jianchu Twelve-Officer Congruences and Runic Combinatorics · 中文

Chapter 7. The Shuihudi Daybooks, the Qing Imperial Compilation on Day Selection, and the Runes of Havamal

Why read these sources here

The computations of this book have three historical anchors: the earliest manuscripts of the twelve officers, an imperial attempt to fix one official version of the rules of day selection, and the Norse poem in which Odin takes up the runes. Two points come out of the check. First, the Shuihudi daybook already holds two officer systems side by side, so disagreement between schools is as old as the officers themselves. Second, the Havamal tells how the runes were won; it says nothing about drawing them, reversing them or reading them as lots, so the conventions computed in Chapters 5 and 6 are modern.

Two systems in one Qin manuscript

The bamboo slips from tomb 11 at Shuihudi in Yunmeng, Hubei, buried in the late third century BCE, include two daybooks (rishu) for choosing days (睡虎地秦墓竹简整理小组 1990). The first slips of daybook A carry a text titled simply “Chu” (remove), generally read as the “Chu-style” system, and it is followed by a text titled “Qin chu”, the Qin-style system (Harkness 2019). The Qin-style system is the ancestor of the twelve officers used to this day; the standard twelve labels appear in the Han manuscript from Kongjiapo as jian, chu, ying, ping, ding, zhi, po, wei, cheng, shou, kai, bi, with “ying” where later almanacs have “man”, and daybook A writes po with a different character (Harkness 2019). Li Jiahao argued that the Chu-style system is a late Warring States Chu form that combined the twelve-officer scheme with the separate “congchen” scheme (李家浩 1999). A daybook that copied two systems for the same purpose, without choosing between them, is the earliest surviving instance of the two schools of Chapter 1.

Ranking the rules

When almanacs disagree, someone must rank the rules. The Qing court did so in the Imperially Authorised Book on Harmonising the Times and Distinguishing the Directions (Qinding xieji bianfang shu), a compilation in 36 juan made under Yunlu in the Qianlong reign and catalogued among the arts of calculation and divination (允禄 et al. 乾隆年间). The computation below asks how much such a ranking decides.

Calculation

# Chapter 7. p14: When the verdict depends on the order of the rules.
# Ten kinds of mark: five good (tian de, yue de, tian she, good officer,
# yellow road) and five bad (bad officer, black road, year breaker,
# three sha, unlucky lodge). A school ranks the ten kinds; a day's
# verdict is the sign of its highest-ranked mark. Over all 10! = 3,628,800
# rankings, a day with g good and b bad marks is called good in g/(g+b)
# of them (each present mark is equally likely to rank first; checked by
# enumeration on one day). Counted for 2027: days whose verdict is fixed,
# and days that two rankings ("virtues first", "breakers first") split.
from itertools import permutations
import datetime

OFFICERS = ("jian chu man ping ding zhi po wei cheng shou kai bi").split()
# the 12 "jie" of 2027, Beijing time (UTC+8), from NAOJ's 2027 table
JIE = ((1, 5, 22, 10), (2, 4, 9, 46), (3, 6, 3, 40), (4, 5, 8, 17),
       (5, 6, 1, 25), (6, 6, 5, 26), (7, 7, 15, 37), (8, 8, 1, 27),
       (9, 8, 4, 28), (10, 8, 20, 17), (11, 7, 23, 39), (12, 7, 16, 38))
D0 = datetime.date(2027, 1, 1)          # geng-chen day, mansion Gui (22)

def days(offset_h=0):
    """One dict per day of 2027: stem, branch, month and year branch."""
    jie = [datetime.datetime(2027, m, d, h, mi) +
           datetime.timedelta(hours=offset_h) for m, d, h, mi in JIE]
    out = []
    for k in range(365):
        day = D0 + datetime.timedelta(days=k)
        n = sum(1 for j in jie if j.date() <= day)   # jie passed
        gz = (16 + k) % 60
        out.append({"date": day, "gz": gz, "s": gz % 10, "b": gz % 12,
                    "M": n % 12, "Y": 6 if n < 2 else 7,
                    "mansion": (22 + k) % 28})
    return out

GOOD_OFFICER = {1, 4, 5, 7, 8, 10}     # chu ding zhi wei cheng kai
QINGLONG = {2: 0, 8: 0, 3: 2, 9: 2, 4: 4, 10: 4, 5: 6, 11: 6,
            0: 8, 6: 8, 1: 10, 7: 10}  # month branch -> Azure Dragon day
YELLOW = {0, 1, 4, 5, 7, 10}           # the six "yellow road" gods
SANSHA = {8: (5, 6, 7), 0: (5, 6, 7), 4: (5, 6, 7),
          2: (11, 0, 1), 6: (11, 0, 1), 10: (11, 0, 1),
          5: (2, 3, 4), 9: (2, 3, 4), 1: (2, 3, 4),
          11: (8, 9, 10), 3: (8, 9, 10), 7: (8, 9, 10)}
BAD_MANSION = {1, 2, 4, 8, 9, 10, 11, 14, 17, 19, 22, 23, 26}  # model
TIANDE = {2: ("s", 3), 3: ("b", 8), 4: ("s", 8), 5: ("s", 7),
          6: ("b", 11), 7: ("s", 0), 8: ("s", 9), 9: ("b", 2),
          10: ("s", 2), 11: ("s", 1), 0: ("b", 5), 1: ("s", 6)}
YUEDE = {2: 2, 6: 2, 10: 2, 8: 8, 0: 8, 4: 8, 11: 0, 3: 0, 7: 0,
         5: 6, 9: 6, 1: 6}
TIANSHE = {2: 14, 3: 14, 4: 14, 5: 30, 6: 30, 7: 30,
           8: 44, 9: 44, 10: 44, 11: 0, 0: 0, 1: 0}

def officer(d):
    return (d["b"] - d["M"]) % 12

def marks(d, births=(0, 3)):
    """Bad marks (rule sets R1..R7) and good marks of one day."""
    bad = {
        "R1 officer": officer(d) not in GOOD_OFFICER,
        "R2 black road": (d["b"] - QINGLONG[d["M"]]) % 12 not in YELLOW,
        "R3 year breaker": d["b"] == (d["Y"] + 6) % 12,
        "R4 three sha": d["b"] in SANSHA[d["M"]],
        "R5 mansion": d["mansion"] in BAD_MANSION,
        "R6 clash A": d["b"] == (births[0] + 6) % 12,
        "R7 clash B": d["b"] == (births[1] + 6) % 12,
    }
    kind, v = TIANDE[d["M"]]
    good = {
        "tian de": d[kind] == v,
        "yue de": d["s"] == YUEDE[d["M"]],
        "tian she": d["gz"] == TIANSHE[d["M"]],
    }
    return bad, good

def day_marks(d):
    bad, good = marks(d)
    g = [k for k, v in good.items() if v]
    g += ["good officer"] if not bad["R1 officer"] else []
    g += ["yellow road"] if not bad["R2 black road"] else []
    b = [k for k, v in bad.items() if v and k[:2] in
         ("R1", "R2", "R3", "R4", "R5")]
    return g, b

if __name__ == "__main__":
    ds = days()
    shares = []
    split = 0
    for d in ds:
        g, b = day_marks(d)
        shares.append(len(g) / (len(g) + len(b)))
        virtues = any(m in g for m in ("tian de", "yue de", "tian she"))
        breakers = any(m[:2] in ("R3", "R4") for m in b)
        if virtues and breakers:
            split += 1
    g, b = day_marks(ds[1])
    top = [p[0] in g for p in permutations(g + b)]
    print("   check on {}: enumerated {:.3f}, formula {:.3f}".format(
        ds[1]["date"].isoformat(), sum(top) / len(top),
        len(g) / (len(g) + len(b))))
    fixed = sum(1 for s in shares if s in (0.0, 1.0))
    open_ = sum(1 for s in shares if 0.25 <= s <= 0.75)
    print("   verdict the same under every ranking: {} days".format(fixed))
    print("   called good by 25% to 75% of rankings: {} days".format(open_))
    print("   'virtues first' and 'breakers first' disagree: {} days"
          .format(split))
#    check on 2027-01-02: enumerated 0.400, formula 0.400
#    verdict the same under every ranking: 113 days
#    called good by 25% to 75% of rankings: 249 days
#    'virtues first' and 'breakers first' disagree: 25 days

With five kinds of good mark and five of bad, a day’s verdict under a ranking is the sign of its highest-ranked mark, and over all 10! rankings a day with gg good and bb bad marks is called good in a share g/(g+b)g/(g+b) of them (the enumeration on 2 January 2027 gives 0.400, as the formula does). In 2027 only 113 days have the same verdict under every ranking; 249 days are called good by between 25% and 75% of rankings; and on 25 days the two simplest rankings, “virtues first” and “breakers first”, disagree. An official ranking does not discover which days are good; it decides them, which is why an imperial authority was needed to fix one.

The runes of the Havamal

Source text

Havamal, stanzas 138 and 139 (Poetic Edda)

Veit ek, at ek hekk vindga meiði á nætr allar níu, geiri undaðr ok gefinn Óðni, sjalfr sjalfum mér, á þeim meiði, er manngi veit hvers af rótum renn.

Við hleifi mik sældu né við hornigi; nýsta ek niðr, nam ek upp rúnar, æpandi nam, fell ek aftr þaðan.

(Neckel and Kuhn 1983; Larrington 2014)

“I know that I hung on a windswept tree nine whole nights, wounded with a spear and given to Odin, myself to myself, on that tree of which no one knows from what roots it rises. With no bread did they refresh me, nor with a drinking horn; I peered down, I took up the runes, screaming I took them, I fell back from there.” The stanzas tell how the runes were won through sacrifice. They do not describe drawing runes as lots, nor any reading of a rune upside down. The arithmetic of the three aettir is still worth having, because modern spreads are built on them.

Calculation

# Chapter 7. p13: Counting with the three aettir. The Elder Futhark has
# 24 runes in three aettir (families) of 8. Exact counts for a Norns
# reading of 3 ordered runes: orders without and with orientation (a
# reversible rune doubles the readings), and the chance that the three
# come from three different aettir or all from one; and for a cast of
# nine (as in the nine nights of Havamal 138), the number of readings.
from itertools import permutations
from math import perm

FUTHARK = ("Fehu Uruz Thurisaz Ansuz Raidho Kenaz Gebo Wunjo "
           "Hagalaz Naudhiz Isa Jera Eihwaz Perthro Algiz Sowilo "
           "Tiwaz Berkano Ehwaz Mannaz Laguz Ingwaz Dagaz Othala").split()
SAME_TURNED = {"Gebo", "Hagalaz", "Naudhiz", "Isa", "Jera", "Eihwaz",
               "Sowilo", "Ingwaz", "Dagaz"}

if __name__ == "__main__":
    idx = range(24)
    rev = [FUTHARK[i] not in SAME_TURNED for i in idx]
    orders = with_turn = spread3 = same1 = 0
    for t in permutations(idx, 3):
        orders += 1
        with_turn += 2 ** sum(rev[i] for i in t)
        fam = {i // 8 for i in t}
        spread3 += len(fam) == 3
        same1 += len(fam) == 1
    print("   Norns: {:,} ordered readings, {:,} with orientation".format(
        orders, with_turn))
    print("   one rune from each aett: {:.3f}; all from one aett: {:.3f}"
          .format(spread3 / orders, same1 / orders))
    nine = perm(24, 9)
    print("   nine runes: {:.4e} ordered casts".format(nine))
#    Norns: 12,144 ordered readings, 51,504 with orientation
#    one rune from each aett: 0.253; all from one aett: 0.083
#    nine runes: 4.7447e+11 ordered casts

A Norns reading has 12,144 ordered arrangements of three runes, and 51,504 once each reversible rune can lie either way. One rune from each aett comes up with probability 0.253, all three from one aett with probability 0.083; a cast of nine has 4.7447e+11 ordered arrangements. The nine nights of stanza 138 are often linked to nine-rune casts; the link is modern.

Hypothesis · not established

The author’s interpretation (not yet tested): where an almanac tradition has an officially fixed ranking of rules, published almanacs within it agree with each other on good days far more than almanacs in traditions without one. What would show it wrong: almanacs following an official ranking agree with one another no more than independent commercial almanacs do.

Summary

The Shuihudi daybook copied two officer systems side by side, so rival schools are as old as the officers. Any ranking of good and bad marks fixes the verdict on only 113 days of 2027; the rest is decided by the ranking, which is what an imperial compilation supplied. The Havamal tells how Odin won the runes and says nothing of reversed readings.

References

Harkness, Ethan. 2019. “Good Days and Bad Days: Echoes of the Third-Century BCE Qin Conquest in Early Chinese Hemerology.” Journal of the American Oriental Society 139 (3).
Larrington, Carolyne. 2014. The Poetic Edda. Oxford University Press.
Neckel, Gustav, and Hans Kuhn, eds. 1983. Edda: Die Lieder Des Codex Regius Nebst Verwandten Denkmälern. 5th ed. Winter.
允禄 et al. 乾隆年间. 钦定协纪辨方书. 内府.
李家浩. 1999. “睡虎地秦简《日书》「楚除」的性质及其他.” 中央研究院历史语言研究所集刊 70 (4).
睡虎地秦墓竹简整理小组. 1990. 睡虎地秦墓竹简. 文物出版社.

Fan, Y. (2026). Almanac Auspicious Boolean Lattices, Jianchu Twelve-Officer Congruences and Runic Combinatorics: Constraint Satisfaction Paradoxes, Solar-Term Phase Jumps and Elder Futhark Inversion Distributions [黄历择吉布尔格、建除十二直同余与卢恩符文组合学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090239 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).