### Negative Binomial Probability Calculator

The

**binomial distribution**gives the probability of having k successes in a fixed number of trials, given some fixed probability of success on each trial. The

**negative binomial distribution**asks a different question: what is the probability that the rth success will occur on the kth trial, where k varies from r to infinity, given a fixed r, and some fixed probability of success on each trial?

**Impetus for this calculator arose from a question about online dating.**What, I was asked, is the chance of finding a suitable match on the third date, assuming the probability of finding a match on each date is .05? Assuming all the other assumptions involved in Bernoulli trials hold, that's an easy question and would not require this calculator, though this calculator can give the answer (about a 4.5% chance of finding a suitable match on the third date, and a 14.3% chance of finding it on or

*before*the third date). Unfortunately, expectation is that about 5% of people will not have found a match after 58 dates, and about one percent will not have found a match after 90 dates. Blame not thyself, blame Fortuna.

**This reminds me of a famous story about Thomas Edison.**One day, Edison collared an apprentice and said, "We're going out." He took the apprentice to a street corner near the laboratory. For an hour, Edison propositioned every woman who passed. All rejected him. Then he and the apprentice returned to the lab. "Mr. Edison," the apprentice said, "I don't understand this. You propositioned one hundred women, got stuck with a hat pin 23 times, kicked in the shins 72 times, slapped 43 times, and there was that one woman who did all those things besides stamping on your toes and stabbing you in the groin with her parasol. What did you gain from this?" And Edison said, "Young man, you don't understand. It's true I have found one hundred women who rejected my lascivious advances, but that just puts me one hundred closer to finding the one who won't."

**An example lifted from Jeremy Balka uses this calculator to full advantage.**"A person conducting telephone surveys must get 3 more completed surveys before their job is finished. On each randomly-dialed number there is a 9% chance of reaching an adult who will complete the survey. What is the probability the third completed survey occurs on the 10th call?" Click here to find out. (Answer is 1.356%, and a 5.404% chance that three surveys will be completed on or

*before*the 10th call.)

**A realtor (or "realatur" as they say in Minnesota) estimates a 7% chance of making a sale each time a home is shown.**What are the chances of getting one offer in ten or fewer showings, and what are the chances of not getting any offer at all after 20 showings? Click here to compute the probabilities. Answer is a 51% chance of getting an offer on ten or fewer showings, and a (1 - .766) = a 23.4% chance of having no offer after 20 showings.

**Caveat arithemeticus:**Numbers displayed show 10 significant digits and scale from about 10

^{-322}to 10

^{322}. Cumulative probability approaches 1; if the significand rounds to 1, it just shows 1. Display ends when (1) cumulative probability toPrecision(10) = 1.000000000; or (2) k = 10,000; or (3) one or more factors goes out of range. If a factor goes out of range, a message is displayed showing the factor and its JavaScript value. When that occurs, note that a JavaScript value of zero or "infinity" does not really mean zero or infinity, just a positive number smaller or larger than the range of JavaScript's floating point representation.

When the calculator is run, the URL in the address bar is updated with a querystring. This is done as a convenience for the user, who may wish to save or forward a URL that will duplicate the results shown, but also to ensure that the URL matches page content. Clicking the Clear button will clear the querystring to give the bare URL.

Charting is done with the Highcharts JavaScript library, which we highly recommend.