Let $X\mid Y\thicksim\operatorname{Binomial}(Y,p)$, and let $Y\thicksim\operatorname{Binomial}(n,q)$. I have seen it written that:
Claim: $X$ is marginally $\operatorname{Binomial}(n,pq)$.
There is a simple justification: first, $Y$ members of the population are chosen at random with probability $q$, and then each of these is selected with probability $p$, so that each member is randomly selected in the end with probability $pq$. That is satisfying.
However, my computation of the marginal variance of $X$ disagrees with the answer that should be true if the claim above is true. If the claim above is true, we should have $\operatorname{var} X = npq(1-pq)$. However, I'm getting $$\begin{aligned} \operatorname{var} X &= E[\operatorname{var}(X\mid Y)] + \operatorname{var}(E[X\mid Y])\\ &=E[Yp(1-p)] + \operatorname{var}(pY)\\ &=np(1-p) + p^2 n q (1-q). \end{aligned}$$
This does not equal $npq(1-pq)$. To see this, plug in $p=0.5,q=0.5$, and in that case $npq(1-pq)=0.1875n$ and $np(1-p) + p^2 n q (1-q)=0.3125n$.
I'm wondering if someone can check my math, or point to any resource showing that $X$ is really marginally Bin(n,pq). Thanks.
binomial(x | n, pq) * binomial(y - x | n - x, q * (1-p)/(1-pq))
. The result is now immediate from summing out $Y$. This statements feels like it should have an obvious explanation, but I can't see it at a glance. $\endgroup$