Determine Probability of Both Children Being Boys
AmazonData Scientist · Technical ScreenLast updated
Evaluates conditional probability reasoning in the classic two-children problem with different observation mechanisms. Strong answers enumerate ordered outcomes, condition correctly, and compare at-least-one, older-child, and random-child cases.
Scenario
A classic conditional-probability brain-teaser used in data science screens to test probabilistic reasoning and the discipline of stating assumptions before computing.
Question
A family has two children. You learn that at least one of them is a boy.
- What is the probability that both children are boys? Explain your reasoning and state your assumptions clearly.
- How does the answer change if instead you are told that the older (first) child is a boy?
- How does the answer change if a child is selected at random from the family and that child turns out to be a boy?
Hints
Enumerate the equally likely ordered outcomes BB, BG, GB, GG, then condition on the given information by removing the outcomes it rules out. Pay close attention to how the information was obtained — different selection mechanisms produce different answers.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.