Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Bob wants to test a possibly biased coin's probability $p$ of getting heads. His prior prediction is that $p \sim \mathrm{Uniform}(0, 1)$.

After getting all heads on 2 flips of the coin, why should the probability distribution change to $\mathrm{Beta}(3, 1)$? How is the Beta distribution relevant?

share|cite|improve this question
I don't think your question is clear. What are you asking? Does Bob wants to conduct Testing of Hypothesis for $H_0 : p \sim U(0,1) \text {vs } H_1 : p \sim Beta (3,1)$? (If he does, it might explain the question a little bit.) Please consider editing your question. – TheJoker Nov 15 '12 at 8:45
To me the question seem well formed. From what I understood, the question is equivalent to: you generate a random number $p$ between 0 and 1 uniformly. Now you flip the coin that generate heads with probability $p$ two times. What is the distribution of $p$ over the coins that result in $2$ heads? (if your initial $p$ was close to 0, only few times end with $HH$, so on the final distribution should be less represented) – carlop Nov 15 '12 at 9:37
up vote 0 down vote accepted

Fixing $p$, what is the probability of obtaining $HH$? $P(HH | p) = p^2$

What's the probability of getting p with the initial distribuition? $f(p) = 1$ (this is the probability density function)

What's the total probability of getting HH? $P(HH) = \int_0^1{P(HH|p)f(p)dp} = \int_0^1{p^2dp}=[1/3p^3]_0^1=1/3$

And then, using Bayes' theorem: $f(p|HH) = \frac{P(HH|p) * f(p)}{P(HH)}=\frac{p^2}{1/3}=3p^2$

You can check that this is exactly the probabily density function of $B(3,1)$. More generally, if you obtain $h$ heads and $t$ tails starting with uniform distribuition, the probability distribuition become $B(h,t)$.

share|cite|improve this answer

check pages 28 and up

you're trying to evaluate $p$ in $[0,1]$. The Beta is a convenient prior distribution.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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