A number p is drawn from the interval [0,1] according to the uniform distribution, and then a sequence of independent Bernoulli trials is performed, each with success probability p. What is the variance of the number of successes in k trials? Note k is a deterministic number.
In this question, I tried solving by calculating the expected value of p which is $\frac{1}{2}$ as p ~ U[0,1]. Then took a random variable M = No. of successes in k trials Since M ~ Binomial(k,p). Therefore, calculated the variance to be V(M) = $k\times{p}\times{(1-p)} = \frac{k}{4}$. The Answer is $ \frac{k\times{(k+2)}}{12}$. Not sure where I am going wrong.