Probability that the probability for a binomial distribution is below a certain value 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]$.
 A: You are not correct in the way that in the frequentist framework parameters (in your case probability\proportion) are NOT a random variable. However, if you assume Bayesian framework, you can safely work with parameters as random variables and to obtain probabilities that some parameters exceeds some value.
You have your sampling distribution $$X|p,N \sim B(N,p)$$
Assume that you observed sample is $X_{1},...,X_{t}$. Then, the likelihood function is proportional to $$p^{r}(1-p)^{N-r},$$
where $r= \Sigma X_{k}$. Now you need prior distribution on the proportion parameter. The usual choise in this problem is to use beta distribution $B(\alpha, \beta)$. Then you posterior (due to the conjugacy property) will also be a beta distribution with updated parameters $B(\alpha +r, \beta +N-r)$ or 
$$p|X,N \sim B(\alpha +r, \beta +N-r)$$
Now you can calculate the probabilities that you want, though it is not straightforward, since it requires to calculate incomplete Beta function. Another aspect is that I dont see any way how to calculate the number of experiments, since all statistical information colapses to one sum $r$.
A: I think Tomas' answer addresses some of the misconceptions you seem to have with your question.  First of all the binomial distribution assumes an infinite population where a sample of size N is selected.  You do not formulate the problem in a Bayesian framework and yet you do an integration that appears to assume a uniform prior on the proportion.
Tomas shows you how to do the inference in the Bayesian framework using a Beta conjugate prior.  In the frequentist framework you can ask what is the maximum likelihood estimate for p given a sample of size n from a binomial distribution where all n observations are failures?
The likelihood function is L(p)=(1-p)$^n$,.
ln[L(p)]= n ln(1-p)  d/dp{ln[L(p)]} = -n/(1-p).  -ln[l(p)] s maximum at p=0.  If p=0 is not an acceptable answer because you know that p>0 and must be at least p$_0$ then thmaximum likelihood estimate under the constraint would be p=p$_0$.
In the frequency approach parameters are not given probability distributions.  So the question in your title can only be answered using the Bayesian approach.  You can integrate the posterior distribution for p in the region p<ϕ to answer the question.  The posterior could be the beta specified by Tomas in his answer.
