Figuring out the future and the now

, , , ,

The Mathematics and Game Theory Behind a Simple Number Game

My son recently came home from school excited about a number guessing game they’d played in class. The rules were simple: one child thinks of a number, and then the class takes turns asking questions about it. The first child to identify the exact number wins.

Before reading on, pause and consider: What strategy would you use if you were playing this game?




The Optimal Group Strategy

If we’re working as a team to find the number as quickly as possible, what’s our best approach? We need a systematic way to eliminate as many possibilities as we can with each question.

The optimal strategy is binary search – repeatedly halving the possible range by asking if the number is in one half or the other. For a number between 1 and n, this takes approximately log₂(n) questions. This is provably optimal from an information theory perspective – each yes/no question can at best halve our uncertainty. (This approach might be familiar if you’ve ever studied or used binary sort algorithms in computer science – the same principle of dividing the search space in half each time.)

Why does this work so well? Each question eliminates half the possible numbers, regardless of the answer. After k questions, we’ve reduced the possible range by a factor of 2^k. For example, with a starting range of 1-1000:

  • Question 1: >500? Reduces to 500 numbers
  • Question 2: >750 or >250? Reduces to 250 numbers
  • Question 3: >875 or >375? Reduces to 125 numbers
    And so on…

The Competitive Dynamic

But here’s where it gets interesting. The class isn’t actually trying to find the number as quickly as possible. Each child is competing to be the first to identify it. This transforms our optimization problem into a game theory challenge.

Consider child A’s decision when it’s their turn. They now face a trade-off:

  1. Ask a “narrowing” question that helps everyone by reducing the possible range
  2. Make a direct guess at the number

This becomes a competitive sequential search problem, touching on three related areas of study:

  1. Competitive Search Problems: How do agents search through a solution space when competing to find something first? This appears in various contexts, from R&D races between firms to parallel search algorithms in computer science.
  2. Information Cascade Theory: How do individuals make sequential decisions while observing others’ choices? This typically studies how public information influences private decisions, leading to potential herding behavior.
  3. Strategic Information Revelation: How do agents decide what information to reveal when that information might help competitors? This is crucial in contexts like patent disclosures and auction bidding.

The optimal individual strategy shifts as the game progresses:

  • Early game: The search space is too large for guessing to be rational
  • Mid game: There’s a tipping point where direct guesses become more attractive
  • Late game: Once the range is sufficiently narrow, direct guesses become optimal

For a rational player, the decision at each turn should be based on:

  1. Calculate probability of winning with a direct guess: p = (current range size)^-1
  2. Calculate probability of winning later after a narrowing question, accounting for:
  • Reduced range size
  • Number of other players who might guess correctly before your next turn
  • Number of turns until you go again
  1. Choose the action with higher expected value

Crucially, this assumes all other players are also playing rationally – a strong assumption that might not hold in practice, especially with younger players!

The Finite Guesses Twist

Here’s another interesting variation: what if players are limited to a fixed number of questions? This creates a fascinating optimization problem even in non-competitive scenarios.

At some point, if you have k questions left and n possible numbers, random guessing becomes better than binary search. The intuition is that binary search might narrow down the range significantly but leave you unable to identify the specific number.

For example, with just two questions left and a range of five numbers, you might be better off making two direct guesses (probability of success = 2/5) rather than two binary search questions that could narrow it to 2 numbers but not identify which one.

The optimal strategy becomes a dynamic programming problem, where at each stage you need to calculate the expected probability of success for:

  1. Using a binary search question
  2. Making a direct guess

The mathematics behind this optimization is fascinating, but I’ll leave that for another post!

An Interesting Parallel

This competitive dynamic reminds me of the board game Cluedo (Clue in North America). While the optimal strategy is usually to gather information methodically, the game dynamic shifts dramatically when you suspect another player is close to solving the mystery. At this point, making an educated guess at the solution, even with incomplete information, might be your best play despite the penalty for guessing incorrectly.

This perfectly mirrors our number game – when you suspect other players are close to identifying the number, the rational strategy might be to take a calculated risk with a direct guess, even if you’d normally prefer to gather more information.

Final Thoughts

What started as a simple classroom game reveals layers of mathematical and game theoretical complexity. It demonstrates how individual incentives can lead to strategies that are suboptimal for the group – a common theme in game theory.

Have you encountered similar games or puzzles that seem simple at first but reveal hidden complexity? I’d love to hear about them in the comments.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About David Kirk

Featured Posts