Ques. 3: The probability of heads of a random coin is a random variable p uniform in the interval
(0.4, '0.6). (a) Find the probability that at the next tossing of the coin heads will show.
(b) The coin is tossed 100 times and heads shows 60 times. Find the probability that at the
next tossing heads will show.
Answers
Answer:
Let's go step by step.
Although the result you arrive to regarding the question of what is the probability we should assign to heads before seeing the coin tosses is correct, your reasoning is not. To simplify notation I will use θ instead of P to denote the random variable which represents the coin bias.
First we want to find P(H|θ is uniform in [0.4,0.6]). But this is the same as ∫0.60.4P(H|θ=x)πθ(x)dx, where π is the prior density of θ and it is πθ(x)=I[0.4,0.6](x)0.6−0.4.
Substituting, we have that P(H)=∫0.60.4x10.6−0.4(x)dx=12.
Now we want to do a Bayes update given the data on the coin tosses. If we denote by B(n,h,p) the mass distribution of a binomial, where n is the number of coin tosses, h the number of heads and p the coin bias, then:
f(θ=x|Data)=πθ(x)P(Data|θ=x)P(Data)=πθ(x)B(50,29,x)∫0.60.4B(50,29,y)πθ(y)dy=10.6−0.4(5029)x29(1−x)21∫0.60.4(5029)y29(1−y)2110.6−0.4dy=x29(1−x)21∫0.60.4y29(1−y)21dy
Thus the result is a beta distribution with a rather hideous denominator