Recently Ernie's twin niece and nephew Maria and Mario were spending a few days staying at his place. When I dropped in on a rainy Friday morning I found them a little dissatisfied with the arrangement. "Ernie cooks great food...", said Maria, "...and his stories are interesting, if a bit weird...", continued Mario, "...but he doesn't have any kids books..." (Maria), "...or games!" (Mario). I told them that I couldn't help with children's books, but might be able to find a few old games if they could come over for the afternoon. As Ernie had "stuff to do" he would arrive in time for dinner and to take them home later in the evening.
Back at my place, I fossicked through the spare-room cupboards until I stumbled on an old favorite - the game of Mastermind - a bit dusty, but none the worse for wear after goodness knows how many years in storage. Back when I was a school-child I had earned a bit of a reputation as an astute player. The children picked up the rules quickly and spent most of the afternoon in a battle-royale for Mastermind supremacy while I prepared dinner. Ernie arrived late in the afternoon as promised and to my surprise (I assumed Ernie would have known everything about games of logic) he didn't seem familiar with the game at all. "Mastermind?", he questioned, "Never heard of it". So of course the twins proposed a contest against him "We'll choose the secret code first" said Mario, as Ernie familiarized himself with the rules printed on the back of the box.
The first two turns went like this:
Ernie chose red, blue, yellow, purple (in that order), and Maria responded with "No hits and no misses".
Ernie then chose green, green, orange, orange (in that order), and Mario said "No hits but four misses".
To my surprise Ernie next chose yellow, orange, green, yellow. He stared hesitantly at the two 'hit' markers that Maria placed on the board and spent a long time before choosing red, red, red, blue for his next guess (his fingers were shaking slightly as he did so). To cut a long story short, Ernie took another seventeen turns before finally stumbling on the obvious orange, orange, green, green and the secret code was revealed.
"Time for dinner", I called, interrupting the twins request for a second game. After the pasta was eaten, the twins headed off to the lounge to watch a DVD cartoon while Ernie and I finished off the wine. "That was nice of you - losing on purpose to the twins - but don't you think you made it just a bit too obvious?" I suggested. "On purpose!" Ernie replied, "Not at all. It would be intellectually dishonest to do that". "Well then," I ventured, "I guess it was your first time playing. You do realize that a good player should be able to guess anything but the sneakiest secret code in no more than seven or eight turns?". Ernie gave me the look, and explained that in his opinion the game was 'trivial'. "If you really want to know" he continued, "it was my synasthesia acting up again - some of the combinations of colours smelled like rotting fish, sounded like fingernails on blackboards, and tasted like ear-wax. That's why I had trouble concentrating. If the game had consisted of numbers instead of colours I could have cracked any code in far less than eight turns". To say the least I had my doubts. "Then, how about we play a game with base-6 arithmetic instead of colours - and see how you fare against a real Master?" I suggested. I then prepared a set of paper tabs (suitably numbered) and glued them to the playing pieces so Ernie couldn't use his synasthesia as an excuse.
After a few games I thought I was going to have to eat my words. In our first ten games, with me setting the code, Ernie never needed more than 5 guesses to reveal the code. "Beginners luck!" I muttered under my breath. "Nothing to do with luck" Ernie replied. "I just used a simple algorithm that is nearly optimal against a random opponent". "Algorithm?" I thought, "How could a simple algorithm beat an experienced player like me in a game of skill and cunning like this?". I spent some time thinking up the most Machiavellian secret code possible. It was so convoluted that it would surely take Ernie a good eight or nine turns to guess. "Of course," continued Ernie, as I placed the secret code pegs in position, "against a non-random clue-setter like you I'm sure I can adapt the algorithm and win even faster. I notice that in your attempt to choose 'sneaky' numbers, you always end up choosing a prime - so I will assume that is the case in this game". I realized that my next code was prime, and my ears burnt in embarrassment. "Well, there's another way to be sneaky" I thought in desperation - I would change the rules to see if I could last more than five moves.
The game went like this:
Ernie said "I will choose the smallest possible prime", and played his guess.
I said (truthfully) "The sum of hits and misses is an odd number." (lets see how he dealt with that!).
Ernie said "Tricky, but no matter. I will choose the smallest possible prime consistent with the results so far", and played his guess.
I said (truthfully) "The sum of hits and misses is an odd number."
Ernie said "I will choose the smallest possible prime consistent with the results so far", and played his guess.
I said (truthfully) "The sum of hits and misses is an odd number."
Ernie said "I will choose the smallest possible prime consistent with the results so far", and played his guess.
I said (truthfully) "The sum of hits and misses is an odd number."
Ernie said "I will choose the smallest possible prime consistent with the results so far", and played his guess.
I said (truthfully) "Four hits - you win".
Ernie said "What a nice coincidence. You chose my favorite base-6 prime for your code".
At that point the kids came back and we switched to Snap (at which, thankfully, I was far better than Ernie) until it was time for them to leave. As Ernie was heading out the door, he turned back and told me that someone listening in on our conversation (from the point at which we started the last game), should have been able to guess his favorite base-6 prime number. Do you think he is right?