A complete search tree, opened and checked

The Question You Know Is Wrong

Standard four-peg, six-colour Mastermind has two different optima. Run Knuth's minimax against all 1,296 secrets, then audit Koyama and Lai's published strategy tree: five guesses protects the worst case, while a sixth row buys the better average.

Pick a secret. The machine will ask only questions whose answers are scored by the ordinary black-and-white peg rule. What changes is the meaning of best.

MM(4,6) codebreaker

Building 1,296 codes and auditing both strategies.

Your secret code, click each peg to change it
What should optimal mean?

Knuth opens 1122. The candidate counter is recomputed after every answer.

The full search is being recomputed.

openingcomputing
mean guessescomputing
worst casecomputing

Protect the last secret

Knuth chooses the guess whose worst response leaves the fewest candidates. Our deterministic tie rule prefers a remaining candidate, then the first code in numeric order. The browser rebuilds this tree from scratch.

Reduce the sum of all rows

Koyama and Lai's exhaustive search opens 1123. The browser does not search for this tree. It expands their published Table 1, replays every edge, and rejects the table if one count or one score is inconsistent.

All 1,296 secrets

Recomputing both distributions.

Knuth minimax, rebuilt liveKoyama and Lai, published tree audited live

The tail is the price

The expected-case tree moves enough secrets left to save auditing guesses in total against this page's Knuth tie rule. It also grows one new leaf on row six. That is not a failure of the strategy. It is the exact bargain the objective asked for.

The sixth-row secret

auditing

The published tree's only depth-six route is audited from its response edges.

Forbid row six

auditing / 1,296

Replacing the one vulnerable 39-candidate subtree with Koyama and Lai's published five-row modification costs exactly one extra guess across the entire code space.

A false question can be useful

A guess is logical when it is still a possible secret. Koyama and Lai allow a guess that earlier answers have already ruled out. It cannot be the answer, but its pattern of responses can split the candidates more cleanly. Press “Show a known-false question.” For secret 6312, the strategy asks 2345 and then 2461; both are already impossible, and both still carry information.

The live audit finds auditing secrets whose routes use at least one such question, and auditing routes that use two. If every guess must remain a candidate, the optimum rises from the unrestricted 5625 / 1296 = 4.340 to the logical-only 5660 / 1296 = 4.367. The 35-row penalty is a published exhaustive-search result; this page demonstrates the ruled-out guesses but does not reconstruct that separate logical-only tree.

The check

Definition, recomputed

  • auditing codes.
  • auditing attainable black/white responses.
  • Scores count exact positions first, then colour matches among the unused pegs.

Live diagnostic audit

  • Knuth tree pending.
  • Published tree pending.
  • Five-row modification pending.

Published result and free choices

  • Global optimality, both worst-case 5 and expected total 5,625, comes from exhaustive searches reported in the cited papers.
  • Averages assume all 1,296 secrets are equally likely.
  • Knuth minimax ties are free choices. This page states its tie rule and prints its own result.
  • No sampling, physical measurement, uncertainty interval, or toy model is used.

Waiting for the independent scoring pass.

What this page proves locally, and what it cites

Locally recomputed: the scoring function, the 1,296-code space, all 14 attainable responses, the complete deterministic Knuth tree, every candidate count in the Koyama-Lai table, every response edge, both histograms, the sole depth-six secret, every ruled-out guess, and the one-row cost of substituting the published five-row subtree.

Cited rather than re-run in the browser: that no worst-case strategy can do better than five, that no expected-case strategy totals fewer than 5,625 rows, and that the best candidate-only tree totals 5,660. Those are exhaustive-search theorems, not consequences of a naive information bound.