Suppose that $N|\Lambda$ has a binomial distribution with parameters $\Lambda$ and $q = 0.4$ (here q is referred as 'success') .Suppose that $\Lambda$ has a probability function defined by $p(1) = p(2) = p(3) = p(4) = 0.25$ Calculate the unconditional variance of N.
My Answer: Let $N|\Lambda$ ~ $Bin(\lambda,q=0.4)$ and $$p_{\Lambda}(\lambda) = 0.25, \lambda=1,2,3,4$$ Hence,
$Var(N) = Var[E(N|\Lambda)] + E[Var(N|\Lambda)] = Var[\lambda*0.4]+E[\lambda*0.4*0.6]$
$=0.4^2Var(\lambda)+0.24E(\lambda)$
Since $E_{\Lambda}(\lambda) = 0.25(1+2+3+4)=2.5$ and $E_{\Lambda}(\lambda^2) = 0.25(1+4+9+16)= 7.5$, then $Var_{\Lambda}(\lambda) = 1.25$
Therefore,
$Var(N)=0.16(1.25) + 0.24(2.5) = 0.8$
But Book's answer is $6.2784$
Where did I go wrong?
The distribution of $N$ is given by \begin{align} \mathbb P(N = k) &= \sum_{\lambda=1}^4 \mathbb P(N=k\mid\Lambda=\lambda)\mathbb P(\Lambda = \lambda)\\ &=\frac14\sum_{\lambda=1}^4 \binom\lambda k\left(\frac25\right)^k\left(\frac35\right)^{\lambda-k}, \end{align} with the convention that $\binom \lambda k = 0$ for $k>\lambda$. Hence $$ \mathbb P(N=0) = \frac14\sum_{\lambda=1}^4 \left(\frac35\right)^\lambda = \frac{204}{625}, $$ $$ \mathbb P(N=1) = \frac14 \sum_{\lambda=1}^4 \frac25\lambda\left(\frac35\right)^{\lambda-1} = \frac{259}{625}, $$ $$ \mathbb P(N=2) = \frac14 \sum_{\lambda=2}^4 \left(\frac25\right)^2\frac{\lambda(\lambda-1)}2\left(\frac35\right)^{\lambda-2} = \frac{124}{625}, $$ $$ \mathbb P(N=3) = \frac14 \sum_{\lambda=3}^4 \left(\frac25\right)^3\frac{\lambda(\lambda-1)(\lambda-2)}6\left(\frac35\right)^{\lambda-3} = \frac{34}{625}, $$ and $$ \mathbb P(N=4) = \frac14 \left(\frac25\right)^4 = \frac4{625}. $$ It follows that $$ \mathbb E[N] = \sum_{k=0}^4 k\mathbb P(N=k) = \frac1{625}\left(259 +2\cdot124 + 3\cdot34 + 4\cdot 4 \right) = 1 $$ and $$ \mathbb E[N^2] = \sum_{k=0}^4 k^2\mathbb P(N=k) = \frac1{625}\left(259 +2^2\cdot124 + 3^2\cdot34 + 4^2\cdot 4 \right) = \frac95, $$ hence $$ \mathsf{Var}(N) = \mathbb E[N^2]-\mathbb E[N]^2 = \frac95 - 1^2 = \frac45. $$