You may have noticed, but I have been on a brainteaser kick; I blame it on reading online on how to prepare for interviews–I’m trying to get a job! I found this probability question on Quora.
Suppose your wife is at the hospital, and she’s just given birth to a health baby; but you do not know if it’s a boy or girl. The baby has been taken to the hospital nursery, where before the addition of your infant, there are boys and an unknown (but fixed) number of girls . The nurse selects an infant at random from the nursery. Given that the nurse’s selection is a boy, what is the probability that your wife gave birth to a boy?
Proof. The problem can be solved with Bayes’ theorem. Let and be the Bernoulli random variables representing the sex of your baby and the sex of the baby the nurse picks up from the nursery, respectively. We assume that a woman is equally likely to have a boy as a girl, so . We are interested in the probability that given , which we write as
By Bayes’ theorem,
There are girls and boys in the nursery, if the wife has a boy. Since we assume that each infant in the nursery has equal probability of being selected by the nurse, we see that
To compute , we condition on , obtaining
Substituting these results in, we obtain
Your wife had a boy with probability , given the information that the nurse selected a boy at random from the nursery.