Probability of At Least One Success and At Least One Failure

combinatoricsprobability

(a) Independent Bernoulli trials are performed, with probability $\frac{1}{2}$ of success, until
there has been at least one success. Find the PMF of the number of trials performed.

(b) Independent Bernoulli trials are performed, with probability $\frac{1}{2}$ of success, until
there has been at least one success and at least one failure. Find the PMF of the number
of trials performed.

The solution for part (a) is $P(N = n) = (\frac{1}{2})^{n – 1} \frac{1}{2}$ where $N$ is the number of Bernoulli trails.

The given solution for part (b) says to use the solution for part (a) by letting the first trial occur and letting that event be failure, then just finding $P(N = n – 1)$ to be the PMF.

However, I tried to find a general solution where $p$ is the probability of success and $1 – p = 1$ is the probability of failure, which gave:
$$
P(N = n) = p^{n – 1}q \binom{n}{1} + p^{2}q^2 \binom{n}{n -2} + \cdots + p^2 q^{n – 2} \binom{n}{n – 2} + pq^{n – 1} \binom{n}{1} = (\frac{1}{2})^n (2^n – 2)
$$

which does not match when I plug in the answer. Why doesn't this expression work?

Best Answer

Suppose $p$ is the probability of success for one Bernoulli trial.

Suppose it takes $N\in \mathbb{Z}_{+}$ trials until there has been at least one success and at least one failure. This can never happen for $N=1$. For $N\geq 2$, this can only be the case if the first $N-1$ trials were successes and the $N$th trial was a failure, or the first $N-1$ trials were failures and the $N$th trial was a success. Thus, $$P(N=n)=p^{n-1}(1-p)+(1-p)^{n-1}p, \quad n=2,3,4...$$