The negative binomial distribution is typically used to predict the number of failures observed when repeating a test until a total of n successes have occurred, where each test has a probability p of success.
The density function for the negative binomial distribution is given by:
Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525.