Negative Binomial Probability Calculator
Cumulative probability toPrecision(10) = 1.000000000 reached at k=85
Negative Binomial results for p = 0.3 and r = 3
Mean = 10
Median = 9 (~8.58)
Mode = 7
Variance = 23.33333333;
Std. Dev. = 4.830458915
Mean = 10
Median = 9 (~8.58)
Mode = 7
Variance = 23.33333333;
Std. Dev. = 4.830458915
Negative Binomial results for p = 0.3 and r = 3
Mean = 10
Median = 9 (~8.58)
Mode = 7
Variance = 23.33333333;
Std. Dev. = 4.830458915
Display ends because: Cumulative probability toPrecision(10) = 1.000000000 reached at k=85
Mean = 10
Median = 9 (~8.58)
Mode = 7
Variance = 23.33333333;
Std. Dev. = 4.830458915
k Number of trials |
Probability of third success on kth trial | Probability of third success on kth trial or less | Binomial coefficient _{k-1}C_{2} |
---|---|---|---|
3 | 0.02700000000 | 0.02700000000 | 1 |
4 | 0.05670000000 | 0.08370000000 | 3 |
5 | 0.07938000000 | 0.1630800000 | 6 |
6 | 0.09261000000 | 0.2556900000 | 10 |
7 | 0.09724050000 | 0.3529305000 | 15 |
8 | 0.09529569000 | 0.4482261900 | 21 |
9 | 0.08894264400 | 0.5371688340 | 28 |
10 | 0.08004837960 | 0.6172172136 | 36 |
11 | 0.07004233215 | 0.6872595457 | 45 |
12 | 0.05992510639 | 0.7471846521 | 55 |
13 | 0.05033708937 | 0.7975217415 | 66 |
14 | 0.04164250121 | 0.8391642427 | 78 |
15 | 0.03400804265 | 0.8731722854 | 91 |
16 | 0.02746803445 | 0.9006403198 | 105 |
17 | 0.02197442756 | 0.9226147474 | 120 |
18 | 0.01743304586 | 0.9400477933 | 136 |
19 | 0.01372852362 | 0.9537763169 | 153 |
20 | 0.01074055083 | 0.9645168677 | 171 |
21 | 0.008353761757 | 0.9728706295 | 190 |
22 | 0.006463173570 | 0.9793338030 | 210 |
23 | 0.004976643649 | 0.9843104467 | 231 |
24 | 0.003815426798 | 0.9881258735 | 253 |
25 | 0.002913598645 | 0.9910394721 | 276 |
26 | 0.002216868535 | 0.9932563407 | 300 |
27 | 0.001681125305 | 0.9949374660 | 325 |
28 | 0.001270930731 | 0.9962083967 | 351 |
29 | 0.0009580862433 | 0.9971664829 | 378 |
30 | 0.0007203389162 | 0.9978868219 | 406 |
31 | 0.0005402541872 | 0.9984270760 | 435 |
32 | 0.0004042591676 | 0.9988313352 | 465 |
33 | 0.0003018468452 | 0.9991331821 | 496 |
34 | 0.0002249245846 | 0.9993581066 | 528 |
35 | 0.0001672876598 | 0.9995253943 | 561 |
36 | 0.0001241984141 | 0.9996495927 | 595 |
37 | 0.00009205294222 | 0.9997416457 | 630 |
38 | 0.00006811917724 | 0.9998097648 | 666 |
39 | 0.00005033250319 | 0.9998600973 | 703 |
40 | 0.00003713722532 | 0.9998972346 | 741 |
41 | 0.00002736427129 | 0.9999245988 | 780 |
42 | 0.00002013729708 | 0.9999447361 | 820 |
43 | 0.00001480091335 | 0.9999595370 | 861 |
44 | 0.00001086603639 | 0.9999704031 | 903 |
45 | 0.000007968426685 | 0.9999783715 | 946 |
46 | 0.000005837335827 | 0.9999842088 | 990 |
47 | 0.000004271868492 | 0.9999884807 | 1,035 |
48 | 0.000003123210519 | 0.9999916039 | 1,081 |
49 | 0.000002281301597 | 0.9999938852 | 1,128 |
50 | 0.000001664864782 | 0.9999955501 | 1,176 |
51 | 0.000001213963904 | 0.9999967640 | 1,225 |
52 | 8.844594156e-7 | 0.9999976485 | 1,275 |
53 | 6.438864546e-7 | 0.9999982924 | 1,326 |
54 | 4.683958326e-7 | 0.9999987608 | 1,378 |
55 | 3.404877399e-7 | 0.9999991013 | 1,431 |
56 | 2.473354337e-7 | 0.9999993486 | 1,485 |
57 | 1.795472037e-7 | 0.9999995282 | 1,540 |
58 | 1.302533351e-7 | 0.9999996584 | 1,596 |
59 | 9.443366792e-8 | 0.9999997528 | 1,653 |
60 | 6.842299096e-8 | 0.9999998213 | 1,711 |
61 | 4.954768311e-8 | 0.9999998708 | 1,770 |
62 | 3.585908591e-8 | 0.9999999067 | 1,830 |
63 | 2.593807214e-8 | 0.9999999326 | 1,891 |
64 | 1.875195052e-8 | 0.9999999514 | 1,953 |
65 | 1.354979650e-8 | 0.9999999649 | 2,016 |
66 | 9.785964141e-9 | 0.9999999747 | 2,080 |
67 | 7.064242864e-9 | 0.9999999818 | 2,145 |
68 | 5.097122928e-9 | 0.9999999869 | 2,211 |
69 | 3.676106839e-9 | 0.9999999905 | 2,278 |
70 | 2.650088960e-9 | 0.9999999932 | 2,346 |
71 | 1.909622927e-9 | 0.9999999951 | 2,415 |
72 | 1.375482021e-9 | 0.9999999965 | 2,485 |
73 | 9.903470554e-10 | 0.9999999975 | 2,556 |
74 | 7.127709089e-10 | 0.9999999982 | 2,628 |
75 | 5.127990706e-10 | 0.9999999987 | 2,701 |
76 | 3.687938521e-10 | 0.9999999991 | 2,775 |
77 | 2.651328775e-10 | 0.9999999993 | 2,850 |
78 | 1.905421613e-10 | 0.9999999995 | 2,926 |
79 | 1.368895001e-10 | 0.9999999997 | 3,003 |
80 | 9.831155005e-11 | 0.9999999998 | 3,081 |
81 | 7.058265132e-11 | 0.9999999998 | 3,160 |
82 | 5.065868772e-11 | 0.9999999999 | 3,240 |
83 | 3.634760844e-11 | 0.9999999999 | 3,321 |
84 | 2.607155618e-11 | 0.9999999999 | 3,403 |
85 | 1.869521345e-11 | 1.000000000 | 3,486 |
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? This is the geometric distribution, a special case of the negative binomial where r=1, and 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.
For a more interesting example, consider a realtor (or "realatur" as they say in Minnesota) who estimates a 30% chance of getting an offer each time a particular house is shown. What are his chances of having three offers on or before the tenth showing? Click here to find out.
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."
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 (click the hamburger icon on a chart for print, image or pdf download options).
Note on Edison. I'm a little surprised that nobody has emailed me about the Edison story saying "Edison was a fool! The geometric distribution is memoryless, and Edison's failure on the first 100 trials did not put him any closer to fulfilling his lustful desires!" But perhaps the inventor's strategy was to drive upright women from the precincts of his laboratory and attract those of dubious character, who might provide the lubricious ministrations he sought. In that scenario, each trial would indeed put him closer to his goal.