Optimal Consistent Guessing in Bulls and Cows

A simple Bulls and Cows solver always guesses the smallest remaining possible secret. What should it guess if it wants to finish in the fewest turns on average? We solve the decision tree under the rule that every guess must still be a possible secret. With four distinct decimal digits the optimal total is 26,688 guesses over 5,040 secrets when a leading zero is allowed, and 23,620 over 4,536 secrets when it is forbidden. An eleven-secret position shows why the guess leaving the fewest candidates on average can take longer to finish. In a 216-secret position, reuse of solved states, symmetry and lower bounds reduce the number of guess evaluations from 94,765,680 to 34,531 while selecting the same guess. We give exact averages through length four and bounds through length ten. In a separate four-digit experiment with no leading zero, allowing probes outside the remaining candidates yields a playable strategy costing 23,499 guesses.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-26
DOI
https://doi.org/10.5281/zenodo.24541919
Primary Topic
Artificial Intelligence in Games
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Optimal Consistent Guessing in Bulls and Cows

Mingon Kim
Zenodo (CERN European Organization for Nuclear Research)
Artificial Intelligence in Games
preprint

Optimal Consistent Guessing in Bulls and Cows

Mingon Kim
preprint en

Abstract

A simple Bulls and Cows solver always guesses the smallest remaining possible secret. What should it guess if it wants to finish in the fewest turns on average? We solve the decision tree under the rule that every guess must still be a possible secret. With four distinct decimal digits the optimal total is 26,688 guesses over 5,040 secrets when a leading zero is allowed, and 23,620 over 4,536 secrets when it is forbidden. An eleven-secret position shows why the guess leaving the fewest candidates on average can take longer to finish. In a 216-secret position, reuse of solved states, symmetry and lower bounds reduce the number of guess evaluations from 94,765,680 to 34,531 while selecting the same guess. We give exact averages through length four and bounds through length ten. In a separate four-digit experiment with no leading zero, allowing probes outside the remaining candidates yields a playable strategy costing 23,499 guesses.

Zenodo (CERN European Organization for Nuclear Research)
Artificial Intelligence in Games
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon