Binomial Distribution with probability $P$ such that $P$ is Uniformly distributed

128 Views Asked by At

A number $P$ is random chosen from the uniform distribution from [0,1]. Then a coin with probability $P$ of getting a head is flipped $n$ times. Let $X$ be the number of heads showing and compute $P(X=k)$.

I believe this is simply: $n\choose k$$P^k(1-P)^{n-k}$. But this seems fairly simple. Am I missing something?

1

There are 1 best solutions below

1
On

No. The expression you displayed will have to be integrated over $[0,1]$:

$$\mathbb P(X=k)=\int_0^1{{n\choose k}p^k(1-p)^{n-k}}dp.$$

This is so because $${n\choose k}P^k(1-P)^{n-k}=\mathbb P(X=k\mid P)$$ and $$\mathbb P(X=k)= \mathbb E[\mathbb P(X=k\mid P)].$$