# How do I calculate the probability distribution of the percentage of a binary random variable?

I have an urn containing balls that are all either black or red. I'm interested in discovering the percentage of balls that are red. But I can only sample from the urn (without replacement), so the best I can do is calculate a probability distribution over possible percentages.

Obviously, if I've drawn no balls, I have no information, so the probability distribution is uniform from 0 to 1. But what is it once I start drawing balls?

-

## 1 Answer

Theory: if $reds$ is the number of red balls you've seen and $blacks$ is the number of black balls you've seen, then the distribution is:

$Beta(reds+1, blacks+1)$

This starts out as $Beta(1,1)$ which is the uniform distribution we want. As we see blacks, it shifts toward zero; as we see reds, it shifts toward one.

Does anyone know if this is right?

-
This is, I think, a lucky guess, but it's actually the right lucky guess. However I'd point out that there's no reason you should necessarily start with B(1,1). If you want to learn more you should read up a bit on Bayesian statistics, which is what you're trying to do. –  Michael Lugo Aug 3 '12 at 15:42
Yes the idea here is that you are calling the Bayesian aposteriori distribution the right answer without realizing that you are doing Bayesian analysis and that "what you start with" is called a prior distribution. The uniform distribution is the noninformative prior that some Bayesians might start with. Since it is in the beta family which form conjugate priors for the binomial likelihood the posterior distribution on which Bayesian inference relies is also in th Beta family with a very special form in terms of the number of successes. –  Michael Chernick Aug 3 '12 at 19:03