EV_calc(5,1/3) = +4.27049 <=> esperance bloodstone
EV_calc(10,1/3) = +17.3311 <=> esperance blueprint+bloodstone
EV_calc(5,2/3) = +12.9871 <=> esperance oop's all 6's + bloodstone
EV_calc(20,1/3)= +324.3554 <=> esperance 3 blueprint empilés + bloodstone
function EV_calc(n,p) {
let tab_counters = new Array(20).fill(0);
for (let k = 0; k < 10000; k++) {
let active_count = 0;
for (let i = 0; i < n; i++) {
if (Math.random() < p) {
active_count++;
}
}
tab_counters[active_count]++;
}
let EV = 0;
for (let z = 0; z < tab_counters.length; z++) {
EV += (tab_counters[z]/10000) * Math.pow(2, z);
}
return EV;
}