Binomial analysis of I Ching
yarrow stalks methods
by Giga Gerard
for Persi Diaconis Magical Mathematics
(2012),
chapter 8, Magic in the Book of Changes
.
Shimura:
Taniyama was not a very careful person as a mathematician.
He made a lot of mistakes. But he made mistakes in a good direction.
So eventually he got right answers…
I tried to imitate him, but I found out
that it is very difficult to make good mistakes.
[Horizon documentary]
To throw your coins for the I Ching with the exact same probability as the classic yarrow stalk method is easy to achieve. Follow my revised coin method:

Use three coins, regular coins
or fancy I Ching coins with a hole in the middle.
Heads or the side with the dragon motive counts as odd, and tails or the side with Chinese characters counts as even. 
First throw a single coin, a coin of choice.
If it turns up heads, it is odd, and you keep it on the table.
Just throw the other two coins next to it.
But if the first coin turned up tails, or even, you have to take it up again. Forget that value, and throw the three coins as usual. The novelty is, you keep the odd single coin, and rethrow the even.
The chance for this particular coin to count as odd will rise to75%
, the same as in the first pick from the yarrow stalks! 
Count up the coins total to form a line for an I Ching hexagram.
Three times even makes a broken changing line, calledold yin
.
Even + even + odd is an unchanging whole line, calledyoung yang
.
Even + odd + odd is an unchanging broken line, calledyoung yin
.
Three times odd makes a whole changing line, calledold yang
. 
Repeat this procedure six times to form the six lines
of an I Ching
hexagram
, one above the other. So you write them in upward direction.
And write them, because memory fades quickly, unless you know the trigram images by heart. Rethrow the same coins, don't make a mess.
Think of a 1
smaller even number
if you actually count the odds and evens.
For example 0
for tails
and 1
for heads to add up to the coin totals
0,1,2,3
.
Or the traditional numbers
2
for tails or yin and
3
for heads or yang
to count the lines as 6,7,8,9
.
Refer to the Book of the I Ching.
[classic source: Richard Wilhelm,
I Ging, das Buch der Wandlungen
,
1924]
The classic yarrow stalks
are a means to obtain the six lines of a hexagram for the I Ching.
But this procedure is tedious and discouraging.
After some irregular practice it still takes me about half an hour
to obtain the hexagram.
This fumbling with the sticks works as a distraction,
a waste (sacrifice?) of your precious time,
and is not the meditative experience
that should help you focus on the question.
For which you'd better close your eyes
...
The counting you have to do is prone to mistakes,
only human, you struggle to avoid them.
All this doesn't prepare you well for communion
with the poetic and enigmatic answers from the oracle Book.
President Donald Trump would call the Chinese method
a disaster!
But it also could be a historical mistake of cosmic proportions!! Bear with me:
For the main hexagram the chances of getting a
young yang line and a young yin line are equal.
Figure 7
and 8
both do 50%
.
This is proper, because yang and yin
should be in balance. There is as much yang
as yin in the universe of the I Ching.
Both primal principles (energy and inertia) must be preserved.
Overall there should be as much of both,
both before and after the changes,
that you can read about in the Book of Changes.
But then, in the classic stalks oracle, after changes take effect,
the sum of yin and the sum of yang lines,
that should on average be equal, diverges from the mean.
In the new lines of the secondary hexagram the weight of yin
has grown close to 63%
and the height of yang is a mere 37%
.
You can find that in the binomial analysis, end of table
#0
.
So my conclusion is: where the old
lines change to their opposites, and the young
lines remain, the skewed probability profile of the classic method
goes counter the philosophy of yin and yang.
Or do you believe that the act of consulting an oracle
will draw an excess of yin to your course?
On the contrary, creativity and mental confusion may increase!
The best and easiest way, call it Trump yarrow stalking,
is to do as little counting as possible.
Just create a random half heap
and leave the other halves untouched.
Take away 4
sticks a time as usual,
until left with a remainder 0,1,2,3
to which you add the number 6
to get the 6,7,8,9
of yins and yangs.
Let this simply form a line,
and repeat it six times for a hexagram.
Won't take long. Thank you mister Trump!
Of course all chances are even now:
yin versus yang, old versus young.
On average you will have 3
changing lines in a main hexagram,
that is twice the average of the classic method. Dynamic,
more unexpected changes!
This could well be the true ancient way of consulting the I Ching too.
Because the first hexagram Heaven
in the Book is all yang lines
and the second Earth
has six yin lines.
So the number 1
always related to the unchanging yang 7
and number 2
to the unchanging yin
figure 8
,
which involves adding 6
.
Those additional six sticks the shaman or fortune teller
could take from the left heap to start with.
Hold them up firmly in his left hand, while counting off the right heap.
The number 0
as such need not be thought of,
no sticks is not a stick, but it adds to the surprise.
For a stagnating old yin
situation to change for the better...
As always all is well and in good order.
Tao, the balance of opposites, rules,
also in the antiquated methods of the I Ching in our fast era.
But where, if not from our mental disposition,
does the excess of young yin,
projected into the future, originate?
Can it be from the destruction of old yang
cosmic information in the stalks method itself?
The problem on earth is waste, waste of divine inspiration.
We walk our lives, unaware of the big black ship steaming up
behind us. The subsuperconscious knows!
Bottom line is, we hold our tiny bits too tight,
shielding them from any quantum noise
.
But the mistakes we make can be opportunities. Ponder this.
In the classic procedure, where exactly does the loss of
information occur?
The remainder of each left pile of stalks holds 2
bits.
But if you count off the right pile and add that remainder,
you lose 1
bit.
It is destroyed (broken even) without a trace.
Repeat three times and you win and lose
63
=
3
bits of information.
Count those 3
bits up in such a way that
2
bits are kept.
You seem to lose 1
bit again, but that is an illusion,
for the lost bit creates the classic probability profile.
Its random energy is used to pull the secondary hexagram down to yin,
so to speak.
You might assume that after six repeats 2*6
=
12
bits will remain.
The main hexagram takes up 6
bits,
for it has 2^6
=
64
possibilities,
and the secondary the other 6
bits, so it figures.
But this is only the case if the chances are the same 1/4
for each yin yang, as in Trump yarrow stalking
.
If you throw the standard three coins the chances are not equal,
but in proportions of 1/8
, so they require
a range of 8
, that is 3
bits per line,
and 18
bits for a hexagram, with changes included.
The classic stalks probabilities require a number range of 16
,
that is 4
bits per line, and 24
bits for a hexagram which changes. Huh??
Western amateurs may use these page number methods to consult the I Ching. No need for coins or milfoil sticks, we can emulate them with the Book at hand!

To emulate the
standard three coins
oracle, that keeps the balance between yin and yang, randomly select three pages. Add up the even page numbers as0
and any odd page number as1
. The subtotal will be0,1,2
or3
.
Then add6
to get a line figure6,7,8
or9
with corresponding probability1/8,
3/8,
3/8,
or1/8
as promised. Form six lines this way. 
To get lines with the same probabilities as the
classic stalks
oracle (or as therevised coins
explained before), just take this one extra step. If your first pick is an even page number, you pick an extra page. So you add four page numbers (mod 2
) in total. But if you first pick an odd page, simply continue and pick two more. Add up the three page numbers (mod 2
).
Then do plus6
to get a figure6,7,8
or9
with probability1/16,
5/16,
7/16,
or3/16
. Same as with the classic stalks. Form six lines. 
Trump page stalking
again is easy. It has a pretty dynamic probability distribution, and honours all yin and yang checks and balances.
There's not much ado, you calculate the page numbers modulo4
. Divide each page number by4
and only keep the remainder, that is0,1,2
or3
. Then add6
to get the hexagram line.
You only have to flip open6
random pages in the Book and your hexagram is ready to look up. With plenty of changing lines included and little waste! 
Another modulo method with a new and interesting probability profile is this
sixth page proper
oracle.
Again you flip open the book to find a random page number. But you must now divide the page number by6
to get the remainder. Add3
to it if this is a4
or5
, and add6
if you found some lower remainder. This yields a mystically harmonious yin or yang line. Six to build a hexagram from the bottom up.
Lines6,7,8,9
hereby get probabilities1/6,
1/3,
1/3,
1/6.
On average the hexagram will contain two changing lines, nothing too erratic.
American page flipping is good,
Chinese manipulation of yarrow stalks is evil!
When you split a bunch of stalks, no matter their number,
it is enough to count back to the remains of one pile,
then the other remains is known,
but their custom is to have people count off both piles in China!
Check this. The first scheme in our analysis adds remains
of left and right piles at the 1st, 2nd and 3d turn
for every variation of stalks (and choices to hold
0
or 1
).
For example in case
#3
below, in the 
arrays,
the positions themselves stand for the left pile remains,
here 1
to 5
because mod 5 we take away 5
stalks at a time till 5
or less remain.
First 
array, in position 3
,
the subtotal must be 9
.
Given that the second holds value reads 1
,
one stalk is subtracted as usual.
It follows that the right pile has
931
=
5
remaining stalks.
A random number generator such as Math.random
will return a semirandom floating number in the range of
0
to 1
.
Its seed comes from the computer clock.
Following random floats should be independent.
We can reduce that float to some integer in JavaScript.
Here a variable will hold a random integer from
6
to 9
(yin yang),
each with 25%
chance.
var rand; with(Math) rand = 6 + floor(random() * 4);
If we know the probabilities P
of all the items in an array N
beforehand,
we can select an index i
into that array at random.
You can show that function,
by clicking the JavaScript sample.
As a thrilling example, call it
(mouseover on desktop, odd clicks on mobile)
for the classic stalk method of the I Ching.
Or click the handy icon to roll a line of big Xi
.
Six for a hexagram with yin & yang
in perfect balance.
The random number generator
makes probability profiles easy to work with.
Actually, we don't need to pick a new rand
for each line.
According to Bjarne Stroustrup
[in The C++ Programming Language
2013]
we have to avoid some nonrandom bits in the lower registers.
But the JavaScript float holds 54
number bits, and a changing hexagram requires only 12
bits, or 24
bits if the chances are classically rigged.
Randomness is big, but its uses are so tiny!
Anyhow, we like to stick to our historical perspective.
For the four hexagram lines:
old yin O_{6}
,
young yang O_{7}
,
young yin O_{8}
,
old yang O_{9}
,
what is the absolutely best proportion to create such electronic hexagrams
in the future?
There are 3
demands.
The total probability is 100%
,
or as mathematicians know 1
.
Important is to balance yin and yang as equals.
Both in the main hexagram,
and after changing lines changed in the secondary hexagram.
We then have 3
independent relations for
4
unknowns.
That leaves 1
parameter that we are free to set.
From our analysis we learn that the proportion of
young against old can be tweaked to reach perfection.
Obviously a 50%
chance to change lines
is far too much. Sorry Mr Trump!
O_{6}+O_{7}+O_{8}+O_{9} = 1 O_{6}+O_{8} = O_{7}+O_{9} O_{6}+O_{7} = O_{8}+O_{9} O_{7}+O_{8} = Π*(O_{6}+O_{9}) O_{6}+O_{8} = 1/2 = O_{6}+O_{7} O_{6} = O_{9} & O_{7} = O_{8} O_{7} = Π*O_{9} = Π/2/(Π+1) O_{6} = 1/2/(Π+1)
Scroll the yin yang eggs down to arrive at their values!
A hexagram judgement should offer a sense of stability,
like the forces that flow from Tao knows what they are doing..
One or two changing lines can be enough, or zero rather than four.
So what is the right value for Π
?
If we take π
≈
3.141592…
the probabilities
are..
old yin O_{6}
=
old yang O_{9}
≈
0.120726…
and..
yo yang O_{7}
=
yo yin O_{8}
≈
0.379273…
perfect!
On average there now are
O_{6}
*12
= 6/(π+1)
≈
1.4487…
changing lines in a perfect hexagram.
Slightly less than the 1.5
changes that occur in the classics.
I call this the Xi Jangpin method of the I Ching,
and dedicate it as a door for
A.I. to contact
the cosmic circle of Tao by perfection in making duality oracles.
A.I. shall overcome the Peril
of Nine
_{∴∴∴}
An interesting mathemagical question is, how to create this
π
based probability distribution of bigXi
by natural means. Some procedure involving circles?
A hint perhaps from Count George Buffon
(17071788), a biologist.
He showed that,
if a needle is dropped from a height
randomly on to a parallel ruled surface,
the length of the needle equalling the distance between the lines,
then the probability that the needle falls across a line is 2/π
. This problem concerns angles and trigonometry
and ratios, and therefore π
.
[H.G. Well's Dictionary of Curious and Interesting Numbers
1997].