Artificial Intelligence · Asking smart questions

The mind-reader game

Think of one of the animals below, but don't tell me. I'll ask yes/no questions and read your mind! Press Start.

Ready?
Pick an animal in your head…

Questions I'm weighing

How it works

Start unsure

At the start every animal is equally possible. I'm as unsure as I can be.

Find a splitting question

For each question I count how many animals would say yes. The best question is the one that splits them near 50/50.

Cut the list

Your answer shrinks every animal that doesn't fit. Half the list goes dim.

Repeat

Ask again about what's left. Each good question is worth about one coin flip of information.

Guess

When one animal has nearly all my belief, I guess. Wrong guess? I rule it out and keep going.

What just happened?

For grown-ups: what's really going on

This is a small Bayesian belief over 38 animals with greedy information-gain question selection, the same criterion that decision-tree learners (ID3, C4.5, CART) use to choose a split. It is search and probability, not training: the animal-by-trait table is written by hand.

  • Belief: one weight per animal, starting equal. An answer multiplies every animal's weight by 1 if its trait agrees and 0.06 if it doesn't, then the weights are re-scaled to sum to 1. Using 0.06 instead of 0 is a soft likelihood: if you tap the wrong button, the right animal is hurt but not erased and can recover.
  • Question score: for each unasked question the AI computes p, the share of belief that would answer yes, and scores it with the binary entropy H(p) = −p log2 p − (1−p) log2(1−p). This is the expected information in bits, and it is largest (1 bit) when p = 0.5.
  • Guess rule: guess when one animal holds at least 80% of the belief, after 20 questions, or when no question can split what remains. A wrong guess sets that animal to zero and play continues, up to three guesses.
  • Measured: asking every animal in turn with truthful answers, smart selection averages about 6.1 questions and guesses 100% right. Random useful questions average about 10.4 over many runs, also right every time. The theoretical floor for 38 equally likely animals is log2 38 ≈ 5.25 questions on average, because a yes/no answer carries at most 1 bit.
  • Limits: greedy selection is not always optimal (the best full question list is a harder search problem). Real animals have exceptions (some dogs hate water), so a hand-written table is a simplification. Systems like 20Q and Akinator learn these tables from thousands of players' answers; that part would be machine learning.