Probability of something happening at least n out of m times Write a program or function, that given a success probability p, a number n and a number of trials m returns the chance of at least n successes out of m trials.

Your answer must be precise to at least 5 digits after the decimal.

Test cases:

 0.1, 10, 100 -&gt; 0.54871
 0.2, 10, 100 -&gt; 0.99767
 0.5, 13,  20 -&gt; 0.13159
 0.5,  4,   4 -&gt; 0.06250
0.45, 50, 100 -&gt; 0.18273
 0.4, 50, 100 -&gt; 0.02710
   1,  1,   2 -&gt; 1.00000
   1,  2,   1 -&gt; 0.00000
   0,  0,   1 -&gt; 1.00000
   0,  0,   0 -&gt; 1.00000
   0,  1,   1 -&gt; 0.00000
   1,  1,   0 -&gt; 0.00000
Mathematica, 29 bytes

BetaRegularized[#3,#,1+#2-#]&amp;


Takes input in the order n,m,p. Mathematica is so good, it even golfs your code for you:



BetaRegularized is the regularised incomplete beta function.