  We propose an optimal sequential methodology for obtaining confidence
intervals for a binomial proportion $\theta$. Assuming that an i.i.d. random
sequence of Benoulli($\theta$) trials is observed sequentially, we are
interested in designing a)~a stopping time $T$ that will decide when is the
best time to stop sampling the process, and b)~an optimum estimator
$\hat{\theta}_{T}$ that will provide the optimum center of the interval
estimate of $\theta$. We follow a semi-Bayesian approach, where we assume that
there exists a prior distribution for $\theta$, and our goal is to minimize the
average number of samples while we guarantee a minimal coverage probability
level. The solution is obtained by applying standard optimal stopping theory
and computing the optimum pair $(T,\hat{\theta}_{T})$ numerically. Regarding
the optimum stopping time component $T$, we demonstrate that it enjoys certain
very uncommon characteristics not encountered in solutions of other classical
optimal stopping problems. Finally, we compare our method with the optimum
fixed-sample-size procedure but also with existing alternative sequential
schemes.
