Probability and statistical reasoning
The mathematical model of the Dayan yarrow-stalk method
Based on the derivation provided by the site owner, this page explains the site’s casting model through three transformations, congruences, and transitions between discrete states.
1. Three transformations and remainders
“The number of the Great Expansion is fifty; of these, forty-nine are used.” Each line starts with 49 stalks and goes through three rounds of dividing into two piles, setting one stalk aside, counting in fours, and collecting the remainders. For a nonempty handful, an exact division is assigned a remainder of 4:
First transformation: remove 5 or 9
Let x and y be the remainders after counting in fours, each between 1 and 4. Their sum x+y can only be 4 or 8. Including the single stalk set aside, the total removed, D₁, is as follows:
| x | y | Removed, including the stalk set aside |
|---|---|---|
| 1 | 3 | 5 |
| 2 | 2 | 5 |
| 3 | 1 | 5 |
| 4 | 4 | 9 |
Second and third transformations: remove 4 or 8
After the first transformation, 44 or 40 stalks remain, both multiples of 4. After setting one stalk aside, the total is congruent to 3 modulo 4.
The remainders can sum only to 3 or 7. The pairs (1,2) and (2,1) remove 4 stalks including the stalk set aside; (3,4) and (4,3) remove 8. This holds for every state reachable in the subsequent transformations:
A state is defined by the transformation number and the number of stalks remaining. The next state depends only on the current state and the random remainder in that transformation, so the procedure can be viewed as a finite-step Markov process. This is a mathematical description, not proof of metaphysical efficacy.
2. Distribution of the four line types and expected value
| Line type / value | Removal combinations | Remaining | Probability |
|---|---|---|---|
| Old yang 9 | (5,4,4) | 36 | |
| Young yin 8 | (5,4,8)、(5,8,4)、(9,4,4) | 32 | |
| Young yang 7 | (5,8,8)、(9,4,8)、(9,8,4) | 28 | |
| Old yin 6 | (9,8,8) | 24 |
The weights for 6, 7, 8, and 9 are 1, 5, 7, and 3 respectively, totaling 16.
7.75 is the mean of the numerical encoding used for line values. Young yin is the most probable individual outcome, but yin and yang each account for half of the total:
The expected value therefore cannot establish a “conservation of yin softness” or any other philosophical proposition. “Yang changes readily, yin with difficulty” may serve as a cultural interpretation; what the model directly establishes is that old yang occurs more often than old yin.
3. Changing and unchanging lines, and special cases
Whether a single line changes
Let M denote a changing line. Old yang 9 and old yin 6 change; young yang 7 and young yin 8 do not.
When the six lines are independent, the total number of changing lines, K, follows a binomial distribution:
All six lines unchanging
Use Nine: all six lines are old yang, Qian changing to Kun
Use Six: all six lines are old yin, Kun changing to Qian
Here, “Use Nine” and “Use Six” refer specifically to the site’s display conditions when all six lines are 9 or all six are 6. This does not equate every ancient rule of divinatory interpretation with those conditions. All old yin is the rarest specific sequence of six line values in this model.
4. Pi changing to Tai
Pi has Qian above and Kun below. For all six lines to reverse and form Tai, the upper three must be old yang and the lower three old yin. The program’s array runs from the bottom line to the top, so it is [6, 6, 6, 9, 9, 9]; reading the diagram from top to bottom gives [9, 9, 9, 6, 6, 6].
A. Joint probability before any casting
B. Conditional probability given an initial hexagram of Pi
This can also be checked by dividing the joint probability by the probability of Pi:
These two probabilities answer different questions and are not interchangeable. The symbols Pi and Tai refer to the corresponding hexagrams.
5. The implementation and observed statistics
The program maps a uniformly random integer to one of 16 equally likely states, then obtains a line from the three-transformation result. Tests enumerate all 4⁶ = 4096 sequences of line values, weighting them by 1, 5, 7, and 3, to verify the theoretical probabilities of every initial and resulting hexagram, Use Nine, Use Six, and Pi changing to Tai. They do not rely solely on a small random sample.
The theoretical distribution does not predict visitor behavior. Site statistics are affected by self-selection, tracking opt-outs, and sample size. An association between casting again and opening the source text does not establish causation, nor does it imply dissatisfaction with the previous hexagram.