Anonymous user
Unbias a random generator: Difference between revisions
m
→{{header|Liberty BASIC}}: fmt
No edit summary |
m (→{{header|Liberty BASIC}}: fmt) |
||
Line 651:
end function
</lang>
<pre>
Biased bit-string, '1' chosen once out of 3 times . . .
664236 zeros & 335764 ones. Ratio =0.335764
Line 671 ⟶ 673:
Unbiased bit-string . . .
500407 zeros & 499593 ones. Ratio =0.499593
</pre>
=={{header|Lua}}==
|