Conditional independence can hide marginal dependence

Let θ be uniform on [0,1], and conditionally on θ let Y₁ and Y₂ be independent Bernoulli(θ). Find P(Y₁=1), P(Y₁=1,Y₂=1), and Cov(Y₁,Y₂). Are the two observations marginally independent?

Eθ=1/2, so P(Y₁=1)=1/2. Conditional independence gives P(Y₁=1,Y₂=1)=Eθ²=1/3. Thus Cov(Y₁,Y₂)=1/3-(1/2)²=1/12>0. Sharing an uncertain θ makes them marginally dependent.