|
BGonline.org Forums
Rolls vs. Pips algorithm
Posted By: rambiz
Date: Sunday, 24 April 2011, at 11:52 p.m.
Hi all,
this is the MATLAB code, I wrote for the Rolls vs. Pips positions. It can simply be rewritten in any other language for example C, as I think the code is very simple to follow. However, there are several points, I'd like to share with you in advance: Achtung! If you want to keep an unbiased mind, jump to the code, now!1. I do know, estimating EPC for a pipish position can be difficult, but I want to have a working algorithm first.
2. I am well aware, the weighted averaging I'm using, could be a daunting task over the board, but I want to have a working algorithm first.
3. I do know, I will never learn the normal cumulative distribution function by heart, but as Kleinman did, we can also try our best later by using some representative values after some reformulation.
4. This algorithm does NOT work, if the no-miss side is behind in the race.An example will come later. Please try to find out, why?
5. As calculated within the code, the no-miss side gains an average of ~9.53 EPCs per roll, whereas the pipish side rolls only ~8.167 EPCs on average. It is a substantional advantage! So after,say N rolls for each side, I expected the no-miss side to gain about N*(9.53-8.167) EPCs. The results has shown, there is no such advantage for the no-miss side. Why?
Here begins the code:
function probability=RollsVsPips(r,p)
r is the number of rolls: e.g. for 4 checkers on the ace point,r=2
p is the EPC of the pipish side
rolls' position statistics
M=49/6; This is the EPC you gain, when taking 2 checkers off (when you roll a non-double)~8.167
muROLL=7^3/6^2; This is the average EPCs you get each roll (5/6)*(49/6)+(1/6)*2*(49/6)~9.53
VarROLL=(5/6)*(M-muROLL)^2+(1/6)*(2*M-muROLL)^2; the variance~9.263
pips' position statistics
muPIP=49/6; average EPC gained each roll
VarPIP=sum(([3 3 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 10 10 11 11 12 16 20 24]-muPIP).^2)/36; VarPIP =18.4722
N1=(7*r+1)/M;average number of rolls for the no-miss side
N2=p/M;average number of rolls for the pipish side
S=7*r+1+p-muROLL/2; total length of the race
var=(N2*VarROLL+N1*VarPIP)/(N1+N2); it is a weighted average for the total variance. my innovation!
mu= (N2*muROLL+N1*muPIP)/(N1+N2); it is a weighted average for the total mean. my innovation!
denominator=sqrt(S*var/mu);
D=p-(7*r+1)+muROLL/2; here I expected D (the advantage in EPC terms) to be affected by the difference between muRoll and muPIP but it is NOT!
K=D/denominator
probability=normcdf(K); norfmcdf(.) is the normal cumulative distribution function
Example 1: (algorithm works)
White 48
Blue on roll 12 Position ID: dHcAAPh/AAAAAA Match ID: cAkAAAAAAAAA
Cube decision 4-ply cubeless equity +0.858 0.929 0.000 0.000 - 0.071 0.000 0.000 Cubeful equities: 1. Double, pass +1.000 2. Double, take +1.677 +0.677 3. No double +0.972 -0.028 Proper cube action: Double, pass
The algorithm works well for Example 1: RollsVsPips(6,55)=0.922
Example 2: (The Trice Prop)
White 50
Blue on roll 30 Position ID: uHcAAPi+DwAAAA Match ID: cAkAAAAAAAAA
Cube decision 4-ply cubeless equity +0.261 0.631 0.000 0.000 - 0.369 0.000 0.000 Cubeful equities: 1. No double +0.415 2. Double, pass +1.000 +0.585 3. Double, take +0.311 -0.104 Proper cube action: No double, take (15.1%)
The algorithm works well for Example 2: RollsVsPips(8,57)=0.642
Example 3: no-miss side is behind and the algorithm fails
White 15
Blue on roll 8 Position ID: qAAA8A8AAAAAAA Match ID: cAkAAAAAAAAA
Cube decision 4-ply cubeless equity -0.508 0.246 0.000 0.000 - 0.754 0.000 0.000 Cubeful equities: 1. No double -0.783 2. Double, pass +1.000 +1.783 3. Double, take -1.635 -0.852 Proper cube action: No double, beaver (32.3%)
In this example the algorithm fails: RollsVsPips(4,20.3)=0.325
At this spot, I'd like to express my gratitude towards Rick Janowsky, who has encouraged me to do this little, I have been able to come up with.
Dear readers, please don't deprive me of your stimulating comments, suggestions and questions.
|
BGonline.org Forums is maintained by Stick with WebBBS 5.12.