Skip to content

Liu Yao Coin Casting: Counting the Coins, Moving Lines, Na Jia, Shi and Ying, and the Six Relations

Liu Yao coin casting (六爻铜钱起卦, also called the three-coin method, or 以钱代蓍, “coins in place of yarrow”) builds a hexagram from six tosses of three coins, one line per toss. The first toss gives the bottom line and the sixth the top line. The six lines form the primary hexagram (本卦); any “old” lines then flip, giving the changed hexagram (变卦). The hexagram is then dressed (装卦) with Na Jia (纳甲), a system traditionally credited to Jing Fang of the Western Han: each line gets a stem-and-branch pair and its five-phase element, the hexagram is placed in one of eight palaces, which fixes the Shi (世, self) and Ying (应, other) lines and each line’s relation, and the day of the cast adds the six spirits and two void branches. The dressed chart is what a Liu Yao reading works from.

Key numbers

  • 3 coins, 6 tosses: 18 coin faces in all, three to each line.
  • The back counts 3 and the inscribed side 2. Three coins can only total 6, 7, 8 or 9: old yin, young yang, young yin, old yang.
  • The four results have probabilities 1/8, 3/8, 3/8 and 1/8. With fair coins tossed independently, three coins have 2³ = 8 equally likely face patterns: one with three inscribed sides, one with three backs, and three each with one back or with two.
  • Each line moves with probability 1/4. No moving line: about 17.8% (729/4096). One: 35.6%. Two: 29.7%. Three: 13.2%. Four or more: about 3.8% together. All six: 1 in 4096.
  • 4096 outcomes. Four values per line give 4⁶ = 4096, exactly 64 primary hexagrams times 64 changed ones (a cast with no moving line counts as changing into itself). Zhu Xi made the same count: “one hexagram can change into sixty-four, and the 4,096 hexagrams are all contained in them” (一卦可变六十四卦,而四千九十六卦在其中矣).
  • Eight palaces of 8 hexagrams make 64. Within each palace the Shi line sits on lines 6, 1, 2, 3, 4, 5, 4 and 3 in turn, and the Ying line is always three lines away from it.
  • The “six relations” (六亲) are five kinds: Parents, Siblings, Offspring, Wealth, and Officials and Ghosts. There are 6 spirits, and 2 void branches for each day: a ten-day week (旬) pairs its ten stems with ten of the twelve branches, leaving two out.

Counting the faces

Three coins Sum Line Old name Mark Three-coin probability Yarrow probability Moving?
3 inscribed sides 2 + 2 + 2 = 6 Old yin 交 × 1/8 1/16 Yes, becomes yang
1 back, 2 inscribed 3 + 2 + 2 = 7 Young yang 单 ⚊ 3/8 5/16 No
2 backs, 1 inscribed 3 + 3 + 2 = 8 Young yin 拆 ⚋ 3/8 7/16 No
3 backs 3 + 3 + 3 = 9 Old yang 重 ○ 1/8 3/16 Yes, becomes yin
  • Which side is which. The inscribed side (字, also called 面, “face”) is the side cast with the coin’s legend; the back (背) is the other side. This page, like HeyFate, takes the back as the yang side worth 3 and the inscribed side as the yin side worth 2.
  • Why one back makes young yang. Adding 3s and 2s, the odd coin out decides the young lines. One back among two inscribed sides makes a yang line; two backs and one inscribed side make a yin line.
  • Where the old names come from. Jia Gongyan, a Tang-dynasty scholar, explains in his subcommentary on the Yili (仪礼) how lines obtained with yarrow stalks were recorded: “in ancient times wood was used to draw on the ground; now coins are used” (古用木画地,今则用钱). He then names the four values: three “few” make a 重 coin, nine; three “many” a 交 coin, six; two many and one few a 单 coin, seven; two few and one many a 拆 coin, eight (《仪礼注疏》, juan 1). “Few” and “many” are the yarrow stalks set aside in the count, not coin faces. A note in Hu Fangping’s commentary on Zhu Xi’s Yixue qimeng classes a set-aside total of four or five stalks as qi (奇) and one of eight or nine as ou (偶). These are category names in the yarrow count, not the arithmetic odd and even of the numbers. Three qi make old yang, the 重 line.
  • The coin rule. The Southern Song scholar Xiang Anshi (项安世) put it plainly: “toss three coins: two backs and one face make 坼, two faces and one back make 单, all faces make 交, all backs make 重” (以三钱掷之,两背一面为坼,两面一背为单,俱面为交,俱背为重). He is quoted in the Siku Quanshu abstract of the Jingshi Yizhuan; 坼 is another way of writing 拆. The Huozhulin (火珠林) calls the same four lines young yang (单), young yin (拆), great yang (重) and great yin (交).
  • The yarrow column uses the usual idealised model of the three counts: in the first, the stalks set aside total 5 or 9 with probabilities 3/4 and 1/4; in the second and third, 4 or 8 with probability 1/2 each.

From the primary to the changed hexagram

  1. Record from the bottom up. Toss 1 is line 1, and so on up to toss 6, line 6.
  2. Draw the primary hexagram. Sums of 7 and 9 are yang lines, 8 and 6 yin lines. Lines 1 to 3 form the inner (lower) trigram and lines 4 to 6 the outer (upper) trigram; together they name the hexagram.
  3. Flip the moving lines. Old yang (○) becomes yin and old yin (×) becomes yang; young lines are copied unchanged. The result is the changed hexagram. In the words of the Zengshan Buyi (增删卜易), “if the lines do not move they do not change; if they move they must change” (六爻不动则不变,动则必变). A cast without moving lines is usually called an unchanging hexagram (静卦); the app still shows the changed-hexagram row, with the same name as the primary hexagram.
  4. Give the changed hexagram its own Na Jia. It takes stems and branches from its own trigrams, so a line that did not move can still read differently when its trigram has changed (see line 1 in the example below).
  5. Keep the primary hexagram’s palace for the relations. The Zengshan Buyi: “the lines that change out are given their relations by the original hexagram” (变出之爻安六亲者,仍照正卦而推).

Dressing the hexagram with Na Jia, in five steps

  1. Palace, Shi and Ying. The eight doubled trigrams, such as Heaven over Heaven (乾为天) or Water over Water (坎为水), head the eight palaces. Starting from the head hexagram, flip one more line each time from the bottom: flipping line 1 gives the first-generation hexagram, flipping line 2 as well gives the second, and so on up to line 5 for the fifth. Flipping line 4 of the fifth back gives the wandering-soul hexagram (游魂); turning its inner trigram back into the palace’s trigram gives the returning-soul hexagram (归魂). The top line never changes, so all eight hexagrams of a palace share their top line. The Shi line is line 6 for the head, lines 1 to 5 for the first to fifth generations, line 4 for the wandering soul and line 3 for the returning soul. The Ying line is three away: Shi on 1 with Ying on 4, Shi on 2 with Ying on 5, and so on.

Numbers are the King Wen sequence. The order within each palace follows the Jingshi Yizhuan, juan 1 and 2; the palace elements follow the Zengshan Buyi chapter on the six relations.

  1. Stems and branches (Na Jia). The inner trigram (lines 1 to 3) and the outer trigram (lines 4 to 6) each take three stem-branch pairs. Only the trigram matters, not the palace:
Trigram Palace element As inner trigram: lines 1, 2, 3 As outer trigram: lines 4, 5, 6
Qian 乾 metal Jia-Zi 甲子 water, Jia-Yin 甲寅 wood, Jia-Chen 甲辰 earth Ren-Wu 壬午 fire, Ren-Shen 壬申 metal, Ren-Xu 壬戌 earth
Zhen 震 wood Geng-Zi 庚子 water, Geng-Yin 庚寅 wood, Geng-Chen 庚辰 earth Geng-Wu 庚午 fire, Geng-Shen 庚申 metal, Geng-Xu 庚戌 earth
Kan 坎 water Wu-Yin 戊寅 wood, Wu-Chen 戊辰 earth, Wu-Wu 戊午 fire Wu-Shen 戊申 metal, Wu-Xu 戊戌 earth, Wu-Zi 戊子 water
Gen 艮 earth Bing-Chen 丙辰 earth, Bing-Wu 丙午 fire, Bing-Shen 丙申 metal Bing-Xu 丙戌 earth, Bing-Zi 丙子 water, Bing-Yin 丙寅 wood
Kun 坤 earth Yi-Wei 乙未 earth, Yi-Si 乙巳 fire, Yi-Mao 乙卯 wood Gui-Chou 癸丑 earth, Gui-Hai 癸亥 water, Gui-You 癸酉 metal
Xun 巽 wood Xin-Chou 辛丑 earth, Xin-Hai 辛亥 water, Xin-You 辛酉 metal Xin-Wei 辛未 earth, Xin-Si 辛巳 fire, Xin-Mao 辛卯 wood
Li 离 fire Ji-Mao 己卯 wood, Ji-Chou 己丑 earth, Ji-Hai 己亥 water Ji-You 己酉 metal, Ji-Wei 己未 earth, Ji-Si 己巳 fire
Dui 兑 metal Ding-Si 丁巳 fire, Ding-Mao 丁卯 wood, Ding-Chou 丁丑 earth Ding-Hai 丁亥 water, Ding-You 丁酉 metal, Ding-Wei 丁未 earth

Stems: Qian takes Jia (甲) inside and Ren (壬) outside, Kun takes Yi (乙) inside and Gui (癸) outside, and the other six use one stem both ways: Zhen Geng, Xun Xin, Kan Wu, Li Ji, Gen Bing, Dui Ding. Juan 3 of the Jingshi Yizhuan puts it as “divide the images of Heaven and Earth, Qian and Kun, adding Jia, Yi, Ren and Gui; Zhen and Xun are matched with Geng and Xin, Kan and Li with Wu and Ji, Gen and Dui with Bing and Ding”. Which of Qian’s and Kun’s stems goes inside shows in Lu Ji’s notes on single lines in juan 1 and 2: Qian’s line 1 is Jia-Zi and line 6 Ren-Xu, Kun’s line 1 is Yi-Wei and line 6 Gui-You. Branches: the yang trigrams Qian, Zhen, Kan and Gen start from Zi, Zi, Yin and Chen and run forward, skipping one branch each time; the yin trigrams Kun, Xun, Li and Dui start from Wei, Chou, Mao and Si and run backward in the same way (read off the table in the Zengshan Buyi chapter 浑天甲子).

  1. Relations. Take the palace element as “self”. What produces self is Parents (父母), what self produces is Offspring (子孙), what controls self is Officials and Ghosts (官鬼), what self controls is Wealth (妻财), and the same element is Siblings (兄弟). Production runs metal, water, wood, fire, earth and back to metal; control runs metal over wood, wood over earth, earth over water, water over fire, fire over metal (Zengshan Buyi, chapters on the five phases). Juan 3 of the Jingshi Yizhuan names the five kinds differently: 系爻 for ghosts, 制爻 for wealth, 义爻 for “heaven and earth”, 宝爻 for “fortune and virtue” and 专爻 for “the same qi”; Lu Ji’s notes identify heaven and earth as parents, fortune and virtue as offspring, and the same qi as siblings.

  2. Six spirits. By the stem of the day, from line 1 upward: Jia and Yi days start with Qing Long 青龙 (Azure Dragon), Bing and Ding with Zhu Que 朱雀 (Vermilion Bird), Wu with Gou Chen 勾陈, Ji with Teng She 螣蛇 (Flying Serpent), Geng and Xin with Bai Hu 白虎 (White Tiger), and Ren and Gui with Xuan Wu 玄武 (Black Tortoise). The order then continues round to line 6 (Zengshan Buyi, chapter on the six spirits, which writes Xuan Wu as 元武).

  3. Month, day and void branches. The month branch (月建) is the branch of the month in which the cast is made, and the day (日辰) is the stem-branch pair of that day. The void branches follow the day: counting ten-day weeks from each Jia day, the ten stems meet only ten of the twelve branches, so two are left void. The Jia-Zi week leaves Xu and Hai, Jia-Xu leaves Shen and You, Jia-Shen leaves Wu and Wei, Jia-Wu leaves Chen and Si, Jia-Chen leaves Yin and Mao, and Jia-Yin leaves Zi and Chou (Zengshan Buyi, chapter on void branches).

A worked example

Suppose the cast is made at 10:00 Beijing Time on 28 October 2026, with the coins in the table (B = back, I = inscribed side). The day is Yi-Hai (乙亥). 2026 is a Bing-Wu year; the stretch from Cold Dew (寒露, 8 October) to Winter Commences (立冬, 7 November) is the Xu (戌) month, and since a Bing year’s Yin month is Geng-Yin, counting on gives Wu-Xu (戊戌) as the month. Yi-Hai belongs to the Jia-Xu week, so Shen (申) and You (酉) are void, and a Yi day starts the spirits with the Azure Dragon. HeyFate’s Liu Yao engine produced the table (October 2026), and every cell was checked by hand with the five steps above.

Line Coins Sum Line type Spirit Relation Na Jia Shi / Ying Changed hexagram (relations by the Qian palace)
6 (toss 6) I I B 7 Young yang Black Tortoise Parents Ren-Xu 壬戌 earth Parents, Ren-Xu 壬戌 earth
5 (toss 5) B I I 7 Young yang White Tiger Siblings Ren-Shen 壬申 metal (void) Ying Siblings, Ren-Shen 壬申 metal
4 (toss 4) I B I 7 Young yang Flying Serpent Officials and Ghosts Ren-Wu 壬午 fire Officials and Ghosts, Ren-Wu 壬午 fire
3 (toss 3) B B B 9 Old yang ○ Gou Chen Siblings Bing-Shen 丙申 metal (void) Officials and Ghosts, Wu-Wu 戊午 fire
2 (toss 2) I I I 6 Old yin × Vermilion Bird Officials and Ghosts Bing-Wu 丙午 fire Shi Parents, Wu-Chen 戊辰 earth
1 (toss 1) B B I 8 Young yin Azure Dragon Parents Bing-Chen 丙辰 earth Wealth, Wu-Yin 戊寅 wood
  • Primary hexagram. Lines 1 to 3 (yin, yin, yang) are Gen 艮, Mountain; lines 4 to 6 (all yang) are Qian 乾, Heaven. Together they make Dun 遁, hexagram 33. Flipping line 1 of Qian gives Gou 姤 (first generation), and flipping line 2 as well gives Dun, so Dun is the second-generation hexagram of the Qian palace, with Shi on line 2 and Ying on line 5.
  • Changed hexagram. Line 2 (old yin) becomes yang and line 3 (old yang) becomes yin. The lower trigram becomes yin, yang, yin, which is Kan 坎, Water, giving Song 讼, hexagram 6.
  • Na Jia. The inner Gen gives Bing-Chen, Bing-Wu and Bing-Shen; the outer Qian gives Ren-Wu, Ren-Shen and Ren-Xu. In the changed hexagram the inner Kan gives Wu-Yin, Wu-Chen and Wu-Wu, and the outer trigram is still Qian. Line 1 did not move, yet it reads Wu-Yin instead of Bing-Chen in the changed hexagram, because its trigram changed from Gen to Kan.
  • Relations. The Qian palace is metal. Earth (Chen, Xu) produces metal, so those lines are Parents; fire (Wu) controls metal, so Officials and Ghosts; metal (Shen) is the same element, so Siblings; wood (Yin, on the changed line 1) is controlled by metal, so Wealth. Song itself is the wandering-soul hexagram of the Li palace, which is fire. With fire as self, Wu-Chen would be Offspring and Wu-Wu Siblings, but the rule keeps the primary hexagram’s Qian palace.
  • Void branches. Bing-Shen on line 3 and Ren-Shen on line 5, the Ying line, carry the void branch Shen.
  • Missing relations. Dun has no Offspring (water) and no Wealth (wood) line. The Zengshan Buyi chapter on hidden spirits (飞伏神章) says that when the relation you need does not appear, the day or month can stand in for it, and if neither is that relation, look for it in the head hexagram of the palace (本宫首卦). Here the day branch Hai (water) is Offspring for a metal palace and the month branch Xu (earth) is Parents; Wealth (wood) is neither, so by that rule it is looked for in Qian, whose line 2, Jia-Yin, is Wealth. This page sets out the chart only and does not interpret it.

Where traditions differ

  • Which side is yang. Chinese Wikipedia’s article 文王卦 calls the side opposite the back 正 and counts two 正 and one back as young yin, two backs and one 正 as young yang, three backs as old yin and three 正 as old yang. That counts the inscribed side as 3 and the back as 2, the reverse of Xiang Anshi’s rule above. The same physical toss then gives the opposite line: three inscribed sides is old yin under one count and old yang under the other, and one back with two inscribed sides switches between young yang and young yin. The probabilities stay the same; what changes is which coin pattern maps to which line. When charting coins someone else recorded, ask which count they used. English Wikipedia gives heads 3 and tails 2 but does not say which side of a Chinese coin is heads.
  • Coins or yarrow. Yarrow makes old yang three times as likely as old yin, while coins give both 1/8 (see the table). The same Wikipedia article describes modified coin methods that reproduce the yarrow odds, and methods that build a hexagram from the time, a direction and similar data.
  • Reading several moving lines. Zhu Xi’s rules in the Yixue qimeng (考变占) are for reading the line texts of the Zhouyi. No moving line: read the primary hexagram’s judgment. One: that line’s text. Two: both line texts, the upper one leading. Three: the judgments of both hexagrams. Four: the two unmoved lines of the changed hexagram, the lower one leading. Five: the one unmoved line of the changed hexagram. Six: the “use nine” and “use six” texts for Qian and Kun, and the changed hexagram’s judgment for the rest. For the two- and four-line cases Zhu Xi notes that “the classic and its commentaries have no text; I infer it by analogy” (经传无文,今以例推之). Na Jia readings generally do not use the line texts. They weigh how strong each line’s element is and how it produces, controls, clashes with or combines with the Shi and Ying lines and the relations. The Siku abstract that quotes Xiang Anshi says in the same passage that this coin method “does not divine by the 交 and 重 lines but by the Shi line” (不以交重为占,自以世为占).
  • Casts between 23:00 and midnight. Whether the day changes at 23:00 or at 00:00 decides which day the cast belongs to. The spirits and void branches are read from that day, so they can differ: the spirits differ when the new day’s stem falls in another group, the void branches only when the day crosses into a new ten-day week. If the worked example above had been cast at 23:30 on the same date, it would fall on Bing-Zi (丙子) under the 23:00 rule, with the spirits starting from the Vermilion Bird and the void branches still Shen and You. Both day-change rules are explained in True Solar Time in Bazi.
  • Disagreement within one tradition. The Zengshan Buyi often sets older rules against its author’s own trials: “the ancients said so; I tried it and it was not so” (古有此说,予试不然), in its chapter on the month. Its chapter on void branches complains that “the books make void branches too complicated” (旬空之法,诸书论太烦) and lists twelve kinds of void. Hidden spirits, the Gua Shen (卦身) and spirit stars are beyond the scope of this page.

How HeyFate handles it

As of October 2026:

  • Coins only. HeyFate does not cast by the time or by numbers, and you cannot enter results from your own physical coins; a Liu Yao reading asks only for your question.
  • Each cast first locks 18 bytes from the system’s cryptographically secure random source (Web Crypto getRandomValues). The lowest bit of each byte is one coin, 1 for the back and 0 for the inscribed side; every 3 bytes make one toss, and toss 1 is the bottom line.
  • By default you toss by hand: press “Toss” six times and the hexagram builds from the bottom up. The card shows each coin, labelled H (back) or T (inscribed side) in the English interface, with the line’s name, and marks moving lines ○ or ×. You can skip the animation or stop midway. Each toss was fixed when the bytes were locked, and a result that does not match the locked bytes is rejected.
  • With “Cast I Ching automatically” turned on in Settings › General (it is off by default), HeyFate tosses all six at once. /pk comparisons and scheduled readings always cast automatically. Both modes use the same random source, and an automatic cast tells the model that the user did not toss the coins by hand.
  • Counting and dressing follow the rules on this page: the back counts 3 and the inscribed side 2; eight palaces with Shi and Ying, Na Jia, relations (by the primary hexagram’s palace in the changed hexagram), six spirits and void branches. The Liu Yao engine has 148 golden test cases (64 for the hexagram table, 64 for Na Jia, 12 casts and the 8 coin patterns), each checked against independent sources.
  • The day and month come from the computer’s clock at the moment the sixth toss completes, in the local standard time of the system time zone (daylight saving removed, no true solar time). The day changes at 23:00 and the month at the solar terms, both computed by the Bazi engine, and the spirits and void branches follow the day.
  • The chart lists the primary hexagram with its palace and generation, the changed hexagram, the moving lines, the day, the month and the void branches, plus a table from line 6 down to line 1: spirits, relations, Na Jia, line shape (○ and × for moving lines) and Shi / Ying. The changed-hexagram column shows the new stem-branch pair and relation on moving lines only.
  • Hidden spirits, the Gua Shen, spirit stars and the choice of the “use spirit” (用神) are not part of the engine. It hands over the chart facts above, and the model you choose writes the reading.

HeyFate is a desktop app for macOS and Windows: charts are built on your computer and read by your own AI subscription or API key. See the install guide.

Sources

AI-generated content, for reference only; not medical, legal, financial or psychological advice. These methods come from cultural traditions, and HeyFate offers them for cultural interest, entertainment and self-reflection.

All articles