# An experiment is repeated, and the first success occurs on the 8th attempt. What is the success probability for which this is most likely to happen?

An experiment is repeated, and the first success occurs on the 8th attempt. What is the success probability for which this is most likely to happen?

So we want to find $p$ between $0$ and $1$ which maximizes $(1-p)^{7}p$. To do this we could take the derivative and find all the critical points:

$$(1-p)^7 - 7(1-p)^6p = 0$$

But I don't know how to get the roots of this equation by hand. What can I do instead to solve this problem?

• That is only the correct likelihood if it was determined before the experiment that there would be $8$ attempts. This is known as the "stopping condition." If the stopping condition is that you continue until you get a success, then you need a different likelihood. – Sean Lake Oct 10 '16 at 4:53
• Try factoring out $(1-p)^6$ !!! – Ted Shifrin Oct 10 '16 at 4:53
• @SeanLake The question implies that we continue until the first success. – Parcly Taxel Oct 10 '16 at 5:07
• @SeanLake It is a geometric distribution, not a binomial distribution – GoodDeeds Oct 10 '16 at 5:10
• It doesn't matter how the experiment was supposed to be run. The likelihood is simply $\mathcal{P}(\text{observation}|\text{parameter})$, and our observation is the result of $8$ first trials, not "the number of first success was $8$ and something else happened after that" nor "there was one success in first $8$ trials (but the order is unspecified)". For our observation, the likelihood is $(1-p)^7 p$. It doesn't even matter if we intended to do $100$ trials but stopped after the $8$th trial because of a fire alarm. – JiK Oct 10 '16 at 7:53

Go ahead and solve for where the derivative is zero: $$(1-p)^7-7(1-p)^6p=0$$ $$(1-p)^6(1-p-7p)=0$$ $$(1-p)^6(1-8p)=0$$ $$1-p=0\text{ or }1-8p=0$$ $$p=1\text{ or }p=\frac18$$ We reject $p=1$ because then the experiment would succeed on the first try. $p=0$ can also be rejected for obvious reasons, so $p=\frac18$.

• Faster, I think, to rule out $p=0$ and $p=1$ rather than to apply the second derivative test. – user14972 Oct 10 '16 at 7:38
• @Hurkyl that has been taken into account. $\ddot\smile$ – Parcly Taxel Oct 10 '16 at 7:44
• Where does your $p=0$ come from? You reject it obviously, but there are only two extremal points, right? – example Oct 10 '16 at 14:06
• @example because $0$ is an endpoint which you would check normally – b_pcakes Oct 10 '16 at 19:26

$$(1-p)^7-7(1-p)^6p=(1-p)^6(1-p-7p)=(1-p)^6(1-8p)$$ Thus, for extremum, $$(1-p)^6(1-8p)=0$$ $$p=1 \text{ or }p=\frac18$$

The boundary values are $p=0$ and $p=1$, both which constitute zero probability. Moreover, by the second derivative test, it can be seen that $p=\frac18$ is a point of maximum.

Hence, $$p=\frac18$$

• (but the second derivative test is superfluous here -- the maximum must be either at $p=0$, $p=1/8$, or $p=1$, so as soon as you rule out $p=0$ and $p=1$, you're done) – user14972 Oct 10 '16 at 7:38
• @Hurkyl I agree, that was my intention of using "Moreover,..", to show that it is another way to get the same thing. – GoodDeeds Oct 10 '16 at 7:39