This is a slightly odd problem I ran across recently. Assuming a population of size $N$ following a binomial distribution with unknown $p$, how many different samples must be taken from the population to say that $P[p<\phi]>\alpha$, assuming all the samples taken turn out to be failures?
My approach was to state that the probability of $p=x$ given $n$ failures is $$ P[p=x|n] \propto (1-x)^n $$
Normalizing this so that $\int_0^1 P[p=x|n]\ dx=1$ gives $$ P[p=x|n] = (n+1)(1-x)^n $$
The probability that $p<\phi$ is then easy to calculate as $$ P[p<\phi|n] = \int_0^\phi (n+1)(1-x)^n\ dx = 1 - (1 - \phi)^{n + 1} $$
And finally solve the inequality $P[p<\phi|n]>\alpha$ $$ 1 - (1 - \phi)^{n+1} > \alpha \ \Rightarrow\ n > \frac{\ln 1 - \alpha}{\ln 1 - \phi} - 1 $$
Now, my first question regarding this is whether my approach is correct or not.
Secondly, is there an intuitive way to explain/understand the equations above? Above I solved it only mathematically, but I'm really more interested in the why than the how.
For example, $1-(1-\phi)^{n+1}$ above, given $n$ failures, reads to me like the probability that the next sample taken is not a failure. But I see no connection between that and the left hand side $P[p<\phi|n]$.