Suppose there is a three-child family and the probability of the children's genders are independent. The probability of giving birth to a boy is $p$ ($0<p<1$). Prove that events
$A$ = there are both, girls and boys, in the family
$B$ = there is one girl in the family at most
are independent if and only if $p=\frac{1}{2}$.
The possible combinations are
$(b,b,b)$ $(b,b,g)$ $(b,g,g)$ $(g,g,g)$ $(g,g,b)$ $(g,b,b)$ $(b,g,b)$ $(g,b,g)$
where $g$ is a girl and $b$ is a boy. Now $P(A)=1-P(A^c)=1-\frac{2}{8}=\frac{6}{8}$ and $P(B)=\frac{3}{8}$.
$A$ and $B$ are independent if $P(A∩B)=P(A)P(B)$.
We know that $P(A)P(B)=\frac{18}{64}=\frac{9}{32}$.
"$\Rightarrow$"
Assume that $A$ and $B$ are independent. This means that $P(A∩B)=P(A)P(B)=\frac{9}{32}$.
I don't know how to go on from here to prove that $p=\frac{1}{2}$. I'm also not sure how to prove the other side "$\Leftarrow$" of the statement; how can I use the information $p=\frac{1}{2}$ to prove $P(A∩B)=P(A)P(B)$?
$A$ is the event of being both girls and boys in the family therefore $$P(A)=1-P(A')=3(1-p)p^2+3p(1-p)^2=3p(1-p)$$ and $$P(B)=3(1-p)p^2+p^3$$ also $A\cap B$ happens when there is at most one girl and both girls and boys are there in the family, so $A\cap B$ is in fact the event that there is exactly one girl. This leads us to:$$P(A\cap B)=3p^2(1-p)$$Independence means that:$$P(A\cap B)=P(A)P(B)$$which by substitution leads to:$$3p^2(1-p)=p^2(3-2p)3p(1-p)$$Two answers are $p=0$ or $p=1$. Another is$$p(3-2p)=1$$or$$p=\frac{1}{2}\\p=1$$therefore $A$ and $B$ are independent if and only if $p=0$ or $p=1$ or $p=\dfrac{1}{2}$.