jsoendermann / draw-elements-with-probability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About


Languages

Language:TypeScript 100.0%