The History of Bulls and Cows

A code-breaking game of pure logic, with no rival player to outwit, that began as a pencil-and-paper guessing game and went on to become a favorite subject for computer scientists studying how to search for a hidden answer efficiently.

A Pencil-and-Paper Classic

The central idea - guess a hidden code and get back only a count of exact and partial matches, never which positions are right - comes from Bulls and Cows, a pencil-and-paper guessing game that is older than 1970 - by some accounts much older. It is traditionally played with secret numbers: a right digit in the right place is a bull, a right digit in the wrong place is a cow.

It also came to computers early: versions, often called Moo, ran on university computers from around 1970 on, and programming it is still a classic exercise today.

The Board Game and the Name

In 1970 the idea was turned into a board game with colored pegs, which became famous worldwide under the name Mastermind. Mastermind is a trademark; the rights lie with Invicta Plastics. PaperGames is not affiliated with Invicta Plastics or that board game and therefore uses the older name, Bulls and Cows.

A Favorite Puzzle for Computer Scientists

Because it boils down to searching for a hidden answer using nothing but match-count feedback, the game became a standard test case in computer science and combinatorics for studying guessing strategies and search algorithms.

In a well-known paper from 1976/77, Donald Knuth showed that the classic version with four positions and six symbols can always be solved in at most five guesses using an optimal strategy - a result still cited whenever the game comes up in discussions of algorithmic search.

← Back to the board