A numerical check of the margin
Let . Conditional on , let and be independent Bernoulli variables with success probability if and if . Compute .
Worked answer
Given the probability is . Given it is . The marginal is .
Let Y∼Bernoulli(1/2). Conditional on Y=y, let X and Z be independent Bernoulli variables with success probability 0.8 if y=1 and 0.2 if y=0. Compute P(X=1,Z=0).
Given Y=1 the probability is 0.8×0.2=0.16. Given Y=0 it is 0.2×0.8=0.16. The marginal is 21(0.16)+21(0.16)=0.16.