A Riddle About Family Size And The Solution

Author

Bas Machielsen

Published

November 12, 2025

Introduction

I’ve come across a very nice riddle in Alex Bellos’ book So You Think You’ve Got Problems, which I managed to solve. The solution (provided in the book) was not entirely satisfactory to me, so this blog post will paraphrase the riddle and give out a more detailed solution based on “dynamic programming” insights. I’ll paraphrase the riddle due to copyright issues and so on, instead of citing it verbatim.

The Riddle

Mr and Mrs Brown are deciding how many children to have. Mr Brown wants to stop as soon as they have two boys in a row, and Mrs Brown wants to stop after having a girl followed by a boy. According to whose strategy is it more likely to stop earlier?

The Solution

To determine which strategy is more likely to result in stopping earlier, we will calculate the expected number of children for both Mr. Brown’s and Mrs. Brown’s strategies. A lower expected number of children implies an earlier stopping time on average.

We will assume that the probability of having a boy (B) is equal to the probability of having a girl (G), and that this probability is 1/2. We also assume that the gender of each child is an independent event.

Mr. Brown’s Strategy: Stopping at Two Consecutive Boys (BB)

Let \(N_{BB}\) be the random variable representing the total number of children until the sequence ‘BB’ occurs for the first time. We want to find the expected value of this variable, denoted as \(E[N_{BB}]\).

We can establish a system of equations for the expected number of additional children needed from different states of the process:

  • Let \(E_{start}\) be the expected number of children from the beginning.
  • Let \(E_{B}\) be the expected number of additional children needed given the last child was a boy.

The process from the start (\(E_{start}\)) can be described as follows:

  1. The first child is a Girl (with probability 1/2). This means one birth has occurred, and the process resets to the start. The expected number of additional children is \(E_{start}\).
  2. The first child is a Boy (with probability 1/2). This means one birth has occurred, and we move to the state of needing one more boy. The expected number of additional children is \(E_{B}\).

This gives us the first equation:

\(E_{start} = 1 + \frac{1}{2} E_{start} + \frac{1}{2} E_{B}\).

Multiplying by 2 and rearranging gives:

\(2E_{start} = 2 + E_{start} + E_{B}\) \(\implies E_{start} = 2 + E_{B}\) (Eq. 1)

Now, let’s analyze the state after having one boy (\(E_{B}\)):

  1. The next child is a Girl (with probability 1/2). One additional birth has occurred, and the sequence is broken. The process resets to the start, requiring an expected \(E_{start}\) more children.
  2. The next child is a Boy (with probability 1/2). One additional birth has occurred, and the ‘BB’ sequence is complete. The process stops.

This gives us the second equation for \(E_{B}\):

\(E_{B} = 1 + \frac{1}{2} E_{start} + \frac{1}{2} \cdot 0\) \(\implies E_{B} = 1 + \frac{1}{2} E_{start}\) (Eq. 2)

Now we solve the system of two linear equations. Substituting (Eq. 2) into (Eq. 1):

\[\begin{align*} E_{start} &= 2 + (1 + \frac{1}{2} E_{start}) \\ E_{start} &= 3 + \frac{1}{2} E_{start} \\ \frac{1}{2} E_{start} &= 3 \\ E_{start} &= 6 \end{align*}\]

Thus, the expected number of children for Mr. Brown’s strategy is 6.

State-Action Values

To understand this a little bit better, let’s delve a bit deeper into the recursive aspect. This way of thinking about problems (the “value” of a decision-today is the value today plus the future value) is also called dynamic programming and has a lot of applications in math and economic theory.

The 1 at the beginning of the right-hand side of each equation represents the immediate, certain cost of taking the next single step.

In this problem, the “steps” are having children and the “cost” is the number of children. Therefore, the 1+ represents the one child that is about to be born, whose outcome will determine the next state of the problem.

Let’s break it down using Mr. Brown’s first equation as an example:

\(E_{start} = 1 + \frac{1}{2} E_{start} + \frac{1}{2} E_{B}\)

Here is what each part means:

  • \(E_{start}\): This is what we want to find—the total expected number of children we will have, starting from the very beginning.

  • 1: This represents the first child the couple decides to have. Before we can even consider what comes next, one child must be born. This is a guaranteed, non-probabilistic event in the calculation; it adds exactly 1 to the final count.

  • \(\frac{1}{2} E_{start} + \frac{1}{2} E_{B}\): This is the “what happens next” part. It’s the weighted average of the future expected number of children after the first one has been born.

    • There’s a 1/2 probability that the first child (the “1” we already counted) is a Girl. If this happens, the sequence “BB” has not started, and they are essentially back at the beginning. The expected number of additional children they will need is \(E_{start}\).
    • There’s a 1/2 probability that the first child is a Boy. If this happens, they have made progress. The expected number of additional children they will need from this new state is \(E_{B}\).

Hence, the formula is simply a statement of logic: the total expected number of children from any given state is equal to one (for the child you are about to have right now) plus the expected number of additional children you will need after that child is born.

This same logic applies to every state equation:

  • For \(E_{B} = 1 + \frac{1}{2} E_{start}\): Starting from a state where you just had a Boy (\(B\)), the total future expectation (\(E_{B}\)) is 1 (for the very next child you have) plus the future expectation from where you land after that child is born (which is either back to the start, \(E_{start}\), or finished, which is 0).

This method recursively defines the expected value from a given state in terms of the expected values of the states that can be reached in a single step. The “1+” is the cost of taking that single step.

Mrs. Brown’s Strategy: Stopping at a Girl followed by a Boy (GB)

Similarly, let \(N_{GB}\) be the random variable for the total number of children until the sequence ‘GB’ occurs. We want to find its expected value, \(E[N_{GB}]\).

We use a similar state-based approach:

  • Let \(E_{start}\) be the expected number of children from the beginning.
  • Let \(E_{G}\) be the expected number of additional children needed given the last child was a girl.

From the start (\(E_{start}\)):

  1. The first child is a Boy (with probability 1/2). This does not start the ‘GB’ sequence. One birth has occurred, and the process is effectively back at the start. The expected number of additional children remains \(E_{start}\).
  2. The first child is a Girl (with probability 1/2). One birth has occurred, and we are now waiting for a boy. The expected number of additional children from this state is \(E_{G}\).

This leads to our first equation:

\(E_{start} = 1 + \frac{1}{2} E_{start} + \frac{1}{2} E_{G}\)

Multiplying by 2 and rearranging gives:

\(2E_{start} = 2 + E_{start} + E_{G}\) \(\implies E_{start} = 2 + E_{G}\) (Eq. 3)

Now, let’s analyze the state after having one girl (\(E_{G}\)):

  1. The next child is a Boy (with probability 1/2). One additional birth has occurred, completing the ‘GB’ sequence. The process stops.
  2. The next child is a Girl (with probability 1/2). One additional birth has occurred, but the sequence is not complete. However, we are still in a state of having just had a girl, so the expected number of additional children remains \(E_{G}\).

This provides the second equation:

\[\begin{align*} E_{G} &= 1 + \frac{1}{2} \cdot 0 + \frac{1}{2} E_{G} \\ E_{G} &= 1 + \frac{1}{2} E_{G} \\ \frac{1}{2} E_{G} &= 1 \\ &\implies E_{G} = 2 \text{ (Eq. 4)} \end{align*}\]

Substituting (Eq. 4) into (Eq. 3):

\(E_{start} = 2 + 2\), hence \(E_{start} = 4\).

So, the expected number of children for Mrs. Brown’s strategy is 4.

Conclusion

Hence, by comparing the expected number of children for each strategy, we can determine which is likely to conclude earlier.

  • Mr. Brown’s Strategy (BB): Expected number of children = 6.
  • Mrs. Brown’s Strategy (GB): Expected number of children = 4.

Since the expected number of children for Mrs. Brown’s strategy (4) is less than that for Mr. Brown’s strategy (6), it is more likely that they will stop earlier by following Mrs. Brown’s strategy.