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.

General Preface
The greatest virtue of Heaven and Earth is to give birth; the greatest treasure of the Sage is position. Since Fuxi in antiquity observed the patterns above and the laws below, drawing the trigrams and establishing the images, the ancient people of Huaxia have connected Heaven and humanity through the methodology of "Images and Numbers" (Xiang Shu). Their Dao is vast and profound, and their techniques are numerous and diverse. As for the two arts later referred to as "Bazi" (Eight Characters) and "Qimen Dunjia" (Mysterious Gates and Escaping Jia), although their forms and operational methods differ, their foundations all stem from the grand system of the Heavenly Stems, Earthly Branches, Yin, and Yang, Five Phases. Their origins can all be traced back to the great achievements of the ancient Sage-Kings in establishing the calendar and charting the celestial phenomena during the pre-Qin period and earlier.
Among contemporary practitioners of the arts of calculation and divination, there is often a dispute: between Bazi and Qimen Dunjia, which one carries a greater volume of information$1 This question appears to be a mere technical distinction, but it actually touches upon the deep structure of mathematical principles and the fundamental doctrines of metaphysics. The concept of "information capacity" is not new to modern times. The Book of Changes, Great Treatise (Xici Zhuan) states: "The Yi as a writing is vast and fully equipped: there is the Way of Heaven, there is the Way of Man, there is the Way of Earth. Combining the Three Powers and multiplying them by two, thus we have Six." This "vast and fully equipped" (guangda xibèi) refers to the ultimate expression of information capacity. The Sages established the trigrams and observed the images with the aim of "encompassing the Dao of Heaven and Earth" (mílún tiāndì zhī dào); how immense, then, is the information capacity of the hexagrams! The arts of Stems and Branches, Dunjia, and others all derive from this fundamental principle of "encompassing" and are adapted therefrom. The size of their information capacity ultimately depends on their respective mathematical structures and layers of symbolic meaning.
The purpose of this article is to trace the origins, starting from pre-Qin classics and ancient transmissions, using the mathematical structure as the warp and metaphysical doctrine as the weft, to conduct a systematic comparative study of the information capacity of Bazi and Qimen Dunjia, ultimately attempting to arrive at a unified conclusion based on both mathematics and metaphysics. All references cited herein are based on classics dating from the pre-Qin period up to the end of the Han Dynasty, striving for evidential rigor and doctrinal grounding.
What is "information capacity"$2 This is not a concept invented by modern people. The Xici Zhuan says: "Writing does not exhaust words; words do not exhaust meaning" (shū bù jìn yán, yán bù jìn yì). And also: "The Sage established images to exhaust meaning, set up hexagrams to exhaust emotion and falsehood, and attached statements to exhaust their words." There is an "inexhaustible" gap between words and meaning, which requires supplementation by "images" (xiàng) and "hexagrams" (guà)—this is the classical expression of information encoding and capacity. The capacity of a system to bear "meaning" (yì), to express "emotion and falsehood" (qíngwěi), and to encompass the "juncture" (jǐ) of transformations, lies precisely in its information capacity.
We must ask:
How is it that the Stems and Branches can record the movements of Heaven and Earth$3 And how is it that Dunjia can unfold the transformations of military strategy$4 From where do the "abilities" (néng) of these two arts derive$5 And how is the extent of this "ability" to be measured$6
This is the core proposition of this paper.