The Evolution of the Heavenly Stems and Earthly Branches and the Transformation of Dun Jia: A Unified Mathematical Metaphysical Study of the Information Capacity in Bazi and Qimen Dunjia
This paper systematically investigates the information-carrying capacity of Bazi (Eight Characters) and Qimen Dunjia (Mystical Gates) as divination systems, starting from the mathematical structure of Taiji, Liangyi, Sixiang, and Bagua in the *Book of Changes*. By analyzing the classical mathematical foundations such as Yin-Yang, Five Phases, the River Chart, and the Luo Script, it aims to provide a unified perspective for measuring and comparing the information density of these two divination arts.

Chapter 5: Detailed Examination of the Mathematical Structure of Bazi
Section 1: Combinatorial Mathematics of the Four Pillars of Bazi
In the previous section, we roughly calculated the theoretical combination number of Bazi to be about 518,400. We will now analyze this more precisely.
Year Pillar:
Since the Sixty Jiazi cycle repeats, the Year Pillar has 60 possible combinations, each appearing once in a 60-year cycle.
Month Pillar:
The Heavenly Stem of the Month Pillar is determined by the Heavenly Stem of the Year Pillar (Method of the Five Tigers Hiding the Month):
- Jia or Ji Year starts with Bing Yin month.
- Yi or Geng Year starts with Wu Yin month.
- Bing or Xin Year starts with Geng Yin month.
- Ding or Ren Year starts with Ren Yin month.
- Wu or Gui Year starts with Jia Yin month.
There are twelve months per year; the Earthly Branch of the Month is fixed sequentially (Yin, Mao, Chen, etc.). The Heavenly Stem of the Month is determined by the starting Stem of the Year Stem and follows sequentially.
Thus, for any given Year Pillar, there are 12 possibilities for the Month Pillar (corresponding to the twelve months). Because different Year Stems correspond to different starting Month Stems, five groups of Year Stems (Jia-Ji, Yi-Geng, Bing-Xin, Ding-Ren, Wu-Gui) $\times$ 12 months = 60 types of Month Pillars—coincidentally also sixty combinations of the Jiazi cycle.
Year Pillar $\times$ Month Pillar: $60 \times 12 = 720$ Year-Month combinations.
However, a structural constraint exists: once the Heavenly Stem of the Year is given, the Heavenly Stem of the Month is determined. Therefore, the independent information of the Month Pillar only lies in the choice of the Month Branch (12 possibilities), i.e., $\log_2(12) \approx 3.58$ bits of independent information.
Day Pillar:
The Sixty Jiazi cycle of the Day Pillar is independent of the Year and Month—on any day of any month, the Day Pillar can be any of the Sixty Jiazi. Thus, the Day Pillar has 60 possibilities, completely independent of the Year/Month Pillars.
Information capacity of the Day Pillar: $\log_2(60) \approx 5.91$ bits.
Hour Pillar:
The Heavenly Stem of the Hour Pillar is determined by the Heavenly Stem of the Day Pillar (Method of the Five Rats Hiding the Hour), similar to the Month Pillar:
- Jia or Ji Day starts with Jia Zi hour.
- Yi or Geng Day starts with Bing Zi hour.
- Bing or Xin Day starts with Wu Zi hour.
- Ding or Ren Day starts with Geng Zi hour.
- Wu or Gui Day starts with Ren Zi hour.
There are twelve shí chén (double-hours) per day; the Earthly Branch of the Hour is fixed sequentially (Zi, Chou, Yin...). The Heavenly Stem of the Hour is determined by the starting Stem of the Day Stem and follows sequentially.
Thus, for every Day Pillar, there are 12 possibilities for the Hour Pillar.
Day Pillar $\times$ Hour Pillar: $60 \times 12 = 720$ Day-Hour combinations.
Similarly, the independent information of the Hour Pillar only lies in the Hour Branch (12 possibilities), i.e., $\log_2(12) \approx 3.58$ bits.
First Layer of Total Independent Information of Bazi:
= Year Pillar Information + Independent Month Pillar Information + Day Pillar Information + Independent Hour Pillar Information = $\log_2(60) + \log_2(12) + \log_2(60) + \log_2(12)$ = $5.91 + 3.58 + 5.91 + 3.58$ $\approx 18.98$ bits
This is the "first layer" static combination information capacity of Bazi—about 19 bits.
Section 2: Relational Information of Bazi
The information in Bazi extends far beyond static combinations. A complex network of relationships exists among the Four Pillars:
1. Relationships among Heavenly Stems:
The four Heavenly Stems can have the following relationships with each other:
- Five Harmonies (Wǔ Hé): Jia-Ji, Yi-Geng, Bing-Xin, Ding-Ren, Wu-Gui.
- Overcoming (Kè): Jia/Yi Wood overcomes Wu/Ji Earth, Bing/Ding Fire overcomes Geng/Xin Metal...
- Generation (Shēng): Water generates Wood, Wood generates Fire, Fire generates Earth, Earth generates Metal, Metal generates Water.
There are $C(4, 2) = 6$ pairs of relationships among the four Stems. Each pair can be: Harmony, Generation, Overcoming, Being Generated, Being Overcome, or Comparison/Similarity (Bi He)—a total of 6 basic types.
6 pairs $\times$ approximately 6 types per pair = 36 possible relational combinations.
In reality, Stem relationships are more complex—harmony leading to transformation, harmony without transformation, overcoming within generation, generation within overcoming—these subtleties further increase the relational information.
2. Relationships among Earthly Branches:
The relationships among the four Earthly Branches are particularly complex:
- Six Harmonies (Liù Hé): Zi-Chou, Yin-Hai, Mao-Xu, Chen-You, Si-Shen, Wu-Wei.
- Three Combinations (Sān Hé): Shen-Zi-Chen combine to form Water Bureau; Hai-Mao-Wei combine to form Wood Bureau; Yin-Wu-Xu combine to form Fire Bureau; Si-You-Chou combine to form Metal Bureau.
- Three Meetings (Sān Huì): Yin-Mao-Chen meet as Wood; Si-Wu-Wei meet as Fire; Shen-You-Xu meet as Metal; Hai-Zi-Chou meet as Water.
- Six Clashes (Liù Chōng): Zi-Wu, Chou-Wei, Yin-Shen, Mao-You, Chen-Xu, Si-Hai.
- Three Punishments (Sān Xíng): Yin punishes Si, Si punishes Shen, Shen punishes Yin (Unkind Punishment); Chou punishes Xu, Xu punishes Wei, Wei punishes Chou (Presumptuous Punishment); Zi punishes Mao, Mao punishes Zi (Shameless Punishment); Chen-Chen, Wu-Wu, You-You, Hai-Hai (Self-Punishment).
- Six Harms (Liù Hài): Zi-Wei harm, Chou-Wu harm, Yin-Si harm, Mao-Chen harm, Shen-Hai harm, You-Xu harm.
- Breach (Pò): Zi-You breach, Chou-Chen breach, Yin-Hai breach, Mao-Wu breach, Si-Shen breach, Wei-Xu breach.
- Three Meetings (Sān Huì): Yin-Mao-Chen meet as Wood; Si-Wu-Wei meet as Fire; Shen-You-Xu meet as Metal; Hai-Zi-Chou meet as Water.
There are 6 pairs of relationships among the four Earthly Branches. Each pair may have multiple types of relationships listed above, and multiple relationships can coexist (e.g., simultaneously clashing and punishing). Furthermore, there are multi-party relationships among three or four Earthly Branches, such as Three Combinations and Three Punishments.
This relational network complexity far exceeds that of the Heavenly Stems. A preliminary estimate suggests that the relational information among the Branches alone could reach tens of bits.
3. Relationships between Heavenly Stems and Earthly Branches:
- Stem Seated on Branch: Each Heavenly Stem sits on the Earthly Branch below it, and the two have a generation or overcoming relationship.
- Stem Rooting: A Heavenly Stem finds its "root" within the Hidden Stems of the Earthly Branches (e.g., Jia Wood has a root in Yin).
- Capping and Intercepting: When a Stem overcomes a Branch, it is called Capping; when a Branch overcomes a Stem, it is called Intercepting.
Each of the four Pillars has its own Stem-Branch relationship, totaling 4 groups. Moreover, Stems and Branches across different pillars also have relationships.
4. The Ten Gods System (Shí Shén):
Taking the Day Master (Day Stem) as "Self" (Wǒ), the remaining seven characters determine the Ten Gods:
- Companion (Bǐjiān): Same Five Phase, same Yin/Yang as Self.
- Rob Wealth (Jiécái): Same Five Phase, different Yin/Yang from Self.
- Output God (Shíshén): Same Five Phase, same Yin/Yang as what Self generates.
- Hurting Officer (Shāngguān): Same Five Phase, different Yin/Yang as what Self generates.
- Indirect Wealth (Piāncái): Same Five Phase, same Yin/Yang as what Self overcomes.
- Direct Wealth (Zhèngcái): Same Five Phase, different Yin/Yang as what Self overcomes.
- Seven Killings (Qīshā): Same Five Phase, same Yin/Yang as what overcomes Self.
- Direct Officer (Zhèngguān): Same Five Phase, different Yin/Yang as what overcomes Self.
- Indirect Resource (Piānyìn): Same Five Phase, same Yin/Yang as what generates Self.
- Direct Resource (Zhèngyìn): Same Five Phase, different Yin/Yang as what generates Self.
The Ten Gods system transforms the Five Phase generation/overcoming relationships in Bazi into interpersonal relationships—this is the most core mechanism for information transformation in Bazi. The ten types of Gods each symbolize different social/humanistic symbols:
- Direct Officer: Reputation, status, constraint.
- Seven Killings: Authority, pressure, danger.
- Direct Resource: Mother, learning, protection.
- Indirect Resource: Esoteric learning, adoptive mother, isolation.
- Output God: Talent, enjoyment of food, ease.
- Hurting Officer: Outward display of talent, rebellion, verbal disputes.
- Direct Wealth: Legitimate income, wife, material goods.
- Indirect Wealth: Windfall, father, relations with the opposite sex.
- Companion: Siblings, competition, self-reliance.
- Rob Wealth: Seizing, cooperation, loss.
The Self is not assigned a God, so there are 7 God positions. Each position can take one of 10 Gods. Thus, there are 7 Ten God positions.
The information capacity of the Ten Gods system is approximately $7 \times \log_2(10) \approx 7 \times 3.32 \approx 23.24$ bits.
However, relationships exist among the Ten Gods—such as Officer and Killings mixed, Output/Hurting combined to generate Wealth, Killings generating Resource, etc.—these pattern relationships further increase the total information amount.
Section 3: Dynamic Information of Bazi—Great Cycles and Flowing Years
The information in Bazi is not only contained in the static Four Pillars at birth (static), but also in the subsequent Great Cycles (Dàyùn) and Flowing Years (Liúnián) (dynamic).
Great Cycles (Decades):
Great Cycles begin from the starting point of the Month Pillar, moving forward for Yang Males/Females and backward for Yin Males/Females, one step every ten years. Each step is a Stem-Branch combination, containing information on both the Heavenly Stem and Earthly Branch. A person typically experiences 8 to 10 Great Cycles (about 80-100 years), meaning a dynamic information trajectory spanning 80-100 years.
The information capacity of each Great Cycle step is about $\log_2(60) \approx 5.91$ bits. The total information capacity of 10 steps is about $59.1$ bits—but since adjacent Great Cycles have fixed intervals, the independent information capacity is smaller.
More importantly, the information in the Great Cycle lies in its interaction with the natal chart—the Harmony or Overcoming between the Great Cycle Stem and the natal Stems, the Clash, Harmony, or Punishment between the Great Cycle Branch and the natal Branches—these interactions generate a vast amount of "conditional information."
Flowing Years:
Each year is a Flowing Year Stem-Branch, cycling every 60 years. The triple interaction among the Flowing Year, Natal Chart, and Great Cycle generates extremely rich annual information.
Flowing Months, Flowing Days, Flowing Hours:
Further refinement shows that within a Flowing Year are Flowing Months (12 months), within Flowing Months are Flowing Days (about 30 days), and within Flowing Days are Flowing Hours (12 shí chén)—this recursive refinement can push temporal precision to the two-hour level.
Dynamic Information Estimation:
A lifetime of about 80 years, totaling $80 \times 12 \times 30 \times 12 \approx 345,600$ double-hours. The interaction of the Flowing Year, Flowing Month, Flowing Day, and Flowing Hour with the natal chart at each moment generates new information.
Of course, this dynamic information is not entirely independent—there is a great deal of redundancy and repetition. But the total amount of information is still substantial.
A preliminary estimate suggests that the "dynamic information capacity" of Bazi (including interactions from Great Cycles, Flowing Years, Flowing Months, Flowing Days) could reach several hundred bits.
Section 4: Estimation of Total Bazi Information Capacity
Summarizing the analysis above:
| Information Layer | Estimated Information Capacity (bits) |
|---|---|
| Static Combination Info | $\approx 19$ |
| Heavenly Stem Relationship Info | $\approx 10-15$ |
| Earthly Branch Relationship Info | $\approx 20-30$ |
| Stem-Branch Interaction Info | $\approx 10-15$ |
| Ten Gods System Info | $\approx 20-25$ |
| Nayin Information | $\approx 10-15$ |
| Hidden Stem Information | $\approx 15-20$ |
| Pattern Judgment Information | $\approx 10-15$ |
| Dynamic Information (Cycles/Years) | $\approx 100-200$ |
| Total | $\approx 214-354$ |
Taking the median value, the total information capacity of Bazi is about 250-300 bits.
Although this estimate is rough, it provides a reference order of magnitude. About 300 bits of information capacity implies that the Bazi system can distinguish about $2^{300} \approx 10^{90}$ different states—a number far exceeding the total number of atoms in the universe (about $10^{80}$).
Of course, in reality, the effective information capacity of Bazi is limited by its structural constraints—not all 300 bits are independent. After deducting redundancy, the effective information capacity might be around 100-200 bits.
Even so, this capacity is considerable—sufficient to provide a unique and detailed life description for every individual.