Statistical inferences and predictions I am a beginner in statistics, and am self-studying from "Information Theory, Inference, and Learning Algorithms" by David MacKay. I've hit a wall with one of the questions, and was wondering if any of you could please kindly help me with it. It's exercise 3.1, page 63. Here is the question:
You visit a family whose three children are all at the local school. You don’t know anything about the sexes of the children. While walking clumsily round the home, you stumble through one of the three unlabelled bedroom doors that you know belong, one each, to the three children, and ﬁnd that the bedroom contains girlie stuﬀ in suﬃcient quantities to convince you that the child who lives in that bedroom is a girl. Later, you sneak a look at a letter addressed to the parents, which reads “From the Headmaster: we are sending this letter to all parents who have male children at the school to inform them about the following boyish matters...”. These two sources of evidence establish that at least one of the children is a girl, and that at least one of the children is a boy. What are the probabilities that there are (a) two girls and one boy; (b) two boys and one girl?
 A: If you assume that there are only two sexes and the chance to have a child of either sex are equal, then knowing that there are three children, the following order of births are equally likely:


*

*BBB

*BBG

*BGB

*BGG

*GBB

*GBG

*GGB

*GGG


You have examined one bedroom and discovered that it is for a girl child. You have also discovered that there is at least one boy child. Call this information: $d_1$. Use Bayes theorem:
$$P(2G1B|d_1) = \frac{P(d_1|2G1B)P(2G1B)}{P(d_1)}$$
The prior probability for two girls and one boy is $P(2G1B)=3/8$ from the table above. The likelihood of observing $d_1$ assuming they have 2 girls and one boy is $P(d_1|2G1B)=2/3$. The denominator is the overall probability to observe that data.
$$P(d_1)=\sum_{i=1}^{8}P(d_1,i)=\sum_{i=1}^{8}P(d_1|i)P(i)=\sum_{i=1}^{8}P(d_1|i)\frac{1}{8}= \left(0+\frac{1}{3}+\frac{1}{3}+\frac{2}{3}+\frac{1}{3}+\frac{2}{3}+\frac{2}{3}+0\right)\frac{1}{8}=\frac{3}{8}$$
So the posterior probability after accounting for the data you observed is:
$$P(2G1B|d_1) = \frac{2}{3}$$
