Handbook
Glossary
weighted-random ( histogram -- obj )
Vocabulary
math
.
extras
Inputs
histogram
an
object
Outputs
obj
an
object
Definition
USING:
assocs
kernel
math
math.statistics
random
sequences
sorting.extras
;
IN:
math.extras
:
weighted-random
( histogram -- obj )
unzip
cum-sum
[
last
>float
random
]
keep
bisect-left
swap
nth
;