I'm fixing a software defect that occurs 1 in n test runs. If I want to know that the probability of it being fixed is >= p for some 0 <= p < 1, how many times, m, do I need to run the test successfully (without the defect occurring)?
closed as off topic by Gerald Edgar, Harald HancheOlsen, Steve Huntsman, Noah Snyder, Douglas Zare May 7 '10 at 19:19Questions on MathOverflow are expected to relate to research level mathematics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question. 


According to my statistics final which I took yesterday, the answer should be 


I guess $m>\log(1p)/\log(11/n)$ works since the probability of a faulty system running $m$ times without defect is $(11/n)^m$ and this should be smaller than $1p$. This seems to be a homework type question (and moreover an easy one) rather than a MOquestion. 


If your problem was a little bit more difficult (rolandbacher already provided an easy, precise and correct solution) and your $n$ is big, you can also approximate the binomial distribution by a Poisson distribution. Repeating the test $m$ times gives then the parameter $\lambda = \frac{m}{n}$ and your goal is that $m$ is big enough that $e^{\lambda}\ge 1p$. So $m \ge n\ln(1p)$. The approximation by the Poisson distribution is pretty good, for $n = 500$ and $p = 0.99$ it yields $m > 2302.585$ instead of the correct $m > 2300.28$ given by rolandbacher's formula. 

