[Math] How many experiments we should run to have one success with probability at least $50\%$

binomial distributionprobability

Could you tell me if my reasoning is right? I'm new in probability so I'm still not secure of how I should use the classical distributions to model problems.

My problem is the following: I have a success-failure experiment such that the probability of success is $p\in(0,1)$ ($p$ is supposed to be very little, but this shouldn't change the reasoning). If we run the experiment one time, the probability of success is $p$. If we run the experiment $n$ times, the probability of having $k$ successes is $\binom{n}{k}p^k(1-p)^{n-k}$, for $0\leq k\leq n$. This is modeled by the binomial distribution.

What I want to know is an inverse problem, we can say. How many experiments we should run to have one success with probability at least $50\%$? I'm looking for the minimal number $n$ of experiments.

My idea: We can keep $n$ unknown and ask for the probability of having at least one success in $n$ experiments. This is given by $\sum_{k=1}^n \binom{n}{k}p^k(1-p)^{n-k}$. It's possible to use some program to find the minimum $n$ such that $\sum_{k=1}^n \binom{n}{k}p^k(1-p)^{n-k}\geq \frac{1}{2}$. In fact, I did this for some values of $p$, in particular, for $p=\frac{1}{10000}$ we have $n=6932$.

But I'm not sure of this argument. I was looking for the number of experiments necessary to have one success with probability at least $50\%$, but ended up calculating the number of experiments necessary to have at least one success with probability at least $50\%$.

Best Answer

The number of successes in $n$ independent Bernoulli trials with probability of success $p$ is a binomial random variable $X$, such that $$\Pr[X = k] = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0, 1, 2, \ldots, n.$$ Therefore, the probability of observing at least one success in one trial is the complement of the probability of observing no successes: $$\Pr[X \ge 1] = 1 - \Pr[X = 0] = 1 - \binom{n}{0} p^0 (1-p)^{n-0} = 1 - (1-p)^n.$$ We then wish to find the minimum $n$ such that $$0.5 \le \Pr[X \ge 1] = 1 - (1-p)^n;$$ that is to say, $$n \ge -\frac{\log 2}{\log(1-p)} = \left\lceil -\frac{\log 2}{\log (1-p)} \right\rceil.$$ For $p = 10^{-4}$, this gives $n = 6932$ as you wrote.


If, however, you want the probability of exactly one success to be at least 50%, this would be $$0.5 \le \Pr[X = 1] = \binom{n}{1} p^1 (1-p)^{n-1} = np(1-p)^{n-1}.$$ The solution of this inequality does not have an elementary closed form for general $p \in (0,1)$ and positive integer $n$. However, we can show that there is no solution to this inequality if $p < 0.44303\ldots$, since for a fixed $p \in (0,1)$, treating $n$ temporarily as a continuous positive real and differentiating $\Pr[X = 1]$ with respect to $n$, we can see that a local extremum occurs when $$n = -1/\log(1-p),$$ attaining $$\Pr[X = 1]_{\text{max}} \approx \frac{-p}{e(1-p)\log(1-p)}.$$ And this expression is less than $1/2$ for $p < 0.44303\ldots$. Of course, $n$ is a positive integer, so this is just an approximation, but it remains the case that when $p$ is "small," no number of experiments will guarantee that the probability of exactly one success will exceed $0.5$.

Related Question