pi是每个人的胜率,N是总局数,zi是每个人当地主的盘数。
限定条件:
1.每个人当地主时的胜率等于当农民时的胜率,均为pi
结论:
单局收益ri=(2pi-1)/(1+zi/N)
N(p0+p1+p2)+(z0p0+z1p1+z2p2)=2N
增加限定条件后:
1.每个人当地主时的胜率等于当农民时的胜率,均为pi
2.每个人当地主的局数zi均等于N/3
结论:
单局收益ri=4(2pi-1)/3
p0+p1+p2=3/2
详细代码贴一下:
public class Practice3 {
public static void main(String[] args) {
/**
* N = x[0]+x[1]+x[2]+(y[0]+y[1]+y[2])/2
* 假定每个玩家有5个筹码,每局输赢为1.
*/
double[] res = new double[3];
double sumRate = 0.0;
double[] originRate = new double[] {0.57,0.45,0.47};
int[] money = new int[] {5,5,5};
t2(1000000,originRate,money);
}
public static double[] t2(int N, double[] p, int[] money) {
double[] res = new double[3];
for(int i = 0; i < 3; i++) {
res[i] = 4 * (2 * p[i] - 1) / 3 - 0.2;
}
for(int i = 0; i < 3; i++) {
if (res[i] >= 0) System.out.println(i + "号赢,平均每局" + res[i]);
else {
int temp = (int)(-money[i] / res[i]);
System.out.println(i + "号输,平均输光局数:" + temp);
}
}
return r