Chance of something being fixed - MathOverflow [closed]most recent 30 from http://mathoverflow.net2013-05-23T10:12:59Zhttp://mathoverflow.net/feeds/question/23869http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/23869/chance-of-something-being-fixedChance of something being fixedPaul Reiners2010-05-07T15:30:22Z2010-05-07T18:40:03Z
<p>I'm fixing a software defect that occurs 1 in <em>n</em> test runs. If I want to know that the probability of it being fixed is <em>>= p</em> for some <em>0 <= p < 1</em>, how many times, <em>m</em>, do I need to run the test successfully (without the defect occurring)?</p>
http://mathoverflow.net/questions/23869/chance-of-something-being-fixed/23871#23871Answer by Roland Bacher for Chance of something being fixedRoland Bacher2010-05-07T16:00:23Z2010-05-07T16:00:23Z<p>I guess $m>\log(1-p)/\log(1-1/n)$ works since the probability of a faulty system running
$m$ times without defect is $(1-1/n)^m$ and this should be smaller than $1-p$.</p>
<p>This seems to be a homework type question (and moreover an easy one) rather than a MO-question. </p>
http://mathoverflow.net/questions/23869/chance-of-something-being-fixed/23872#23872Answer by Gabriel Benamy for Chance of something being fixedGabriel Benamy2010-05-07T16:10:23Z2010-05-07T16:10:23Z<p>According to my statistics final which I took yesterday, the answer should be <br>
$m=\lceil 2\left(1-\frac{1}{n}\right)\text{InverseErf}^2[1-p]\rceil$ where InverseErf[<em>x</em>] is the <a href="http://en.wikipedia.org/wiki/Error_function#Inverse_function" rel="nofollow">Inverse Error Function</a>.<br></p>
http://mathoverflow.net/questions/23869/chance-of-something-being-fixed/23883#23883Answer by somebody for Chance of something being fixedsomebody2010-05-07T18:40:03Z2010-05-07T18:40:03Z<p>If your problem was a little bit more difficult (roland-bacher already provided an easy, precise and correct solution) and your $n$ is big, you can also approximate the binomial distribution by a <a href="http://en.wikipedia.org/wiki/Poisson_distribution#How_does_this_distribution_arise.3F_.E2.80.94_The_law_of_rare_events" rel="nofollow">Poisson distribution</a>. 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 1-p$. So $m \ge -n\ln(1-p)$. 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 roland-bacher's formula.</p>