5D Library › Books › 5DL-B-066
四柱排盘的历法计算与规则引擎
儒略日干支同余、早晚子时分歧、出生时间误差敏感度与旺衰加权图
Four-Pillar Calendrical Computation and Formal Rule Engines: Julian-Day Sexagenary Cycles, Midnight-Boundary Disagreements, Birth-Time Sensitivity Bounds and Weighted-Graph Strength Scoring
DOI10.5281/zenodo.24090180摘要
四柱排盘先做历法,再做判断。前一半是天文与历法的计算,约定说清楚后有唯一的答案;后一半是一套规则引擎,结果取决于参数。本书把两半都写成程序,问三个问题:同一个出生,不同的软件会不会排出不同的盘?出生时间差几分钟,盘会不会变?同一张盘,不同的参数会不会给出相反的判断?本书不主张、也不检验任何断语是否应验;全部数据为程序生成。
第一章用儒略日把日柱写成(儒略日 + 49)模 60 的余数,跨越 1582 年改历仍然连续,并把五虎遁、五鼠遁写成模 10 的仿射映射,与歌诀逐条相符;八个字中只有四个自由,可能的四柱共 518,400 种。第二章比较子时的三种约定,它们只在 23 点到 24 点之间不同,影响 0.0417 的出生;钟表时间与真太阳时之差使时支在上海对 0.069 的出生不同,在吉隆坡对 0.610 的出生不同。第三章计算误差的传播:一刻钟的误差让时柱出错的概率为 0.06250 到 0.09974,日柱、月柱、年柱小一到三个数量级;给出「时辰边界校准」的条件概率表;起运岁数在节气之间是三天一岁的直线,在节气处跳变可达 10.48 年。
第四章证明十神是 Z5 × Z2 的十个元素,十神表是拉丁方,而不是天干次序距离的函数;藏干的三种通行权重在主五行上一致,0.6、0.3、0.1 与人元司令的 18、9、3 天同源。第五章把旺衰判断写成加权图上的打分,三套说得通的参数对全部四柱两两的 Cohen's kappa 只有 0.553 到 0.622,三者一致的盘占 0.684,从格的比例在 0.022 与 0.121 之间;时支差一格,判定对 0.127 的盘改变。第六章比较两个排盘引擎:钟表时间与 23 点换日对真太阳时与零点换日,在上海对 0.1043 的出生、在吉隆坡对 0.6463 的出生至少一柱不同,并给出一套测试向量与指纹。第七章与《渊海子平》《三命通会》《滴天髓》并读。第八章给出四步核查、一致性研究的样本量(255 张盘把 kappa 定在 0.100 之内)与一项预注册的配对检验(359 名纳入分析的参与者)。书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的假说。
关键词:四柱;八字;子平;六十甲子;儒略日;模运算;中国剩余定理;仿射映射;子时;真太阳时;均时差;二十四节气;误差传播;敏感度分析;大运起运;十神;群作用;拉丁方;地支藏干;加权图;规则引擎;Cohen's kappa;评分者一致性;测试向量;渊海子平;三命通会;滴天髓;配对检验;预注册
Abstract
A four-pillar chart first does calendar work and then judges. The first half is astronomy and calendar calculation, with a single answer once the conventions are stated; the second half is a rule engine whose results depend on parameters. This book writes both halves as programs and asks three questions. Do different programs give the same birth different charts? Does a birth time a few minutes off change the chart? Do different parameters give the same chart opposite judgements? It neither claims nor tests that any reading comes true; all data are generated by its programs.
Chapter 1 writes the day pillar as the residue of the Julian day plus 49 modulo 60, continuous across the reform of 1582, and the five-tigers and five-rats rules as affine maps modulo 10 that agree with the verses line by line; only four of the eight characters are free, giving 518,400 possible charts. Chapter 2 compares three conventions for the zi hour, which differ only between 23:00 and 24:00 and affect 0.0417 of births; the gap between clock time and true solar time changes the hour branch for 0.069 of births in Shanghai and 0.610 in Kuala Lumpur. Chapter 3 follows errors through: a quarter of an hour of error makes the hour pillar wrong with probability 0.06250 to 0.09974, the day, month and year pillars one to three orders of magnitude less often; it gives the conditional probabilities a "boundary check" needs; and the starting age of the luck cycles is a straight line of one year per three days between solar terms that jumps by as much as 10.48 years at a term.
Chapter 4 proves that the ten gods are the ten elements of Z5 × Z2, their table a Latin square and not a function of distance along the order of the stems; three common weightings of the hidden stems agree on the main element, and 0.6, 0.3 and 0.1 share their origin with the 18, 9 and 3 days in command. Chapter 5 writes the judgement of strength as scoring on a weighted graph: over all charts, three defensible parameter sets reach a pairwise Cohen's kappa of only 0.553 to 0.622, all three agree on 0.684 of charts, and the share of "follow" charts lies between 0.022 and 0.121; one double-hour of difference changes the verdict for 0.127 of charts. Chapter 6 compares two chart engines, clock time with the day changing at 23:00 against true solar time with the day changing at midnight: at least one pillar differs for 0.1043 of births in Shanghai and 0.6463 in Kuala Lumpur; it also gives test vectors and a fingerprint. Chapter 7 reads the Yuanhai ziping, the Sanming tonghui and the Ditian sui. Chapter 8 gives a four-step check, the sample size of an agreement study (255 charts fix kappa to within 0.100) and a pre-registered matching test (359 analysed participants). Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Keywords: four pillars; BaZi; Ziping; sexagenary cycle; Julian Day Number; modular arithmetic; Chinese remainder theorem; affine maps; zi hour; true solar time; equation of time; solar terms; error propagation; sensitivity analysis; luck cycles; ten gods; group action; Latin square; hidden stems; weighted graph; rule engine; Cohen's kappa; inter-rater agreement; test vectors; Yuanhai ziping; Sanming tonghui; Ditian sui; matching test; pre-registration
目录 · Contents
- 序:排盘是一段可以检验的程序English 中文Preface: A Chart Is a Program That Can Be Checked
- 第一章 儒略日与四柱的同余公式English 中文Chapter 1. The Julian Day and the Congruences of the Four Pillars
- 第二章 子时的三种约定与真太阳时English 中文Chapter 2. Three Conventions for the Zi Hour, and True Solar Time
- 第三章 出生时间误差与时辰边界English 中文Chapter 3. Timing Errors and the Edges of the Double-Hours
- 第四章 十神是 Z5 × Z2,藏干是权重向量English 中文Chapter 4. The Ten Gods Are Z5 × Z2, the Hidden Stems Weight Vectors
- 第五章 旺衰是加权图上的打分English 中文Chapter 5. Strength Is Scoring on a Weighted Graph
- 第六章 两个排盘引擎与一套测试向量English 中文Chapter 6. Two Chart Engines and a Set of Test Vectors
- 第七章 《渊海子平》《三命通会》与《滴天髓》English 中文Chapter 7. The Yuanhai ziping, the Sanming tonghui and the Ditian sui
- 第八章 四步核查、一致性研究与一项预注册的配对检验English 中文Chapter 8. A Four-Step Check, an Agreement Study and a Pre-Registered Matching Test
How to cite · 引用
Fan, Y. (2026). Four-Pillar Calendrical Computation and Formal Rule Engines: Julian-Day Sexagenary Cycles, Midnight-Boundary Disagreements, Birth-Time Sensitivity Bounds and Weighted-Graph Strength Scoring [四柱排盘的历法计算与规则引擎] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090180
BibTeX
@book{fan2026four,
title = {{Four-Pillar Calendrical Computation and Formal Rule Engines}: Julian-Day Sexagenary Cycles, Midnight-Boundary Disagreements, Birth-Time Sensitivity Bounds and Weighted-Graph Strength Scoring},
author = {Fan, Yafu},
year = {2026},
publisher = {5D Library},
edition = {Version 1.0.0},
doi = {10.5281/zenodo.24090180},
url = {https://doi.org/10.5281/zenodo.24090180},
note = {Chinese title: 四柱排盘的历法计算与规则引擎}
}
| DOI | https://doi.org/10.5281/zenodo.24090180 |
|---|---|
| DOI(全部版本 all versions) | https://doi.org/10.5281/zenodo.24090179 |
| ORCID | https://orcid.org/0009-0004-3519-1203 |
| 5D Library ID | 5DL-B-066 |
| 版本 Version | 1.0.0 · 中英双语版 Bilingual edition |
| 出版日期 Date | 2026-11-08 |
| 网址 Online | https://5dlibrary.com/books/four-pillar-calendrical-computation-rule-engine/ |
| SHA-256 · four-pillar-calendrical-computation-rule-engine_bilingual_v1.0.0.pdf | d49e7171d03ad74857116cd20a01d428dc810581e46ffc3f30435187f8921993 |
| SHA-256 · four-pillar-calendrical-computation-rule-engine_en_v1.0.0.pdf | 03a4b4863598c3b4659d7838fe1a28548fa18f810598875d52359063a461e471 |
| SHA-256 · four-pillar-calendrical-computation-rule-engine_zh_v1.0.0.pdf | 26a88d606e757c6f8f99b0e7a37f6a62ae570d093de581655f77c89d02510a88 |
| Licence · 许可 | Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0). https://creativecommons.org/licenses/by-nc-nd/4.0/ |
Disclosure. The author uses the works of 5D Library, including this book, as the methodological basis of his community courses, the 5D Ascension Cards (Dimensional Shift Card Decks) and the Yafu AI knowledge base, and develops and runs paid online reading software and services built on traditional divinatory symbol systems (four-pillar charts, six-line hexagram casting, Zi Wei Dou Shu, chart matching and date selection); the models of this book are the mathematical basis of those programs' algorithms, so he has a direct commercial interest in its subject. The book promotes no software, course, card deck or service, uses no user data from the author's businesses, and accepts no sponsorship. All its models are offered for mathematical study and teaching only and constitute no promise of divinatory prediction and no advice on any decision. The test in Chapter 8 must be carried out with pre-registered code by an independent analyst who has no financial relationship with the author and does not know where the readings came from, and its results will be published whether positive or negative.