Anonymous user
Unbias a random generator: Difference between revisions
→{{header|Aime}}
m (→{{header|REXX}}: used a consistant style of alternating types of quoted strings.) |
|||
Line 77:
biased(integer bias)
{
}
Line 88:
}
}
Line 99:
b = 3;
while (b <= 6) {
i = cb = cu = 0;
cb += biased(b);
cu += unbiased(b);
}
o_form("bias ~: /d2p2/%% vs /d2p2/%%\n", b, 100r * cb / n,
b += 1;
}
}</lang>
Output:<pre>bias 3: 33.51% vs 50.27%
|