Anonymous user
Unbias a random generator: Difference between revisions
→{{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
(+Java) |
(→{{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) |
||
Line 9:
=={{header|J}}==
{{incomplete|J|It doesn't adequately generate and show counts of the outputs of randN and unbiased(randN) over the range of N.}}
<lang j>biased=: 0 = ?
unbiased=: i.@# { ::$: 2 | 0 3 -.~ _2 #.\ 4&* biased@# ]</lang>
Line 19:
unbiased 10#6
1 0 0 1 0 0 1 0 1 1</lang>
=={{header|Java}}==
<lang java>public class Bias{
|