The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.



(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A231205 Table of maximal number of guesses required to solve a Mastermind variant, read by columns. 0
0, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 2 (list; table; graph; refs; listen; history; text; internal format)



The table is the maximum number of guesses required to absolutely identify a code from n colored pegs in k slots with no repetition, where marking is ordered and uses 3 types of peg - gray indicating the color isn't present, white indicating the color is present but in the wrong position and black indicating the color is present and in the right position.

Ordered marking means the codemaker marks from left to right and places a marking peg in the corresponding slot in the answer grid.

Note that the sequence only gives the number of guesses required, not the number of turns required. If for example we have 2 colors and 2 slots, and we guess RG and get marked ww, we now know the answer is GR, and this is not counted as necessary to guess.

T(3,2)=1 because with 3 colors, say c1, c2 and c3, then any answer to, say, the guess c1|c2 tells you the answer - if it's ww the answer is c2|c1, bb -> c1|c2, gw -> c2|c3, wg -> c3|c1, gb -> c3|c2 and bg -> c1|c3. The answers bw, wb and gg are all impossible.

T(4,3)=2 because the worst case scenario involves the 1st guess returning www or some form of wwg.


Table of n, a(n) for n=1..12.

Web Games Online, Online MasterMind

Eric Weisstein, MathWorld : MasterMind

Wikipedia, MasterMind






With 6 colors (RGYBOP) and 4 slots, say the code is YBRG. The guess BORP should be marked wgbg.

The table starts:


Slots  | 1   2   3   4   5   6


     1 | 0   1   2   3   4   5

     2 | x   1   1   2   2

     3 | x   x   2   2

     4 | x   x   x   3

     5 | x   x   x   x   4

     6 | x   x   x   x   x   5


Cf. A004523.

Sequence in context: A049819 A284566 A079056 * A341839 A003984 A087061

Adjacent sequences:  A231202 A231203 A231204 * A231206 A231207 A231208




Jon Perry, Nov 05 2013



Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 1 14:40 EDT 2021. Contains 346391 sequences. (Running on oeis4.)