June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,7 +1,7 @@
integer
biased(integer bias)
{
return 1 ^ min(drand(bias - 1), 1);
1 ^ min(drand(bias - 1), 1);
}
integer
@ -12,7 +12,7 @@ unbiased(integer bias)
while ((a = biased(bias)) == biased(bias)) {
}
return a;
a;
}
integer
@ -23,21 +23,17 @@ main(void)
n = 10000;
b = 3;
while (b <= 6) {
i = 0;
cb = 0;
cu = 0;
while (i < n) {
i = cb = cu = 0;
while ((i += 1) <= n) {
cb += biased(b);
cu += unbiased(b);
i += 1;
}
o_form("bias ~: /d2p2/%% vs /d2p2/%%\n", b, 100r * cb / n,
100r * cu / n);
100r * cu / n);
b += 1;
}
return 0;
0;
}