Unbias a random generator: Difference between revisions
m
J: radically reduce recursion depth for short lists
m (J: further cleanup (did not actually need parenthesis)) |
m (J: radically reduce recursion depth for short lists) |
||
Line 11:
<lang j>biased=: 0 = ?
unbiased=: i.@# { ::$: 2 | 0 3 -.~ _2 #.\
Example use:
|