Using Coins to Consult the I Ching
These methods both consist of first throwing one coin to determine yang or yin, then throwing 2 or 3 more to determine whether the line is changing. There is no arithmetic involved. And it is consistent with the binary nature of the I Ching: one bit of information determines the line, and another whether it is changing or not.
The fourcoin method reproduces the yarrow stalk probabilities. The threecoin method retains the traditional coin probabilities.
yarrow stalks  traditional coins  
changing yin  1/16  0.0625  1/8  0.125 
yang  5/16  0.3125  3/8  0.375 
yin  7/16  0.4375  3/8  0.375 
changing yang  3/16  0.1875  1/8  0.125 
Fourcoin method to reproduce the yarrow stalk probabilities:
• Throw one coin to determine yang (heads) or yin (tails).
• Throw three more coins. Exactly three heads among all four coins means the line is changing.
Note that if the first coin is heads, then there is a 3/8 chance that it will be changing, and the total odds of a changing yang are thus 3/16; but if the first coin is tails, the chance of it changing is only 1/8, and the total odds of changing yin are 1/16.
changing yang  
changing yin 
Threecoin method to retain the traditional coin probabilities:
• Throw one coin to determine yang (heads) or yin (tails).
• Throw two more coins. If these two coins are both heads, the line is changing.
Each line (yang or yin) has a 1/4 chance of being a changing line, so each changing line has a 1/8 chance of being thrown.
changing yang  
changing yin 
Simple, logical, and easy to remember!
An alternative to throwing the coins
I have never liked the idea of throwing coins, because the process seems to separate the user from the final result; I prefer a more “handson” method such as yarrow stalks because the division of the bundle is a volitional act that happens completely in one’s own hands. Plus, “casting coins” sounds to me like “casting spells.” And I feel like I am playing craps at a casino when I do it. But coins are definitely faster and easier than yarrow stalks, and it is easy to see why they are more popular. I prefer another way of using coins: selecting them from a mixedup group.
Keeping the coins in a bag lets you carry them around with you; if they are stationary, a bowl may make more sense, and allows others to use the coins. I lay a cloth in a small bowl and place the coins on it, partly so I can cover them up when not in use, and partly so they make less noise in the bowl. The ritual should probably include hand washing. Things like incense, or holding or manipulating the coins first, may also be included. I don’t look at the coins until I have selected all four, to keep myself from being distracted by the process. After I put them back, I use my fingers to toss them like a little salad before selecting the next ones. It would be possible to select the 18 or 24 coins for all six lines without putting them back; but I would prefer to always have extra coins in the container so that there is a choice to be made each time, and this would require a greater number of coins. But the point is arguable; one might prefer to simply start with 18 or 24 coins and use them all up.
My guess is that the old testament divination technique, the urim and thummim, operated something like this. Alternatives might include using marbles or beads of two different colors; or fortune sticks, with even numbers being yin and odd ones yang.

In the chinese coin image at the above right, the first (fourcharacter) side is “heads,” and the second (twocharacter) side is “tails.”