A numerical check of the margin

Let Y∼Bernoulli⁡(1/2)Y\sim\operatorname{Bernoulli}(1/2). Conditional on Y=yY=y, let XX and ZZ be independent Bernoulli variables with success probability 0.80.8 if y=1y=1 and 0.20.2 if y=0y=0. Compute P(X=1,Z=0)P(X=1,Z=0).

Given Y=1Y=1 the probability is 0.8×0.2=0.160.8\times 0.2=0.16. Given Y=0Y=0 it is 0.2×0.8=0.160.2\times 0.8=0.16. The marginal is 12(0.16)+12(0.16)=0.16\tfrac12(0.16)+\tfrac12(0.16)=0.16.