1.1.0 • Published 6 years ago
draw-elements-with-probability v1.1.0
Input
- an array A of elements, each with a probability p
- a number n
Output
An array of n values drawn with replacement from A according to the probabilities p with the additional requirement that no value must occur twice in immediate succession