The Mathematics of the Ling Qi Jing
The Ling Qi Jing (“magic chess,” “divine tokens”) is a Taoist oracle that dates back to the first few centuries CE. It consists of 125 oracle texts which are chosen by casting three sets of four tokens or coins, and counting the number of heads in each set of four. Each set of tokens determines one number of a threenumber trigraph which corresponds to one of the oracle texts. The numbers are actually base 5, and range from 000 to 444, an interesting early use of a zeroincluded nondecimal numbering system.
For example, using nickels, pennies, and dimes, the following represents the number 431, which is trigraph 57 in the traditional numbering:

TS’UNG HSIN Follow your Heart Mysterious clouds cover you above, Below there are no deceivers. Everything flows along— All returns to its true state. 
Four twosided tokens can be arranged 16 different ways. There is only one way to make 0 or 4 heads, 4 ways to make 1 or 3 heads, and 6 ways to make 2 heads; so the odds ratio is 1:4:6:4:1 for 0, 1, 2, 3, and 4 heads, respectively. The relative odds of obtaining the trigraphs thus range from:
6/16 × 6/16 × 6/16 = 216/4096 for trigraph 222, to
1/16 × 1/16 × 1/16 = 1/4096 for each of the trigraphs that consist of only 0’s and 4’s.
The odds of getting each trigraph, assuming that the results are random:
odds/4096  trigraphs 
216  222 
144  122, 212, 221, 223, 232, 322 
96  112, 121, 123, 132, 211, 213, 231, 233, 312, 321, 323, 332 
64  111, 113, 131, 133, 311, 313, 331, 333 
36  022, 202, 220, 224, 242, 422 
24  012, 021, 023, 032, 102, 120, 124, 142, 201, 203, 210, 214, 230, 234, 241, 243, 302, 320, 324, 342, 412, 421, 423, 432 
16  011, 013, 031, 033, 101, 103, 110, 114, 130, 134, 141, 143, 301, 303, 310, 314, 330, 334, 341, 343, 411, 413, 431, 433 
6  002, 020, 024, 042, 200, 204, 240, 244, 402, 420, 424, 442 
4  001, 003, 010, 014, 030, 034, 041, 043, 100, 104, 140, 144, 300, 304, 340, 344, 401, 403, 410, 414, 430, 434, 441, 443 
1  000, 004, 040, 044, 400, 404, 440, 444 
In the table above, the numbers of the seemingly “good” or “neutral” trigraphs are bold, and the “bad” ones are gray. (Of course, this is a value judgment, and sometimes the interpretation depends on the situation.) There is a bias of “good” trigraphs near the high end. Based on the numbers above, the odds of getting a “not bad” vs. a “bad” trigraph are 2995:1101, or about 2.7.
Before my first cast of the Ling Qi Jing, I was rummaging through my wallet and various drawers around the house to find the right number of coins, and imagining what some old literalminded friends might be saying about my efforts. I was having a little mental argument with them, almost certainly to dispel my own doubts, and finally just shut them up and resolved to do it no matter what these imaginary people thought. I let the nickels, pennies, and dimes fall through my fingers, with no specific question in my mind other than, “what about the Ling Qi Jing,” and got 431 for Follow your Heart, trigraph 57 displayed above.
Lingqijing: The Magical Chess Classic by Steve Marshall
Spirit Tokens of the Ling Qi Jing translated by Ivan Kashiwa
Ling Ch’i Ching: A Classic Chinese Oracle translated by Ralph D. Sawyer and MeiChun Lee Sawyer