I'm having some trouble on how to tackle the following problem
$X_1$ is a random variable with probability density $f(x)$ in the range $[0,1]$. A value of $X_1$ is picked, call its value $p$. A coin is played $n$ times with a probability $p$ to come up heads in each time. Calculate the expected value of the number of $k$ heads in the $n$ plays in the following cases:
Each coin toss is independent and the $p$ value is the same for all of them. Find an expression for $E [k]$ in the case of a general $f(x)$
Find $E[k]$ if $f(x)$ is uniform over $[0,1]$
Find $E[k]$ if $f(x)$ is uniform over $[0,1]$ and a new $p$ value is picked before each coin flip.
I'm not sure I'm interpreting this correctly and honestly I think it's a little bit confusing.
If $p$ is fixed, the PMF would be the binomial distribution. In the case of a general $f(x)$, I assume I've to first derive a posterior distribution for $X_1$, where $f(x)$ is the prior. I'd proceed by finding the likelilhood based on the information that the coin was flipped $n$ times with a probability $p$ to come up heads. Then I could find the distribution for the next $m$ plays and calculate the expected value for this case. Here starts the trouble for me - it's asking for the expected value of the same $n$ plays I'm using to construct the likelihood. Because of that I'm not sure my approach is correct.
Also, I would appreciate some insight in the case where $X_1$ is picked before each coin flip.