If a newborn baby is born a girl with probability $p$ and a boy with probability $1-p$ Define the events $A$ = "both children are girls", $B$ = "at least one of the children is a girl" 
What is the probability $Pr(A|B)$?
Can someone explain how to do this?
Both children are born independently 
 A: $$\begin{align} &&P(A)&=p^2 \\ &&P(B)&=1-(1-p)^2 \\&&P(A \cap B)&=P(A) \\&&&=p^2 \\&&P(A|B)&=\frac{P(A \cap B)}{P(B)} \\ &&&=\frac{p^2}{1-(1-p)^2} \end{align}$$
Explanations:


*

*$P(A)=p^2$ because the probability of getting a girl in each trial is $p$. Therefore getting a girl for two trials it's $p \times p = p^2$.

*$P(B)=1-(1-p)^2$ because we have an "at least one" task. What this means is that we're seeking to find the complement of none. The complement is just just 1 minus the probability of the thing you're finding the complement of. In this car, the probability of getting a boy is $1-p$. Thus the probability of getting two boys (in other words, no girls) is $(1-p)^2$. Take the complement of that and you've got $P(B)$, which is the probability of having at least 1 girl. Any combination other than 3 boys will have at least 1 girl; that's why we subtract from 100% (1).

*$P(A \cap B)$ may confuse you, but here it goes. It's only equal to $P(A)$ because, if $A$ is true, then $B$ is true (if you have 2 girls, the probability of having at least 1 girl [$B$] is 100%). If $B$ is true but $A$ is not true, or $B$ is false, that statement would be false anyway. The probability of $A$ and $B$ is just the probability of $A$ because whenever $A$ is true, $B$ is always true.

*The next thing is $P(A|B)$ which is read as the probability of $A$ given $B$. If $B$ is true, what is the probability that $A$ will also be true? This is given by the formula of $\frac{P(A \cap B)}{P(B)}$. When you plug what you have in, you get the answer. You can simplify it, but I don't see a point.


http://sketchtoy.com/60552724
I made a sketch of what we have. This helps you visually see how the problem is solved, but it also helps understand the $A$ given $B$ part.
We know that $B$ is true (...$A$ given $B$), so our "100%" will be $1-(1-p)^2$ (everything but the last one). Therefore the probability of getting the red one out of that enclosed span, will be the probability of getting $A$ over the new "100%".
