simulate_negative_binomial

function simulate_negative_binomial(k:Integer, ρ:Real) -> Integer

Simulate a negative binomial distribution.

  • k: Number of successes before the experiment is stopped.
  • ρ: Probability of success.

Returns the number of failures.