My father likes to tell a story about how he broke the system for a game event his school held. Specifically, he figured out a way to always at least break even on the Mastermind-like game, which would give you back the tickets you bet, and possibly more, as long as you found the answer by the last possible guess. He and a friend came up with a strategy such that they were guaranteed to solve the game by then.
However, beyond that it was a Mastermind variant, he does not remember any further details about the game. The minimal maximum number of guesses required for standard Mastermind is a solved problem: Donald Knuth came up with a 5-guess algorithm that is guaranteed to solve the puzzle when there are 6 different colors and the code is 4 colors long. (In Mastermind, the player attempts to guess a secret code consisting of 4 ordered elements which may be any of 6 different colors. After each guess, they get feedback consisting of how many colors are in the correct position, and how many colors are in the secret code but are in the wrong position. I am allowing duplicate colors but not "blanks" as a de facto extra color.)
My father doesn't think that his school's version of the game was exactly like the standard Mastermind. I am interested in the minimal maximum number of guesses when the parameters are varied. Surely there is a way to calculate this; I simply don't know how one would do the maths required.
Questions
- How does the minimal maximum number of guesses change when the number of possible colors changes? What if there are five colors? Seven colors? nk colors? For this problem, hold the length of the secret code constant at 4.
- How does the minimal maximum number of guesses change when the length of the secret code changes? What if it is length three? Five? kn? For this problem, hold the number of possible colors constant at 6.
- (Bonus) What is the minimal maximum number of guesses for nk possible colors in a code of length kn?