Intuitive explanation for a constant answer in a Bayes theorem question

I imagine the argument may go like this...

Let's assume you have two identical wards A and B in the hospital, both having nurseries, in each nursery there are $3$ boys and $k$ girls. Then a woman in ward A gives birth to a boy and another woman in ward B gives birth to a girl. Now there are $4$ boys in ward A's nursery, but still $3$ boys in ward B's.

Imagine now you (not having the wards clearly labelled, as it often happens in hospitals) randomly (with probabilities $50\%$ each) enter one of the wards and see a nurse holding a boy from the nursery. What is the probability you'd entered ward A?

This is the same problem as the original one, but has the obvious solution $4/7$. Namely, each child (out of all $8+2k$ children) is picked with equal probability, so knowing that it was a boy, it could've been one of $7$ equally likely boys. However, $4$ of them are from ward A, so the odds that you'd strolled into ward A are $4/7$.


Wow this one was a doozy. For brevity's sake, I will refer to the three other boys as "boy 1," "boy 2" and "boy 3," and to the child in question as just "the child."

There are seven different possible outcomes:

If the child is female: (1) Boy 1 is chosen, (2) Boy 2 is chosen, (3) Boy 3 is chosen.

If the child is male: (4) Boy 1 is chosen, (5) Boy 2 is chosen, (6) Boy 3 is chosen, (7) the child is chosen.

Essentially, each of these seven events have equal probability, which is pretty counter intuitive. This is because 4/7 of the time the nurse will pick the second category since there are four children instead of three. In fact, this is where the probability that the child is male comes from. Note that this has nothing to do with the .5 chance of any child being male, since the nurse is more likely to pick from the pool of males if there are more males.

It might be a bit easier to consider if you consider the case with 1 known male. You are twice as likely to pick a male if the child is male, which means that 2/3 times, you will pick from the second pool, which is synonymous to saying the child is male.

You could also think about it as if the child has half the "weight" of the other children, if that would help.

If you want some numbers to convince you: if any of the three other boys is chosen, which happens 6/7 of the time, this has no bearing on the gender of the child. However, 1/7 of the time, when the child is chosen, he is guaranteed to be male.

Then the calculation is $(\frac12) \frac67 + (1)\frac17 = \frac47 $

If you realize this extremely counter intuitive way of looking at it, this problem is pretty much immediate and requires no calculation. I apologize if this is a convoluted explanation.


Revised answer: It may be helpful to refer to my original answer below in order to follow this revised answer. Some of the context I give there is relevant, but I'd rather not repeat it here. (Nothing in that answer is incorrect, as far as I know, but it fails to get to the key point.)

Having thought about the bigger picture, I'm convinced that the only intuitive explanation is essentially the algebraic explanation: the number of girls does not affect the conditional probability because it only enters in the common denominator of the terms in Bayes' formula, and therefore cancels out.

Consider a modified version of the problem where the number of girls ends up mattering: in the hospital there are currently $k$ newborn girls and $\ell$ newborn boys plus one woman in labor who is known (say from ultrasound) to be having a boy. The probability that she will give birth in the next hour is $p$. At the end of the hour a nurse holds up a random newborn and it is seen to be a boy. What is the probability the baby has been born?

The answer is \begin{align} \frac{\frac{\ell+1}{k+\ell+1}p}{\frac{\ell+1}{k+\ell+1}p+\frac{\ell}{k+\ell}(1-p)}&=\frac{(\ell+1)(k+\ell)p}{(\ell+1)(k+\ell)p+\ell(k+\ell+1)(1-p)}\\ &=\frac{p(\ell^2+k\ell+\ell+k)}{\ell^2+k\ell+\ell+pk}\\ &=p+\frac{kp(1-p)}{\ell^2+k\ell+\ell+pk}. \end{align} When $k=0$ this reduces to $p$; as $k$ grows, the conditional probability grows and approaches $\frac{\ell p+p}{\ell+p}$, the same answer as in the original problem. This makes sense: if $k=0$ there are no girls in the story and so seeing a boy provides no information. When $k$ is large, the small difference in the denominators of the terms in Bayes' formula becomes negligible.

The explanations that have been given for the answer to the original problem focus on the fact that (in the $p=0.5$, $\ell=3$ version of the problem) the three boys in the universe where a girl was born and the four boys in the universe where a boy was born all have the same probability of being held up by the nurse. When one conditions on a boy being held up, it becomes clear that the number of girls is not going to enter. In this modified problem, the four boys in the universe where the birth has occurred each have a slightly lower probability of being held up by the nurse. So even when we condition on a boy being held up, the number of girls affects the probability that a boy is held up differently depending on which universe you are in, and so the number of girls is going to enter.

Original answer: There is something very right about the intuition you expressed in your question, which I think is worth emphasizing. Before I get to that, let me rephrase your question as "Why does the conditional probability not depend on the number of girls (or equivalently, on the total number of children)?" I think this is better than "Why is the conditional probability constant?" since the latter leads to the question "Constant with respect to what?" I realize that you meant constant with respect to the number of girls, as that's the only variable in the problem, but it is enlightening to let other quantities vary as well. So let $\ell$ be the number of boys and let $p$ be the probability that a birth results in a boy. With these changes, $$ \Pr(A\vert B)=\frac{\frac{\ell+1}{k+\ell+1}p}{\frac{\ell+1}{k+\ell+1}p+\frac{\ell}{k+\ell+1}(1-p)}=\frac{\ell p+p}{\ell+p}. $$ So the conditional probability does depend on two of the parameters, $\ell$ and $p$. It just doesn't depend on $k$.

Looking at this expression, we can now see what was right about your intuition: seeing the nurse pick up a boy is much more significant when the original number of boys is low than it is when the original number of boys is high. So $\Pr(A|B)$ is $100\%$ when $\ell=0$, but decreases toward $p$ when $\ell$ gets large. The only place you went astray was in thinking that the number of boys relative to the total number of children was significant, rather than the absolute number of boys. Added: To pinpoint the error, you say "we are already given the claim that we have selected a boy", but you follow this with "If we have infinite girls, then the newborn has to almost surely be a boy to help support that observed claim." The claim needs no support, since it is an assumption, no matter how probable or improbable. A place where support actually would be needed is if you wanted to claim the newborn was a boy. Seeing a boy would provide some support for that claim, but the support would be rather weak if there were lots of other boys that might have been the boy that was seen. If there were very few, or even no other boys, then support for the claim would get much stronger.

For good measure, let's compute $\Pr(A\vert B')$, the probability the birth resulted in a boy given that the child picked up by the nurse was a girl: $$ \Pr(A\vert B')=\frac{\frac{k}{k+\ell+1}p}{\frac{k}{k+\ell+1}p+\frac{k+1}{k+\ell+1}(1-p)}=\frac{kp}{k+1-p}. $$ In this case, the original number of boys is irrelevant; only the original number of girls matters. The explanation is that given by Joshua Malco (although I do agree with Ilmari Karonen's criticism). I'll try to formulate that explanation slightly differently: we can solve the problem in such a way that the only numbers that are relevant are those that relate to the gender of the child you see (both $k$ and $p$ relate to this) and the gender of the new child ($p$ relates to this). We saw a girl; a fraction $p$ of the time this will have been one of the $k$ original girls; a fraction $1-p$ of the time it will have been one of the $k$ original girls or the new child. In a sense, there are $k+(1-p)$ girls that the nurse could have picked, where the fractional weight $1-p$ has been attached to the new child because their gender is uncertain. The portion of this quantity associated with the case where the new child is a boy is $pk$. This accounts for our final expression without needing to consider any of the original boys.

The same idea can be applied to the original problem: there are effectively $\ell+p$ boys, which breaks down as $p(\ell+1)+(1-p)\ell$. The portion of the quantity associated with the case where the new child is a boy is $p(\ell+1)$, hence the final probability expression.

To say this again, slightly differently, the gender of the new child is independent of the genders of the children already in the nursery—the probability it's a boy is always $p$. If you see the nurse pick a boy, you need only consider whether the child you saw could be the new child; it's already ruled out that it was one of the original girls, and they can be ignored, but it might have been one of the original boys, so their number will have an effect.

If you change the problem so that the nurse picks up two children and condition on the event that one girl and one boy get picked up, then the probability depends on both of the parameters $k$ and $\ell$: $$ \frac{\frac{(\ell+1)k}{\binom{k+\ell+1}{2}}p}{\frac{(\ell+1)k}{\binom{k+\ell+1}{2}}p+\frac{\ell(k+1)}{\binom{k+\ell+1}{2}}(1-p)}=\frac{\ell kp+kp}{kp+\ell k+\ell-\ell p}. $$