Likelihood of probability of heads = 0.5 given that the coin yields 4 heads in 9 tosses.

72 Views Asked by At

Suppose I have a coin.

The probability of heads is unknown.

I toss the coin 9 times and get 4 heads. What is the likelihood that probability of heads(Ph) is 0.5

What I have tried till now

Likelihood  of Ph being 0.5 given I have 4 heads from 9 tosses = Probability of getting 4 heads from 9 tosses when Ph is 0.5/Probability of getting 4 heads from 9 tosses when Ph varies from 0 to 1

In equation form:

P(Ph=0.5|4 heads from 9 tosses) = P(4 heads from 9 tosses|Ph=0.5)/P(getting 4 heads from 9 tosses)

Since coin tosses follow binomial distribution

$P(4 heads from 9 tosses|Ph=0.5) = 9C4 (0.5^4) * (1-0.5)^5 \tag{1}$

$P(getting 4 heads from 9 tosses) = 9C4 \int_0^1 (Ph^4)(1-Ph)^5 \, dPh \tag{2}$

where Ph varies from 0 to 1

But dividing eqn (1) and (2) yields a number greater than 1.

What am I doing wrong?

2

There are 2 best solutions below

9
On BEST ANSWER

The likelihood is only the numerator of your calculation

$L(\frac{1}{2})=\binom{9}{4}(\frac{1}{2})^9\approx 0.246$

what you were triyng to calculate is the posterior density of $\theta$

$$f(\theta|\mathbf{x})=\frac{\binom{9}{4}\theta^4(1-\theta)^5}{\int_0^1 \binom{9}{4}p^4(1-p)^5 dp}=1260\cdot\theta^4(1-\theta)^5$$

Which is a $Beta(5;6)$ distribution

Please, for future posts, use MathJax

0
On

To be more specific and replying to @WA Don in few words, let's take the binomial distribution

$\mathbb{P}[X=x|\theta]=\binom{n}{x}\theta^x(1-\theta)^{n-x}$

$x=0,1,2,...,n$

If you look at this function as a function of $\theta$ you can ignore the normalization constant $\binom{n}{x}$ and say that the function is

$\mathbb{P}[\theta|\mathbf{x}]\propto\theta^x(1-\theta)^{n-x}$

Immediately you recognize now the core of a Beta distribution that is

$Beta (\alpha;\beta)\sim \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta}\theta^{\alpha-1}(1-\theta)^{\beta-1}$

$\theta \in [0;1]$