Understanding the boy or girl paradox calculator — concept and principle
This calculator works through the two-child problem: a family has two children, and you learn something about them. What is the chance both are boys? Depending on exactly what you learned, the answer is 1/3, 1/2 or, with an extra detail such as "born on a Tuesday", 13/27. You can also change the chance of a boy and the rarity of the detail.
How it is calculated
With b = chance a baby is a boy and t = 1/N = chance of the detail:
- At least one is a boy: P(two boys) = b ÷ (b + 2(1 − b)); for b = ½ this is 1/3.
- The older one is a boy: P(two boys) = b; for b = ½ this is 1/2.
- At least one is a boy with the detail: P = b²(1 − (1 − t)²) ÷ [b²(1 − (1 − t)²) + 2b(1 − b)t]; for b = ½ and N = 7 this is 13/27.
- The page also shows the chance of one boy and one girl and the gut answer (the other child alone, which is b).
The principle
List the two children oldest first. With equal chances there are four equally likely families: BB, BG, GB and GG. "At least one boy" rules out only GG and leaves three cases, one of which is BB, so the answer is 1/3. "The older is a boy" leaves BB and BG, so 1/2. A specific detail matters because a two-boy family has two chances to contain a boy with that detail, which pushes the answer back toward 1/2. All of this assumes the fact was learned by asking "is at least one a boy?". If instead you met one child at random and saw a boy, the answer is 1/2.
Worked example
Default inputs: at least one child is a boy, chance of a boy 50 %, detail 1 in 7 (not used for this option).
- Equally likely families: BB, BG, GB, GG; GG is ruled out.
- P(two boys) = 0.5 ÷ (0.5 + 2 × 0.5) = 0.5 ÷ 1.5 = 33.33 %, as a fraction 1/3.
- P(one boy and one girl) = 2 out of the 3 remaining cases = 66.67 %.
- Gut answer, thinking only about the other child: 50 %.
How to read the result
The gap between 1/3 and 1/2 is about information, not biology. The precise question matters: how you found out changes which families are still possible. Try the "detail" option with N = 7 to see 13/27, and with a very rare detail (large N) to see the answer approach 1/2.
Common mistakes
- Treating "at least one is a boy" as "this particular child is a boy".
- Ignoring how the information was obtained.
- Thinking the day of the week cannot matter.
- Using 50 % when the real chance of a boy is slightly higher; at birth it is a little over half in most populations.
Frequently asked questions
Why is the answer 1/3 and not 1/2?
"At least one boy" leaves three equally likely families (BB, BG, GB), and only one of them has two boys.
How can a Tuesday birthday change the answer?
A family with two boys has two chances to include a Tuesday boy, so the detail makes two-boy families relatively more likely: 13/27.
Who made the puzzle famous?
Martin Gardner popularised it in his writing on recreational mathematics.
Sources: P. Norvig, "ProbabilityParadox" notebook (pytudes)