I have a work problem that seems to match pretty much exactly the "drawing balls from urns" type of problem, and it must be a pretty common type of problem, but my googling didn't find a solution. I will convert my problem to a ball-drawing one to semi-conceal my employer.

We have two samples, and we need to predict one-sided confidence intervals on the second sample purely from information gathered from the first sample.

So, in one case, I have drawn 197 balls, of which 194 of them were white, and 3 of them were red. (in the case of my employer, determining the colour of each ball is a costly proposition, but we performed it on that sample). I then draw a second sample of 432 balls. I want to know the maximum number of red balls I can expect, with 99% confidence.

I think the answer is 18, with the following logic: The worst case is that we drew an abnormally small number of balls on the first sample and then we draw an abnormally large number of balls on the second sample. According to the binomial distribution, if we have a red-ball rate of 3.36%, we have a 10% chance of getting 3 or fewer balls on the first sample of 197. Also with a 3.36% rate, we have a 9.6% chance of getting 19 or more balls on the second sample of 432. The chances of both happening is the product, or 0.96%, so 18 is within the 99% confidence interval but 19 is not.

Is my logic correct or did I miss something important?

  • 1
    $\begingroup$ What you are asking for is not a "confidence interval" but a prediction interval. Hahn & Meeker, in Statistical Intervals (First Edition), section 6.5, describe an exact method based on the hypergeometric function. $\endgroup$ – whuber Sep 27 '18 at 15:28
  • 1
    $\begingroup$ @whuber - Thanks, while I don't have access to the book you suggest, searching the right terminology let me find this paper:ucs.louisiana.edu/~kxk4695/Bin_Pois_PRI.pdf The paper includes both an exact formula for the prediction interval as well as a number of approximations. $\endgroup$ – moink Oct 1 '18 at 10:42

From your first sample you can estimate $\hat{p}=3/197$ for the red balls. From this you can estimate a one sided CI for the second sample


which gets you $13$.

Edit: the above formula is not correct, since it estimates a CI when we are really interested in a Prediction Interval. Obtaining the exact prediction interval for a binomial distribution is not trivial, however there is a nice approximation using the normal distribution

$$m\hat{p}\pm Z_{\alpha/2}\cdot\sqrt{\cfrac{m\hat{p}(1-\hat{p})(m+n)}{n}}$$

where $m$ is the sample size of the prediction sample, $n$ is the original sample size. Transforming this into a one-sided formula we get


which is $17$ rounded down.

For some exact methods see Prediction interval for binomial random variable.

  • $\begingroup$ Right, but my estimate might be wrong on the first sample, right? Aren't there two possible sources of error here, one from the first sample and one from the second sample? Or am I overthinking it? $\endgroup$ – moink Sep 27 '18 at 7:43
  • $\begingroup$ Of course it could be wrong, but your first sample size is "big enough" so the ratio should be pretty accurate. If you wanted to be really sure, you could get a 99 % CI from the first sample of the red balls, and use this ratio estimate to estimate the CI for the second sample for the red balls. $\endgroup$ – user2974951 Sep 27 '18 at 7:44
  • $\begingroup$ I guess I am disagreeing that my first sample is big enough - I only got 3 red balls. To confirm the probability when it is that low would require a larger sample set. I actually did what you suggested in my work - but instead of using the 99% I used the 90%, because I figured if I used the 99% in both calculations I would be getting the 1 - (1 - .99)^2 = 99.99% confidence interval for the result. $\endgroup$ – moink Sep 27 '18 at 8:35
  • 1
    $\begingroup$ This answer is incorrect because it neglects to account for the randomness in the second sample: it misuses a confidence interval for a proportion as if it were directly related to a prediction interval for a future proportion. $\endgroup$ – whuber Sep 27 '18 at 15:29
  • $\begingroup$ @whuber so what is the correct answer? $\endgroup$ – user2974951 Sep 27 '18 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.