The probability for a vector of non-negative integers , , ..., , where is the length of in a negative multinomial distribution, is proportional to .
The parameter n can be any positive real number, and p can be any vector of non-negative real numbers that sum to less than unity.
If n is a positive integer, NegativeMultinomialDistribution gives the distribution of the failure counts in a sequence of trials with success probability 1-Total[p] and Length[p] types of failure before n successes occur.
Find the distribution for the number of times a biased coin should be flipped until you get heads twice in a row. If you let p be the probability of heads, the two events for which you start over are (tail) or (head, tail) and the event for which you succeed is (head, head). These events have the following probabilities:
The total number of coin flips until two heads:
Find the probability that no more than five coin flips are required: