Unbias a random generator: Difference between revisions
Content added Content deleted
(→{{header|J}}: Marked incomplete as it doesn't adequately generate and show counts of the outputs of randN and unbiased(randN) over the range of N) |
(→{{header|Java}}: Marked incomplete as it doesn't adequately generate and show counts of the outputs of randN and unbiased(randN) over the range of N) |
||
Line 21: | Line 21: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
{{incomplete|Java|It doesn't adequately generate and show counts of the outputs of randN and unbiased(randN) '''over the range of N'''.}} |
|||
<lang java>public class Bias{ |
<lang java>public class Bias{ |
||
public static int biased(int probOf1Denom){ |
public static int biased(int probOf1Denom){ |
||
Line 67: | Line 68: | ||
Unbiased 1 percentage: 51.9 |
Unbiased 1 percentage: 51.9 |
||
Unbiased 1 percentage: 48.1</pre> |
Unbiased 1 percentage: 48.1</pre> |
||
=={{header|Python}}== |
=={{header|Python}}== |
||
<lang python>from __future__ import print_function |
<lang python>from __future__ import print_function |