MasterMind

In MasterMind, your hypothesis is made explicit in the form of a sequence of colored marbles. The following describes the fate of a series of guesse trying to deduce the sequence
Magenta-Orange-Magenta-Green-Green:

This is the correct answer, but it is actually hidden from you when the game commences.
A truly lousy guess—none of the marbles you have selected match the correct answer, so you receive null feedback—no pegs.
Aha! Two marble match, the greens in positions 4 and 5. You will receive 2 black pegs to indicate 2 of your placements are correct both in position and color
Your first try at a multicolored set is disappointing. You have one green marble correctly colored and placed. You are shown a black peg to indicate this. Thus you can ‘lock’ in a green marble at position 4.
Your attempt to find the position of the second green marble fails. You again receive a black peg for marble 4, and a white peg for marble three—right color, wrong place.
An inspired guess! Positions 1, 2 and 5 are right color, right place (3 black pegs). Position 3 is a correct color, but wrong place, as is position 4 (2 white pegs).
Ta-dah! All are correct in color and position, you grab the brass ring with 5 black pegs.

Some things to note:

  • the pegs are given to you in an order unrelated to the marbles they are referring to. In other words, even if you have the correct marble in position 4, the black peg you get will not be in the 4th position.
  • You only get 1 peg per marble—thus in the fourth line, you get 1 black peg for the green marble, and do not receive another white peg even though there is a green marble in position 5 of the code as well.
  • The code determines the number of pegs you get for incorrect placements. In other words, the code above has one orange marble at position 2. If you made a guess with orange marbles at positions 3, 4 and 5 you would receive only 1 white peg.

Points to ponder

  • What guesses give rise to easily interpreted answers?
  • What is the most efficient series of patterns?

In all cases, think slowly and carefully—every guess is rich in information, particularly those with NO pegs! Use a piece of paper to write down your hypotheses and reasoning if you find it’s a little tough to keep it all in your head. Even Einstein used a pencil...

To the game!