Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
function randN(integer N)
|
||||
return rand(N) = 1
|
||||
end function
|
||||
|
||||
function unbiased(integer N)
|
||||
integer a
|
||||
while 1 do
|
||||
a = randN(N)
|
||||
if a!=randN(N) then
|
||||
return a
|
||||
end if
|
||||
end while
|
||||
end function
|
||||
|
||||
constant n = 10000
|
||||
integer cb, cu
|
||||
for b=3 to 6 do
|
||||
cb = 0
|
||||
cu = 0
|
||||
for i=1 to n do
|
||||
cb += randN(b)
|
||||
cu += unbiased(b)
|
||||
end for
|
||||
printf(1, "%d: %5.2f%% %5.2f%%\n", {b, 100 * cb / n, 100 * cu / n})
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue