June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue